Skip to content

Instantly share code, notes, and snippets.

Avatar

Bill Moritz billmoritz

View GitHub Profile
View 1.md
View gist:e9f0fcd5503b972fa0bd8d1101a80e4a
### 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:
View main.tf
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 Dec 3, 2015
Download cloudformation templates from your aws account
View download_stacks.sh
#!/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
View spork-config.yml
environment_groups:
corporate:
- corporate
development:
- development
int:
- int
qa:
- qa
staging:
View gist:392b0cb2abb58ee3dc55
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
View chef_handler.rb
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
View application.rb
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 Jan 16, 2013
Deletes remote branches from origin that have been merged in to origin/master
View cleanmerged.sh
git branch -r --merged origin/master |
grep origin | egrep -v '>|master' |
awk '{sub(/origin\//,"");print}' |
xargs git push origin --delete