This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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){ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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) } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"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", |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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. |