Skip to content

Instantly share code, notes, and snippets.

View acolin's full-sized avatar

Arnoldo Rodriguez Colin acolin

View GitHub Profile
# Nginx+Unicorn best-practices congifuration guide. Now with SPDY!
# We use latest stable nginx with fresh **openssl**, **zlib** and **pcre** dependencies.
# Some extra handy modules to use: --with-http_stub_status_module --with-http_gzip_static_module
#
# Deployment structure
#
# SERVER:
# /etc/init.d/nginx (1. nginx)
# /home/app/public_html/app_production/current (Capistrano directory)
#
upstream unicorn{
server unix:/path/to/unicorn.sock fail_timeout=0;
}
#rewrite any http request to https
server {
listen 80;
rewrite ^(.*) https://$host$1 permanent;
}
@acolin
acolin / psqlfix.txt
Created October 22, 2012 22:58
Change postgres default template0 to UTF8 encoding
mike@rbci:~$ psql -U postgres
psql (9.0.3)
Type "help" for help.
postgres=# update pg_database set datallowconn = TRUE where datname = 'template0';
UPDATE 1
postgres=# \c template0
You are now connected to database "template0".
template0=# update pg_database set datistemplate = FALSE where datname = 'template1';
UPDATE 1
@acolin
acolin / gist:3907726
Created October 17, 2012 19:53 — forked from jyr/gist:3907705
# -*- mode: ruby -*-
# vi: set ft=ruby :
Vagrant::Config.run do |config|
# All Vagrant configuration is done here. The most common configuration
# options are documented and commented below. For a complete reference,
# please see the online documentation at vagrantup.com.
# Every Vagrant virtual environment requires a box to build off of.
config.vm.box = "plupets"
@acolin
acolin / devise.es.yml
Created September 29, 2012 02:36
Mexican Spanish Locale for Devise
es:
errors:
messages:
not_found: 'no encontrado'
already_confirmed: 'ya ha sido confirmada'
not_locked: 'no está bloqueada'
expired: "ha caducado, por favor pide uno nuevo"
not_saved:
one: "1 error evitó crear este %{resource}:"
other: "%{count} errores evitaron crear este %{resource}:"