Skip to content

Instantly share code, notes, and snippets.

View rchampourlier's full-sized avatar

Romain Champourlier rchampourlier

View GitHub Profile
@rchampourlier
rchampourlier / postgres-macosx-install
Last active August 29, 2015 13:59
A gist for installing PostgreSQL with appropriate configuration on MacOS X.
#!/usr/bin/env bash
# A gist for installing PostgreSQL with appropriate
# configuration on MacOS X.
#
# MIT License
#
# Copyright © 2014 Romain Champourlier <romain@softr.li>
brew update
@rchampourlier
rchampourlier / proxy.js
Created July 18, 2015 08:34
Minimal development proxy middleware for NodeJS. Usable to complete BrowserSync with a customized proxy.
// Basic development proxy middleware for NodeJS.
//
// You may use it with BrowserSync to proxy some paths
// to another service. Example of BrowserSync conig:
//
// browserSync({
// server: {
// baseDir: 'dist',
// middleware: function(req, res, next) {
// proxy('/api/', 127.0.0.1', 9292, req, res, next);
@rchampourlier
rchampourlier / gist:1079082
Created July 12, 2011 22:01
SystemV service startup script for a Ruby On Rails app with unicorn
#!/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 July 12, 2011 22:03
SystemV service startup script for a Ruby On Rails app (redmine) with passenger
#!/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:1079098
Created July 12, 2011 22:05
SystemV service startup script for nginx
#!/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:1079094
Created July 12, 2011 22:04
SystemV service startup script for php-fcgi for reverse proxied php on nginx
#!/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 / factcgi_params
Created July 12, 2011 22:19
factcgi_params file for use with nginx reverse-proxying php
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 August 4, 2011 06:37
Small launchd script for MacOS X to backup a Photo Booth library every 15 minutes
#!/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 September 2, 2011 13:50
Unicorn configuration file example
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 September 6, 2011 12:53
Snippet for ~/.gemrc suitable for a deployment environment
:update_sources: true
:bulk_threshold: 1000
:sources:
- http://rubygems.org
gem: --no-ri --no-rdoc
:verbose: true
:benchmark: false
:backtrace: false