Skip to content

Instantly share code, notes, and snippets.

View abahgat's full-sized avatar

Alessandro Bahgat abahgat

View GitHub Profile
@econandrew
econandrew / NominatimOnEC2.md
Last active May 19, 2023 17:51
Instructions for installing an OpenStreetMap Nominatim geocoder instance on Amazon Linux / EC2 (Dec 2014)

Installing Nominatim on Amazon Linux / EC2

  1. Introduction

The official instructions for installing Nominatim are complete, but brief in places, and several steps must be changed in the Amazon Linux environment (which is roughly CentOS / Redhat). The steps below are rough record of what I did to get it working, but I didn't keep perfect track so you shouldn't rely on them as a shell script. Just follow each step, make sure it worked, and hopefully you'll need to adapt very little (version numbers, for one thing). (I also skip in and out of root, but you can be more careful if you like.)

  1. Setting up the EC2 instance

@jgeewax
jgeewax / handlers.py
Created June 16, 2012 19:57
webapp2_extras auth example (copy/paste)
# -*- coding: utf-8 -*-
"""
A real simple app for using webapp2 with auth and session.
It just covers the basics. Creating a user, login, logout and a decorator for protecting certain handlers.
PRE-REQUIREMENTS:
Set at secret_key in webapp2 config:
@ngauthier
ngauthier / import.rb
Created December 21, 2011 16:19
Import a blogger archive to jekyll
require 'rubygems'
require 'nokogiri'
require 'fileutils'
require 'date'
# usage: ruby import.rb my-blog.xml
# my-blog.xml is a file from Settings -> Basic -> Export in blogger.
data = File.read ARGV[0]
doc = Nokogiri::XML(data)
@potch
potch / gist_line_numbers.css
Created September 26, 2011 18:53
CSS to add line numbers to embedded gists
.gist-highlight {
border-left: 3ex solid #eee;
position: relative;
}
.gist-highlight pre {
counter-reset: linenumbers;
}
.gist-highlight pre div:before {
@beaumartinez
beaumartinez / gaecache.py
Created August 9, 2011 21:15
Use GAE's Memcache to cache functions
import google.appengine.api.memcache
DEFAULT_CACHE_TTL = 60 * 60 * 24
def cache(function, ttl=DEFAULT_CACHE_TTL):
'''Cache `function` and its arguments for `ttl` seconds in GAE's
Memcache.
Usable as a decorator.
'''