Find the last day of the month¶
$ set $(cal)
$ shift $(($# - 1))
$ echo $1
30
Encrypt all files in one dir and save to another dir with ansible vault¶
ls files/source/ | xargs -I@ ansible-vault encrypt --vault-id $(pwd)/files/destination/@
Find the current dpi in X¶
$ xdpyinfo | grep -i -V 2 resolution
Go to a specific line number in less¶
less +<LINE_NUM> FILE
Go to a specific byte (offset?) in less¶
less +<BYTE>P FILE
Show a specific line number in less¶
less -N +<LINE_NUM>g FILE
Extract a specific line using sed¶
sed -ne '<LINE_NUM>P' FILE
Better ^w behavior¶
Make ^w delete up until a special character (like what happens on OpenBSD) in bash.
Put this in ~/.inputrc:
## Not sure why, but this needs to be disabled
set bind-tty-special-chars off
"\X-w": backward-kill-word