Skip to content

Instantly share code, notes, and snippets.

View escowles's full-sized avatar

esmé cowles escowles

View GitHub Profile
#!/bin/sh
function f
{
read ARK
while [ "$ARK" ]; do
LOC=`curl -s -I https://n2t.net/$ARK | grep Location`
echo $ARK $LOC
read ARK
done
{"@context":"http://iiif.io/api/presentation/2/context.json","@type":"sc:Manifest","@id":"https://figgy.princeton.edu/concern/scanned_resources/bafc515e-ba0b-4626-9bb2-48b021d9d155/manifest","label":["Abb. Jo. Baptistae Pacichellii ... De Tintinnabvlo Nolano Lvcvbratio Avtvmnalis : in qua D. Paulini \u0026 cujuslibet sacro-profanum aes campanum iuridice, ac philologice ; indice cum gemino"],"description":["Preliminary Cicognara record"],"viewingHint":"individuals","metadata":[{"label":"Author","value":["Pacichelli, Giovanni Battista"]},{"label":"Alternative","value":["De tintinnabulo Nolano lucubratio autumnalis"]},{"label":"Extent","value":["319 S"]},{"label":"Identifier","value":["\u003ca href='http://arks.princeton.edu/ark:/88435/b8515r60q' alt='Identifier'\u003ehttp://arks.princeton.edu/ark:/88435/b8515r60q\u003c/a\u003e"]},{"label":"Title","value":[{"@value":"Abb. Jo. Baptistae Pacichellii ... De Tintinnabvlo Nolano Lvcvbratio Avtvmnalis : in qua D. Paulini \u0026 cujuslibet sacro-profanum aes campanum i
#!/bin/sh
# lookup redirect URL for all ARKs in file "arks.txt"
function f
{
read ARK
while [ "$ARK" ]; do
LOC=`curl -s -I https://n2t.net/$ARK | grep Location`
echo $ARK $LOC
#!/bin/sh
# test inbound references in f6
INBOUND="http://fedora.info/definitions/fcrepo#PreferInboundReferences"
BASE=http://localhost:8998/rest/$RANDOM
# create an object
curl -X PUT $BASE/obj1
# create a second object linking to the first
@escowles
escowles / fedora-version.md
Last active August 4, 2020 17:27
Valkyre / Fedora 6 snapshot testing
  • Built current commit of Fedora 6 snapshot from main branch (e36826ca87a0d2e3451a43d0235780a2ba33cbb8)
  • Ran one-click JAR with command: java -jar fcrepo-webapp-6.0.0-SNAPSHOT-jetty-console.jar -p 8998
#!/bin/sh
# usage:
# $ export GITHUB_TOKEN=[token]
# $ rename-master-to-main.sh [org] [repo]
# generate GITHUB_TOKEN at https://github.com/settings/tokens/new with "repo" privileges
ORG="$1"
REPO="$2"
rm -rf $REPO
#!/bin/sh
N=$RANDOM
curl -X PUT http://localhost:8080/rest/$N
echo
curl -X PATCH \
-d "INSERT { <> <http://example.org/foo> \"test updated value\" } WHERE {}" \
-H "If-Unmodified-Since: Wed, 21 Oct 1955 07:28:00 GMT" \
-H "Content-Type: application/sparql-update" \
#!/bin/sh
URL=${1:-https://catalog.princeton.edu}
EXP=`curl --insecure -v $URL 2>&1 | grep "* expire date" | sed -e's/* expire date: //'`
EXP_S=`date -j -f "%B %e %H:%M:%S %Y %Z" +%s "$EXP"`
NOW_S=`date +%s`
echo $URL: $(( ($EXP_S - $NOW_S) / (3600*24) )) days until expiration
#!/bin/sh
URL=${1:-https://catalog.princeton.edu}
EXP=`curl --insecure -v $URL 2>&1 | grep "* expire date" | sed -e's/* expire date: //'`
EXP_S=`date -j -f "%B %e %H:%M:%S %Y %Z" +%s "$EXP"`
NOW_S=`date +%s`
echo $URL: $(( ($EXP_S - $NOW_S) / (3600*24) )) days until expiration
#!/bin/sh
CID=$1 # figgy collection id
DST=$2 # output directory
EAD=$3 # full path to EAD
FIGGY=/home/deploy/figgy # figgy source code
RESTR=/home/deploy/pulfa-restricted # pulfa-restricted source code
# use figgy to export PDFs and update EAD links with DAOs pointing to them
cd $FIGGY