Skip to content

Instantly share code, notes, and snippets.

View Gurpartap's full-sized avatar
:octocat:
Working from home

Gurpartap Singh Gurpartap

:octocat:
Working from home
View GitHub Profile
@ebeigarts
ebeigarts / Gemfile
Created January 5, 2012 10:42
Capistrano + Unicorn conf
# ...
gem 'unicorn'
@jtimberman
jtimberman / knife.rb
Created February 1, 2012 19:33
Commented knife.rb for all the things
# Knife Configuration File.
#
# This is a Ruby DSL to set configuration parameters for Knife's
# general options. The default location for this file is
# ~/.chef/knife.rb. If multiple Chef repositories are used,
# per-repository configuration files can be created. A per repository
# configuration file must be .chef/knife.rb in the base directory of
# the Chef repository. For example,
#
# ~/Development/chef-repo/.chef/knife.rb
web: bundle exec thin start -p $PORT -e $RACK_ENV
worker: QUEUE=* bundle exec rake resque:work
scheduler: bundle exec rake resque:scheduler
ruote: bundle exec rake ruote:run_worker
@amateurhuman
amateurhuman / gist:2005745
Created March 9, 2012 09:03
Installing Rubinius 2.0.0-dev with rbenv

Installing rbx-2.0.0-dev with Ruby 1.9 support using rbenv can be a tad tricky. This is what I did to get up and running, you'll need another version of ruby already installed as well as rake.

The basic outline:

  1. Clone Rubinius HEAD from github
  2. Configure installation for rbenv and 1.9 support
  3. Install Rubinius
  4. Configure your $PATH to use Rubinius gems
  5. Start using Rubinius
@ryandotsmith
ryandotsmith / getting_a_job.md
Created April 10, 2012 23:37
Getting a Job: How I transition from college to career.

Getting a Job

May 25 2010

I recently graduated from University with a B.S. in Mathematics and a minor in Computer Science. I love to write code and so naturally I began applying for computer engineering jobs. The keyword is computer engineering, NOT tech support, web ninja or css guru. What I found in the job market was shocking!

YOUR DEGREE DOES NOT MATTER. that much

@scalp42
scalp42 / joyent-smartos.erb
Created April 26, 2012 03:32 — forked from ulfmagnetics/joyent-smartos.erb
joyent-smartos.erb
# shove this in ~/.chef/bootstrap/joyent-smartos.erb
# run knife bootstrap <hostname> -d joyent-smartos
bash -c '
if [ ! -f /opt/local/bin/chef-client ]; then
cd /tmp
pkgin -y install gcc-compiler gcc-runtime gcc-tools-0 ruby19 scmgit-base scmgit-docs gmake
wget http://production.cf.rubygems.org/rubygems/rubygems-1.8.10.tgz
tar -xzf rubygems-1.8.10.tgz
cd rubygems-1.8.10
@sarogers
sarogers / Monit to the Resque
Created April 29, 2012 04:11
Monit script for restarting our Resque workers.
check process resque_worker
with pidfile /home/USER_NAME/dp20/current/tmp/pids/resque_worker.pid
start program = "/usr/bin/env HOME=/home/USER_NAME RACK_ENV=production PATH=/usr/local/bin:/usr/local/ruby/bin:/usr/bin:/bin:$PATH /bin/sh -l -c 'cd /home/USER_NAME/dp20/current; nohup bundle exec rake environment resque:work RAILS_ENV=production QUEUES=record_event,update_counter_cache VERBOSE=1 PIDFILE=tmp/pids/resque_worker.pid & >> log/resque_worker.log 2>&1'" as uid USER_NAME and gid USER_NAME
stop program = "/bin/sh -c 'cd /home/USER_NAME/dp20/current && kill -9 $(cat tmp/pids/resque_worker.pid) && rm -f tmp/pids/resque_worker.pid; exit 0;'"
if totalmem is greater than 300 MB for 10 cycles then restart # eating up memory?
group resque_workers
@MohamedAlaa
MohamedAlaa / tmux-cheatsheet.markdown
Last active December 14, 2025 12:59
tmux shortcuts & cheatsheet

tmux shortcuts & cheatsheet

start new:

tmux

start new with session name:

tmux new -s myname
@vmihailenco
vmihailenco / proxy.go
Created June 25, 2012 21:33
Redis proxy
package main
import (
"flag"
"io"
"log"
"net"
"os"
"os/signal"
"runtime/pprof"
@mikhailov
mikhailov / 0. nginx_setup.sh
Last active August 29, 2025 05:48
NGINX+SPDY with Unicorn. True Zero-Downtime unless migrations. Best practices.
# Nginx+Unicorn best-practices congifuration guide. Heartbleed fixed.
# We use latest stable nginx with fresh **openssl**, **zlib** and **pcre** dependencies.
# Some extra handy modules to use: --with-http_stub_status_module --with-http_gzip_static_module
#
# Deployment structure
#
# SERVER:
# /etc/init.d/nginx (1. nginx)
# /home/app/public_html/app_production/current (Capistrano directory)
#