Skip to content

Instantly share code, notes, and snippets.

@branchmispredictor
branchmispredictor / encrypted-zfs-root-key-on-usb-using-arch.md
Last active January 5, 2024 15:42
Encrypted ZFS Root Key on USB using Arch

Encrypted ZFS Root Key on USB using Arch

This is an initcpio hook that loads your root pool zfs password from a usb stick, as an alternative to modifying the zfs initcpio hook as mentioned in https://wiki.archlinux.org/title/Install_Arch_Linux_on_ZFS#Loading_password_from_USB-Stick.

This hook can also be used in ZFSBootMenu, meaning the same code and same usb can unlock your root pool in ZFSBootMenu and Linux itself. This solution does not store your key in initramfs.

Generate the Password + Write to the USB

@branchmispredictor
branchmispredictor / youtube-archive.sh
Created January 7, 2024 18:06
Youtube Archiver Script
#!/bin/bash
# Youtube Archiver v0.1.0
#
# Requires `yt-dlp` and `jq` to be installed and on $PATH
#
# Downloads videos into `./recent` and rechecks them within 30 days because
# it may take YT some time to encode the highest quality version of a video.
# Will move any replaced videos in `./replaced`
# NOTE: Script depends on this specific folder and file naming format, do not change!