Skip to content

Instantly share code, notes, and snippets.

View mbabineau's full-sized avatar

Mike Babineau mbabineau

  • Second Measure
  • San Francisco, CA
View GitHub Profile
mbabineau / docker-registry.template.json
Last active July 3, 2018 13:34
Docker Registry CloudFormation template (better version here:
View docker-registry.template.json
"AWSTemplateFormatVersion" : "2010-09-09",
"Description" : "Launches a Docker Registry.",
"Parameters" : {
"InstanceType" : {
"Description" : "EC2 instance type",
"Type" : "String",
"Default" : "m1.small",
# Example code for specifying multiple dimensions in a
# query of Amazon EC2 CloudWatch using the boto library.
# Boto may be downloaded here:
from datetime import datetime, timedelta
from boto import connect_cloudwatch
from boto.ec2.cloudwatch.metric import Metric
# ssh-instance - function to let you SSH to an EC2 instance ID
# Written by Mike Babineau <>. Original here:
# Put this in ~/.profile and reload your terminal
function ssh-instance() {
if [ $# -lt 1 ] || [ $# -gt 3 ]; then
echo "Usage: ssh-instance [-r region] <instance id>"
case "$1" in
mbabineau / delayQueueService.groovy
Last active December 12, 2015 09:39
Redis-backed delay queue as a Grails service
View delayQueueService.groovy
import redis.clients.jedis.Jedis
* Handles the delaying of queued messages for later retrieval.
* See
class DelayQueueService {
def redisService
View gist:977747
import datetime
import urllib2
from jabberbot import JabberBot, botcmd
import boto
class EA2DJabberBot(JabberBot):
def __init__(self, *args, **kwargs):
super(EA2DJabberBot, self).__init__(*args, **kwargs)
mbabineau / knife.rb
Created February 21, 2011 02:29 — forked from jbz/knife.rb
View knife.rb
# This knife.rb orig. provided by - but any mistakes are mine!
current_dir = File.dirname(__FILE__)
platform = ""
require 'grit'
branch ="#{current_dir}/..")
case branch
View cascade.html
<script type="text/javascript" src=""></script>
<script type="text/javascript" src="/static/js/jquery.cascade.js"></script>
<script type="text/javascript" src="/static/js/jquery.templating.js"></script>
<script type="text/javascript">
// Set up dropdown menu items for Cascade
var az_list = [
mbabineau /
Created August 3, 2015 19:26
babelchart example
import datetime
import json
import boto
import requests
from flask import Flask, render_template
from babelchart.sources.cloudwatch import CloudWatchSource
from babelchart.sinks.googlecharts import GoogleChartsSink
from babelchart.sources.graphite import GraphiteSource
View gist:9caa3c208bf392041f3f
$ grep eda431d7-4a74-11e4-a320-56847afe9799 /var/log/mesos/mesos-slave.INFO
I1002 20:44:39.176024 1528 slave.cpp:1002] Got assigned task serialization.eda431d7-4a74-11e4-a320-56847afe9799 for framework 20140919-224934-1593967114-5050-1518-0000
I1002 20:44:39.176257 1528 slave.cpp:1112] Launching task serialization.eda431d7-4a74-11e4-a320-56847afe9799 for framework 20140919-224934-1593967114-5050-1518-0000
I1002 20:44:39.177287 1528 slave.cpp:1222] Queuing task 'serialization.eda431d7-4a74-11e4-a320-56847afe9799' for executor serialization.eda431d7-4a74-11e4-a320-56847afe9799 of framework '20140919-224934-1593967114-5050-1518-0000
I1002 20:44:39.191769 1528 docker.cpp:743] Starting container '1d337fa3-8dd3-4b43-9d1e-a774cbcbc22f' for task 'serialization.eda431d7-4a74-11e4-a320-56847afe9799' (and executor 'serialization.eda431d7-4a74-11e4-a320-56847afe9799') of framework '20140919-224934-1593967114-5050-1518-0000'
I1002 20:44:43.707033 1521 slave.cpp:1278] Asked to kill task serialization.eda431d7-4a74-11