Skip to content

Instantly share code, notes, and snippets.

(function ($){
$.ElucidateEndpoint = function (options) {
jQuery.extend(this, {
token: null,
container: options.container,
url: options.url,
dfd: null,
// OA list for Mirador use
annotationsList: [],
@steven2358
steven2358 / ffmpeg.md
Last active May 1, 2024 23:11
FFmpeg cheat sheet
@simonw
simonw / json-objects-into-a-datasette.md
Last active November 11, 2023 17:42
How to turn a list of JSON objects into a Datasette

How to turn a list of JSON objects into a Datasette

This repository has a dataset of 184.879 crimes committed in Buenos Aires: https://github.com/ramadis/delitos-caba

Download the raw data like this:

wget 'https://github.com/ramadis/delitos-caba/releases/download/3.0/delitos.json'

Now use Pandas to load that into a dataframe:

@lucaswerkmeister
lucaswerkmeister / sandbox.conf
Created October 22, 2017 13:56
systemd sandbox for apache2.service on Debian Stretch (systemd v232)
[Service]
# read /var/lib/dehydrated/
CapabilityBoundingSet=CAP_DAC_OVERRIDE
# bind port 80 + 443
CapabilityBoundingSet=CAP_NET_BIND_SERVICE
# drop privileges to www-data
CapabilityBoundingSet=CAP_SETUID CAP_SETGID
# call ulimit
CapabilityBoundingSet=CAP_SYS_RESOURCE
# partially mitigate CAP_DAC_OVERRIDE
@lucaswerkmeister
lucaswerkmeister / sandbox.conf
Last active October 22, 2017 14:28
systemd sandbox for Dovecot on Debian Stretch
[Service]
# change user for worker processes
CapabilityBoundingSet=CAP_SETUID CAP_SETGID
# bind to ports 143 and 993
CapabilityBoundingSet=CAP_NET_BIND_SERVICE
# fchown() /var/run/dovecot/login
CapabilityBoundingSet=CAP_CHOWN
# bind to /var/spool/postfix/private/dovecot{-auth}
CapabilityBoundingSet=CAP_DAC_OVERRIDE
# chroot to /var/run/dovecot/empty
@jeroenjanssens
jeroenjanssens / jq.md
Last active June 8, 2018 08:37
Some jq examples translated from https://github.com/jsonlines/guide
Using Fuzzy Hashing to Create New Relationships Between Digital Archives
Fuzzy hases enable us to spot digital content that shares a high percentage of similar byte sequences.
There may be similarities between two word documents for example, but the items may not be the same, i.e.
a single byte-change will render comparision using cryptographic-hash useless.
A fuzzy hash offers the ability to spot similar items, n.b. not identical, thus enabling us to infer
relationshops between material - a capability we have very few options for at present.
Committing a fuzzy hash of an object to a digital repository can enable comparison at any point in time
@atomotic
atomotic / brainwashed-spotify.go
Last active May 8, 2017 12:34
search spotify for latest albums reviewed on brainwashed.com
package main
import (
"fmt"
"log"
"strings"
"github.com/PuerkitoBio/goquery"
"github.com/zmb3/spotify"
)
@atomotic
atomotic / osm-it-garmin-dowload
Last active August 29, 2015 14:24
scaricare mappe openstreetmap delle regioni italiane e prepararle per il caricamento su un gps garmin.
#!/usr/bin/env bash
declare -A maps
maps=(
["osm-emr"]="http://geodati.fmach.it/gfoss_geodata/osm/output_img/emilia-romagna.tar.gz"
["osm-vdo"]="http://geodati.fmach.it/gfoss_geodata/osm/output_img/valle-aosta.tar.gz"
["osm-piemonte"]="http://geodati.fmach.it/gfoss_geodata/osm/output_img/piemonte.tar.gz"
["osm-trentino"]="http://geodati.fmach.it/gfoss_geodata/osm/output_img/trentino-alto-adige.tar.gz"
["osm-basilicata"]="http://geodati.fmach.it/gfoss_geodata/osm/output_img/basilicata.tar.gz"
@olberger
olberger / shibb-cas-get.sh
Created December 4, 2014 09:59
Connection to a web app protected via Shibboleth with curl
#!/bin/sh
#set -x
# Usage: shibb-cas-get.sh {username} {password} # If you have any errors try removing the redirects to get more information
# The service to be called, and a url-encoded version (the url encoding isn't perfect, if you're encoding complex stuff you may wish to replace with a different method)
DEST=https://myapp.example.com/
SP=https://myapp.example.com/index.php
IDP="https://myidp.example.com/idp/shibboleth&btn_sso=SSOok"