claude idiot

This commit is contained in:
Nathan Rashleigh committed 2026-06-21 21:46:39 +10:00
1 parent 8b4ac2cdaf
commit ea1669babf
32 files changed
+1841 -1183

No files matched your search

+41 -4
View File
@@ -40,13 +40,50 @@ sockseek input:
collection ids="7f5tPIfj21UJI4zfDmH4rx 6sAl8LhU6ediFNJRuQQIQX":
cd maple-py && uv run python -m maple.collection {{ids}}
# Build a rekordbox USB layout at <dst> from the collection at <src>.
# Converts FLAC→MP3 V0, extracts artwork, writes ANLZ (with PWAV/PWV3
# blue/white waveforms) and PIONEER/rekordbox/export.pdb.
export src="data/collection" dst="data/usb":
cd maple-py && uv run python -m maple "{{justfile_directory() / src}}" "{{justfile_directory() / dst}}"
sync args:
s5cmd {{args}}
usb dst="/Volumes/MAPLE":
COPYFILE_DISABLE=1 rsync -rtvh --delete --size-only --no-perms --no-owner --no-group --modify-window=2 maple-py/data/usb/Contents/ {{dst}}/Contents/
COPYFILE_DISABLE=1 rsync -rtvh --delete --size-only --no-perms --no-owner --no-group --modify-window=2 --exclude='USBANLZ/' maple-py/data/usb/PIONEER/ {{dst}}/PIONEER/
rm -f {{dst}}/PIONEER/rekordbox/RBFLTR.DAT
# Sync data/usb/ → mounted USB stick (default /media/ntr/MAPLE), then
# safely unmount so the stick can be pulled without risk to the FAT
# write-back cache.
usb dst="/media/ntr/MAPLE":
@test -d {{dst}} || (echo "USB not mounted at {{dst}}"; exit 1)
rsync -rtvh --delete --size-only --no-perms --no-owner --no-group --modify-window=2 "{{justfile_directory()}}/data/usb/" "{{dst}}/"
sync
@# Try udisksctl first (no sudo, handles the udev event); fall back to
@# plain `umount` if udisks isn't available. Either way the recipe
@# exits 0 even if the unmount fails (e.g. someone has a file open).
@udisksctl unmount -b "$(findmnt -no SOURCE {{dst}})" 2>/dev/null && echo "unmounted {{dst}}" \
|| (umount {{dst}} 2>/dev/null && echo "unmounted {{dst}}") \
|| echo "warning: could not unmount {{dst}} — close any file browsers + retry"
# Build a FAT32 image of data/usb/ — ready to dd onto a stick.
# `size` must exceed the data/usb/ tree (rough rule: data size + ~50 MB FAT overhead).
usb-image size="2G" img="data/maple.img":
@command -v mcopy >/dev/null || (echo "mtools not installed (apt install mtools)"; exit 1)
@test -d "{{justfile_directory()}}/data/usb" || (echo "no data/usb (run \`just export\` first)"; exit 1)
rm -f "{{justfile_directory()}}/{{img}}"
truncate -s {{size}} "{{justfile_directory()}}/{{img}}"
mkfs.vfat -F 32 -n MAPLE "{{justfile_directory()}}/{{img}}"
cd "{{justfile_directory()}}/data/usb" && mcopy -i "{{justfile_directory()}}/{{img}}" -s -Q -p -m * ::/
@echo "image ready:" && ls -lh "{{justfile_directory()}}/{{img}}"
# DESTRUCTIVE: dd data/maple.img onto a block device (e.g. /dev/sdb).
# Double-check `lsblk` first — wrong device wipes that drive.
[confirm("usb-flash will OVERWRITE the entire device. Proceed?")]
usb-flash dev img="data/maple.img":
@test -b {{dev}} || (echo "{{dev}} is not a block device"; exit 1)
@test -f "{{justfile_directory()}}/{{img}}" || (echo "no image at {{img}}; run \`just usb-image\` first"; exit 1)
@lsblk -no NAME,SIZE,LABEL,MODEL {{dev}}
sudo dd if="{{justfile_directory()}}/{{img}}" of={{dev}} bs=4M status=progress oflag=direct conv=fsync
sudo sync
@echo "done — safe to remove (try: udisksctl power-off -b {{dev}})"
usb-pdb dst="/Volumes/MAPLE":
@test -d {{dst}}/PIONEER/rekordbox || (echo "no rekordbox dir at {{dst}}/PIONEER"; exit 1)