Skip to content

Instantly share code, notes, and snippets.

@tkhn
tkhn / rbenv.sls
Created December 23, 2013 17:03 — forked from jescalan/rbenv.sls
#
# ruby deps
#
rbenv_deps:
pkg.installed:
- names:
- git
- build-essential
- openssl
@tkhn
tkhn / .vimrc
Created January 4, 2014 17:11
golang vim syntax
filetype off
filetype plugin indent off
set runtimepath+=$GOROOT/misc/vim
filetype plugin indent on
syntax on
@tkhn
tkhn / Vagrantfile
Created January 9, 2014 10:28
Vagrantfile example
Vagrant.configure("2") do |config|
config.vm.box = "quantal64"
config.vm.network :forwarded_port, guest: 3000, host: 3000
config.vm.network :forwarded_port, guest: 80, host: 80
config.vm.network :forwarded_port, guest: 81, host: 81
config.vm.network :forwarded_port, guest: 443, host: 443
config.vm.synced_folder ".", "/vagrant", :nfs => true
end
#
# Run as root
# $ bash <(curl -s https://gist.github.com/goldenbarb/8355152/raw/ec7c95aafbd41590a5e29f50e051564737c345ad/rbenv-install-system-wide.sh)
#
# Update, upgrade and install development tools:
apt-get update
apt-get -y upgrade
apt-get -y install build-essential git-core curl \
libssl-dev \
FROM ubuntu
MAINTAINER shrikrishna <[email protected]>
# update OS
RUN echo "deb http://archive.ubuntu.com/ubuntu precise main universe" > /etc/apt/sources.list
RUN apt-get update
RUN apt-get upgrade -y
# Install depndencies
RUN apt-get install -y ruby1.9.1-dev build-essential git openssh-server vim
@tkhn
tkhn / nginx.conf
Created January 17, 2014 12:18 — forked from jwo/nginx.conf
# you generally only need one nginx worker unless you're serving
# large amounts of static files which require blocking disk reads
worker_processes 1;
user nobody nogroup; # for systems with a "nogroup"
pid /tmp/nginx.pid;
error_log /tmp/nginx.error.log;
events {
worker_connections 1024;
@tkhn
tkhn / gist:8473312
Created January 17, 2014 13:25 — forked from defunkt/gist:206253
# unicorn_rails -c /data/github/current/config/unicorn.rb -E production -D
rails_env = ENV['RAILS_ENV'] || 'production'
# 16 workers and 1 master
worker_processes (rails_env == 'production' ? 16 : 4)
# Load rails+github.git into the master before forking workers
# for super-fast worker spawn times
preload_app true
@tkhn
tkhn / unicorn.rb
Created January 17, 2014 14:12 — forked from jwo/unicorn.rb
#### This is for mongoid, so the active-record stuff is commented out.
#### Uncomment in before/after fork to make this happy
worker_processes 4
user "unprivileged_user", "unprivileged_group"
working_directory "/u/apps/yourappdirectory/current" # available in 0.94.0+
listen "/tmp/.sock", :backlog => 64
listen 8080, :tcp_nopush => true
@tkhn
tkhn / nginx.conf
Created January 21, 2014 13:52
nginx passenger maintenance mode
if (-f $document_root/system/maintenance.html) {
return 503;
}
error_page 404 /404.html;
error_page 500 502 504 /500.html;
error_page 503 @503;
location @503 {
rewrite ^(.*)$ /system/maintenance.html break;
}