Skip to content

Instantly share code, notes, and snippets.

View Zhengquan's full-sized avatar

Zhengquan Zhengquan

  • ThoughtWorks
  • Beijing
View GitHub Profile
@Zhengquan
Zhengquan / .vimrc
Created March 9, 2012 13:36
my vimrc
"Use Vim settings, rather then Vi settings (much better!).
"This must be first, because it changes other options as a side effect.
set nocompatible
"activate pathogen
call pathogen#runtime_append_all_bundles()
call pathogen#helptags()
"allow backspacing over everything in insert mode
set backspace=indent,eol,start
@Zhengquan
Zhengquan / .tmux.conf
Created March 9, 2012 13:34
my .tmux.conf
set-option -g base-index 1
set-window-option -g mode-keys vi
set-option -g repeat-time 1000
set-option -g status-keys vi
set-option -g status-right "#(date +%H:%M' ')"
set-option -g status-right-length 10
set-option -g status-utf8 on
set-window-option -g utf8 on
@Zhengquan
Zhengquan / resque_worker.markdown
Created February 3, 2012 16:33
resque_workers log file
*** got: (Job{statused} | SchedulerNotifyAccept | ["93772c701eb8012f0c9d723c91df8bf1", {}])
*** done: (Job{statused} | SchedulerNotifyAccept | ["93772c701eb8012f0c9d723c91df8bf1", {}])
*** got: (Job{statused} | SchedulerAcceptAnswer | ["937741001eb8012f0c9d723c91df8bf1", {}])
*** done: (Job{statused} | SchedulerAcceptAnswer | ["937741001eb8012f0c9d723c91df8bf1", {}])
*** Error reserving job: #
*** /prod/dev/magic/shared/bundle/ruby/1.9.1/gems/redis-2.2.2/lib/redis/client.rb:170:in `rescue in read'
/prod/dev/magic/shared/bundle/ruby/1.9.1/gems/redis-2.2.2/lib/redis/client.rb:161:in `read'
/prod/dev/magic/shared/bundle/ruby/1.9.1/gems/redis-2.2.2/lib/redis/client.rb:46:in `block in call'
/prod/dev/magic/shared/bundle/ruby/1.9.1/gems/redis-2.2.2/lib/redis/client.rb:142:in `block (2 levels) in process'
@Zhengquan
Zhengquan / unicorn_init
Created November 10, 2011 13:51
A script to start unicorn at system boots
#! /bin/sh
# File: /etc/init.d/unicorn
prog="unicorn"
PATH=/usr/local/rvm/gems/ruby-1.9.2-p290/bin:/usr/local/rvm/gems/ruby-1.9.2-p290@global/bin:/usr/local/rvm/rubies/ruby-1.9.2-p290/bin:/usr/local/rvm/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games
DAEMON=`which unicorn_rails`
CONFIG_FILE=/var/www/magic/config/unicorn.rb
DAEMON_ARGS="$CONFIG_FILE"
APP_ROOT="/var/www/magic"
PID_FILE="$APP_ROOT/tmp/pids/unicorn.pid"