Skip to content

Instantly share code, notes, and snippets.

View pnorman's full-sized avatar

Paul Norman pnorman

View GitHub Profile
@pnorman
pnorman / commands.sh
Created July 21, 2016 06:34
Tile server pre-downloading
# These commands won't set anything up but will pre-download
# the big packages
sudo apt-get update && sudo apt-get upgrade
sudo apt-get install zip unzip curl git ca-certificates \
postgresql-9.5-postgis-2.2 postgresql-contrib-9.5 \
osm2pgsql proj-bin mapnik-utils node-carto \
fonts-dejavu-core fonts-droid-fallback ttf-unifont \
automake libtool g++ libmapnik-dev apache2 apache2-dev
@pnorman
pnorman / Go_COC.md
Last active August 18, 2016 00:31
Go Code of Conduct

Go Community Code of Conduct

Why have a Code of Conduct?

Online communities include people from many different backgrounds. The Go contributors are committed to providing a friendly, safe and welcoming environment for all, regardless of age, disability, gender, nationality, race, religion, sexuality, or similar personal characteristic.

The first goal of the Code of Conduct is to specify a baseline standard of behavior so that people with different social values and communication styles can talk about Go effectively, productively, and respectfully.

The second goal is to provide a mechanism for resolving conflicts in the community when they arise.

@pnorman
pnorman / index.html
Last active April 18, 2018 20:27
Server map switcher
<!DOCTYPE html>
<html style="height:100%;margin:0;padding:0;">
<title>Leaflet page with OSM render server selection</title>
<meta charset="utf-8">
<link rel="stylesheet" href="https://unpkg.com/[email protected]/dist/leaflet.css" />
<script src="https://unpkg.com/[email protected]/dist/leaflet.js"></script>
<script src="leaflet-hash.js"></script>
<style type="text/css">
.leaflet-tile-container {
pointer-events: auto;
@pnorman
pnorman / changesetmd-partition.sql
Last active January 6, 2017 06:49
Partion ChangesetMD tables
UPDATE osm_changeset_state SET update_in_progress = 1; -- lock out ChangesetMD from updating
ALTER TABLE osm_changeset RENAME TO old_osm_changeset;
CREATE TABLE osm_changeset (LIKE old_osm_changeset INCLUDING CONSTRAINTS);
CREATE TABLE osm_changeset_0m AS SELECT * FROM old_osm_changeset WHERE id >= 0 AND id < 10000000;
ALTER TABLE osm_changeset_0m ADD CHECK (id >= 0 AND id < 10000000);
CREATE UNIQUE INDEX osm_changeset_0m_pkey ON osm_changeset_0m (id) WITH (fillfactor = 100);
ALTER TABLE osm_changeset_0m ADD PRIMARY KEY USING INDEX osm_changeset_0m_pkey;
CREATE INDEX ON osm_changeset_0m (user_id) WITH (fillfactor = 100);
@pnorman
pnorman / 4krw.txt
Last active January 30, 2017 10:35
[global]
name=4k random rw 4ios in 32 queues
filename=fio.bin
ioengine=libaio
direct=1
bs=4k
rw=randrw
iodepth=32
numjobs=8
buffered=0
#!/usr/bin/env bash
# This script will
# 1. Download OSM data and load it into a DB
# 2. Update that DB
# 3. Keep a local copy of the planet up to date
# Requirements
# - osmium-tool
# - osmosis
@pnorman
pnorman / log.txt
Created March 25, 2017 08:23
osmium error with osm2pgsql changes
(gdb) run -d osm2pgsql_test --number-processes 1 --output multi --style cleartables.json --flat-nodes nodes.bin ~/osm/osm2pgsql/tests/liechtenstein-2013-08-03.osm.pbf
Starting program: /home/pnorman/osm/osm2pgsql/build/osm2pgsql -d osm2pgsql_test --number-processes 1 --output multi --style cleartables.json --flat-nodes nodes.bin ~/osm/osm2pgsql/te
sts/liechtenstein-2013-08-03.osm.pbf
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
osm2pgsql version 0.93.0-dev (64 bit id space)
Using lua based tag processing pipeline with script admin.lua
Using lua based tag processing pipeline with script admin.lua
Using lua based tag processing pipeline with script place.lua
We're looking at releasing osm2pgsql 0.94.0 soon and could use testing
of the 0.94.0-RC1 version. Testing from packagers is appreciated,
particularly if you are doing something different with libosmium.
Major changes
- Store unprojected coordinates in slim tables and use osmium dense file
array for flat nodes
This fixes a number of projection-related issues
Your server might stop updating and scripts stop working when
planet.openstreetmap.org goes HTTPS-only. If you are using osmosis, you
MUST apply the updates below. Other software and scripts MAY need updates.
operations is working on switching some services to HTTPS-only, including
planet.openstreetmap.org. This has revealed a critical bug in Osmosis where
it fails to follow HTTP redirects.
If using osmosis with --read-replication-interval, please immediately
adjust the baseUrl of your configuration.txt file to point at
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.