Skip to content

Instantly share code, notes, and snippets.

View emilioeduardob's full-sized avatar
🏠
Working from 🇵🇾

Emilio Blanco emilioeduardob

🏠
Working from 🇵🇾
View GitHub Profile
@emilioeduardob
emilioeduardob / upgrade-postgres-9.3-to-9.5.md
Last active February 17, 2018 17:09 — forked from johanndt/upgrade-postgres-9.3-to-9.5.md
Upgrading PostgreSQL from 9.3 to 9.5 on Ubuntu

TL;DR

Install Postgres 9.5, and then:

export LC_CTYPE=en_US.UTF-8; export LC_ALL=en_US.UTF-8
sudo pg_dropcluster 9.5 main --stop
sudo pg_upgradecluster 9.3 main
sudo pg_dropcluster 9.3 main
@emilioeduardob
emilioeduardob / mailman_capistrano.rb
Last active September 29, 2016 11:29
Capistrano recipe for Mailman
set :mailman_cmd, -> { "#{fetch(:bundle_cmd, 'bundle')} exec mailman" }
set :mailman_config, -> { "#{current_path}/config/mailman.rb" }
set :mailman_role, -> { :app }
set :mailman_pid, -> { "#{current_path}/tmp/pids/mailman.pid" }
namespace :mailman do
desc 'Stop mailman'
task :stop do
on roles(:app) do
execute "if [ -d #{current_path} ] && [ -f #{fetch(:mailman_pid)} ] && kill -0 `cat #{fetch(:mailman_pid)}` > /dev/null 2>&1; then cd #{current_path} && rm #{fetch(:mailman_pid)} ; else echo 'Mailman is not running'; fi"
/**
* WkHtmlToPdf table splitting hack.
*
* Script to automatically split multiple-pages-spanning HTML tables for PDF
* generation using webkit.
*
* To use, you must adjust pdfPage object's contents to reflect your PDF's
* page format.
* The tables you want to be automatically splitted when the page ends must
* have a class name of "splitForPrint" (can be changed).
@emilioeduardob
emilioeduardob / gitproxy-socat
Created October 9, 2012 13:59 — forked from sit/gitproxy-socat
A simple wrapper around socat to use as a git proxy command
#!/bin/sh
# Use socat to proxy git through an HTTP CONNECT firewall.
# Useful if you are trying to clone git:// from inside a company.
# Requires that the proxy allows CONNECT to port 9418.
#
# Save this file as gitproxy somewhere in your path (e.g., ~/bin) and then run
# chmod +x gitproxy
# git config --global core.gitproxy gitproxy
#
# More details at http://tinyurl.com/8xvpny