This file contains hidden or 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 |
This file contains hidden or 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 systemctl stop nvidia-persistenced.service | |
| # only works if nothing is using the GPU | |
| sudo rmmod nvidia_drm nvidia_uvm nvidia_modeset nvidia | |
| nvidia-smi |
This file contains hidden or 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 apt-get install -o Debug::pkgProblemResolver=true -o Debug::Acquire::http=true --no-install-recommends nvidia-driver-520 |
This file contains hidden or 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
| USB_DEV=/dev/sdX # replace X with correct number | |
| USB_MNT=/mnt/usb | |
| sudo mkdir -p /mnt/usb | |
| sudo wipefs -a --force $USB_DEV | |
| sudo dd if=/dev/zero of=${USB_DEV} bs=1M count=100 | |
| ( | |
| echo n # new partition | |
| echo 1 # partition number 1 | |
| echo 2048 # first sector 2048 |
This file contains hidden or 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
| USB_DEV=/dev/sdX # replace X with actual device name | |
| USB_MNT=/mnt/usb | |
| ROOT_LABEL="Ubuntu" # replace with label of root drive you installed ubuntu on | |
| # format | |
| sudo wipefs -a $USB_DEV | |
| sudo dd if=/dev/zero of=${USB_DEV} bs=1M count=128 conv=notrunc | |
| ( | |
| echo n # new partition | |
| echo p # primary | |
| echo 1 # partition number 1 |
This file contains hidden or 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
| DISK_DEV=/dev/sda | |
| sudo find /dev -type l | xargs -I {} bash -c 'echo -n "{} = "; readlink -f {} +' | grep $DISK_DEV |
This file contains hidden or 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
| DISK_DEV=/dev/sd<?> | |
| DISK_PWD="" # leave empty or set to something you will remember | |
| sudo hdparm --user-master u --security-set-pass "$DISK_PWD" $DISK_DEV | |
| sudo hdparm --user-master u --security-erase-enhanced "$DISK_PWD" $DISK_DEV | |
| # secure erase should clear user password and disable security when complete | |
| #sudo hdparm --user-master u --security-disable "$DISK_PWD" $DISK_DEV |
This file contains hidden or 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
| # on server (waits for connection) | |
| ffmpeg -framerate 20 -i /path/to/video.hevc -an -c:v copy -f hevc tcp://<server-ip>:8888?listen | |
| # on client (format -f can often be auto-detected) | |
| ffplay -f hevc -i tcp://<server-ip>:8888 -framerate 20 | |
| # note that -framerate xx is needed because you can't know the frame rate of a raw hevc file |
This file contains hidden or 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
| # multi-threaded off | |
| 7z b -mmt=off | |
| # 4 threads | |
| 7z b -mmt=4 |
This file contains hidden or 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
| # get config for which branches will get pulled | |
| git config --get remote.origin.fetch | |
| # e.g. only master: +refs/heads/master:refs/remotes/origin/master | |
| # set config to pull all branches | |
| git config remote.origin.fetch "+refs/heads/*:refs/remotes/origin/*" |