Skip to content

Instantly share code, notes, and snippets.

@aughban
aughban / hackybus.rb
Created March 11, 2014 18:40
hacky bus tracker code
#!/usr/bin/env ruby
require 'json'
require 'terminal-notifier'
require 'open-uri'
require 'date'
today = Date.today
tomorrow = today+1
@aughban
aughban / gist:5917474
Last active December 19, 2015 07:19
pre-commit for git to check json files syntax are correct.
#!/bin/bash
if git-rev-parse --verify HEAD >/dev/null 2>&1; then
against=HEAD
else
against=4b825dc642cb6eb9a060e54bf8d69288fbee4904
fi
exec 1>&2
@aughban
aughban / sg_update.rb
Created May 5, 2013 14:41
a quick script to help you avoid setting up security groups using 0.0.0.0/8 for your own instances.
require 'aws-sdk'
require 'json'
require 'open-uri'
# Lets get our IP first
ip = JSON.parse(open('http://jsonip.com').string)['ip'] + '/32'
# You'll need to provide details that allow for API access to SG's.
ACCOUNT = {
:access_key_id => '',