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 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 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 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 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 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 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 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 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 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/*" |
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
# https://wiki.archlinux.org/title/Identify_damaged_files#Force_the_disk_to_reallocate_bad_block | |
# scan entire disk for bad blocks (slow but complete) | |
sudo badblocks -v -b 4096 /dev/sda | |
# smartctl test find bad block (fast but not complete) | |
sudo smartctl -t short /dev/sda | |
# get block number of error | |
sudo smartctl -a /dev/sda | |
... |