Skip to content

Instantly share code, notes, and snippets.

donavan donavanm

Block or report user

Report or block donavanm

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
donavanm / gist:2156519
Created Mar 22, 2012 resource record set (rrset)
View gist:2156519
# Name Type Value TTL Region Identifier A 300 ap-southeast-1 A 300 ap-northeast-1 A 300 us-west-1 A 300 us-west-2 A 900 us-east-1 A 300 sa-east-1 A 300 eu-west-1
The last field is a unique identifier in the rrset. Any unique string will work, it doesn't have to be the IP address.
donavanm / elasticat.json
Created Mar 22, 2012
CloudFormation EC2 & Route53 template
View elasticat.json
"AWSTemplateFormatVersion" : "2010-09-09",
"Description" : "Create an EC2 instance, set up Apache, and create Route53 A records",
"Parameters" : {
"KeyName" : {
"Description" : "Name of an existing EC2 KeyPair to enable SSH access to the instances",
"Type" : "String",
donavanm / logdest_json.rb
Created Feb 20, 2011
Adds json formatted ouput for Puppet applications
View logdest_json.rb
# Adds json formatted ouput for Puppet applications.
# Usage: puppet agent --logdest json
# Currently there's no way to load this as a plugin, see #6522. Appending this
# method to puppet/util/log/destinations.rb works. Meh.
# Would also be nice if Puppet::Util::Log had an #attributes method for
# accessors instead of instance_variable hacks.
Puppet::Util::Log.newdesttype :json do
def handle(msg)
message = {}
msg.instance_variables.each {|v| message[v.sub("@","")] = msg.instance_variable_get(v) }
donavanm / gist:812782
Created Feb 5, 2011
A simple IP address reflector.
View gist:812782
// Think something like, but machine parsable,
// small, and fast(ish). Returns a json encoded hash.
// Will accept a port & optional timeout parameter. Attempts to make a TCP
// connection back to the host on specified port. Useful to see if you're
// externally reachable.
// I'm surprised noone else got here first. - donavanm
// Really PHP? What year is this again?
function get_host($ip){
You can’t perform that action at this time.