home

useful scripts

#code

convert all files to m4a

mkdir -p converted
for f in *; do
  [[ -f "$f" ]] || continue
  clean=$(sed -E 's/(\.mp3|\.m4a|\([0-9]+\))+$//' <<< "$f")
  ffmpeg -i "$f" -c:a aac -b:a 128k "converted/${clean}.m4a"
done

change swap file

swapoff /swapfile
fallocate -l 1G /swapfile
chmod 600 /swapfile
mkswap /swapfile
swapon /swapfile

yt playlist markdown links

const links = []

for (const el of document.querySelectorAll("a#video-title")) {
    links.push(`[${el.textContent.trim()}](${el.href})`)
}

console.log(links.join('  \n'))