• Stars
    star
    47,017
  • Rank 255 (Top 0.01 %)
  • Language
    JavaScript
  • Created about 9 years ago
  • Updated about 1 year ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Based on a true story

English | ็ฎ€ไฝ“ไธญๆ–‡

Hacker Scripts

Based on a true story:

xxx: OK, so, our build engineer has left for another company. The dude was literally living inside the terminal. You know, that type of a guy who loves Vim, creates diagrams in Dot and writes wiki-posts in Markdown... If something - anything - requires more than 90 seconds of his time, he writes a script to automate that.

xxx: So we're sitting here, looking through his, uhm, "legacy"

xxx: You're gonna love this

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.

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".

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.

xxx: (and the oscar goes to) fucking-coffee.sh - this one waits exactly 17 seconds (!), then opens a telnet session to our coffee-machine (we had no frikin idea the coffee machine is on the network, runs linux and has a TCP socket up and running) and sends something like sys brew. 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.

xxx: holy sh*t I'm keeping those

Original: http://bash.im/quote/436725 (in Russian) (Archive.org link) Pull requests with other implementations (Python, Perl, Shell, etc) are welcome.

Usage

You need these environment variables:

# used in `smack-my-bitch-up` and `hangover` scripts
TWILIO_ACCOUNT_SID=ACxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
TWILIO_AUTH_TOKEN=yyyyyyyyyyyyyyyyyyyyyyyyyyyyyyy

# used in `kumar_asshole` script
[email protected]
GMAIL_PASSWORD=password

For Ruby scripts you need to install gems: gem install dotenv twilio-ruby gmail

Cron jobs

# Runs `smack-my-bitch-up.sh` monday to friday at 9:20 pm.
20 21 * * 1-5 /path/to/scripts/smack-my-bitch-up.sh >> /path/to/smack-my-bitch-up.log 2>&1

# Runs `hangover.sh` monday to friday at 8:45 am.
45 8 * * 1-5 /path/to/scripts/hangover.sh >> /path/to/hangover.log 2>&1

# Runs `kumar-asshole.sh` every 10 minutes.
*/10 * * * * /path/to/scripts/kumar-asshole.sh

# Runs `fucking-coffee.sh` hourly from 9am to 6pm on weekdays.
0 9-18 * * 1-5 /path/to/scripts/fucking-coffee.sh

Code is released under WTFPL.

More Repositories

1

guides

Design and development guides
2,142
star
2

gitlab

Ruby wrapper and CLI for the GitLab REST API
Ruby
1,061
star
3

ginatra

A web frontend for Git repositories
Ruby
529
star
4

holder_rails

Client side image placeholders for Rails applications
Ruby
47
star
5

go-nyancat

Nyancat in your terminal
Go
30
star
6

wysihtml5-rails

A wysiwyg text editor for use in the Rails asset pipeline
Ruby
27
star
7

gitlab-live

Interactive online shell for GitLab API
JavaScript
21
star
8

narkoz.github.io

My GitHub Page
HTML
18
star
9

bitcoiner

Ruby interface to the 'bitcoind' JSON-RPC API
Ruby
16
star
10

waifu2x

Ruby wrapper and CLI for waifu2x
Ruby
16
star
11

azericard

Ruby interface to AzeriCard online payment processing system
Ruby
13
star
12

dotfiles

~/.
Perl
11
star
13

git-revision

Ruby gem to get information about git source code
Ruby
11
star
14

mmc

Simple command-line currency converter
Go
10
star
15

yuki

Gifzo compatible web app
Ruby
8
star
16

crank-for-rubygems

Chrome extension to make working with RubyGems more productive
JavaScript
8
star
17

xmas

Light the Christmas Tree in your terminal ๐ŸŽ„
Ruby
7
star
18

whoaz

A ruby gem that provides a nice way to interact with Whois.Az
Ruby
7
star
19

destino

Web service that redirects to a Ruby gem's GitHub or RubyGems project page
Elixir
7
star
20

linguo

Language detection library for Ruby
Ruby
6
star
21

emotee

Japanese emoticons (Kaomoji) for Google Chrome. ๏ผไบบโ—• โ€ฟโ€ฟ โ—•ไบบ๏ผผ You need them.
CoffeeScript
6
star
22

gh-ex

github experiments by @narkoz
4
star
23

pixeles

Photo gallery web application
JavaScript
3
star
24

ansible-rails

Ansible playbook to provision a Rails deployment environment on CentOS server
3
star
25

middleman-base

Middleman Base Template with my favorite tools (sass, coffeescript, slim, bootstrap)
Ruby
2
star
26

cancancancan

2deep4u
Ruby
2
star
27

z

an attempt at a browser based realtime twitter client in node.js
JavaScript
2
star
28

pixy

API wrapper for Pixiv url shortener
Ruby
2
star
29

whoaz-api

Web API for Whois.Az
Ruby
1
star