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
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
# install latest from custom apt repo | |
# https://bytexd.com/xpra/#install-xpra-on-ubuntu | |
# start server sharing existing desktop (add for html server: --bind-tcp=0.0.0.0:9876 --html=on) | |
xpra shadow :1 --pulseaudio=no --mdns=no | |
# start client connecting to server | |
xpra shadow ssh://<user>@<host>/1 --ssh="ssh -i ~/.ssh/id_rsa" --pulseaudio=no --mdns=no |
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
flatpak run --share=network --command=sh org.ghidra_sre.Ghidra -c "DISPLAY=$DISPLAY ghidra" |
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
source ~/.git-prompt.sh | |
GIT_PS1_SHOWDIRTYSTATE=true | |
PS1='\[\033[1;32m\]\u@\h \[\033[0;36m\]\w\[\033[1;33m\]$(__git_ps1 " (%s)")$([ $? -ne 0 ] && echo -n " \[\e[0;31m\]!")\n\[\033[0m\]$ ' |
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
gs -dNOPAUSE -sDEVICE=pdfwrite -sOUTPUTFILE=output.pdf -dBATCH input1.pdf input2.pdf |
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
HOST=us.archive.ubuntu.com | |
VERSION=530 | |
#debmirror --host=${HOST} --dist=focal --arch=amd64,all --section=restricted --root=/ubuntu --exclude='/.*' --include='/n/nvidia-graphics-drivers-.*' --no-source --no-check-gpg --progress ./mirror/${HOST} | |
debmirror --host=${HOST} --dist=focal,focal-security,focal-updates --arch=amd64,all --section=restricted --root=/ubuntu --exclude='/.*' --include='/n/nvidia-graphics-drivers-${VERSION}/.*' --no-source --no-check-gpg --progress ./mirror/${HOST} |
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
# python3-openssl is broken on ubuntu 20.04 (incompatible with python3-cryptography) | |
# remove these apt packages without removing their dependencies | |
# install latest version of these packages into system python | |
# then after re-installing the apt packages the pip installed packages are still used | |
sudo apt-get install -y python3-pip | |
sudo dpkg -r --force-depends python3-openssl python3-cryptography | |
sudo pip3 install pyopenssl cryptography | |
sudo apt-get install -y --fix-missing python3-openssl python3-cryptography |
NewerOlder