Skip to content

Instantly share code, notes, and snippets.

Avatar

Romain Champourlier rchampourlier

View GitHub Profile
@rchampourlier
rchampourlier / gist:1079082
Created Jul 12, 2011
SystemV service startup script for a Ruby On Rails app with unicorn
View gist:1079082
#!/bin/bash
#
# app Rails application served through an Unicorn instance
#
# Author Romain Champourlier @ softr.li
#
# chkconfig: - 87 13
#
# description: This a web application developed in Ruby On Rails
# which is served through an Unicorn instance.
@rchampourlier
rchampourlier / gist:1079091
Created Jul 12, 2011
SystemV service startup script for a Ruby On Rails app (redmine) with passenger
View gist:1079091
#!/bin/bash
#
# chkconfig: - 86 14
### BEGIN INIT INFO
# Provides: redmine
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# X-Interactive: true
# Short-Description: redmine (Rails app) provided through Passenger Standalone
### END INIT INFO
@rchampourlier
rchampourlier / gist:1079094
Created Jul 12, 2011
SystemV service startup script for php-fcgi for reverse proxied php on nginx
View gist:1079094
#!/bin/sh
#
# php-fcgi Start and stop FastCGI processes
#
# chkconfig: - 80 20
# description: Spawn FastCGI scripts to be used by web servers
### BEGIN INIT INFO
# Provides: php-fcgi
# Required-Start: $remote_fs $syslog
@rchampourlier
rchampourlier / gist:1079098
Created Jul 12, 2011
SystemV service startup script for nginx
View gist:1079098
#!/bin/sh
#
# nginx - this script starts and stops the nginx daemon
#
# chkconfig: - 85 15
# description: Nginx is an HTTP(S) server, HTTP(S) reverse \
# proxy and IMAP/POP3 proxy server
# processname: nginx
# config: /usr/local/nginx/conf/nginx.conf
# pidfile: /usr/local/nginx/logs/nginx.pid
@rchampourlier
rchampourlier / gist:1079119
Created Jul 12, 2011
nginx configuration file template for HTML-serving, reverse-proxying PHP and Rails apps through Passenger and standalone rails servers
View gist:1079119
user www;
worker_processes 1;
daemon on;
error_log /var/log/nginx/error.log warn;
timer_resolution 500ms;
events {
worker_connections 512;
}
@rchampourlier
rchampourlier / factcgi_params
Created Jul 12, 2011
factcgi_params file for use with nginx reverse-proxying php
View factcgi_params
fastcgi_param QUERY_STRING $query_string;
fastcgi_param REQUEST_METHOD $request_method;
fastcgi_param CONTENT_TYPE $content_type;
fastcgi_param CONTENT_LENGTH $content_length;
fastcgi_param SCRIPT_NAME $fastcgi_script_name;
fastcgi_param REQUEST_URI $request_uri;
fastcgi_param DOCUMENT_URI $document_uri;
fastcgi_param DOCUMENT_ROOT $document_root;
fastcgi_param SERVER_PROTOCOL $server_protocol;
@rchampourlier
rchampourlier / gist:1124608
Created Aug 4, 2011
Small launchd script for MacOS X to backup a Photo Booth library every 15 minutes
View gist:1124608
#!/bin/bash
# Simple script to backup a Photobooth Library hosted in a
# guest account to another folder.
# Intended to be scheduled regularly through launchd.
# Intended for French distribution in this state, needs
# localization to work on another language.
# Tested under Mac OS X Lion.
#
# Useful tutorial for launchd: http://www.devdaily.com/mac-os-x/mac-osx-startup-crontab-launchd-jobs
@rchampourlier
rchampourlier / unicorn-config.rb
Created Sep 2, 2011
Unicorn configuration file example
View unicorn-config.rb
worker_processes 2
working_directory "/var/www/apps/app/"
# This loads the application in the master process before forking
# worker processes
# Read more about it here:
# http://unicorn.bogomips.org/Unicorn/Configurator.html
preload_app true
timeout 30
@rchampourlier
rchampourlier / .gemrc
Created Sep 6, 2011
Snippet for ~/.gemrc suitable for a deployment environment
View .gemrc
:update_sources: true
:bulk_threshold: 1000
:sources:
- http://rubygems.org
gem: --no-ri --no-rdoc
:verbose: true
:benchmark: false
:backtrace: false
@rchampourlier
rchampourlier / rvm.sh
Created Sep 6, 2011
Changed /etc/profile.d/rvm.sh after rvm 1.8.1 install, original one was bugged
View rvm.sh
#
# 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