Stephen Lindberg

This is my commonplace repository. It’s a single-page document, kind of like a cheat-sheet for… well, anything. Built-in search: ctrl + f.

dotfiles

adapted from this guide

Store dotfiles in a bare git repo

Create a bare git repo in your home folder (or anywhere) which will store the refs for all your dotfiles:

git init --bare $HOME/.dotfiles

Create an alias for managing your dotfiles from anywhere on the system, using an absolute reference to the repo you just created:

alias dot='/usr/bin/git --git-dir=$HOME/.dotfiles/ --work-tree=$HOME'

Add this alias to your .zshrc or whatever.

Configure the repo to ignore untracked files:

dot config --local status.showUntrackedFiles no

Now you can commit dotfiles to the repo:

dot add .vimrc && dot commit -m "Add vimrc"

If you make modifications to tracked files, you can quickly commit them with:

dot add -u . && dot commit -m "update some dotfiles"

This only stages and commits files which are already tracked.

ffmpeg

Create a video from an image sequence

ffmpeg -r 24 -i img%03d.png -c:v libx264 -pix_fmt yuv420p out.mp4

Loop an existing video X times

for i in {1..4}; do printf "file '%s'\n" input.mp4 >> list.txt; done
ffmpeg -f concat -i list.txt -c copy output.mp4

Explode a video into an image sequence

ffmpeg -i input.mp4 -vsync 0 images/%06d.jpg

Remove audio from a video

use the -an flag

ffmpeg -i input.mp4 -c copy -an output.mp4

imagemagick

Convert a sequence of images to gif, with transparency

convert -loop 0 -delay 6 -alpha set -dispose previous *.png output.gif