Linux ‘date’ stuff I didn’t know until recently.

I’ve been using Linux for a long time but I had no idea you could do this.

evan@evbox:~$ date -d yesterday
Thu Jul 25 12:44:39 EDT 2013
evan@evbox:~$ date -d '42 days ago'
Fri Jun 14 12:44:51 EDT 2013
evan@evbox:~$ date -d '65 minutes ago'
Fri Jul 26 11:41:18 EDT 2013

As epoch:

evan@evbox:~$ date -d '65 minutes ago' +%s
1374853307

Amazing.

Advertisements

Running MRTG cfgmaker across your entire subnet?

I realized recently that I had a bunch of newly-provisioned VMs that weren’t being monitored by MRTG (one of the tools we use to monitor network usage and other fun stats). Rather than manually run cfgmaker against all the new machines, I decided to script my way out of this.

Continue reading “Running MRTG cfgmaker across your entire subnet?”