Skip to content

Instantly share code, notes, and snippets.

View pnorman's full-sized avatar

Paul Norman pnorman

View GitHub Profile
@pnorman
pnorman / names.csv
Last active March 25, 2018 09:05
name data
2808870 name:en
1035545 name:ru
559728 name:ja
488167 name:de
464426 name:fr
410579 name:ar
352527 name:zh
328441 name:uk
277724 name:fi
190678 name:es
<!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="https://unpkg.com/[email protected]/leaflet-hash.js"></script>
<style type="text/css">
.leaflet-tile-container { pointer-events: auto; }
</style>
@pnorman
pnorman / LICENCE
Created June 6, 2018 05:55
open mouth emoji
This SVG is licensed CC0 by Paul Norman
e (external) 11291.733
m (main) 11256.321
x (extended) 11321.855
@pnorman
pnorman / tuning.sql
Created February 20, 2019 17:38
tuning
ALSTER SYSTEM SET work_mem = '128MB';
ALSTER SYSTEM SET maintenance_work_mem = '4GB';
ALSTER SYSTEM SET default_statistics_target = '10000';
ALSTER SYSTEM SET autovacuum_vacuum_scale_factor = '0.05';
ALSTER SYSTEM SET autovacuum_analyze_scale_factor = '0.02';
ALSTER SYSTEM SET shared_buffers = '8GB';
ALSTER SYSTEM SET max_wal_size = '4GB';
ALSTER SYSTEM SET min_wal_size = '1GB';
ALSTER SYSTEM SET checkpoint_completion_target = '0.9';
ALSTER SYSTEM SET max_worker_processes = '10';
CREATE INDEX CONCURRENTLY planet_osm_polygon_way_area_z10
ON planet_osm_polygon USING GIST (way)
WHERE way_area > 23300;
ALTER INDEX planet_osm_polygon_way_area_z6 RENAME TO planet_osm_polygon_way_area_z6_old;
CREATE INDEX CONCURRENTLY planet_osm_polygon_way_area_z6
ON planet_osm_polygon USING GIST (way)
WHERE way_area > 5980000;
DROP INDEX planet_osm_polygon_way_area_z6_old;
@pnorman
pnorman / index_status.sql
Created July 9, 2022 21:13
Report index status
SELECT p.datname, relid::regclass as table, index_relid::regclass as index,
phase, lockers_done ||'/'|| lockers_total as lockers, blocks_done||'/'||blocks_total as blocks,
tuples_done||'/'||tuples_total as tuples, partitions_done||'/'||partitions_total as partitions, query
from pg_stat_progress_create_index p join pg_stat_activity a on (p.pid = a.pid);
@pnorman
pnorman / 2022Q3CountryTiles.csv
Created November 22, 2022 23:08
2022Q3 OSM usage by country
country osm.org tile requests total requests
DE 2007619478 15493019708
RU 1379970978 16901329649
US 983666291 18346539594
PL 868123678 9942454942
GB 546764609 7317480891
FR 540115081 13940686020
NL 408656025 6593005826
IT 393766036 6885004966
IN 297670395 5293519843
sudo fincore /store/database/nodes; uptime
odin: 14.4G/83.1G, 312d
ysera: 14.4G/83.1G, 411d
pyrene: 38.5G/83.1G, 414d
culebre: 6.1G/83.1G, 183d
nidhogg: 6.7G/83.1G, 223d
palulukon: 26.9G/83.1G, 291d
balerion: 43G/83.1G, 138d
bowser: 44.9G/83.1G, 335d
#!/usr/bin/env python3
import argparse
import csv
from math import log
from PIL import Image
ZOOM = 10
SCALE_MAX = 1_500_000