excuse.sh
Texts a random made-up excuse when someone is still logged in after hours.
- cron
- */15 18-23 * * 1-5
- reads
- who / w -h
- sends
- Twilio · webhook · signal-cli
bash · cron · curl · zero dependencies
A small, silly collection of cron-driven office automation — the classic Hacker Scripts gag rebuilt so every prank is a standalone command-line script, cron-safe, and configured entirely from environment variables in one config file.
Each one runs by hand or from cron. Each one honours DRY_RUN=1 so you can watch the decision logic without sending anything.
Texts a random made-up excuse when someone is still logged in after hours.
Emails a sick note in the morning if nobody is logged in — the joke being that absence is taken as illness.
Scans IMAP for mail from one sender and replies once per message, threaded and deduplicated.
Waits a bit, then triggers the network coffee machine over HTTP or an arbitrary shell command.
Set the conditions, then run. This mirrors the real branch order in the shell scripts — nothing is sent, and the log lines are the ones the scripts actually print.
Every line above is real output from DRY_RUN=1 runs.
Everything lives in one shell file, config/config.env. The full documented list is in the example file; these are the ones you'll actually touch.
| Variable | Default | What it does |
|---|---|---|
DRY_RUN | 0 | 1 = log decisions, send nothing, call no APIs |
SMS_PROVIDER | twilio | none · twilio · webhook · signal |
NOTIFY_TO | — | Destination for SMS/chat: phone number or chat id |
EMAIL_FROM / EMAIL_TO | — | Sender and recipient for email-backed scripts |
WORK_START_HOUR / WORK_END_HOUR | 9 / 18 | What counts as “after hours” |
WORKDAYS | 1,2,3,4,5 | ISO weekday numbers (1 = Mon) |
MIN_SESSIONS | 1 | Sessions required before an excuse goes out |
EXCUSE_COOLDOWN_MINUTES | 120 | Anti-spam window; what makes */15 cron safe |
SICKDAY_HOUR | 8 | Only fire the sick note at this local hour |
WATCH_SENDER | — | Whose mail triggers the auto-reply |
AUTOREPLY_LIMIT | 5 | Max replies per run |
COFFEE_DELAY_SECONDS | 300 | “Wait a bit” before brewing |
Secrets stay out of the repo. config/config.env is git-ignored; only the placeholder example is committed. Use an app password for IMAP, never your main one.
Cron runs with a minimal $PATH and no shell rc files, so set the path and config variables at the top. Always redirect output, or cron will try to email you.
SHELL=/bin/bash PATH=/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin HACKER_SCRIPTS=/opt/hacker-scripts-office HACKER_SCRIPTS_CONFIG=$HACKER_SCRIPTS/config/config.env # weeknight evenings: still logged in? text an excuse */15 18-23 * * 1-5 $HACKER_SCRIPTS/scripts/excuse.sh >> $HACKER_SCRIPTS/state/excuse.log 2>&1 # weekday 08:00: nobody logged in? email a sick note 0 8 * * 1-5 $HACKER_SCRIPTS/scripts/sickday.sh >> $HACKER_SCRIPTS/state/sickday.log 2>&1 # every 5 minutes: watch one sender, reply once */5 * * * * $HACKER_SCRIPTS/scripts/autoreply.sh >> $HACKER_SCRIPTS/state/autoreply.log 2>&1 # weekday 09:00: wait, then brew 0 9 * * 1-5 $HACKER_SCRIPTS/scripts/coffee.sh >> $HACKER_SCRIPTS/state/coffee.log 2>&1
Needs bash and curl. Add python3 for the IMAP watcher, and a mail transport (msmtp, sendmail, or SMTP) for the email scripts.
git clone https://github.com/ArthurzWong/hacker-scripts-office.git cd hacker-scripts-office && ./install.sh
Run ./install.sh — makes the scripts executable, creates config/config.env from the example, and creates state/.
Edit config/config.env: message backend, email backend, work hours, and the sender to watch.
Run ./scripts/doctor.sh for a read-only status report, then make test for 17 dry-run checks across every script.
Paste the lines you want from cron/crontab.example into crontab -e. Nothing runs until you do.
This is a joke repo. It's for demos, hackdays, and laughing at your own build pipeline — not for deceiving your employer or your team. Point it at yourself or a test mailbox before pointing it at anyone else.