Skip to content

Instantly share code, notes, and snippets.

### Keybase proof
I hereby claim:
* I am billmoritz on github.
* I am billmoritz (https://keybase.io/billmoritz) on keybase.
* I have a public key ASAwUSZsqn3dRlmgPqqxfI5rb8aD3sW4ILDWNw9FhNmYjgo
To claim this, I am signing this object:
provider "aws" {
region = "us-west-2"
}
variable "server_count" {
default = 4
}
resource "aws_eip" "ip" {
count = "${var.server_count}"
@billmoritz
billmoritz / download_stacks.sh
Last active December 3, 2015 16:06
Download cloudformation templates from your aws account
#!/bin/bash
for i in `aws cloudformation list-stacks --output text --stack-status-filter CREATE_COMPLETE | awk '{ print $4 }'`; do
aws cloudformation get-template --stack-name $i | jq .TemplateBody | jq -S '.AWSTemplateFormatVersion="2010-09-09"' > stacks/$i.json
done
for i in `aws cloudformation list-stacks --output text --stack-status-filter UPDATE_COMPLETE | awk '{ print $5 }'`; do
aws cloudformation get-template --stack-name $i | jq .TemplateBody | jq -S '.AWSTemplateFormatVersion="2010-09-09"' > stacks/$i.json
done
curl -s -D - -o /dev/null -L $@
environment_groups:
corporate:
- corporate
development:
- development
int:
- int
qa:
- qa
staging:
Using rake 10.3.2
Using addressable 2.3.6
Using builder 3.2.2
Using gyoku 1.1.1
Using nokogiri 1.5.11
Using akami 1.2.2
Using app_conf 0.4.2
Using multipart-post 2.0.0
Using faraday 0.9.0
Using berkshelf-api-client 1.2.0
hipchat_arguments = [ "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX", "My Room" ]
include_recipe "hipchat"
chef_handler "HipChat::NotifyRoom" do
source "#{Gem::Specification.find_by_name("hipchat").lib_dirs_glob}/hipchat/chef.rb"
arguments hipchat_arguments
action :enable
end
app = node[:rails][:app]
rails_base app[:name] do
ruby_ver app[:ruby_ver]
gemset app[:gemset]
end
%w{config log pids cached-copy bundle system}.each do |dir|
directory "#{app[:app_root]}/shared/#{dir}" do
owner app[:deploy_user]
@billmoritz
billmoritz / cleanmerged.sh
Created January 16, 2013 13:37
Deletes remote branches from origin that have been merged in to origin/master
git branch -r --merged origin/master |
grep origin | egrep -v '>|master' |
awk '{sub(/origin\//,"");print}' |
xargs git push origin --delete