Skip to content

Commit de59b60

Browse files
committed
update README
1 parent 14d1165 commit de59b60

File tree

1 file changed

+21
-7
lines changed

1 file changed

+21
-7
lines changed

README.md

Lines changed: 21 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -9,25 +9,36 @@ story](https://www.jitbit.com/alexblog/249-now-thats-what-i-call-a-hacker/)_:
99
1010
> xxx: You're gonna love this
1111
12-
> xxx: `smack-my-bitch-up.sh` - sends a text message "late at work" to his wife (apparently). 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.
12+
> xxx: [`smack-my-bitch-up.sh`](https://github.com/NARKOZ/hacker-scripts/blob/master/smack-my-bitch-up.sh) - sends a text message "late at work" to his wife (apparently). 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.
1313
1414
> xxx: `kumar-asshole.sh` - scans the inbox for emails from "Kumar" (a DBA 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".
1515
16-
> xxx: `hangover.sh` - 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.
16+
> xxx: [`hangover.sh`](https://github.com/NARKOZ/hacker-scripts/blob/master/hangover.sh) - 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.
1717
1818
> xxx: (and the oscar goes to) `fucking-coffee.sh` - this one waits exactly 17 seconds (!), then opens an SSH session to our coffee-machine (we had no frikin 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 walk to the machine from the dudes desk.
1919
2020
> xxx: holy sh*t I'm keeping those
2121
22-
Scripts are written in Ruby.
2322
Pull requests with other implementations (Python, Perl, Shell, etc) are welcome.
2423

2524
## Usage
2625

27-
Install required gems: `gem install dotenv twilio gmail whenever`
28-
Set environment variables. See `.env.example`
26+
You need these environment variables:
2927

30-
Example cron:
28+
```sh
29+
# used in `smack-my-bitch-up` and `hangover` scripts
30+
TWILIO_ACCOUNT_SID=ACxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
31+
TWILIO_AUTH_TOKEN=yyyyyyyyyyyyyyyyyyyyyyyyyyyyyyy
32+
33+
# used in `kumar_asshole` script
34+
35+
GMAIL_PASSWORD=password
36+
```
37+
38+
For Ruby scripts you need to install gems:
39+
`gem install dotenv twilio gmail whenever`
40+
41+
## Cron jobs
3142

3243
```sh
3344
# Runs `smack_my_bitch_up` daily at 9:20 pm.
@@ -41,9 +52,12 @@ Example cron:
4152

4253
# Runs `fucking_coffee` hourly from 9am to 6pm.
4354
0 9,10,11,12,13,14,15,16,17,18 * * * /bin/bash -l -c 'ruby fucking_coffee.rb'
55+
56+
# Runs `hangover.sh` daily at 8:45am with logfile output.
57+
45 8 * * * /bin/bash -l -c '/path/to/scripts/hangover.sh >> /path/to/hangover.log 2>&1'
4458
```
4559

46-
Check `config/schedule.rb`.
60+
Check `config/schedule.rb` file.
4761

4862
---
4963
Code is released under WTFPL.

0 commit comments

Comments
 (0)