Skip to content

Instantly share code, notes, and snippets.

View kefo's full-sized avatar

Kevin Ford kefo

View GitHub Profile
{
"type": "Merge",
"id": "https://ld4.github.io/entity_metadata_management/examples/activity1.json",
"published": "2022-02-03T15:04:18Z",
"object": [
{
"type": "Relationship",
"subject": "http://id.loc.gov/authorities/subjects/cookeryWhiskey",
"relationship": "http://www.loc.gov/mads/rdf/v1#useInstead",
"object": "http://id.loc.gov/authorities/subjects/sh85032152",
@kefo
kefo / float_bug.sh
Last active March 27, 2018 21:48
Bash script to reveal float-related bug.
#!/bin/bash
pfx="http://localhost:8080/rest/kefo_test"
uuid=$(uuidgen)
container="${pfx}/${uuid}"
echo; echo; echo "Creating root {$pfx}"
curl -iXPUT "${pfx}"
@kefo
kefo / langtag_test
Last active September 26, 2017 17:14
fcrepo4 langtag bug
#!/bin/bash
#####
# Steps to reproduce:
#
# ./langtag_test install
# ./langtag_test start 4.6.1
# ./langtag_test create_resource
# ./langtag_test backup
# ./langtag_test stop 4.6.1
@kefo
kefo / bootstrap.py
Created September 8, 2017 20:28
Bootstrap 'glacier' moto and execute some jobs.
import requests
import json
import sys
import io
from io import BytesIO
def do_request(method, url, headers={}, data={}):
r = requests.request(method, url, headers=headers, data=data)
if r.status_code > 399:
@kefo
kefo / extract_schedule.xqy
Created May 19, 2017 13:33
XQuery: Split large XML into parts; Extract LCC Letter
xquery version "3.0";
(:~
: Takes a file of LCC MARC records and extracts all the records per Class,
: as indicated by letter.
:
: Example invocation:
: zorba -i --serialize-text -q file:///Users/kefo/Work/mlenv/lcc/extract_schedule.xqy -e sourceuri:="/Users/kefo/Work/mlenv/lcc/source/d140612.records.xml" -e savedir:="/Users/kefo/Work/mlenv/lcc/schedules/" -e letter:="a"
:
: @author Kevin Ford (kefo@3windmills.com)
127.0.0.1 - - [11/Apr/2017:10:38:59 -0500] "GET /fcrepo/rest/prod/v1/18/rp/19/v118rp19s/files/3eed0f37-c815-441f-a435-1c6d3308a755/fcr:metadata HTTP/1.1" 200 4161
127.0.0.1 - - [11/Apr/2017:10:38:59 -0500] "HEAD /fcrepo/rest/prod/ed/b1/9b/f1/edb19bf1-2117-6d84-3603-07f181d57639 HTTP/1.1" 200 -
127.0.0.1 - - [11/Apr/2017:10:38:59 -0500] "HEAD /fcrepo/rest/prod/v1/18/rp/19/v118rp19s/files/3eed0f37-c815-441f-a435-1c6d3308a755 HTTP/1.1" 200 -
127.0.0.1 - - [11/Apr/2017:10:38:59 -0500] "GET /fcrepo/rest/prod/v1/18/rp/19/v118rp19s/files/3eed0f37-c815-441f-a435-1c6d3308a755/fcr:metadata HTTP/1.1" 200 4523
127.0.0.1 - - [11/Apr/2017:10:38:59 -0500] "HEAD /fcrepo/rest/prod/5a/f3/cf/e1/5af3cfe1-22bd-4fd7-6220-349b568d6909 HTTP/1.1" 200 -
127.0.0.1 - - [11/Apr/2017:10:38:59 -0500] "HEAD /fcrepo/rest/prod/ed/b1/9b/f1/edb19bf1-2117-6d84-3603-07f181d57639 HTTP/1.1" 200 -
127.0.0.1 - - [11/Apr/2017:10:38:59 -0500] "GET /fcrepo/rest/prod/ed/b1/9b/f1/edb19bf1-2117-6d84-3603-07f181d57639 HTTP/1.1" 200 6886
127.0.0.1 - - [11/Ap
@kefo
kefo / snippet-access.log
Last active February 28, 2017 14:27
fcrepo-log-modeshape-error
grep prod/da/39/e4/3d/da39e43d-fd1a-5971-8f7b-3f36fabcc650 localhost_access_log.2017-02-*
localhost_access_log.2017-02-17.txt:127.0.0.1 - - [17/Feb/2017:22:19:53 -0600] "HEAD /fcrepo/rest/prod/da/39/e4/3d/da39e43d-fd1a-5971-8f7b-3f36fabcc650 HTTP/1.1" 404 -
localhost_access_log.2017-02-17.txt:127.0.0.1 - - [17/Feb/2017:22:19:54 -0600] "PUT /fcrepo/rest/prod/da/39/e4/3d/da39e43d-fd1a-5971-8f7b-3f36fabcc650 HTTP/1.1" 201 97
localhost_access_log.2017-02-17.txt:127.0.0.1 - - [17/Feb/2017:22:19:54 -0600] "HEAD /fcrepo/rest/prod/da/39/e4/3d/da39e43d-fd1a-5971-8f7b-3f36fabcc650 HTTP/1.1" 200 -
localhost_access_log.2017-02-17.txt:127.0.0.1 - - [17/Feb/2017:22:19:54 -0600] "HEAD /fcrepo/rest/prod/da/39/e4/3d/da39e43d-fd1a-5971-8f7b-3f36fabcc650/list_source HTTP/1.1" 404 -
localhost_access_log.2017-02-17.txt:127.0.0.1 - - [17/Feb/2017:22:19:54 -0600] "HEAD /fcrepo/rest/prod/da/39/e4/3d/da39e43d-fd1a-5971-8f7b-3f36fabcc650/list_source HTTP/1.1" 404 -
localhost_access_log.2017-02-17.txt:127.0.0.1 - - [17/Feb/2017:22:19:5
# FCREPO LOG
ERROR 13:57:09.915 (RepositoryChangeBus) Unexpected error while processing the event 'Save by 'bypassAdmin' at 2017-02-16T13:57:09.145-06:00 with user data = {org.modeshape.jcr.observation.userdata={"baseUrl":"https://aicdamstest08.artic.edu/fcrepo/rest/","userAgent":"Faraday v0.9.2"}} in repository with key '927fdb8' and workspa
ce 'default'
Added node '87a0a8c7505d642cef048f-4a7a-471c-a5c8-4a31e56c7328' at "/{}prod/{}5a/{}6f/{}31" under '87a0a8c7505d648249f0bf-93bf-4aeb-a0e6-70e4eeae505f'
Added property {http://www.jcp.org/jcr/1.0}createdBy to node '87a0a8c7505d642cef048f-4a7a-471c-a5c8-4a31e56c7328' at path /{}prod/{}5a/{}6f/{}31 with values:{http://www.jcp.org/jcr/1.0}createdBy = bypassAdmin
Added property {http://www.jcp.org/jcr/1.0}primaryType to node '87a0a8c7505d642cef048f-4a7a-471c-a5c8-4a31e56c7328' at path /{}prod/{}5a/{}6f/{}31 with values:{http://www.jcp.org/jcr/1.0}primaryType = {http://www.jcp.org/jcr/nt/1.0}folder
Added property {http://www.jcp.org/jcr/1.0}created to node
@kefo
kefo / .gitignore
Last active February 7, 2017 19:41
*.jpg
@kefo
kefo / fcrepo_error.log
Created November 11, 2016 19:59
fcrepo_error_jetty_put.log
INFO 13:00:44.438 (FedoraLdp) PUT resource 'test/6a/sh2010011419'
ERROR 13:00:44.442 (InvocationContextInterceptor) ISPN000136: Execution error
org.infinispan.persistence.spi.PersistenceException: java.lang.RuntimeException: Could not open table 14893
at org.infinispan.persistence.leveldb.LevelDBStore.load(LevelDBStore.java:428) ~[infinispan-cachestore-leveldb-7.2.4.Final.jar:7.2.4.Final]
at org.infinispan.persistence.manager.PersistenceManagerImpl.loadFromAllStores(PersistenceManagerImpl.java:436) ~[infinispan-core-7.2.4.Final.jar:7.2.4.Final]
at org.infinispan.persistence.PersistenceUtil.loadAndCheckExpiration(PersistenceUtil.java:116) ~[infinispan-core-7.2.4.Final.jar:7.2.4.Final]
at org.infinispan.persistence.PersistenceUtil$4.compute(PersistenceUtil.java:100) ~[infinispan-core-7.2.4.Final.jar:7.2.4.Final]
at org.infinispan.container.DefaultDataContainer$BoundedEquivalentConcurrentExtendedMap$2.apply(DefaultDataContainer.java:539) ~[infinispan-core-7.2.4.Final.jar:7.2.4.Final]
at org.infinispan.cont