Skip to content

Instantly share code, notes, and snippets.

View rottmanj's full-sized avatar

Jeremy Rottman rottmanj

  • Amazon
  • Seattle, WA
View GitHub Profile
{
"user" : {
"email" : "test@example.com",
"password" : "password"
}
}
Ironfan.cluster 'sweetyhigh_production' do
cloud :ec2 do
# permanent true
availability_zones ['us-east-1d']
flavor 'c1.medium' # change to something larger for serious use
backing 'ebs'
image_name 'ubuntu-precise-ironfan'
chef_client_script 'client.rb'
mount_ephemerals
end
@rottmanj
rottmanj / gist:4514254
Created January 11, 2013 21:52
HA Proxy
global
log 127.0.0.1 local0
log 127.0.0.1 local1 notice
#log loghost local0 info
maxconn 4096
#debug
#quiet
user haproxy
group haproxy
@rottmanj
rottmanj / gist:4222707
Created December 6, 2012 08:20
permsex
groups:
default:
default: true
options:
rank: '1000'
permissions:
- modifyworld.*
Admins:
prefix: '&0(&4Admins&0)&7 '
permissions:
@rottmanj
rottmanj / gist:3921943
Created October 20, 2012 03:50
oh-my-zsh
# ZSH Theme - Preview: http://gyazo.com/8becc8a7ed5ab54a0262a470555c3eed.png
local return_code="%(?..%{$fg[red]%}%? ↵%{$reset_color%})"
# COLOR SETTINGS
BIRA_BRACKET_COLOR="%{$fg[white]%}"
BIRA_TIME_COLOR="%{$fg[yellow]%}"
BIRA_RVM_COLOR="%{$fg[magenta]%}"
BIRA_DIR_COLOR="%{$fg[cyan]%}"
BIRA_GIT_BRANCH_COLOR="%{$fg[green]%}"
load 'deploy'
# ================================================================
# ROLES
# ================================================================
role :app, "ec2-81-243-196-157.compute-1.amazonaws.com", {:primary=>true}
role :background, "ec2-81-243-205-119.compute-1.amazonaws.com"
@rottmanj
rottmanj / gist:3740162
Created September 17, 2012 22:25
Git Errors
** loading stage recipe 'deploy'
** loading stage recipe 'init_config'
** loading stage recipe 'nginx'
** loading stage recipe 'post_deploy_unicorn_test'
** loading stage recipe 'unicorn'
executing locally: "git ls-remote git@github.com:XXXXXXXXXX/XXXXXXXXXXX.git unicorn_test"
*** Could not save revision: Command git ls-remote git@github.com:XXXXXXXXXX/XXXXXXXXXXX.git unicorn_test returned status code pid 23267 exit 128
* executing `deploy'
* executing `deploy:update'
** transaction: start
@rottmanj
rottmanj / gist:3718765
Created September 13, 2012 23:58
nginx config
upstream unicorn-<%=webistrano_stage %> {
server unix:<%= current_path %>/tmp/sockets/unicorn-<%= webistrano_stage %>.sock fail_timeout=0;
}
server {
listen <%= current_ip %>:80 default deferred;
server_name <%= domain %>;
root <%= current_path %>/public;
try_files $uri/index.html $uri @unicorn;
location @unicorn {
@rottmanj
rottmanj / gist:3718762
Created September 13, 2012 23:58
nginx task
after "deploy:setup", :nginx
namespace :nginx do
desc "Create nginx.conf and generates nginx.conf symlink"
task :default, :roles => :app do
current_ip = capture("curl http://169.254.169.254/latest/meta-data/public-ipv4")
# CREATES THE BASE NGINX CONFIG
config_content = from_template("config/templates/nginx.conf.erb")
put config_content, "#{shared_path}/config/nginx.conf"
#!/bin/sh
set -e
# Feel free to change any of the following variables for your app:
TIMEOUT=${TIMEOUT-60}
APP_ROOT=/data/SweetyHighGamingPlatform/staging/current
SHARED_ROOT=/data/SweetyHighGamingPlatform/staging/shared
PID=$APP_ROOT/tmp/pids/unicorn-staging.pid
CMD="$APP_ROOT/bin/unicorn_rails -D -c /data/SweetyHighGamingPlatform/staging/shared/config/unicorn.rb -E staging"
action="$1"
set -u