New file `lib.sh` to collect useful sh/bash functions and code snippets.