Alex Jumašev, founder and CEO, Jitbit shared the story of a Build Engineer – “the type of guy who loves Vim, creates diagrams in Dot and writes wiki-posts in Markdown,” but more importantly, has a tendency to automate any task that takes him more than 90 seconds to get done.
“If something – anything – requires more than 90 seconds of his time, he writes a script to automate that,’ Alex writes.
Find below, 4 of his finest examples of code, for everyday things that he doesn’t want to spend time on:
1. For the co-worker that doesn’t fix his ways:
Scans the inbox for emails from “Kumar” (a DataBase Administrator at our clients). Looks for keywords like “help”, “trouble”, “sorry” etc. If keywords are found – the script SSHes into the clients server and rolls back the staging database to the latest backup. Then sends a reply “no worries mate, be careful next time”.
2. For getting coffee:
This one waits exactly 17 seconds, then opens an SSH session to our coffee-machine (we had no idea the coffee machine is on the network, runs linux and has SSHD up and running) and sends some weird gibberish to it. Looks binary. Turns out this thing starts brewing a mid-sized half-caf latte, and waits another 24 seconds before pouring it into a cup. The timing is exactly how long it takes to for him to walk from his desk to the machine.
3. For telling people when you’re running late:
Sends a text message “late at work” to his wife. Automatically picks reasons from an array of strings, randomly. Runs inside a cron-job. The job fires if there are active SSH-sessions on the server after 9pm with his login.
4. For dropping leave applications to your boss:
Another cron-job that is set to specific dates. Sends automated emails like “not feeling well/gonna work from home” etc. Adds a random “reason” from another predefined array of strings. Fires if there are no interactive sessions on the server at 8:45am.
You can find the scripts to all of the above mentioned tasks, on his Github.Meet ‘Project Zero’ – Google’s Secret Team of Bug-Hunting Hackers. The 12 Highest Paying Programming Languages.