Almost forgot before going to bed but I feel bi-weekly is a good rhythm for this.
Let us know what you set up lately, what kind of problems you currently think about or are running into, what new device you added to your homelab or what interesting service or article you found.
Bash is a really great shell, but consider trying out a functional shell scripting language like Elvish (which is also a shell). Syntatically it’s pretty similar and not hard to pickup, but it’s stupid powerful. A cool example is updating different servers via ssh in parallel using a
servers.json
file;[ {"name": "server.com", "user": "root", "identity": "~/.ssh/private_key0", "cmd": "apt update; apt upgrade -y"}, {"name": "serverb.com", "user": "root", "identity": "~/.ssh/private_key1", "cmd": "pacman -Syu"}, {"name": "serverc.com", "user": "root", "identity": "~/.ssh/private_key2", "cmd": "apk update; apk upgrade"} ]
and a little elvish magic;
Just run the script and boom, done. You can even swap out
peach
which isparallel each
foreach
if you want to do each command procedurally–but I really love using peach, especially with file operations over many different files. Linux is fast, but peach is fuckin’ crazy fast. Especially for deleting files (fd -e conf -t file | peach {|x| rm $x }
, or one thing that I do is extract internal subs (so they play on my chromecast) in my Jellyfin server, using elvish makes it really fast;Find all
*.mkv
files, pass the filenames through ffmpeg (using peach) and extract the first subtitle asfilename.mkv.srt
. Takes only about a few seconds to do thousands and thousands of video files. I highly recommend it for home-labbers.Pretty dumb example, but
peach
is like 6x faster;