Skip to content

Instantly share code, notes, and snippets.

View patte's full-sized avatar

Patrick Recher patte

View GitHub Profile
@patte
patte / simulate_zfs_data_errors.md
Last active October 31, 2025 18:14
test zed notifications by manufacturing a bad zfs scrub
# create
dd if=/dev/zero of=/tmp/sparse_file bs=1 count=0 seek=512M
sudo losetup /dev/loop10 /tmp/sparse_file
sudo zpool create test /dev/loop10
sudo zpool status test

# write
sudo zfs create test/fs
sudo dd if=/dev/urandom of=/test/fs/bigfile bs=1M count=400 status=progress
@patte
patte / create_date_xmps.ugly.sh
Created November 1, 2025 16:46
write .xmp with DateTimeOriginal for files which miss creation date based on Library.apdb extraction and file creation date
#!/usr/bin/env bash
## move away CR2 and AAE files
cd /data/
SRC="./Fotos-Mediathek.photoslibrary/Masters/"
DEST="./additional-files/Masters/"
sudo mkdir -p "$DEST"
sudo rsync -av \
--remove-source-files \