Sysadmins offen happen upon simple tasks for which there's no actual shell command. For example, you may want to run a command after a random delay of up to 3 minutes. Well, there's
$RAND, so you'll probably quickly solve that problem. If you need to do this more often, you'll likely build some kind of script to make this task as easy as possible.
ago: Show how long ago a file/directory was modified in a human-readable fashion.
dupes: Report on duplicate files, via a SHA1 hash of the contents, recursively.
empty-dir: Indicate, via return code, whether a given directory is empty or not.
maybe: In a similar vain to true and false the maybe command exits with a status code of zero or one, depending on a random number.
multi-ping: Ping a host, regardless of whether it is an IPv6 or IPv4 host.
mysql-slave-check: If the current host is a MySQL slave this script will test that the slave replication is still working.
randpass: Generate a single random password via /dev/urandom.
since: Show the new output since previously reading a file. This is useful for keeping track of logfile updates.
splay: Sleep for a random amount of time, limited by the given max value. (Default is 5 minutes).
ssl-expiry-date: Report the date, and number of days, until the given SSL certificate expires.
timeout: Timeout allows you to run a command which will be killed after the given number of seconds.
until-success: Repeat the specific command until it succeeds - run at least once always.
which-shell: Identify the shell we're running under.
with-lock: Run a command, unless an existing copy of that command is already running, via the creation of a temporary lockfile.
Being a leader in a growing business with all the duties and responsibilities is a challenge that requires me to learn new skills all the time. For every task that I get done, two new ones seem to grow back. I actually enjoy that. But I also realise the hidden dangers of losing focus and going into burnout.
That's why I'm making it a habit to start my day with 20 minutes of mindfulness meditation. Concentrating on my breath alone and putting all the thoughts whizzing around in my head back to their waiting line (again and again and again...) helps me keep my peace of mind and trains my mental muscles.
Buffer CEO Joel Gascoigne lists "5 reasons as a CEO you should develop a habit of daily meditation":
- You will easily handle the inevitable ups and downs
- It will save you time, by reducing procrastination
- You will have bursts of creative genius
- You will feel alive and healthy and have better sleep
- It will make you happy and you’ll find meaning
One of the utilities that I immediately install on every new Mac is TextExpander. It makes typing routine stuff so much easier.
In a recent blog post, David Sparks wrote about his TextExpander snippets for date and time, describing two simple but effective use cases: Shortcuts like "xm8", which expands to "August" (why haven't I thought of this myself?), and date calculation snippets like "d--" that inserts yesterday's date.
Using David's snippets on your Mac requires only three mouse clicks (on the link above, on the download link in his post and finally on the snippet file).
Recently, I've had a discussion with my precious about the song "Clouds across the moon" and how the laws of physics make a phone call in the common sense between Earth and Mars impossible.
Had I known that there is a website with an awesome visualisation of the distance to Mars, this would have been far easier!