Skip to content

Instantly share code, notes, and snippets.

View booo's full-sized avatar

Philipp Borgers booo

View GitHub Profile
# http forking example
http = require "http"
httpProxy = require "http-proxy"
options =
forward:
port: 9001
host: "localhost"
@booo
booo / gist:2574934
Created May 2, 2012 08:02
riak error
07:59:12.988 [error] application: mochiweb, "Accept failed error", "{error,emfile}"
07:59:12.988 [error] CRASH REPORT Process <0.14896.444> with 0 neighbours crashed with reason: {error,accept_failed}
from fileformat_pb2 import Blob
from fileformat_pb2 import BlobHeader
from osmformat_pb2 import *
from zlib import decompress
def map_reader(f, size, url, params):
data = f.read(4)
while data != "":

ping-pong

Ziel des ping-pong Setup ist ein redundantes, hochverfügbares VServer-Setup einzurichten (Alle mal lachen). Das Setup besteht aus den zwei Servern ping und pong. In jedem Server sind zwei Raids konfiguriert, die über das Netzwerk auf den anderen Server gespiegelt werden. Raid X fungiert immer als Primary (Master) auf Server A und Secondary auf Server B und umgekehrt.

ping pong

  • email setup
  • null mailer
  • monitoring
  • smartmon (don't)
  • munin (philipp)
  • vm migration
  • autopatch von pang installieren (done)
  • update start scripts?
  • test migration
  • script
SELECT * INTO postcodes_convex FROM
(SELECT ST_ConvexHull(ST_Collect(geom)) AS geom, tags->'addr:postcode' AS postal_code
FROM nodes
WHERE tags ? 'addr:postcode' GROUP BY postal_code) AS foo
CREATE INDEX idx_nodes_tags_addr_postcode ON nodes ((tags->'addr:postcode')) WHERE (tags->'addr:postcode') IS NOT NULL;

resource pad

api/:version/pads/

create a pad

POST api/:version/pads/

	{

resource pad

api/:version/pads/

create a pad

POST api/:version/pads/

create a pad with a given id

@booo
booo / test.js
Created January 23, 2012 10:25
(function() {
var pg;
pg = require("pg");
pg.connect("pg://postgres:thesecret@localhost/database", function(error, client) {
if (error) {
return console.log(error);
} else {
return client.query("CREATE TEMP TABLE users(id int, name varchar)", function(error, result) {