One-liners
From Sasara
Jump to navigationJump to search
Audio/visual
Best FLAC
$ flac --best --delete-input-file --keep-foreign-metadata --preserve-modtime --verify "$AUDIO"
Best MP3 with CBR
$ lame -b 320 -q 0 --cbr "$AUDIO"
Best MP3 with VBR
$ lame -b 320 -q 0 -V 0 "$AUDIO"
Fade image to white background
$ convert $1 -alpha on -channel a -evaluate set 20% out.png
Flip image horizontally
$ convert $IMAGE -flop $OUTPUT
Flip image vertically
$ convert $IMAGE -flip $OUTPUT
Increase video volume
$ ffmpeg -i "$VIDEO" -filter:a "volume=4.0" "out.$VIDEO"
Merge incomplete yt-dlp
$ ffmpeg -i "$VIDEO" -i "$AUDIO" "$OUT.mp4" && AtomicParsley "$OUT.mp4" --artwork "$THUMB.png"
Optimal PNG
$ pngcrush -blacken -check -fix -oldtimestamp -ow -reduce -speed -v "$IMG"
Retina/2x HiDPI export
$ convert -units PixelsPerInch -density 192 "$TARGET"
Remove EXIF data
$ exiftool -all= "$TARGET"
Rotate video counter-clockwise
$ ffmpeg -i "$VIDEO" -vf 'transpose=3' -c:a copy "out.$VIDEO"
Rotate video clockwise
$ ffmpeg -i "$VIDEO" -vf 'transpose=1' -c:a copy "out.$VIDEO"
Storage
Basic fio(1) read/write test
$ fio --randrepeat=1 --direct=1 --gtod_reduce=1 --name=test --filename=test --bs=4k --iodepth=64 --size=4G --readwrite=randrw --rwmixread=75
Basic fio(1) read test
$ fio --randrepeat=1 --direct=1 --gtod_reduce=1 --name=test --filename=test --bs=4k --iodepth=64 --size=4G --readwrite=randread
Basic fio(1) write test
$ fio --randrepeat=1 --direct=1 --gtod_reduce=1 --name=test --filename=test --bs=4k --iodepth=64 --size=4G --readwrite=randwrite