Scripts and Automation
I spend too much time using the computer, which means I’ve compiled a series of little tools for making things easier. I'm not a good coder, necessarily, so these may not be pretty, but they get the job done for my purposes, and maybe they will for yours too.
Alfred Rectangle Quick Commands
An Alfred workflow for quickly sending commands to Rectangle, because I couldn’t remember all the esoteric keyboard shortcuts, and this was easier.
Goatlings Accessibility Mod
A userscript for the web game Goatlings, to make some of the more repetitive sections usable by keyboard instead of mouse. No longer actively maintained!
Novak
A simple static site generator, designed for sharing essays and short stories outside of the traditional blog format. Layout directly inspired by Matthew Butterick’s Practical Typography and Drew McConville’s Better Motherfucking Website. It is very bad, do not use it, use Eleventy instead.
mkvtomp4.sh
I wrote this script to handle torrenting videos, and them coming in as mkv files encoded in god knows what encoding, which aren’t supported by QuickTime and a bunch of other tools I use. Take this script, cd
into the directory containing those files, and it will re-encode every mkv file in the directory and it’s sub-directories, then trash the old files (which is not the same as rm
: these files will be in your trash can, just in case something goes wrong).
Dependencies: ffmpeg, trash
#!/usr/bin/env bash
IFS=$'\n'; set -f
for i in $(find . -name "*.mkv"); do
ffmpeg -i "$i" -vcodec libx264 -acodec aac -c:s mov_text "${i%.*}.mp4"
trash $i
done
unset IFS; set +f
yt-dlp alias
yt-dlp is a great tool for downloading YouTube videos, but the default settings are almost never what I want. This does exactly what I want: get the highest quality video and audio, the English subtitles (if they exist), and name the file [TITLE] - [CHANNEL_NAME]
. Just drop this line wherever you put your aliases.
Dependencies: yt-dlp, bash-compatible shell
alias ytd="yt-dlp -f 'bestvideo[ext=mp4]+bestaudio[ext=m4a]/bestvideo+bestaudio' --merge-output-format mp4 --write-sub --sub-lang en --embed-subs -o \"%(title)s.%(ext)s - %(channel)s\""