← Back to archive

Repo of the Day

NARKOZ/hacker-scripts

Published: Mar 24, 2025

Open repository ↗

Based on a true story

Summary

NARKOZ/hacker-scripts is a collection of shell and Ruby scripts inspired by a widely-shared anecdote about a build engineer who automated personal and work routines. The repository contains four scripts covering SMS alerts, email-driven database rollbacks, automatic "working from home" messages, and remote control of a network-connected coffee machine. It is published under the WTFPL license and described in the repository metadata as JavaScript, though the documented scripts are written in Shell and Ruby.

What it is useful for

This is not a production framework or library. Its value is as a reference for engineers who want to see how basic shell automation patterns are wired together: cron scheduling, environment variable loading, third-party API calls, and telnet-based device control.

Each script demonstrates a specific technique:

  • smack-my-bitch-up.sh uses who to detect active SSH sessions, then calls the Twilio API to send an SMS at 9pm.
  • kumar-asshole.sh uses the gmail Ruby gem to scan an inbox, match keywords like "help" or "sorry", and trigger an SSH-based database rollback with an automatic reply.
  • hangover.sh follows the same trigger-plus-template pattern with different conditions.
  • fucking-coffee.sh opens a telnet session to a coffee machine, waits 17 seconds, sends sys brew, and waits 24 more seconds before walking over.

How engineers can use it

The README documents the exact setup. Configure these environment variables:

TWILIO_ACCOUNT_SID=ACxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
TWILIO_AUTH_TOKEN=yyyyyyyyyyyyyyyyyyyyyyyyyyyyyyy
[email protected]
GMAIL_PASSWORD=password

For the Ruby scripts: gem install dotenv twilio-ruby gmail

Sample cron entries from the README:

20 21 * * 1-5 /path/to/scripts/smack-my-bitch-up.sh >> /path/to/smack-my-bitch-up.log 2>&1
45 8 * * 1-5 /path/to/scripts/hangover.sh >> /path/to/hangover.log 2>&1
*/10 * * * * /path/to/scripts/kumar-asshole.sh
0 9-18 * * 1-5 /path/to/scripts/fucking-coffee.sh

Documented limitations: there is no error handling, retry logic, or test suite described. fucking-coffee.sh requires a network coffee machine that speaks the specific telnet protocol used in the script. kumar-asshole.sh requires SSH access to a staging database and stores a Gmail password in plaintext, a security concern the README does not address. The Twilio scripts hard-code an account used for personal SMS, and assumptions like a colleague named "Kumar" or a specific coffee machine model are baked in. Treat the repository as a starting template for cron-based automation with third-party APIs, not as deployable code.