Skip to content

Instantly share code, notes, and snippets.

View archaeogeek's full-sized avatar
👋

Jo Cook archaeogeek

👋
View GitHub Profile
@archaeogeek
archaeogeek / gist:7a8a0f6811ab9af98d511ac171a6531e
Created October 15, 2020 08:30
Python snippet for updating GeoNetwork using batch editing API
import requests
import click
from requests.auth import HTTPBasicAuth
from requests.packages.urllib3.exceptions import InsecureRequestWarning
import json
import pandas as pd
from collections import Counter
import os
import glob
import sys
@archaeogeek
archaeogeek / gist:a52b3ddc0fe068a19aa240e55d4ae7cf
Last active November 15, 2020 18:58
Github graphql examples
# search for my repos with the topic "talks"- note order doesn't work particularly well
query {
search(first: 20, type: REPOSITORY, query: "topic:talks user:archaeogeek sort:updated-desc") {
pageInfo {
hasNextPage
endCursor
}
repositories: edges {
repo: node {
@archaeogeek
archaeogeek / csv2skosxl.php
Last active January 21, 2021 13:57
csv2skosxl modified
<?php
/**
* Sample script to convert an CSV (ie. exported form MS Excel file) into
* RDF skos format.
*
* @file csv2skos.php
* @license Licensed under WTFPL (http://www.wtfpl.net/txt/copying/)
* @author Cristian Romanescu <cristian.romanescu@eaudeweb.ro>
*/
@archaeogeek
archaeogeek / pr.md
Created March 9, 2021 13:59 — forked from piscisaureus/pr.md
Checkout github pull requests locally

Locate the section for your github remote in the .git/config file. It looks like this:

[remote "origin"]
	fetch = +refs/heads/*:refs/remotes/origin/*
	url = git@github.com:joyent/node.git

Now add the line fetch = +refs/pull/*/head:refs/remotes/origin/pr/* to this section. Obviously, change the github url to match your project's URL. It ends up looking like this:

@archaeogeek
archaeogeek / gist:dd413568fbf7aabedc8ff101d6a4dc5b
Last active January 13, 2022 17:13
processing os open names with just linux cli tools
# extract zipped csv file to ~/osopennames
cd osopennames
# merge all csvs into one, with header first
for f in DATA/*.csv ; do cat DOC/OS_Open_Names_Header.csv $f; done > mergedwithheader.csv
# view top 5 or so lines to make sure it's what you expect
head -5 mergedwithheader.csv
# take only the columns we want
@archaeogeek
archaeogeek / gist:d7a3c20a12147bab38e1c0e75f56c1f1
Last active January 18, 2022 16:35
Prepping osopennames for ML
# extract zipped csv file to ~/osopennames
cd osopennames
# merge all csvs into one, with header first
for f in DATA/*.csv ; do cat $f; done > mergedwithoutheader.csv
# view top 5 or so lines to make sure it's what you expect
head -5 mergedwithoutheader.csv
# open in a text editor and remove any "
@archaeogeek
archaeogeek / install-docker.md
Created November 14, 2022 14:55 — forked from npearce/install-docker.md
Amazon Linux 2 - install docker & docker-compose using 'sudo amazon-linux-extras' command

UPDATE (March 2020, thanks @ic): I don't know the exact AMI version but yum install docker now works on the latest Amazon Linux 2. The instructions below may still be relevant depending on the vintage AMI you are using.

Amazon changed the install in Linux 2. One no-longer using 'yum' See: https://aws.amazon.com/amazon-linux-2/release-notes/

Docker CE Install

sudo amazon-linux-extras install docker
sudo service docker start