Skip to content

Instantly share code, notes, and snippets.

@etes
etes / supervisord.sh
Created March 7, 2017 12:51 — forked from danmackinlay/supervisord.sh
an init.d script for supervisord
#! /bin/sh
### BEGIN INIT INFO
# Provides: supervisord
# Required-Start: $remote_fs
# Required-Stop: $remote_fs
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: Example initscript
# Description: This file should be used to construct scripts to be
# placed in /etc/init.d.
@etes
etes / supervisord.sh
Created March 7, 2017 12:51 — forked from mhayes/supervisord.sh
init.d for supervisord for Amazon Linux AMI
#!/bin/sh
# Amazon Linux AMI startup script for a supervisor instance
#
# chkconfig: 2345 80 20
# description: Autostarts supervisord.
# Source function library.
. /etc/rc.d/init.d/functions
supervisorctl="/usr/bin/supervisorctl"
@etes
etes / TileLayer.CloudMade.js
Created October 10, 2017 10:04 — forked from mourner/TileLayer.CloudMade.js
Basic CloudMade tile layer for Leaflet
L.TileLayer.CloudMade = L.TileLayer.extend({
options: {
maxZoom: 18,
attribution: 'Map data &copy; 2011 <a href="http://openstreetmap.org">OpenStreetMap</a> contributors, <a href="http://creativecommons.org/licenses/by-sa/2.0/">CC-BY-SA</a>, Imagery &copy; 2011 <a href="http://cloudmade.com">CloudMade</a>'
},
initialize: function(key, styleId, options) {
var url = 'http://{s}.tile.cloudmade.com/{key}/{styleId}/256/{z}/{x}/{y}.png',
urlParams = {key: key, styleId: styleId || 997};
@etes
etes / schema_clone.py
Created April 4, 2018 08:25 — forked from rabbitt/schema_clone.py
PostgreSQL schema cloner (including data).
import psycopg2 as pg
from io import BytesIO
from collections import defaultdict
from contextlib import contextmanager
from psycopg2.extensions import ISOLATION_LEVEL_AUTOCOMMIT, ISOLATION_LEVEL_READ_COMMITTED
READ_COMMIT = ISOLATION_LEVEL_READ_COMMITTED
AUTO_COMMIT = ISOLATION_LEVEL_AUTOCOMMIT
@etes
etes / install_postgresql9.4_postgis2.1_ubuntu.md
Created April 26, 2018 12:11 — forked from ansell/install_postgresql9.4_postgis2.1_ubuntu.md
Installing PostgreSQL 9.4 and PostGIS on Ubuntu 14.04

Remove old PostGIS Installation

The first step is to remove older version of PostGIS if any.

sudo apt-get purge postgis

Setup repository

wget --quiet -O - https://www.postgresql.org/media/keys/ACCC4CF8.asc | sudo apt-key add -
sudo sh -c 'echo "deb http://apt.postgresql.org/pub/repos/apt/ trusty-pgdg main" >> /etc/apt/sources.list.d/postgresql.list'