Skip to content

Instantly share code, notes, and snippets.

@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'
@etes
etes / smtpcheck.py
Last active March 18, 2020 12:44 — forked from blinks/smtpcheck.py
#!/usr/bin/env python
"""
Check that a particular email address exists.
Adam Blinkinsop <blinks@acm.org>
WARNING:
Checking email addresses in this way is not recommended, and will lead to
your site being listed in RBLs as a source of abusive traffic. Mail server
admins do like it when they get connections that don't result in email being
sent, because spammers often use this technique to verify email addresses.
@etes
etes / pi_mount_usb.md
Last active April 27, 2024 06:11
How to setup mount / auto-mount USB Hard Drive on Raspberry Pi

How to setup mount / auto-mount USB Hard Drive on Raspberry Pi

Follow the simple steps in the order mentioned below to have your USB drive mounted on your Raspberry Pi every time you boot it.

These steps are required especially if your are setting up a Samba share, or a 24x7 torrent downloader, or alike where your Raspberry Pi must have your external storage already mounted and ready for access by the services / daemons.

Step 0. Plug in your USB HDD / Drive to Raspberry Pi If you are using a NTFS formatted drive, install the following