Skip to content

Instantly share code, notes, and snippets.

@s0what
s0what / deploy.rb
Created May 9, 2012 07:14
a simple & stupid deploy script(Rails Rake)
require 'rubygems'
require 'net/ssh'
STDOUT.sync = true; STDOUT.flush;
STDERR.sync = true; STDERR.flush;
APP_NAME = "xxx"
APP_ROOT = "/var/www/#{APP_NAME}"
GIT_URL = "/home/www/repositories/xxx.git"
GIT_BRANCH = "origin/master"
@s0what
s0what / unicorn.conf.rb
Created May 9, 2012 07:11
unicorn config
# unicorn -c /var/www/xxx/current/config/unicorn.conf.rb -E production -D
APP_DIR = "/var/www/xxx/current"
worker_processes 1
# Help ensure your application will always spawn in the symlinked
# "current" directory that Capistrano sets up.
working_directory APP_DIR
@s0what
s0what / nginx.conf
Created May 9, 2012 07:10
nginx config
user www www;
worker_processes 2;
pid /var/run/nginx.pid;
error_log /var/log/nginx/err.info.log info;
worker_rlimit_nofile 20046;
@s0what
s0what / nginx.logrotate.conf
Created March 6, 2012 11:55
logrotate for nginx
/var/log/nginx/*.log{
daily
missingok
rotate 7
compress
dateext
delaycompress
notifempty
sharedscripts
postrotate
require "ipaddr"
def ip2int(ip)
IPAddr.new(ip).to_i
end
def int2ip(int)
IPAddr.new(int, Socket::AF_INET).to_s
end