Skip to content

Instantly share code, notes, and snippets.

View hitorilabs's full-sized avatar
🍵

hitorilabs hitorilabs

🍵
View GitHub Profile
@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>

If you follow nvidia's instructions for removing packages, you get stuck in a debugging loop where it says "following packages have unmet dependencies".

For some reason nvidia drivers installed through the default Ubuntu installer is always broken, so you'll need to get force purge these dependencies in order to continue.

sudo dpkg --force-all -P <package_name>

Alternatively, apt --fix-broken install can get you to the point where you can just apt remove all the packages.

@hitorilabs
hitorilabs / BACKUP_APPLE_PHOTOS.md
Last active September 5, 2023 11:33
Export Apple Photos

Never actually knew where my memes were being saved when I do "Add to Photos", so dropping this script for reference.

I have a 24TB zfs pool to sync everything into, so I'll probably backup and wipe the images every so often.

rsync -avP /Users/<user>/Pictures/Photos\ Library.photoslibrary/originals/**/*.jpeg /path/to/destination
@hitorilabs
hitorilabs / WINDOWS11.md
Last active May 3, 2025 23:00 — forked from hungneox/WIN10.MD
Install Windows 11 From A Bootable USB (macos)

Personally, I prefer installing operating systems from a USB stick, so here's a tutorial

TL;DR

If you already have some idea of what's going on:

  1. Download the ISO from Microsoft - https://www.microsoft.com/en-ca/software-download/windows11
  2. Erase USB device and format in MS-DOS/FAT32
diskutil eraseDisk MS-DOS "WINDOWS11" MBR /dev/diskX
@hitorilabs
hitorilabs / nvidia-tdp.service
Last active June 13, 2024 00:44 — forked from DavidAce/nvidia-tdp.service
NVIDIA Power Limit at Boot
[Unit]
Description=Set NVIDIA power limit above default
[Service]
Type=oneshot
ExecStartPre=/usr/bin/nvidia-smi -pm 1
ExecStart=/usr/bin/nvidia-smi -pl 275