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
donavanm / gist:2156519
Created Mar 22, 2012
region.strewth.org resource record set (rrset)
View gist:2156519
# Name Type Value TTL Region Identifier
region.strewth.org. A 122.248.206.109 300 ap-southeast-1 122.248.206.109
region.strewth.org. A 175.41.208.142 300 ap-northeast-1 175.41.208.142
region.strewth.org. A 184.72.6.100 300 us-west-1 184.72.6.100
region.strewth.org. A 50.112.16.165 300 us-west-2 50.112.16.165
region.strewth.org. A 23.20.203.251 900 us-east-1 23.20.203.251
region.strewth.org. A 177.71.146.114 300 sa-east-1 177.71.146.114
region.strewth.org. A 46.51.135.32 300 eu-west-1 46.51.135.32
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
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
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
donavanm / gist:812782
Created Feb 5, 2011
A simple IP address reflector.
View gist:812782
<?php
// Think something like http://whatismyipaddress.com, 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.