Skip to content

Instantly share code, notes, and snippets.

@donno
donno / georef_tiles.py
Last active August 4, 2023 10:54
Produces commands to convert OSM raster tiles (PNGs) and to geo-referenced TIFFs.
"""Produces a command/shell script to convert PNG to Geo-referenced TIFF.
It also produces a command to call out gdal_merge.py which will take the TIFFs
and create a single TIFF from it and if there are too many TIFFs it will write
a file containing the list.
TODO:
Improve this so it doesn't have to create the TIFF from the PNG so instead
create a VRT to associate the bounds/coordinate system with the PNGsand treat
it as a single file already.
@donno
donno / quantized-mesh.hexpat
Created January 18, 2021 12:05
ImHex pattern file for quantized-mesh
#pragma MIME application/vnd.quantized-mesh
// This a hex pattern match for ImHex: https://github.com/WerWolv/ImHex
// Format: https://github.com/CesiumGS/quantized-mesh
struct QuantizedMeshHeader
{
// The center of the tile in Earth-centered Fixed coordinates.
double CenterX;
double CenterY;
@donno
donno / Output
Created July 10, 2020 14:05
Python module for working with LVX (File format by Livox)
$ python lvx_reader.py HorizonSample.lvx
Container:
public_header_block = Container:
signature = b'livox_tech\x00\x00\x00\x00\x00\x00' (total 16)
version = ListContainer:
1
1
0
0
magic_code = 2886641511
@donno
donno / internet_usage_graph.py
Last active May 11, 2020 14:41
Generate plots of my Internet usage
"""Generate monthly usage graphs for Internet usage.
Usage is classified as metered and unmetered.
Known issues
- There is excess padding before the first bar and after the last bar.
TODO
- Support quarterly and yearly graphs
@donno
donno / gnaf.py
Created May 8, 2020 13:48
List addresses with their latitude and longitude from the Geocoded National Address File.
"""GNAF is the Geocoded National Address File.
The G-NAF is Australia's authoritative, geocoded address file.
It is produced by PSMA Australia (psma.com.au) but is freely
available.
The data for this script is available from:
https://data.gov.au/dataset/geocoded-national-address-file-g-naf
Detail of the file format:
@donno
donno / entwineoutput.py
Created April 12, 2020 04:01
Parses the entwine output to determine which files weren't completed.
"""Parses the entwine output to determine which files weren't completed at
the time of a crash.
There are two lines from the output that this script is interested in. The
lines with 'Adding' and 'Done'.
Output Example:
Adding 0 - E:/data/Volcano/LAZ/E262N1546_LAZ_PL1.laz
Adding 1 - E:/data/Volcano/LAZ/E262N1547_LAZ_PL1.laz
Adding 2 - E:/data/Volcano/LAZ/E262N1548_LAZ_PL1.laz
@donno
donno / sweeper.py
Created September 27, 2019 23:47
An implementation of the game of an old classic, Minesweeper (Engine)
"""An implementation of the old classic game, Minesweeper.
The objective is to pick cells in a grid where you don't believe there is a
mine (bomb). If you pick incorrectly you loose the game because the mine goes
off (it explodes).
TODO
- No way to flag a cell.
- Add a clock/timer?
- Add handling for intergrating a user interface.
@donno
donno / fetch_vcdist.py
Last active January 25, 2024 19:45
Downloads and extract the Visual C++ Redistributables.
"""Downloads and extract the Visual C++ Redistributables.
This is useful when working with minidump files as the user may be running
with a new different version of the runtime. This script aims to maintain
a copy of the various versions.
Versions are normally added once I encounter them, in November 2022, I added
a rather large back catalogue of versions.
This requires dark.exe from Wix (http://wixtoolset.org/releases/) and
@donno
donno / Flask-ardfmap
Created October 6, 2013 08:53
A prototype server developed as a proof-of-concept for a new mapping system for foxhunting and balloon chases using the Flask microframework.
#!/usr/bin/env python
"""A prototype server developed as a proof-of-concept for a new mapping system
for foxhunting and balloon chases.
This requires Flask, which is a microframework for Python.
See http://flask.pocoo.org/
"""
import database
import flask
@donno
donno / Fibonacci.cpp
Created February 11, 2012 14:55
Provides a way to iterate over the Fibonacci sequence.
//===----------------------------------------------------------------------===//
//
// NAME : FibonacciGenerator
// VERSION : 0.2
// NAMESPACE : Global namespace.
// PURPOSE : Provided a way to iterate over the Fibonacci sequence.
// COPYRIGHT : (c) 2012 Sean Donnellan. All Rights Reserved.
// AUTHORS : Sean Donnellan (darkdonno@gmail.com)
// DESCRIPTION : Provided a way to iterate over the Fibonacci sequence.
//