This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# configure | |
$cert = New-SelfSignedCertificate -CertstoreLocation Cert:\LocalMachine\My -DnsName $env:COMPUTERNAME | |
Enable-PSRemoting -SkipNetworkProfileCheck -Force | |
New-Item -Path WSMan:\LocalHost\Listener -Transport HTTPS -Address * -CertificateThumbPrint $cert.Thumbprint –Force | |
New-NetFirewallRule -DisplayName "Windows Remote Management (HTTPS-In)" -Name "Windows Remote Management (HTTPS-In)" -Profile Any -LocalPort 5986 -Protocol TCP | |
# connect | |
Enter-PSSession -ComputerName {X.X.X.X} -Credential (Get-Credential) -SessionOption (New-PsSessionOption -SkipCACheck -SkipCNCheck) -UseSSL |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import time | |
import torch | |
torch.backends.cuda.matmul.allow_tf32 = True | |
def get_flops(bs, n, t): | |
flops = (n ** 2) * (2 * n - 1) / t * bs | |
print(f"{flops/1e12:.2f} TFLOP/s") | |
def burn_pytorch(dt, n, bs, runtime=10): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/usr/share/logstash/jdk/bin/jstatd -p 1099 -J-Djava.security.policy=<(echo 'grant codebase "jrt:/jdk.jstatd" { permission java.security.AllPermission; }; grant codebase "jrt:/jdk.internal.jvmstat" { permission java.security.AllPermission; };') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#lowercase letters/numbers only | |
-join ((48..57) + (97..122) | Get-Random -Count 32 | % {[char]$_}) | |
# all characters | |
-join ((33..126) | Get-Random -Count 32 | % {[char]$_}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sudo python -m pip install pip==18.0 --upgrade |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
cd /var/lib/flatpak/app/org.ghidra_sre.Ghidra/current/active/files/lib/ghidra/Ghidra/Extensions/ | |
sudo git clone https://github.com/esaulenka/ghidra_v850 | |
sudo ./lib/ghidra/support/sleigh ./ghidra_v850/data/languages/v850e[23].slaspec | |
cd ghidra_v850/ | |
# TODO: install appropriate version of openjdk first | |
sudo make |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# short reach mode and energy detect mode can cause ports to turn off even when an ethernet cable is plugged in | |
# note that this cannot be disabled from the web management interface under System -> Management -> Green Ethernet | |
# (changing "Auto Power Down Mode" and "Short Cable Mode" settings is disabled) | |
# enabled telnet from web interface under Maintenance -> Trouble Shooting -> Remote Diagnostics -> Enable | |
# connect via telnet: `telnet <switch-ip> 60000` (same username/password as web interface) | |
# only needed if your prompt doesn't end with '#' | |
enable | |
# enter config mode |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Set-ItemProperty -Path HKLM:\SYSTEM\CurrentControlSet\Services\W32Time\TimeProviders\VMICTimeProvider -Name Enabled -Value 0 | |
Restart-Service "Windows Time" | |
# check if domain controller is being used for time | |
# (you don't want to see VM IC Time Synchronization Provider as the source) | |
w32tm /query /source | |
w32tm /query /status |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
curl -X PUT -T ./{file.dat} -H "x-ms-date: $(date -u)" -H "x-ms-blob-type: BlockBlob" "https://{storageaccount}.blob.core.windows.net/backups/{file.dat}?{sas-token}" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# create files in an otherwise empty directory | |
mkdir files | |
cd files | |
touch setup.sh # entry point after extraction | |
touch file.txt # supporting data used by setup.sh | |
# create archive | |
tar -pczf ../archive.tar.gz * | |
cd .. |
NewerOlder