View git-merge-single-file.sh
# 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": {
View puppet-via-ebextensions.md

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
View TUTORIAL-ruby-instance-methods-versus-attribute-accessors.md

Ruby Design Patterns - Methods over Attributes

Overview

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
View vagrant-sync-folders-fix.md

Overview

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.

Software

  • Mac OS X 10.8.5 (Host)
  • Ubuntu 12.04 LTS (Guest)
View HOWTO-puppet-master-environment.md

Overview

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
View HOWTO-openssl.md

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
View tank
░░░░░███████ ]▄▄▄▄▄▄▄▄
▂▄▅█████████▅▄▃▂
██████████████████████
..◥⊙▲⊙▲⊙▲⊙▲⊙▲⊙▲⊙◤....
View install-gnu-screen-mac-os-10.7-lion.md
$ brew install gpg
$ cd ~/src
$ wget http://ftp.gnu.org/gnu/screen/screen-4.0.3.tar.gz
$ wget http://ftp.gnu.org/gnu/screen/screen-4.0.3.tar.gz.sig

Now verify the signature

$ gpg --verify screen-4.0.3.tar.gz.sig

If you see the following error message:

View git-branch-delete.sh
#!/bin/bash
# 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 <develop@evanreeves.com>