Skip to content

Instantly share code, notes, and snippets.

View missinglink's full-sized avatar

Peter Johnson missinglink

View GitHub Profile
@missinglink
missinglink / setup.sh
Last active January 8, 2021 02:26
vsftp FTP server backed by s3 bucket w/ anonymous read-only access
# install packages
sudo apt-get update && sudo apt-get -y upgrade
sudo apt-get install -y s3fs vsftpd
# start vsftpd on boot
sudo systemctl enable vsftpd
# add user to ftp group
sudo usermod -a -G ftp ubuntu
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@missinglink
missinglink / mandelbrot.sql
Last active June 16, 2017 13:29
ASCII-art Mandelbrot Set in pure SQL -- via https://sqlite.org/lang_with.html
WITH RECURSIVE
xaxis(x) AS (VALUES(-2.0) UNION ALL SELECT x+0.05 FROM xaxis WHERE x<1.2),
yaxis(y) AS (VALUES(-1.0) UNION ALL SELECT y+0.1 FROM yaxis WHERE y<1.0),
m(iter, cx, cy, x, y) AS (
SELECT 0, x, y, 0.0, 0.0 FROM xaxis, yaxis
UNION ALL
SELECT iter+1, cx, cy, x*x-y*y + cx, 2.0*x*y + cy FROM m
WHERE (x*x + y*y) < 4.0 AND iter<28
),
m2(iter, cx, cy) AS (
@missinglink
missinglink / fix_slow_go_build.sh
Created June 14, 2017 11:23
fix for slow go builds
[ `ls -ld $GOROOT/pkg | awk '{print $3}'` != `whoami` ] && sudo chown -Rv `whoami` $GOROOT/pkg
@missinglink
missinglink / init.sql
Last active June 3, 2017 18:28
parallel import data in to sqlite from stdin using all available cores
PRAGMA foreign_keys=OFF;
PRAGMA page_size=4096;
PRAGMA cache_size=-2000;
PRAGMA synchronous=OFF;
PRAGMA journal_mode=OFF;
PRAGMA temp_store=MEMORY;
CREATE TABLE data(
lower TEXT NOT NULL,
upper TEXT NOT NULL
@missinglink
missinglink / HexagonalGrid.sql
Last active March 5, 2017 10:13
spatialite hexagonal and triangular tessellations displayed in mercator projection without geometric distortion
SELECT AsGeoJson( Transform( HexagonalGrid( Transform( BuildMbr( 13.086, 52.331, 13.723, 52.683, 4326 ), 3857 ), 2000, 0 ), 4326 ) )
@missinglink
missinglink / berlin.geojson
Last active March 4, 2017 01:32
postcode boundaries generated from the convex hull of point data from the openaddresses project
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.