Skip to content

Instantly share code, notes, and snippets.

Avatar

Romain Champourlier rchampourlier

View GitHub Profile
@rchampourlier
rchampourlier / postgres-macosx-install
Last active Aug 29, 2015
A gist for installing PostgreSQL with appropriate configuration on MacOS X.
View postgres-macosx-install
#!/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 Jul 18, 2015
Minimal development proxy middleware for NodeJS. Usable to complete BrowserSync with a customized proxy.
View proxy.js
// 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 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: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: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 / 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