From e6bb45fb96279a5e9a83761ddbe60bf7e05ea4fc Mon Sep 17 00:00:00 2001 From: Maxime Orefice Date: Fri, 27 Nov 2015 00:19:46 +0100 Subject: [PATCH 01/10] Update README.md Fix gem to use twilio API --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 12d4b99..623762d 100644 --- a/README.md +++ b/README.md @@ -37,7 +37,7 @@ GMAIL_PASSWORD=password ``` For Ruby scripts you need to install gems: -`gem install dotenv twilio gmail` +`gem install dotenv twilio-ruby gmail` ## Cron jobs From b9c6dad2c5d015de100e43f90f616d1f5d6108a7 Mon Sep 17 00:00:00 2001 From: Julio Ordonez Viales Date: Thu, 26 Nov 2015 19:26:15 -0600 Subject: [PATCH 02/10] Update cron job to be executed on weekdays only Updated the cron job so that it only executes the scripts on weekdays, that way there is not need to check for this condition inside the scripts, updated the scripts as well --- README.md | 12 ++++++------ fucking_coffee.rb | 3 --- hangover.rb | 3 --- hangover.sh | 7 ------- python/fucking_coffee.py | 7 ------- python/hangover.py | 7 ------- python/smack_my_bitch_up.py | 8 -------- python3/fucking_coffee.py | 5 ----- python3/hangover.py | 5 ----- python3/smack_my_bitch_up.py | 5 ----- smack-my-bitch-up.sh | 7 ------- smack_my_bitch_up.rb | 3 --- 12 files changed, 6 insertions(+), 66 deletions(-) diff --git a/README.md b/README.md index 12d4b99..67ee79e 100644 --- a/README.md +++ b/README.md @@ -42,17 +42,17 @@ For Ruby scripts you need to install gems: ## Cron jobs ```sh -# Runs `smack-my-bitch-up.sh` daily at 9:20 pm. -20 21 * * * /path/to/scripts/smack-my-bitch-up.sh >> /path/to/smack-my-bitch-up.log 2>&1 +# 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` daily at 8:45 am. -45 8 * * * /path/to/scripts/hangover.sh >> /path/to/hangover.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. -0 9-18 * * * /path/to/scripts/fucking-coffee.sh +# Runs `fucking-coffee.sh` hourly from 9am to 6pm on weekdays. +0 9-18 * * 1-5 /path/to/scripts/fucking-coffee.sh ``` --- diff --git a/fucking_coffee.rb b/fucking_coffee.rb index 29564be..69a85ab 100755 --- a/fucking_coffee.rb +++ b/fucking_coffee.rb @@ -1,8 +1,5 @@ #!/usr/bin/env ruby -# Skip on weekends -exit if Time.now.saturday? || Time.now.sunday? - # Exit early if no sessions with my username are found exit unless `who -q`.include? ENV['USER'] diff --git a/hangover.rb b/hangover.rb index 400c0d8..8578aaf 100755 --- a/hangover.rb +++ b/hangover.rb @@ -1,8 +1,5 @@ #!/usr/bin/env ruby -# Skip on weekends -exit if Time.now.saturday? || Time.now.sunday? - # Exit early if sessions with my username are found exit if `who -q`.include? ENV['USER'] diff --git a/hangover.sh b/hangover.sh index fb3b724..800a182 100755 --- a/hangover.sh +++ b/hangover.sh @@ -1,12 +1,5 @@ #!/bin/sh -e -DAYOFWEEK=$(date +%u) - -# Skip on weekends -if [ "$DAYOFWEEK" -eq 6 ] || [ "$DAYOFWEEK" -eq 7 ]; then - exit -fi - # Exit early if any session with my username is found if who | grep -wq $USER; then exit diff --git a/python/fucking_coffee.py b/python/fucking_coffee.py index a510b02..c19572f 100755 --- a/python/fucking_coffee.py +++ b/python/fucking_coffee.py @@ -1,17 +1,10 @@ #!/usr/bin/env python -import datetime import sys import subprocess import telnetlib import time -today = datetime.date.today() - -# skip weekends -if today.strftime('%A') in ('Saturday', 'Sunday'): - sys.exit() - # exit if no sessions with my username are found output = subprocess.check_output('who') if 'my_username' not in output: diff --git a/python/hangover.py b/python/hangover.py index 1daab65..b1903cd 100755 --- a/python/hangover.py +++ b/python/hangover.py @@ -1,18 +1,11 @@ #!/usr/bin/env python -import datetime import os import random from twilio.rest import TwilioRestClient from time import strftime import subprocess -today = datetime.date.today() - -# skip weekends -if today.strftime('%A') in ('Saturday', 'Sunday'): - sys.exit() - # exit if sessions with my username are found output = subprocess.check_output('who') if 'my_username' in output: diff --git a/python/smack_my_bitch_up.py b/python/smack_my_bitch_up.py index 0884416..5a5d425 100755 --- a/python/smack_my_bitch_up.py +++ b/python/smack_my_bitch_up.py @@ -1,6 +1,5 @@ #!/usr/bin/env python -import datetime import os import random from twilio.rest import TwilioRestClient @@ -8,13 +7,6 @@ import subprocess import sys from time import strftime - -today = datetime.date.today() - -# skip weekends -if today.strftime('%A') == 'Saturday' || today('%A') == 'Sunday': - sys.exit() - # exit if no sessions with my username are found output = subprocess.check_output('who') if 'my_username' not in output: diff --git a/python3/fucking_coffee.py b/python3/fucking_coffee.py index e213a3d..0268b79 100755 --- a/python3/fucking_coffee.py +++ b/python3/fucking_coffee.py @@ -1,7 +1,6 @@ #!/usr/bin/env python3 # -*- coding: utf-8 -*- -import datetime import telnetlib import time @@ -13,10 +12,6 @@ COFFEE_MACHINE_PROM = 'Password: ' def main(): - # Skip on weekends. - if datetime.date.today().weekday() in (0, 6,): - return - # Exit early if no sessions with my_username are found. if not any(s.startswith(b'my_username ') for s in sh('who').split(b'\n')): return diff --git a/python3/hangover.py b/python3/hangover.py index 744b959..25ac0fa 100755 --- a/python3/hangover.py +++ b/python3/hangover.py @@ -1,7 +1,6 @@ #!/usr/bin/env python3 # -*- coding: utf-8 -*- -import datetime import random from twilio import TwilioRestException @@ -18,10 +17,6 @@ LOG_FILE_PATH = get_log_path('hangover.txt') def main(): - # Skip on weekends. - if datetime.date.today().weekday() in (0, 6,): - return - # Exit early if any session with my_username is found. if any(s.startswith(b'my_username ') for s in sh('who').split(b'\n')): return diff --git a/python3/smack_my_bitch_up.py b/python3/smack_my_bitch_up.py index dce950d..f160c1c 100755 --- a/python3/smack_my_bitch_up.py +++ b/python3/smack_my_bitch_up.py @@ -1,7 +1,6 @@ #!/usr/bin/env python3 # -*- coding: utf-8 -*- -import datetime import random from twilio import TwilioRestException @@ -18,10 +17,6 @@ LOG_FILE_PATH = get_log_path('smack_my_bitch_up.txt') def main(): - # Skip on weekends. - if datetime.date.today().weekday() in (0, 6,): - return - # Exit early if no sessions with my_username are found. if not any(s.startswith(b'my_username ') for s in sh('who').split(b'\n')): return diff --git a/smack-my-bitch-up.sh b/smack-my-bitch-up.sh index b0bf6b1..cc0547c 100755 --- a/smack-my-bitch-up.sh +++ b/smack-my-bitch-up.sh @@ -1,12 +1,5 @@ #!/bin/sh -e -DAYOFWEEK=$(date +%u) - -# Skip on weekends -if [ "$DAYOFWEEK" -eq 6 ] || [ "$DAYOFWEEK" -eq 7 ]; then - exit -fi - # Exit early if no sessions with my username are found if ! who | grep -wq $USER; then exit diff --git a/smack_my_bitch_up.rb b/smack_my_bitch_up.rb index 06596e8..e970f2c 100755 --- a/smack_my_bitch_up.rb +++ b/smack_my_bitch_up.rb @@ -1,8 +1,5 @@ #!/usr/bin/env ruby -# Skip on weekends -exit if Time.now.saturday? || Time.now.sunday? - # Exit early if no sessions with my username are found exit if `who -q`.include? ENV['USER'] From 95a25f20ea8a86e5315c7ce20336b83f8c56814a Mon Sep 17 00:00:00 2001 From: hzwanghonglai Date: Fri, 27 Nov 2015 16:10:43 +0800 Subject: [PATCH 03/10] fucking coffee using coffeescript --- coffee/fucking.coffee | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100755 coffee/fucking.coffee diff --git a/coffee/fucking.coffee b/coffee/fucking.coffee new file mode 100755 index 0000000..d0f26bc --- /dev/null +++ b/coffee/fucking.coffee @@ -0,0 +1,28 @@ +#!/usr/bin/env coffee + +username = 'name' + +host = 'localhost' +port = '3000' +pass = '5555' + +sh = require('child_process').execSync + +# weekend +process.exit 0 if new Date().getDay() in [6, 0] + +# no sessions +process.exit 0 unless new RegExp(username).test sh('who -q').toString() + +conn = require('net').createConnection(port, host) + +setTimeout -> + conn.write "#{pass}\nsys brew\n" + setTimeout -> + conn.end 'sys pour' + process.exit(0) + , 2 * 1000 +, 1 * 1000 + +# alert +sh('say come here and take your fucking coffee') From 560667284820b8893c258565d801e21bb5e9d21e Mon Sep 17 00:00:00 2001 From: Maxime Orefice Date: Fri, 27 Nov 2015 11:32:10 +0100 Subject: [PATCH 04/10] Update smack_my_bitch_up.rb Correct exit session unless session with username is found --- smack_my_bitch_up.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/smack_my_bitch_up.rb b/smack_my_bitch_up.rb index 06596e8..6164894 100755 --- a/smack_my_bitch_up.rb +++ b/smack_my_bitch_up.rb @@ -4,7 +4,7 @@ exit if Time.now.saturday? || Time.now.sunday? # Exit early if no sessions with my username are found -exit if `who -q`.include? ENV['USER'] +exit unless `who -q`.include? ENV['USER'] require 'dotenv' require 'twilio-ruby' From 3bcd684b06d41a068282e0bdb6588702686de452 Mon Sep 17 00:00:00 2001 From: robaganrab Date: Fri, 27 Nov 2015 15:43:13 +0100 Subject: [PATCH 05/10] Add perl/smack-my-bitch-up.pl Dependencies: - DateTime - SMS::Send::Twilio - YAML --- perl/smack-my-bitch-up.pl | 72 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 72 insertions(+) create mode 100755 perl/smack-my-bitch-up.pl diff --git a/perl/smack-my-bitch-up.pl b/perl/smack-my-bitch-up.pl new file mode 100755 index 0000000..4707518 --- /dev/null +++ b/perl/smack-my-bitch-up.pl @@ -0,0 +1,72 @@ +#!/usr/bin/perl + +use strict; +use warnings; + +use DateTime; +use SMS::Send; +use YAML; + +# Config +my $conf = Load( <<'...' ); +--- +phone_numbers: + my_number: +15005550006 + her_number: +xxx +reasons: + - Working hard + - Gotta ship this feature + - Someone fucked the system again +... + +my $date = DateTime->now; + +# Skip on weekends +if ( $date->day_of_week >= 6 ) { + exit; +} + +# Exit early if no sessions with my username are found +open( my $cmd_who, '-|', 'who' ) || die "Cannot pipe who command ". $!; + +my @sessions = grep { + m/$ENV{'USER'}/ +} <$cmd_who>; + +close $cmd_who; + +exit if ( scalar( @sessions ) == 0 ); + +# Load Twilio API config +open( my $env, '<', '../.env' ) || die "Cannot find .env file in project root."; +LINE: while ( my $line = <$env> ) { + next LINE unless ( $line =~ m/^(TWILIO[^=]+)=(.*)(?:[\n\r]*)/ ); + $conf->{'env'}->{ $1 } = $2; +} + +close $env; + +# Randomize excuse +my $reason_number = int( rand( scalar( @{ $conf->{'reasons'} } ) ) ); +my $sms_text = "Late at work. ". $conf->{'reasons'}[ $reason_number ]; + +# Create an object. There are three required values: +my $sender = SMS::Send->new('Twilio', + _accountsid => $conf->{'env'}->{'TWILIO_ACCOUNT_SID'}, + _authtoken => $conf->{'env'}->{'TWILIO_AUTH_TOKEN'}, + _from => $conf->{'phone_numbers'}->{'my_number'}, +); + +# Send a message to me +my $sent = $sender->send_sms( + text => $sms_text, + to => $conf->{'phone_numbers'}->{'her_number'}, +); + +# Did it send? +if ( $sent ) { + print "Sent message.\n"; +} else { + print "Message failed.\n"; +} + From 4e17743407dc2b3eb5d0f1b5dc8d5d8620571698 Mon Sep 17 00:00:00 2001 From: robaganrab Date: Fri, 27 Nov 2015 15:44:17 +0100 Subject: [PATCH 06/10] Add perl/hangover.pl Dependencies: - DateTime - SMS::Send::Twilio - YAML --- perl/hangover.pl | 73 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 73 insertions(+) create mode 100755 perl/hangover.pl diff --git a/perl/hangover.pl b/perl/hangover.pl new file mode 100755 index 0000000..dda41a9 --- /dev/null +++ b/perl/hangover.pl @@ -0,0 +1,73 @@ +#!/usr/bin/perl + +use strict; +use warnings; + +use DateTime; +use SMS::Send; +use YAML; + +# Config +my $conf = Load( <<'...' ); +--- +phone_numbers: + my_number: +15005550006 + boss_number: +xxx +reasons: + - Locked out + - Pipes broke + - Food poisoning + - Not feeling well +... + +my $date = DateTime->now; + +# Skip on weekends +if ( $date->day_of_week >= 6 ) { + exit; +} + +# Exit early if no sessions with my username are found +open( my $cmd_who, '-|', 'who' ) || die "Cannot pipe who command ". $!; + +my @sessions = grep { + m/$ENV{'USER'}/ +} <$cmd_who>; + +close $cmd_who; + +exit if ( scalar( @sessions ) == 0 ); + +# Load Twilio API config +open( my $env, '<', '../.env' ) || die "Cannot find .env file in project root."; +LINE: while ( my $line = <$env> ) { + next LINE unless ( $line =~ m/^(TWILIO[^=]+)=(.*)(?:[\n\r]*)/ ); + $conf->{'env'}->{ $1 } = $2; +} + +close $env; + +# Randomize excuse +my $reason_number = int( rand( scalar( @{ $conf->{'reasons'} } ) ) ); +my $sms_text = "Gonna work from home. ". $conf->{'reasons'}[ $reason_number ]; + +# Create an object. There are three required values: +my $sender = SMS::Send->new('Twilio', + _accountsid => $conf->{'env'}->{'TWILIO_ACCOUNT_SID'}, + _authtoken => $conf->{'env'}->{'TWILIO_AUTH_TOKEN'}, + _from => $conf->{'phone_numbers'}->{'my_number'}, +); + +# Send a message to me +my $sent = $sender->send_sms( + text => $sms_text, + to => $conf->{'phone_numbers'}->{'boss_number'}, +); + +# Did it send? +if ( $sent ) { + print "Sent message.\n"; +} else { + print "Message failed.\n"; +} + From c7bce5514c54f0f615a84aeb7f0085f74b40b933 Mon Sep 17 00:00:00 2001 From: robaganrab Date: Fri, 27 Nov 2015 15:45:12 +0100 Subject: [PATCH 07/10] Add perl/fucking-coffee.pl Dependencies: - DateTime - Net::Telnet - YAML --- perl/fucking-coffee.pl | 49 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 49 insertions(+) create mode 100755 perl/fucking-coffee.pl diff --git a/perl/fucking-coffee.pl b/perl/fucking-coffee.pl new file mode 100755 index 0000000..bc08054 --- /dev/null +++ b/perl/fucking-coffee.pl @@ -0,0 +1,49 @@ +#!/usr/bin/perl + +use strict; +use warnings; + +use DateTime; +use YAML; +use Net::Telnet; + +# Config +my $conf = Load( <<'...' ); +--- +coffee_machine_ip: 10.10.42.42 +password: 1234 +password_prompt: Password: +delay_before_brew: 17 +delay: 24 +... + +# Skip on weekends +my $date = DateTime->now; +if ( $date->day_of_week >= 6 ) { + exit; +} + +# Exit early if no sessions with my username are found +open( my $cmd_who, '-|', 'who' ) || die "Cannot pipe who command ". $!; + +my @sessions = grep { + m/$ENV{'USER'}/ +} <$cmd_who>; + +close $cmd_who; + +exit if ( scalar( @sessions ) == 0 ); + +sleep $conf->{'delay_before_brew'}; + +my $con = Net::Telnet->new( + 'Host' => $conf->{'coffee_machine_ip'}, +); + +$con->watifor( $conf->{'password_prompt'} ); +$con->cmd( $conf->{'password'} ); +$con->cmd( 'sys brew' ); +sleep $conf->{'delay'}; +$con->cmd( 'sys pour' ); +$con->close; + From 3c4205c43f13709ff05244de7fc72c9dc4759446 Mon Sep 17 00:00:00 2001 From: robaganrab Date: Fri, 27 Nov 2015 15:46:03 +0100 Subject: [PATCH 08/10] Add perl/kumar-asshole.pl Dependencies: - DateTime - Mail::Webmail::Gmail - YAML TODO: Rewrite using a different GMail interface. --- perl/kumar-asshole.pl | 88 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 88 insertions(+) create mode 100755 perl/kumar-asshole.pl diff --git a/perl/kumar-asshole.pl b/perl/kumar-asshole.pl new file mode 100755 index 0000000..06db753 --- /dev/null +++ b/perl/kumar-asshole.pl @@ -0,0 +1,88 @@ +#!/usr/bin/perl + +use strict; +use warnings; + +use YAML; +use DateTime; +use Mail::Webmail::Gmail; + +# Config +my $conf = Load( <<'...' ); +--- +kumar_mail: kumar.a@examle.com +database_regex: \S+_staging +keywords_regex: sorry|help|wrong +backup_path: /home/backups/databases/ +... +$conf->{'database_regex'} = qr/ ( $conf->{'database_regex'} ) /x; +$conf->{'keywords_regex'} = qr/ ( $conf->{'keywords_regex'} ) /x; + +my $date = DateTime->now->subtract( + 'days' => 1 +); + +# Load GMail API config +open( my $env, '<', '../.env' ) || die "Cannot find .env file in project root."; +LINE: while ( my $line = <$env> ) { + next LINE unless ( $line =~ m/^(GMAIL[^=]+)=(.*)(?:[\n\r]*)/ ); + $conf->{'env'}->{ $1 } = $2; +} + +close $env; + +my $gmail = Mail::Webmail::Gmail->new( + username => $conf->{'env'}->{'GMAIL_USERNAME'}, + password => $conf->{'env'}->{'GMAIL_PASSWORD'}, + encrypt_session => 1, +); + +my $messages = $gmail->get_messages( label => $Mail::Webmail::Gmail::FOLDERS{ 'INBOX' } ); +die "Cannot fetch emails: ". $gmail->error_msg(); + +MESSAGE: foreach my $message ( @{ $messages } ) { + unless ( + ( $message->{ 'new' } ) + && ( $message->{'sender_email'} eq $conf->{'kumars_email'} ) + && ( $message->{'body'} =~ m/$conf->{'keywords_regex'}/ ) + && ( $message->{'body'} =~ m/$conf->{'database_regex'}/ ) + ) { + print "Skipping mail from=[". $message->{'sender_email'}."] subject=[". $message->{'subject'} ."]\n"; + next MESSAGE; + } + exit 1; + + my $database = $1; + my $backup_file = $conf->{'backup_path'} . $database .'-'. $date->ymd() .'.gz'; + + unless ( -f $backup_file ) { + die 'Cannot find backup file=['. $backup_file ."]\n"; + } + + print 'Restoring database=['. $database .'] from day=['. $date->ymd() .'] from file=['. $backup_file ."]\n"; + + # Restore DB + system( 'gunzip -c '. $backup_file .' | psql '. $database ); + die "Error while restoring the database=[". $database ."] from file=[". $backup_file ."]" if ( $? >> 8 ); + + # Mark as read, add label, reply + $gmail->edit_labels( + 'label' => 'Database fixes', + 'action' => 'add', + 'msgid' => $message->{'id'} + ); + + $gmail->send_message( + 'to' => $conf->{'kumars_email'}, + 'subject' => 'RE: '. $message->{'subject'}, + 'msgbody' => "No problem. I've fixed it. \n\n Please be careful next time.", + ); + + $gmail->edit_labels( + 'label' => 'unread', + 'action' => 'remove', + 'msgid' => $message->{'id'} + ); + +} + From a1716b803fe8496c9fcd7d455cc4e8ed30fd8f7d Mon Sep 17 00:00:00 2001 From: Nihad Abbasov Date: Fri, 27 Nov 2015 22:01:08 +0400 Subject: [PATCH 09/10] fix ruby script closes #53 --- kumar_asshole.rb | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/kumar_asshole.rb b/kumar_asshole.rb index ca5b9f6..fc6a2f0 100755 --- a/kumar_asshole.rb +++ b/kumar_asshole.rb @@ -14,8 +14,16 @@ kumars_email = 'kumar.a@example.com' DB_NAME_REGEX = /\S+_staging/ KEYWORDS_REGEX = /sorry|help|wrong/i +def create_reply(subject) + gmail.compose do + to kumars_email + subject "RE: #{subject}" + body "No problem. I've fixed it. \n\n Please be careful next time." + end +end + gmail.inbox.find(:unread, from: kumars_email).each do |email| - if email.body[KEYWORDS_REGEX] && (db_name = email.body[DB_NAME_REGEX]) + if email.body.raw_source[KEYWORDS_REGEX] && (db_name = email.body.raw_source[DB_NAME_REGEX]) backup_file = "/home/backups/databases/#{db_name}-" + (Date.today - 1).strftime('%Y%m%d') + '.gz' abort 'ERROR: Backup file not found' unless File.exist?(backup_file) @@ -29,11 +37,3 @@ gmail.inbox.find(:unread, from: kumars_email).each do |email| gmail.deliver(reply) end end - -def create_reply(subject) - gmail.compose do - to kumars_email - subject "RE: #{subject}" - body "No problem. I've fixed it. \n\n Please be careful next time." - end -end From ac6edc54a8ce4b6d5abb8408723b42a5226fa7da Mon Sep 17 00:00:00 2001 From: mhsjlw Date: Tue, 24 Nov 2015 20:12:54 -0500 Subject: [PATCH 10/10] The coffee machines uses telnet not SSH Update the TCP socket Oops! Fix a grammar mistake --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 1a34a21..bfda095 100644 --- a/README.md +++ b/README.md @@ -15,7 +15,7 @@ story](https://www.jitbit.com/alexblog/249-now-thats-what-i-call-a-hacker/)_: > 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. -> xxx: (and the oscar goes to) [`fucking-coffee.sh`](https://github.com/NARKOZ/hacker-scripts/blob/master/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. +> xxx: (and the oscar goes to) [`fucking-coffee.sh`](https://github.com/NARKOZ/hacker-scripts/blob/master/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