Skip to content

Instantly share code, notes, and snippets.

View archaeogeek's full-sized avatar
👋

Jo Cook archaeogeek

👋
View GitHub Profile
@archaeogeek
archaeogeek / gist:0c055761343996acd432
Last active August 29, 2015 14:05
Pre-push code for automatically generating GitBook static html, pushing the markdown to a master branch and the generated html to a gh-pages branch on github. Save as a pre-push hook (git 1.8 or above) for the master branch. Set the _book folder and contents to be ignored in the master branch to avoid duplication.
#!/bin/sh
gitbook build /path/to/markdown --output=/path/to/markdown/_book
cd /path/to/markdown/_book
git init
git commit --allow-empty -m 'update book'
git checkout -b gh-pages
touch .nojekyll
git add .
git commit -am "update book"
@archaeogeek
archaeogeek / gist:09fd483184f9889303f2
Created April 14, 2015 11:02
Notes on open roads and open rivers data
Open rivers needs startnode and endnode converting to integer (currently double, but that's not needed)
Open roads- all identifiers for start node and end node are suffixed with an L, why? Can't convert to integer as will lose the leading 0's
@archaeogeek
archaeogeek / docx2md.md
Created August 4, 2016 12:44 — forked from aembleton/docx2md.md
Convert a Word Document into MD

Converting a Word Document to Markdown in One Move

The Problem

A lot of important government documents are created and saved in Microsoft Word (*.docx). But Microsoft Word is a proprietary format, and it's not really useful for presenting documents on the web. So, I wanted to find a way to convert a .docx file into markdown.

Installing Pandoc

On a mac you can use homebrew by running the command brew install pandoc.

The Solution

@archaeogeek
archaeogeek / gist:a502c3450748d008b26ed74a5db1bd5c
Last active August 23, 2017 10:14
astun background mapping gn32
## basic setup
git clone https://github.com/geonetwork/core-geonetwork.git core-geonetwork32
cd core-geonetwork32
git checkout 3.2.x
git submodule init
git submodule update
## cherry-pick fixes for ol3
git cherry-pick 8d9db018535caf3331ac26dd0fb2af6bb9e2e3a8
@archaeogeek
archaeogeek / gist:8de3554069248a0181e416de10c26e70
Created October 31, 2017 10:16
Geonetwork 3.2.x procedure
## basic setup
git clone https://github.com/geonetwork/core-geonetwork.git core-geonetwork32
cd core-geonetwork32
git checkout 3.2.x
git submodule init
git submodule update
## cherry-pick fixes for ol3
git cherry-pick 8d9db018535caf3331ac26dd0fb2af6bb9e2e3a8
@archaeogeek
archaeogeek / gist:51c95827430de2ed8f1c76ef22621ec0
Last active December 15, 2017 11:53
loader os highways tinkering
# Extract gml files
find -type f -iname '*.gz' -exec gunzip --force --keep '{}' \;
# Update gml so ogr can read it
find -type f -iname '*.gml' -exec sed -i -e 's/os:Transaction/os:FeatureCollection/' -e 's/os:insert/os:featureMember/' '{}' \;
# Have ogr create default .gfs files for each gml
find -type f -iname '*.gml' -exec ogrinfo -ro -so '{}' \;
I think you'll need to update your ogr_cmd, replace $file_path with /vsigzip/$file_path
@archaeogeek
archaeogeek / gist:e226d4e071a2d4f6abc8fc9dc718eca7
Last active November 11, 2019 15:23
Get all windows local groups
net localgroup > C:\tmp\localgroups.txt
add multiple groups from a list (admin command prompt):
FOR /f %G IN (D:\Astun\gislocalgroups.txt) DO NET LOCALGROUP %G /COMMENT:"iShareGIS local group %G" /ADD
add user to all groups:
FOR /f %G IN (D:\Astun\gislocalgroups.txt) DO NET LOCALGROUP %G username /ADD
@archaeogeek
archaeogeek / gist:6a3732f88e12c48cfa5bf450c6173b63
Last active December 4, 2019 10:25
using geonetwork h2 database
@archaeogeek
archaeogeek / gist:f9bd3ca8bff84bf0836fb35887d8a6e4
Last active April 1, 2020 15:08
Downgrade java to version 8 for Geonetwork
sudo update-alternatives --config java # check if java is already installed
sudo apt-get remove opendk* # purge any existing versions
sudo apt-get purge openjdk*
sudo apt-get update # refresh list
sudo apt-get install openjdk-8-jdk
java -version # check java version (should be openjdk version "1.8.0_222" or similar)
sudo update-alternatives --config java # switch to use jdk8 if necessary
sudo apt-get install tomcat8
sudo vi /etc/default/tomcat8 # edit to use following settings:
JAVA_OPTS="-Djava.awt.headless=true -Xmx1024m -XX:NewSize=256m -XX:MaxNewSize=256m -XX:PermSize=512m -XX:MaxPermSize=512m -XX:CompileCommand=exclude,net/sf/saxon/event/ReceivingContentHandler.startElement"
@archaeogeek
archaeogeek / gist:788199ae56c0d3a04d6bb7b420c7c64b
Created April 23, 2020 16:49
Notes on setting up postgresql/postgis/elasticsearch/kibana in docker
# setup
sudo apt-get -y install apt-transport-https ca-certificates curl software-properties-common
wget -qO - https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu bionic stable"
sudo apt update
sudo apt -y install docker-ce
sudo systemctl start docker
sudo systemctl enable docker
sudo usermod -aG docker $(whoami)