Last active
May 26, 2025 00:31
-
-
Save drbr/09218a1fc2de80325d45fe7019f2fdf6 to your computer and use it in GitHub Desktop.
Shell commands for various tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#/bin/bash | |
# Convert all the files in a directory from M4A (Apple Lossless) to FLAC | |
find . -name "*.m4a" | sort -n | while read -r filename | |
do | |
ffmpeg -i "$filename" -f flac "$filename.flac" | |
done | |
# Rename all the files from `.m4a.flac` to `.flac` | |
# Afterward, clean up with `rm "*.m4a"` | |
find . -name "*.flac" | sort -n | while read -r filename | |
do | |
mv "$filename" "$( echo "$filename" | sed 's/\(.*\)\.m4a\.flac$/\1.flac/' )" | |
done |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#/bin/bash | |
# Split a PDF of 2-page spreads (left/right) into separate pages. | |
# Splits the width of the page exactly in 2, so the original PDF | |
# needs to be cropped correctly before running this. | |
mutool poster -x 2 -r <input.pdf> <output.pdf> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment