Skip to content

Instantly share code, notes, and snippets.

@Firefishy
Firefishy / gist:b2bc79e9d4460e020a0631da839dcfa3
Created March 29, 2017 11:05
Plusnet MTR traceroute ICMP and TCP port 443 to rubygems
grant@redbox:~$ mtr --report -c 60 --no-dns rubygems.org
Start: Wed Mar 29 10:44:31 2017
HOST: redbox Loss% Snt Last Avg Best Wrst StDev
1.|-- 195.166.130.248 0.0% 60 4.7 5.6 4.4 30.4 3.9
2.|-- 84.93.253.71 0.0% 60 5.2 5.2 5.0 5.7 0.0
3.|-- 195.99.125.140 0.0% 60 5.3 5.2 4.8 5.9 0.0
4.|-- 62.172.103.13 0.0% 60 6.6 6.1 5.5 6.7 0.0
5.|-- 166.49.211.238 0.0% 60 5.4 6.6 5.2 28.8 3.6
6.|-- 213.248.82.249 0.0% 60 6.1 6.4 5.7 21.4 2.2
7.|-- 149.11.4.90 0.0% 60 5.6 5.7 5.3 6.1 0.0
@Firefishy
Firefishy / sysctl-tune.conf
Created March 23, 2017 17:57
Safe sysctl tuning for modern high traffic systems
# Enable Packetization Layer Path MTU Discovery.
net.ipv4.tcp_mtu_probing = 1
net.ipv4.tcp_base_mss = 1024
# Ensure slow start is disabled
# https://github.com/ton31337/tools/wiki/tcp_slow_start_after_idle---tcp_no_metrics_save-performance
net.ipv4.tcp_slow_start_after_idle = 0
net.ipv4.tcp_no_metrics_save = 0
# Tune network buffers - servers have more than 16MB of RAM in 2017
@Firefishy
Firefishy / apache-worker.conf
Created March 23, 2017 17:51
Recommended apache worker MPM config for high connection systems
# Set the number of seconds before receives and sends time out
Timeout 300
# Decide whether or not to allow persistent connections
Keepalive On
# Configure worker MPM
StartServers 2
ServerLimit 20
MinSpareThreads 75
MaxSpareThreads 525
ThreadLimit 64
@Firefishy
Firefishy / SACRS.md
Created September 7, 2016 09:04 — forked from gubuntu/SACRS.md
southern African coordinate reference systems (CRS) definitions in proj4 and WKT

Use this file to get the CRS definitions you need in southern Africa, particularly South Africa, Lesotho, Swaziland and Zimbabwe.

Most GIS software now implements the South African CRS (SACRS; incorrectly but popularly known as the "LO" system) which is based on south-oriented (or south-facing) transverse mercator (TMSO). The EPSG codes for these are:

  • odd numbers from 22275 to 22293 for the Cape datum
  • all numbers from 2046 to 2055 for the Hartebeesthoek94 or WGS84 datum.

If you have data in one of these south-oriented CRSs it will draw upside down and back to front in its native CRS but if you have on-the-fly transformation enabled, your layers will overlay your other data perfectly in whatever project CRS you choose. This feature request will result south-oriented coordinates and visualisation being more intutitive to GIS users.

Note on datums: Although there are a few metres difference between the WGS84 and Hartebeethoek94 datums, for all intents and purpos

@Firefishy
Firefishy / fix suspend a .org.za domain.md
Last active September 6, 2016 15:36
How to unsuspend a .org.za domain (Suspended on 1st September 2016 deadline)

Non-technical route

  1. Check FIRST if your domain is on the 3rd party suspended list: http://firefishy.com/orgza-domains-suspended-05092016s.txt if not then this guide is not for you.
  2. Ask the company who registered your domain to sort it out. They will likely charge R100, if wildly more they are ripping you off.
  3. Once they have started the transfer process check https://www.registry.net.za/whois/ to see if your domain has "Domain Status: pendingTransfer", if not return to step 2.
  4. Once in "Domain Status: pendingTransfer" transfer process takes 24 hours + 8 hours for new records to become valid.

Tech / Geek route

  1. Check FIRST if your domain is on the 3rd party suspended list: http://firefishy.com/orgza-domains-suspended-05092016s.txt if not then this guide is not for you.
  2. check https://www.registry.net.za/whois/ if domain has "Domain Status: pendingTransfer" skip to step 6
This file has been truncated, but you can view the full file.
LIDAR-DSM-15CM-2006-SU06.zip 26090209
LIDAR-DSM-15CM-2006-SU16.zip 12068706
LIDAR-DSM-15CM-2006-TF40.zip 37881698
LIDAR-DSM-15CM-2006-TF41.zip 12417770
LIDAR-DSM-1M-2000-SW32.zip 35734249
LIDAR-DSM-1M-2000-SW42.zip 64978457
LIDAR-DSM-1M-2000-SW43.zip 28561013
LIDAR-DSM-1M-2001-SP18.zip 41464120
LIDAR-DSM-1M-2001-SP28.zip 4428531
LIDAR-DSM-1M-2001-SU03.zip 558079
#!/bin/bash
set -e
JAVA_HOME=${1-text}
[ $# -eq 0 ] && { echo "Usage: sudo $0 \$(/usr/libexec/java_home -v '1.8*')" ; exit 1; }
KEYSTORE=$JAVA_HOME/jre/lib/security/cacerts
wget https://letsencrypt.org/certs/letsencryptauthorityx1.der
wget https://letsencrypt.org/certs/letsencryptauthorityx2.der
@Firefishy
Firefishy / docker-osm-me.sh
Created March 26, 2016 19:54
Quickstart for OSM in Docker
#!/bin/bash
set -e
type docker >/dev/null 2>&1 || { echo >&2 "error: docker is required. See: https://docs.docker.com/engine/installation/linux/"; exit 1; }
type docker-compose >/dev/null 2>&1 || { echo >&2 "error: docker-compose is required. See: https://docs.docker.com/compose/install/"; exit 1; }
[ ! -d cgimap ] && git clone --branch add-docker --depth 1 https://github.com/Firefishy/cgimap.git;
[ ! -d openstreetmap-website ] && git clone --branch add-docker --depth 1 https://github.com/Firefishy/openstreetmap-website.git
(cd cgimap && docker build -t openstreetmap/cgimap .)
(cd openstreetmap-website && docker-compose run --rm app bundle exec rake db:migrate)
(cd openstreetmap-website && docker-compose up)
# remove environment; cd openstreetmap-website ; docker-compose down
case "$1" in
configure)
# *sigh* typo in filename in version 0.51ubuntu1
if [ -e /etc/pm/sleep.d/10_unatteded-upgrades-hibernate ]; then
rm -f /etc/pm/sleep.d/10_unatteded-upgrades-hibernate
fi
db_get unattended-upgrades/enable_auto_updates || true
CONFIG="/etc/apt/apt.conf.d/20auto-upgrades"
if [ "${RET}" = "true" ]; then
To: talk, dev, announce
Subject: Disruption of OpenStreetMap Access
Hi All,
OpenStreetMap.org is currently suffering from a partial outage due to a major denial of service attack against the UK Academic Network.
The outage mostly affects those outside of the UK. An outage like this is extremely rare.
The operation team will implement a workaround if the problems persist.