Skip to content

Instantly share code, notes, and snippets.

View rchampourlier's full-sized avatar

Romain Champourlier rchampourlier

View GitHub Profile
@rchampourlier
rchampourlier / rvm.sh
Created September 6, 2011 15:23
Changed /etc/profile.d/rvm.sh after rvm 1.8.1 install, original one was bugged
#
# RVM profile
#
# /etc/profile.d/rvm.sh # sh extension required for loading.
#
if [ -n "${BASH_VERSION:-}" -o -n "${ZSH_VERSION:-}" ] ; then
# Load user rvmrc configurations, if exist
@rchampourlier
rchampourlier / deploy.rb
Created October 11, 2011 17:07
Capistrano deploy.rb for a server hosting the git repository
set :use_sudo, false
set :git_shallow_clone, 1 # tell git to clone only the latest revision and not the whole repository
set :keep_releases, 5
set :application, "app"
set :repository, "git@127.0.0.1:app.git"
set :user, "deployer"
set :password, "deployer_password"
@rchampourlier
rchampourlier / nginx.conf
Created October 11, 2011 14:15
nginx configuration file template
user deployer staff;
worker_processes 4;
error_log /var/log/nginx/error.log;
pid /var/run/nginx.pid;
events {
worker_connections 1024;
# multi_accept on;
accept_mutex on;
@rchampourlier
rchampourlier / monit_unicorn.conf
Created October 13, 2011 07:04
Template for monit configuration file to monitor unicorn instance
check process unicorn
with pidfile <%= "#{unicorn_pid}" %>
start program = "<%= "#{startup_script_path}" %> start"
stop program = "<%= "#{startup_script_path}" %> stop"
group unicorn
@rchampourlier
rchampourlier / unicorn_app.ltd
Created October 13, 2011 07:05
Template for nginx host file for unicorn-served Rails application deployed through our Capistrano recipe
# Some changes made on https://github.com/ricodigo/ricodigo-capistrano-recipes/blob/master/generators/nginx.conf.erb
upstream <%= application %>_app_server {
server unix:<%= unicorn_socket %> fail_timeout=0;
}
# <%= application %> Server
server {
listen <%= app_port %>;
client_max_body_size 500M;
@rchampourlier
rchampourlier / unicorn_startup_script_template
Created October 13, 2011 07:06
Template for startup script to launch unicorn instance for a given rails app. To be used with our Capistrano deployment recipe
#!/bin/bash
#
# <%= "#{application}" %> <%= "#{application}" %> Rails application served through an Unicorn instance
#
# Author Romain Champourlier @ softr.li
#
# chkconfig: - <%= "#{unicorn_startorder} #{unicorn_killorder}" %>
#
# description: This a web application developed in Ruby On Rails
# which is served through an Unicorn instance.
@rchampourlier
rchampourlier / unicorn.rb
Created October 13, 2011 07:06
Template for unicorn.rb to use with Capistrano deployment recipe
# This file has been generated from unicorn_template.rb.erb which is greatly inspired from:
# https://github.com/ricodigo/ricodigo-capistrano-recipes/blob/master/generators/unicorn.rb.erb
#
# See http://unicorn.bogomips.org/Unicorn/Configurator.html for complete
# documentation.
# Local variables
old_pid = '<%= unicorn_pid + ".old" %>'
# Unicorn setup
@rchampourlier
rchampourlier / god.conf
Created March 16, 2012 13:33
Upstart job for god with rbenv
# god
#
# Incomplete Upstart job for God
#
# TODO
# - Find a way to track god (through a pidfile maybe). Maybe this StackOverflow
# answer could help
@rchampourlier
rchampourlier / delayed_job.god.erb
Created March 16, 2012 18:47
God configuration file for delayed_job, with rbenv (ERB generator, usable within Capistrano recipes)
# == God config file for delayed_job
#
# http://god.rubyforge.org/
#
# Config mix from:
# - http://def-end.com/post/10440978748/god-config-for-delayed-job
# - https://groups.google.com/forum/?fromgroups#!topic/delayed_job/VtsFwH3ePiI
# - https://github.com/blog/229-dj-god (not so much, since I wanted to use the script)
#
# Modified by Romain Champourlier (romain@softr.li)
@rchampourlier
rchampourlier / deck.automatic.js
Created March 26, 2012 15:03
Automatic slideshow extension for deck.js
/*!
Deck JS - deck.navigation
Copyright (c) 2012 Romain Champourlier
Dual licensed under the MIT license and GPL license.
https://github.com/imakewebthings/deck.js/blob/master/MIT-license.txt
https://github.com/imakewebthings/deck.js/blob/master/GPL-license.txt
*/
/*
This module adds automatic control of the deck.