Skip to content

Instantly share code, notes, and snippets.

Keybase proof

I hereby claim:

  • I am dwinph on github.
  • I am aldwin (https://keybase.io/aldwin) on keybase.
  • I have a public key ASABRFk3CLlHTc8bC8-eTtvfS2xBUePaR5eWMbK9hv8X-wo

To claim this, I am signing this object:

server {
listen 443 ssl spdy default_server;
server_name example.com;
ssl_certificate /etc/ssl/certs/my.ssl.crt;
ssl_certificate_key /etc/ssl/private/my.ssl.key;
root /mysite/current/public;
passenger_enabled on;
check process sidekiq_<app_name>
with pidfile /<path_to_app>/shared/tmp/pids/sidekiq.pid
start program = "/bin/su - <deploy_user> -c 'cd /<path_to_app>/current; bundle exec sidekiq -C /<path_to_app>/current/sidekiq_conf.yml -P /<path_to_app>/shared/tmp/pids/sidekiq.pid'" with timeout 30 seconds
stop program = "/bin/su - <deploy_user> -c 'cd /<path_to_app>/current; bundle exec sidekiqctl stop /<path_to_app>/shared/tmp/pids/sidekiq.pid 10'" with timeout 30 seconds
if totalmem is greater than 500 MB for 2 cycles then restart # VM bloat is common in Rails apps
group etools_sidekiq
@dwinph
dwinph / gist:3408388
Created August 20, 2012 22:08
Instam mysql gem on Mountain Lion
export CC=/usr/bin/gcc-4.2
env ARCHFLAGS="-arch x86_64" gem install mysql -- --with-mysql-dir=/usr/local/Cellar/mysql --with-mysql-lib=/usr/local/Cellar/mysql/5.5.25a/lib/ --with-mysql-include=/usr/local/mysql/5.5.25a/include --with-mysql-config=/usr/local/Cellar/mysql/5.5.25a/bin/mysql_config
# in .bash_profile
export DYLD_LIBRARY_PATH="/usr/local/mysql/lib:$DYLD_LIBRARY_PATH"
# From : https://simple-note.appspot.com/publish/pGTcJ7
@dwinph
dwinph / gist:3310659
Last active October 8, 2015 09:17
Installing ruby 1.8.7 via RVM on Mountain Lion
rvmsudo CPPFLAGS=-I/opt/X11/include CC=/usr/local/bin/gcc-4.2 rvm install 1.8.7
#new
CC=/usr/bin/gcc rvm install 1.8.7 --with-gcc=clang --without-tcl --without-tk
@dwinph
dwinph / nginx
Created May 15, 2012 19:30
nginx init.d script
#! /bin/sh
### BEGIN INIT INFO
# Provides: nginx
# Required-Start: $all
# Required-Stop: $all
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: starts the nginx web server
# Description: starts nginx using start-stop-daemon