Skip to content

Instantly share code, notes, and snippets.

@AndFroSwe
AndFroSwe / concat_and_reduce.sh
Created March 13, 2026 07:23
Concatenate and change resolution of video files with FFMPeg
ffmpeg -f concat -safe 0 -i files.txt -map 0:v -map 0:a:0 -vf scale=1920:-2 -c:v libx264 -crf 23 -preset slow -c:a copy output.mp4
@AndFroSwe
AndFroSwe / flactest.sh
Created March 1, 2026 12:19
Oneliner for verifying FLAC file integrity
find . -name "*.flac" -print0 | while IFS= read -r -d '' f; do flac --test --silent "$f" 2>/dev/null || echo "FAILED: $f"; done
@AndFroSwe
AndFroSwe / albumize.sh
Last active February 25, 2026 14:24
Extract albums from FLAC files and put into m3u files
#!/usr/bin/env bash
# Usage: ./albumize.sh <folder>
# Generates an "ARTIST - ALBUM.m3u" file from FLAC files in the given folder.
set -euo pipefail
FOLDER="${1:-.}"
if [[ ! -d "$FOLDER" ]]; then
echo "Error: '$FOLDER' is not a directory." >&2
@AndFroSwe
AndFroSwe / svg_to_icon.sh
Last active February 25, 2026 14:25
Using ImageMagick to create an app icon from SVG
magick -background none -density 384 .\icon.svg "(" -clone 0 -resize 16x16 ")" "(" -clone 0 -resize 32x32 ")" "(" -clone 0 -resize 48x48 ")" "(" -clone 0 -resize 64x64 ")" "(" -clone 0 -resize 128x128 ")" "(" -clone 0 -resize 256x256 ")" -delete 0 icon.ico