This file contains hidden or 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
# Author: Erik Elmore <[email protected]> | |
# License: Public Domain | |
# A lazy-loaded collection with built-in lookup indexing. | |
# Good for using lots of memory. | |
class IndexedCollection | |
include Enumerable | |
DEFAULT_DATA = Array[].freeze | |
DEFAULT_LOADER = ->(){ DEFAULT_DATA }.freeze |
This file contains hidden or 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
#!/bin/env ruby | |
### The Poor-Man's DNS Zone Transfer | |
# Copy specific records from a specific name service to Route 53, without using a conventional zone transfer mechanism. | |
# | |
# I realize this is unorthodox and might seem less-than-optimal for most use-cases. In my case, this is a means to | |
# help me continue to utilize Dreamhost's "Fully Hosted Domain" features even after migrating the authority of my zones | |
# as well as my name service to Route 53. The correct functioning of my web hosting and my email services depend on | |
# the ability of dreamhost to freely manage a known subset of the records in my zone. I chose to solve this by | |
# periodically copying that set of records from Dreamhost's name server for my domain into its actual authoritative |
This file contains hidden or 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
#!/bin/env ruby | |
# Create CNAME records in Route 53 that refer to the running EC2 instance | |
# Unless specified by the first argument, a default TTL of 300 is assumed. | |
# Instance tags specify CNAMES to be set: | |
# 'set_cname:0' => 'name.example.com', 'set_cname:1' => 'name2.example.com', etc | |
# Uses IAM credentials found in the AWS CLI config file: | |
# ~/.aws/config (use `aws configure` to create) | |
# Depends on ec2-metadata command to retrieve the current instance ID |
NewerOlder