Skip to content

Instantly share code, notes, and snippets.

Sean Coates scoates

Block or report user

Report or block scoates

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@scoates
scoates / timeline
Created Apr 15, 2015
Measure the time delta between lines in stdout
View timeline
#!/usr/bin/env python
import time
from sys import stdin, stdout, argv, exit
try:
if argv[1] == 'help' or argv[1] == '--help' or argv[1] == '-h':
print "%s: times each line of stdin." % argv[0]
print " Optional parameter is a float of a threshold. (defaults to 2.0)"
exit(255);
@scoates
scoates / salt_roots_sshd-mfa_init.sls
Created Mar 13, 2015
SSH + MFA (with Google Authenticator) on Debian Wheezy
View salt_roots_sshd-mfa_init.sls
include:
# for backports
- apt
openssh6.6:
pkg.installed:
# backports; this number *will* change
- pkgs:
- openssh-server: 1:6.6p1-4~bpo70+1
- openssh-client: 1:6.6p1-4~bpo70+1
View README.md

WHAT?

<?php

function machine_forget(&$data) {
    $data = null;
}

$answer = 42;
@scoates
scoates / 0_reuse_code.js
Created Jul 24, 2014
Here are some things you can do with Gists in GistBox.
View 0_reuse_code.js
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
View keybase.md

Keybase proof

I hereby claim:

  • I am scoates on github.
  • I am scoates (https://keybase.io/scoates) on keybase.
  • I have a public key whose fingerprint is 8A45 6450 4355 2F7B FB92 5422 E905 36DD 957A 42BE

To claim this, I am signing this object:

@scoates
scoates / twitter_user_to_image
Last active Dec 19, 2015
Get a twitter profile image from a username. We route around bad APIs. Twitter wears the scumbag hat, these days.
View twitter_user_to_image
#!/bin/bash
# Usage: $0 username
# e.g.:
# $ ./twitter_user_to_image coates
# https://si0.twimg.com/profile_images/1597362183/me.jpg
curl -sL http://twitter.com/$1 | grep profile_images | head -n1 | perl -p -e's/.*?http/http/;s/".*//;s/_bigger//'
@scoates
scoates / check_elb_healthy_hosts.py
Created Jun 27, 2013
Nagios plugin to monitor AWS/EC2 Elastic Load Balancers for healthy hosts
View check_elb_healthy_hosts.py
#!/usr/bin/env python
"""
A nagios plugin for ensuring that load balancers have at least a certain
number of healthy nodes.
Usage:
Nagios Command:
define command {
command_name check_elb_healthy_hosts
@scoates
scoates / timeline
Last active Dec 10, 2015
Times each line of stdin
View timeline
#!/usr/bin/env python
import time
from sys import stdin, stdout, argv, exit
try:
if argv[1] == 'help' or argv[1] == '--help' or argv[1] == '-h':
print "%s: times each line of stdin.\n Optional parameter is a float of a threshold. (defaults to 2.0)" % argv[0]
exit(255);
else:
You can’t perform that action at this time.