Skip to content

Instantly share code, notes, and snippets.

View hitorilabs's full-sized avatar
🏃

hitorilabs hitorilabs

🏃
View GitHub Profile

Move the default Docker data-root

One situation that seems pretty common that is making a small partition for the root directory and allocated the rest of your memory for your home directory.

The default data-root is in /var/lib/docker/ - my solution is just to move all the files in this directory to /home with the same permissions and what not.


All you have to do is stop docker processes and the service sudo systemctl stop docker

RPi 5 Shenanigans

power supply (?) issues - crashing when pulling >8W (i was running off a power bank)

you might want to consider getting the official one (5A/27W)


Temporarily limiting the CPU clock speed

Notes on installing M.2 PCIe Expansion Card

  1. boot into BIOS
  2. change PCIe link width configuration to x4x4x4x4
  3. partition drives
  4. create and start raid0 array
  5. make configuration persistent between reboots
  6. double check before committing too much data into the array
@hitorilabs
hitorilabs / GPU_HUNTER.sh
Last active February 2, 2024 17:27
GPU_HUNTER.sh
: ${SKU:='16531651'}
: ${USER_AGENT:='Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36'}
read -r SHIPPING_STATUS QUANTITY <<< $(curl -s "https://www.bestbuy.ca/ecomm-api/availability/products?accept=application%2Fvnd.bestbuy.standardproduct.v1%2Bjson&postalCode=${POSTAL_CODE}&skus=${SKU}"\
-H 'accept: application/json' \
-H 'user-agent: $USER_AGENT' \
--compressed | jq -r '.availabilities[0].shipping.status, .availabilities[0].shipping.quantityRemaining')
echo "$(date '+%Y-%m-%d %H:%M:%S') - status=$SHIPPING_STATUS | quantity=$QUANTITY" >> "output.log"
tail -n 15 output.log

If you are seeing this error, it's likely because you are using an incompatible version of gcc/g++. Currently (2023/11/26), you need to have gcc-12 and g++-12.

gcc: error trying to exec 'cc1plus': execvp: No such file or directory

Make sure to install and point your symlinks for gcc and g++ to the right versions.

sudo apt install gcc-12 g++-12

WARNING: I don't really care about desktop, so this might fuck it up - make sure you can still ssh into it on reboots

If your installation is really messed up or you've kind of mangled it by mashing commands, you should wipe everything cuda related and restart - the docs provides a neat that will get rid of most if not all traces

(https://gist.github.com/hitorilabs/3fed1a6e5dd500edb5ad7568562c064d)

https://docs.nvidia.com/cuda/cuda-installation-guide-linux/#removing-cuda-toolkit-and-driver

As an overview, here's a laundry list of things you probably want to check:

  • At Installation:

I was wondering why it took so long for my deep learning rig to fully boot up. It literally takes 5 minutes to go from reboot to ssh service start. Unlike desktop motherboards, the ROMED8-2T has two 10G RDMA ethernet controllers and a port for the IPMI interface.

For a while I thought I must have done something wrong - but it turns out when there are free, unmapped ports it will block boot. To fix this, you just need to make the other interfaces optional in your /etc/netplan/*.yaml

network:
  ethernets:
    enoXnpX:
      addresses:
 - ...

ubuntu packages to install fresh

  • sudo apt install rsync tmux git build-essential gcc-12 g++-12
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-12 100
sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-12 100
  • from source python + cmake
    • sudo apt install pkg-config libssl-dev
@hitorilabs
hitorilabs / backup.sh
Last active October 14, 2023 15:02
script for backing up a system, I personally ignore home because I don't keep anything important in there - I just clean install when needed. To extract the file, replace `-c` with `-x` and specify the destination (note: this will overwrite existing files)
: ${DESTINATION_DIRECTORY:=} [0/0]
: ${BACKUP_FILENAME:=$(date +%Y%m%d%H%M%S)-backup.tar.gz}
tar -czpvf $DESTINATION_DIRECTORY/$BACKUP_FILENAME \
--exclude=/proc \
--exclude=/tmp \
--exclude=/mnt \
--exclude=/dev \
--exclude=/sys \
--exclude=/run \

If you install windows on a machine that already has ubuntu, it will overwrite the MBR (Master Boot Record).

This is a guide that will allow you to keep boot priority on ubuntu (EFI)

1. re-install grub

grub-install onto the device that you installed ubuntu on (don't specify partition e.g. /dev/nvme0n1)

sudo grub-install /dev/<device_with_ubuntu>