Fewer sudo password prompts

The first thing I do on a new Ubuntu installation is to stop sudo from asking me for a password in every terminal I open:

echo 'Defaults !tty_tickets' | sudo tee /etc/sudoers.d/no_tty_tickets

This is especially useful if you use screen, tmux, or byobu.

Even Google can't write shell scripts

Google’s Shell Style Guide — via Hacker News — doesn’t mention using set -e or set -u, and neither does Gentoo’s guide, which seriously undermines them both. They both have sensible advice, but those two settings are the two most important things to include when scripting with Bash. Bash doesn’t even become a scripting language until those are set; without, scripts are just interactive transcripts without the interactive part, i.e. a human to stop execution when there are errors or unexpected behaviour.

[Read More]