Skip to content

Instantly share code, notes, and snippets.

View ross-spencer's full-sized avatar
💭
🖖

Ross Spencer ross-spencer

💭
🖖
View GitHub Profile
@ross-spencer
ross-spencer / default-fpr.json
Created November 4, 2019 16:16
Default FPR Archivematica 1.10
This file has been truncated, but you can view the full file.
[
{
"fields": {
"description": "Audio Interchange File Format",
"group": "c94ce0e6-c275-4c09-b802-695a18b7bf2a",
"slug": "audio-interchange-file-format",
"uuid": "22147b00-0fdc-4653-aa7b-618d1f4b6ffb"
},
"model": "fpr.format",
"pk": 1
@ross-spencer
ross-spencer / mets.xml
Created September 25, 2019 09:38
metsrw lossy demo
<?xml version='1.0' encoding='UTF-8'?>
<mets:mets xmlns:mets="http://www.loc.gov/METS/" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.loc.gov/METS/ http://www.loc.gov/standards/mets/version111/mets.xsd">
<mets:metsHdr CREATEDATE="2019-09-25T08:55:30" LASTMODDATE="2019-09-25T09:37:22"/>
<mets:dmdSec ID="dmdSec_1">
<mets:mdWrap MDTYPE="PREMIS:OBJECT">
<mets:xmlData>
<premis:object xmlns:premis="http://www.loc.gov/premis/v3" xsi:type="premis:intellectualEntity" xsi:schemaLocation="http://www.loc.gov/premis/v3 http://www.loc.gov/standards/premis/v3/premis.xsd" version="3.0">
<premis:objectIdentifier>
<premis:objectIdentifierType>UUID</premis:objectIdentifierType>
<premis:objectIdentifierValue>2586f749-e675-4d43-b48b-7cc8fd20fa92</premis:objectIdentifierValue>
@ross-spencer
ross-spencer / test-compression.sh
Created September 22, 2019 23:16
Archivematica compression test bash script
#!/bin/bash
set -u
# Archivematica compresses uses three tools, at five compression levels. It
# does not use LZMA2 but including it here to understand how much faster it is
# than LZMA.
#
# * 7z bzip2
# * 7z lzma
@ross-spencer
ross-spencer / todo.sh
Last active May 1, 2019 15:20
Simple TODO list implementation inspired by http://todotxt.org/
#!/bin/bash
# Bash script for a rudimentary TODO list.
#
# For best results, save in /usr/local/bin and create a symlink to todo:
#
# $ sudo mv todo.sh /usr/local/bin/
# $ sudo ln -s /usr/local/bin/todo.sh /usr/local/bin/todo
#
# Inspired by the very cool: http://todotxt.org/ specification.
@ross-spencer
ross-spencer / examples.md
Last active April 11, 2019 09:08
Bagit layouts and DC metadata in Archivematica

Bagit layouts and DC metadata

Turns out it's not straightforward and very much depends on how your bag is configured.

Layout one

Highlights

  • Metadata not part of the bag, dropped inside the top-level.
  • Path needs to start data/....
@ross-spencer
ross-spencer / duplicates.sh
Created April 3, 2019 18:37
Create 'n' duplicates of a single file
#!/bin/bash
# Simple bash script to make many copies of one file.
#
# ARG $1: Filename
# ARG $2: Number of copies
#
set -eux
@ross-spencer
ross-spencer / api-demo
Created March 7, 2019 20:43
Archivematica API demo
# Demo Commands for UDenver
----------------------------------------------------------
Version 1.0: 2018-09-21 Initial commands for UDenver Demo
Version 2.0: 2018-11-07 Added Unapproved Transfers Example
----------------------------------------------------------
# 1. Start Transfer
-------------------
http --pretty=format \
@ross-spencer
ross-spencer / posttimesheets.js
Last active March 1, 2019 13:24
Post to Redmine (Google Sheets) JS
/*
* Post timesheet from Google Docs to Redmine
*
* Copyright (c) 2014 David Juhasz
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
@ross-spencer
ross-spencer / diff.xml
Created February 23, 2019 21:44
mets-test
<?xml version='1.0' encoding='UTF-8'?>
<mets:mets xmlns:mets="http://www.loc.gov/METS/" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.loc.gov/METS/ http://www.loc.gov/standards/mets/version111/mets.xsd">
<mets:metsHdr CREATEDATE="2019-02-23T18:01:33"/>
<mets:dmdSec ID="dmdSec_455536" CREATED="2019-02-23T18:00:05" STATUS="original">
<mets:mdWrap MDTYPE="DDI">
<mets:xmlData>
<ddi:codebook xmlns:ddi="http://www.icpsr.umich.edu/DDI" version="2.5" xsi:schemaLocation="http://www.ddi:codebook:2_5 http://www.ddialliance.org/Specification/DDI-Codebook/2.5/XMLSchema/codebook.xsd">
<ddi:stdyDscr>
<ddi:citation>
<ddi:titlStmt>
@ross-spencer
ross-spencer / mets_validate.py
Created February 4, 2019 21:27
Minimal METS validation using METSRW
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import print_function
import argparse
import lxml
import logging
import metsrw
import sys