Skip to content

Instantly share code, notes, and snippets.

View rajanski's full-sized avatar

rajanski

View GitHub Profile
@rajanski
rajanski / get_letsencrypt.sh
Last active November 3, 2021 16:08
Obtain and renew letsencrypt ssl certificate via certbot
#!/bin/bash
# Inspired by an earlier version of Matthieu Petiteau's scripts at https://github.com/smallwat3r
echo "------------------------------------------------------" \
"\nThis script is intended for Ubuntu/Debian Linuxes." \
"\nIt needs to be run as root, on the server which DOMAIN points at." \
"\nIt installs the letsencrypt client and gets/renews a certificate" \
"\nfor the specified domain and email address." \
"\n------------------------------------------------------"
export EMAIL=you@mailbox.org
@rajanski
rajanski / view_geojson.sh
Last active May 29, 2021 15:20
Geojson local file viewer (in browser). It does NOT upload your geojson data to some service. Properties (Attributes) are accessible via click on feature.
#!/bin/bash
usage()
{
cat << EOF
usage: view_geojson.sh -f geojson_file.geojson
This script views a geojson file in a browser (default is google-chrome)
EOF
}
@rajanski
rajanski / osm2igraph.py
Created November 7, 2015 18:32
OSM to directed igraph graph with node coordinates
"""
Read graphs in Open Street Maps osm format
Based on osm.py from brianw's osmgeocode
http://github.com/brianw/osmgeocode, which is based on osm.py from
comes from Graphserver:
http://github.com/bmander/graphserver/tree/master and is copyright (c)
2007, Brandon Martin-Anderson under the BSD License
"""
@rajanski
rajanski / README.md
Last active August 29, 2015 14:24 — forked from tmcw/README.md
@rajanski
rajanski / gist:ccf65d4f5106c2cdc70e
Last active October 24, 2021 04:11 — forked from aflaxman/gist:287370
OSM to networkx graph with node coordinates ;-)
"""
Read graphs in Open Street Maps osm format
Based on osm.py from brianw's osmgeocode
http://github.com/brianw/osmgeocode, which is based on osm.py from
comes from Graphserver:
http://github.com/bmander/graphserver/tree/master and is copyright (c)
2007, Brandon Martin-Anderson under the BSD License
"""
import xml.sax
CREATE OR REPLACE FUNCTION voronoi(table_name text,geom_col text) returns SETOF record as $$
#############################################################################
#
# Voronoi diagram calculator/ Delaunay triangulator
# Translated to Python by Bill Simons
# September, 2005
#
# Additional changes by Carson Farmer added November 2010
#