Skip to content

Instantly share code, notes, and snippets.

Avatar

rajanski

View GitHub Profile
@rajanski
rajanski / get_letsencrypt.sh
Last active Nov 3, 2021
Obtain and renew letsencrypt ssl certificate via certbot
View get_letsencrypt.sh
#!/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
Geojson local file viewer (in browser). It does NOT upload your geojson data to some service. Properties (Attributes) are accessible via click on feature.
View view_geojson.sh
#!/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 Nov 7, 2015
OSM to directed igraph graph with node coordinates
View osm2igraph.py
"""
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
"""
View README.md
@rajanski
rajanski / gist:ccf65d4f5106c2cdc70e
Last active Oct 24, 2021 — forked from aflaxman/gist:287370
OSM to networkx graph with node coordinates ;-)
View gist:ccf65d4f5106c2cdc70e
"""
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
View voronoi.sql
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
#