Skip to content

Instantly share code, notes, and snippets.

View psd's full-sized avatar

Paul Downey psd

View GitHub Profile
@psd
psd / validate_conf.sh
Last active January 25, 2024 19:13
use nginx to validate config
#!/bin/bash
#
# validate nginx config
#
# depends upon a symbolic link from /var/apps/redirector to dist directory
# and a build of nginx which supports real_ip and other extensions
#
# probably best to build a chroot'd tree containing a complete nginx server
# though that's a lot of work to copy in shared libraries, etc
@psd
psd / .gitignore
Last active September 28, 2023 08:57
.venv
@psd
psd / Untitled.ipynb
Last active June 30, 2023 08:08
Example analysis of broken endpoints on planning.data.gov.uk
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@psd
psd / README.md
Created June 13, 2023 08:37
listed-buildings-collection

files from running the listed-buildings-collection build locally

title
Conservation area datasets
erDiagram
    conservation-area {
        string reference
        string name
        string geometry
 url documentation-url
@psd
psd / simplify.py
Last active February 1, 2023 10:12
Reduce precision of a MultiPolygon
#!/usr/bin/env python3
import shapely.wkt
p="MultiPolygon (((-1.60994665622805222 55.00379498345115792, -1.60994600619739314 55.00379491903674278, -1.60994613329638736 55.0037946152858126, -1.60994665622805222 55.00379498345115792)),((-1.60994600619739314 55.00379491903674278, -1.60980778882421394 55.00412523870480186, -1.60972186100530901 55.00432707234649143, -1.60962254155930573 55.00455676609992395, -1.60953000060672702 55.00476385735949236, -1.60943341282917385 55.00498224763406085, -1.60935696567569031 55.00515319174433415, -1.60910274172032675 55.0051207020774342, -1.60860998788058174 55.00506105056158646, -1.60855767448542109 55.00517852794069285, -1.60848120855383003 55.00535097971769716, -1.60843013302326776 55.00547600239842438, -1.60833627909956944 55.00568233437196142, -1.60824905786570738 55.00588114622691904, -1.60818202334823357 55.00602798745143929, -1.60812690700974681 55.00616355492300613, -1.60809945369099605 55.00628789933396945, -1.60804720332470663 55.00639858943617355, -1.60796400348
@psd
psd / dns check.sh
Created November 24, 2022 11:02
Check www.planning.data.gov.uk DNS records
echo "==> Google \n$(dig www.planning.data.gov.uk @8.8.8.8 | grep "IN")\n\n"
echo "==> Google (alt) \n$(dig www.planning.data.gov.uk @8.8.4.4 | grep "IN")\n\n"
echo "==> Control D \n$(dig www.planning.data.gov.uk @76.76.2.0 | grep "IN")\n\n"
echo "==> Control D (alt) \n$(dig www.planning.data.gov.uk @76.76.10.0 | grep "IN")\n\n"
echo "==> Quad9 \n$(dig www.planning.data.gov.uk @9.9.9.9 | grep "IN")\n\n"
echo "==> Quad9 (alt) \n$(dig www.planning.data.gov.uk @149.112.112.112 | grep "IN")\n\n"
echo "==> OpenDNS \n$(dig www.planning.data.gov.uk @208.67.222.222 | grep "IN")\n\n"
echo "==> OpenDNS (alt) \n$(dig www.planning.data.gov.uk @208.67.220.220 | grep "IN")\n\n"
echo "==> Cloudflare \n$(dig www.planning.data.gov.uk @1.1.1.1 | grep "IN")\n\n"
echo "==> Cloudflare (alt) \n$(dig www.planning.data.gov.uk @1.0.0.1 | grep "IN")\n\n"
@psd
psd / notes.md
Last active November 4, 2022 13:44
QGIS and plannning.data.gov.uk

Some notes and thoughts from our QGIS workshop

  • Tony made a QGIS project for Doncaster's data
  • The QGIS project file is XML, which looks very easy for us to template / produce
  • We could make a QGIS project file for each LPA containing the data sources, alongside our processed data (filtered for the LPA)
  • We can organise these sources in the project in different ways, including hierachy
  • Tony showed using our tile server as an API which allows seeing the features
  • We should consider documenting our support for people using this as an API
  • The tile server provides our properties against each shape
  • but QGIS splits features when they overlap tile boundaries
@psd
psd / README
Created January 4, 2010 14:47
OpenOffice Document Conversion
Experiments in running a headless OpenOffice as a document convertor for TiddlyDocs, etc.
Running OpenOffice Headless:
$ cd /Applications/OpenOffice.org.app/Contents/program #Mac OSX
$ cd /usr/lib/openoffice.org.app/program #CentOS
$ ./soffice.bin -headless -invisible -nofirststartwizard -accept="socket,port=8100;urp;"
init script:
see openoffice.sh xvfb.sh for init.d scripts