Ryan Richards rrichards

View Capistrano-Deployment-Recipe.rb
1 2 3 4 5 6 7 8 9 10
# Guide
# Configure the essential configurations below and do the following:
#
# Repository Creation:
# cap deploy:repository:create
# git add .
# git commit -am "initial commit"
# git push origin master
#
# Initial Deployment:
View deploy.rb
1 2 3 4 5 6 7 8 9 10
set :application, 'myapp'
set :repo_url, 'git@github.com:blackxored/myapp'
set :rails_env, 'production'
set :rbenv_type, :system
set :rbenv_ruby, "2.0.0-p247"
set :deploy_to, '/data/apps/myapp'
set :deploy_via, :remote_cache
 
set :user, 'deploy'
set :password, nil
View nginx.conf
1 2 3 4 5 6 7 8 9 10
### Nginx upstart script
### source: http://serverfault.com/a/391737/70451
### /etc/init/nginx.conf
 
description "nginx http daemon"
 
start on (filesystem and net-device-up IFACE=lo)
stop on runlevel [!2345]
 
env DAEMON=/usr/local/sbin/nginx
View _service.md

Sample service script for debianoids

Look at LSB init scripts for more information.

Usage

Copy to /etc/init.d:

# replace "$YOUR_SERVICE_NAME" with your service's name (whenever it's not enough obvious)
View refinerycms_nginx_proxy_cache
1 2 3 4 5 6 7 8 9
Refinery CMS:
Caching images generated by Dragonfly with Nginx cache_proxy instead of Rack:Cache
 
Before:
Static image served by Nginx: 4409.40 req/sec (mean)
Dragonfly generated images from Rack:Cache: 286.66 req/sec (mean)
 
After:
Dragonfly generated images from Nginx proxy_cache: 4099 req/sec (mean)
View .zshrc
1 2 3 4 5 6
 
# for golang
# mkdir $HOME/go
# mkdir -p $GOPATH/src/github.com/user
export GOPATH=$HOME/go
export PATH=$PATH:$GOPATH/bin
View git-branch-status.sh
1 2 3 4 5 6 7 8 9 10
#!/bin/bash
# modified by http://github.com/zeroeth for color/alignment
# modified by http://github.com/kortina
# original from http://github.com/jehiah
# this prints out branch ahead/behind status vs origin/master for all branches
 
# example:
# $ git-branch-status
# dns_check (ahead 1) | (behind 112) origin/master
# master (ahead 2) | (behind 0) origin/master
View gist:8028655
1 2 3 4 5 6 7 8 9
When starting a project that includes refinerycms-blog:
 
$ rake refinery:override view=refinery/pages/*
$ rake refinery:override view=layouts/*
$ rake refinery:override view=refinery/blog/shared/*
$ rake refinery:override view=refinery/blog/posts/*
$ rake refinery:override view=refinery/*
$ rake refinery:override controller=refinery/blog/*
$ rake refinery:override controller=refinery/*
View migrator.sh
1 2 3 4 5 6 7 8 9 10
#! /bin/sh
 
usage_error () {
echo 'Usage: sh migrator.sh <path to sqlite_to_postgres.py> <path to sqlite db file> <an empty dir to output dump files>'
echo
echo 'Example:'
echo '>sh migrator.sh sqlite_to_postgres.py ~/reviewboard.db /tmp/dumps'
echo
echo 'Tested on:'
echo 'Python 2.7.3'
View config.yml
1 2
access_key_id: xxx
secret_access_key: yyy
Something went wrong with that request. Please try again.