Skip to content

Instantly share code, notes, and snippets.

View wait-what's full-sized avatar

Wait What wait-what

View GitHub Profile
@wait-what
wait-what / any_to_aac.fish
Last active July 7, 2025 21:30
Encode your music (or video) library to aac with cover art / thumbnails
#!/usr/bin/fish
# requires ffmpeg with libfdk_aac, ffmpegthumbnailer, atomicparsley
set thread_limit (math (nproc --all) '*' 0.6)
set input_dir '/home/user/music'
set output_dir './output'
rm -rf ./encode_tmp
@wait-what
wait-what / patch.js
Last active June 9, 2025 22:39
ChatGPT's re-implementation of https://github.com/Chicken-Bones/FactorioAchievementPlaytimePatcher in nodejs. all credits to Chicken-Bones. MIT license. `node patch.js factorio.exe` (macos support not included)
const fs = require('fs');
class PatchTargetMissingException extends Error {}
class Patch {
constructor(name, target, replacement) {
this.name = name;
this.target = Buffer.from(target);
this.replacement = Buffer.from(replacement);
@wait-what
wait-what / vm.fish
Last active May 15, 2025 16:09
scuffed script for turning the vfio gpu-passthrough vm on and off on my dual gpu system. note: the detach/attach parts can hang, yet to figure out how to fix it
function vm
switch $argv[1]
case down
echo 'shutting down vm'
while true
sudo virsh destroy windows-11 &> /dev/null
sleep 1
printf '. '
if string match -q 'shut off' (sudo virsh domstate windows-11)
echo
@wait-what
wait-what / unlock.fish
Last active March 31, 2024 03:38
Fish script that unlocks specified zfs filesystems using a passphrase (assuming the passphrase is the same for all of them!) and starts a given user systemd unit (target, service, etc.)
#!/usr/bin/sudo fish
set all_filesystems tank/a tank/b tank/c
set user ww
set target zfs-unlocked.target
function check_target
set output (machinectl -q shell $user@ /usr/bin/systemctl --user is-active $target)
switch (string trim $output)
@wait-what
wait-what / diskstatus.fish
Created March 28, 2024 10:10
Script for displaying useful SMART information using smartctl and fish
#!/usr/bin/sudo fish
# From /dev/disk/by-id
set -a disks scsi-SATA_SAMSUNG_HD204UI_S2H7J1CB906143
set -a disks scsi-SATA_SAMSUNG_HD204UI_S2HGJ1BZ811296
set -a disks scsi-SATA_WDC_WD2000F9YZ-0_WD-WCC5C0072942
set -a disks scsi-SATA_WDC_WD20EARS-00M_WD-WCAZA0355682
set -a disks scsi-SATA_WDC_WD20EARX-00P_WD-WCAZAE460554
set -a disks scsi-SATA_WDC_WD20EARX-00P_WD-WMAZA5013504
set -a disks scsi-SATA_WDC_WD20EARX-00P_WD-WMAZA5775943
@wait-what
wait-what / Rust Make.md
Last active April 9, 2022 22:59
A simple "guide" for using cargo-make

Dependencies

cargo install cargo-make # cargo-edit is also useful

rustup target add x86_64-unknown-linux-gnu
rustup target add x86_64-pc-windows-gnu

# Only if you're on an Arch-based distro
paru -Sy mold upx binutils

WORDLE code golf challenge

Goal

The goal is to make your code as short as possible

Concept

There are 2 words: the secret word and the guess.