Skip to content

Instantly share code, notes, and snippets.

View delan's full-sized avatar

Delan Azabani delan

View GitHub Profile
@delan
delan / upchost.sh
Last active October 13, 2023 05:32
cohost image uploader
#!/usr/bin/env zsh
# cohost image uploader v3
# requirements: linux + zsh + imagemagick + curl + jq
# (you don’t need to be a zsh user)
# limitations: does not actually attach the image to the post
set -euo pipefail
if [ $# -lt 3 ]; then
>&2 echo "usage: $0 <projectHandle> <postId> <file> [file ...]"
exit 1
fi
@delan
delan / luks.sh
Created July 4, 2023 06:39
LUKS remote unlock over ssh for NixOS
#!/bin/sh
set -eu
stty -echo
if ! ssh "root@$1" '
set -eu
printf '\''unlocking luks on '"$1"': '\''
sed q > /crypt-ramfs/passphrase.
echo
mv /crypt-ramfs/passphrase. /crypt-ramfs/passphrase
@delan
delan / tdarr-dirstat.sh
Last active August 25, 2022 09:15
Tdarr size explorer script for use with QDirStat (or similar)
#!/bin/sh
# usage: $0 <path/to/shows>
#
# tdarr-dirstat uses hard links to allow QDirStat (or a similar tool) to take video codecs and
# resolution classes (SD, HD, FHD, UHD) into account when colouring tree maps.
#
# We create a .dirstat directory under the given path, containing the same directory structure as
# the original tree, then create hard links to the original videos of the form “foo.mkv.FHD+h264”.
# If .dirstat already exists, we update it for any new paths or changed inode numbers.
#

Keybase proof

I hereby claim:

  • I am delan on github.
  • I am delan (https://keybase.io/delan) on keybase.
  • I have a public key whose fingerprint is 3359 F6FA AED9 B627 E700 F58E FC18 AA5D 1313 1313

To claim this, I am signing this object:

@delan
delan / keybase.md
Created May 27, 2014 14:49
Keybase GitHub proof

Keybase proof

I hereby claim:

  • I am delan on github.
  • I am delan (https://keybase.io/delan) on keybase.
  • I have a public key whose fingerprint is 7F21 2455 67B2 3E09 2664 20EF 0548 7476 1841 6AA7

To claim this, I am signing this object: