Here I am building up a list of things I sometimes need to do on a computer but not often enough that I remember how to do them. Now all I have to remember is to check here first when I want to, for example, extract audio from a video. And, if the solution isn’t here, to add it after I find it.
Extract audio from a video
ffmpeg -i video.mp4 -q:a 0 -map a audio.mp3
(Source: Stack Overflow.)
Slice an image vertically
With Imagemagick’s crop, to cut an image into a stack of five slices:
convert -crop 100%x20% input.jpg cropped_%d.jpg
Make a favicon
Makes a favicon that contains different sizes.
convert -background transparent "favicon.png" -define icon:auto-resize=32,64,128,256 "favicon.ico"
Convert a PDF to PNG, and give it a white background
I’d generated a PDF of a graphic that I wanted to convert to a PNG, but the background became transparent.
convert -density 300 -background white -alpha remove input.pdf output.png