# Check out the original file should receive the changes. This should be the version on your working branch
git checkout {MY-WORKING-BRANCH-SHA} -- path/to/my/file.txt
# Generate a diff of the file, ignoring space changes against a known branch. You should be on your working branch for this
git checkout my-working-branch
git diff HEAD..master --ignore-space-change -- path/to/my/file.txt > patch.diff
# Apply the patch. Note that you MUST use the same --ignore-space-change flag to apply properly
git apply --ignore-space-change patch.diff
View cloudformation-gnip-kinesis-connector.json
"AWSTemplateFormatVersion" : "2010-09-09",
"Description": "Create EC2 instance to run a GNIP Kinesis connector. Creates CloudWatch alarms when 85% stream capacity reached.",
"Parameters" : {
"Environment" : {
"Type": "String",
"Description": "Environment in which to run",
"AllowedValues": ["production", "development"]
"InstanceTerminationProtection": {

Here's how we install puppet onto our EC2 instances using ELB customizations through .ebextensions. Certain details omitted for the sake of security. I've been unable to make an AMI that contains a preinstalled version of puppet. Each time the instance gets provisioned onto a sever, the environment and certname are out of sync and never seem to get updated.

$CHIRPIFY_ENV is an ENV variable that gets introduced via the ELB configuration.

# Install puppet agent onto the EC2 instance.
# NOTE the path for elasticbeanstalk variables changes between ELB
#   applications. Newer versions of pre-packaged ELB applications have entirely
#   different paths, so the following directives are not necessarily compatible
#   i.e. /opt/elasticbeanstalk/containerfiles/envars.d

Ruby Design Patterns - Methods over Attributes


The objective of this article is to highlight the subtle differences between using class attributes and class methods in Ruby. Both offer a valid way to manipulate the state of an instance of a class. Things can get increasingly complex, hard to test and hard to maintain as more instance variables are introduced. Beginner and intermediate Rubyists often miss this subtle but important point which can introduce bugs that may be hard to fix in their native habitat.

The reasons I prefer to use methods over instance variables:

  • Increases predictability of method calls
  • Increases predictability when testing


After updating my Virtualbox installation I was experiencing issues with vagrant not syncing my shared folders from my Mac OS X host to the guest filesystem (Ubuntu). This document logs some of the steps that I used to fix that problem.

After booting my vagrant VM, none of the folders I had specified in the directory were syncing.


  • Mac OS X 10.8.5 (Host)
  • Ubuntu 12.04 LTS (Guest)


This document describes how to modify the Puppet Master (Enterprise v3.7) server configuration so that it can use environments for the manifests. Using those environment files allows the puppet agents to configure themselves in a variety of environments. It allows you to create a separate set of manifests and modules for specific environments, thereby safeguarding that untested modifications to no promote to the production nodes.

Setup environment directories

$ cd /etc/puppetlabs
$ sudo mkdir environments
$ sudo clown -r puppet:root environments

Self Signed Certificate

Generate a new RSA key of 4096 bits. Adding the -des3 (or any other cipher) requires that the key have a password issued:

openssl genrsa -out server.key 2048

Generate a new CSR (Certificate Signed Request)

openssl req -new -key server.key -out server.csr
# An interactive script that allows you to delete multiple remote branches from
# a git repository with confirmation before deletion.
# Provide the path to the git repo as an argument to the script or it will
# prompt you for the path to the repo
# @version 0.1
# @author Evan Reeves <>
View git-notes.mdown

Git Notes

Merge Two Branches in seperate repos

I have two independent repositories (A and B) and would like to merge one repo. (B) into another one (A) with keeping the whole history of both. What do to?

% cd projectA
% git remote add test ../path/to/other/repo && git fetch test

Adds a new branch called test which pulls in ALL branches from the /other/repo. git fetch test pulls code for all branches


find commands

find . -regextype posix-egrep -regex ".*(rb|js)$"

Find all files ending in .rb or .js.

find . -name "*js" -o -name "*rb"

Same as above, not using regular expressions.