Skip to content

Instantly share code, notes, and snippets.

@billmoritz
billmoritz / gist:3837723
Created October 5, 2012 02:25
Amazon RDS Performance Tuning Settings
rds-modify-db-parameter-group {param-group-name} \
--parameters="name=character_set_server, value=utf8, method=pending-reboot" \
--parameters="name=collation_server, value=utf8_general_ci, method=pending-reboot" \
--parameters="name=tmp_table_size, value={DBInstanceClassMemory/16}, method=pending-reboot" \
--parameters="name=max_heap_table_size, value={DBInstanceClassMemory/16}, method=pending-reboot" \
--parameters="name=query_cache_type, value=1, method=pending-reboot" \
--parameters="name=query_cache_size, value={DBInstanceClassMemory/32}, method=pending-reboot" \
--parameters="name=table_open_cache, value=2500, method=pending-reboot" \
--parameters="name=join_buffer_size, value={DBInstanceClassMemory/64}, method=pending-reboot" \
--parameters="name=thread_cache_size, value={DBInstanceClassMemory/12582880}, method=pending-reboot" \
#!/bin/bash
# Darwin or Linux
[ `uname -s` = 'Darwin' ] || { echo 'Im not a Mac.'; exit 1; }
brew doctor || { echo "*** Fix Homebrew before running again."; exit 1; }
brew install git
brew update
brew install hub
# Git-FTP install
cd /tmp
git clone https://github.com/resmo/git-ftp.git
cd git-ftp
git checkout master
sudo make install
@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
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]
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
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
environment_groups:
corporate:
- corporate
development:
- development
int:
- int
qa:
- qa
staging:
curl -s -D - -o /dev/null -L $@
@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