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 / inotifywait-transfer.log
Created August 3, 2018 13:35
File moves for a single Archivematica transfer of a single file
/tmp/am-pipeline-data/tmp/tmpjh2VLA/1/ CREATE .file.txt.kMXAsQ
/tmp/am-pipeline-data/tmp/tmpjh2VLA/1/ OPEN .file.txt.kMXAsQ
/tmp/am-pipeline-data/tmp/tmpjh2VLA/1/ ATTRIB .file.txt.kMXAsQ
/tmp/am-pipeline-data/tmp/tmpjh2VLA/1/ MODIFY .file.txt.kMXAsQ
/tmp/am-pipeline-data/tmp/tmpjh2VLA/1/ CLOSE_WRITE,CLOSE .file.txt.kMXAsQ
/tmp/am-pipeline-data/tmp/tmpjh2VLA/1/ ATTRIB .file.txt.kMXAsQ
/tmp/am-pipeline-data/tmp/tmpjh2VLA/1/ MOVED_FROM .file.txt.kMXAsQ
/tmp/am-pipeline-data/tmp/tmpjh2VLA/1/ MOVED_TO file.txt
/tmp/am-pipeline-data/watchedDirectories/activeTransfers/standardTransfer/1/ MOVE_SELF
/tmp/am-pipeline-data/tmp/tmpjh2VLA/ DELETE_SELF
@ross-spencer
ross-spencer / ttype.json
Last active July 24, 2018 03:11
New Transfer Type
{
"transfer_type": {
"title": "Dataverse",
"chains": [
{
"id": 1,
"chain_uuid": "10c00bc8-8fc2-419f-b593-cf5518695186",
"ms_uuid": "fdb12ea6-22aa-46c8-a591-a2bcf5d42e5e",
"description": "Approve Dataverse transfer"
},
@ross-spencer
ross-spencer / createmets.py
Last active June 6, 2018 14:36
Create METS (Dataverse comparison)
#!/usr/bin/env python2
# -*- coding: utf-8 -*-
#
# This file is part of Archivematica.
#
# Copyright 2010-2013 Artefactual Systems Inc. <http://artefactual.com>
#
# Archivematica is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
@ross-spencer
ross-spencer / dataset.json
Last active May 25, 2018 08:45
Dataverse dataset.json comparison
{
"comment_for_gitHub_issue": "Downloaded via the API",
"authority": "10.5072/FK2",
"id": 574,
"identifier": "6PPJ6Y",
"latestVersion": {
"UNF": "UNF:6:IgxkjKXUlveGP0Darp1fYg==",
"createTime": "2018-05-09T20:33:36Z",
"files": [
{
@ross-spencer
ross-spencer / before-fix.xml
Last active May 16, 2018 12:10
premis:originalName issue in AM METS/PREMIS
<?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="2018-05-15T16:17:37"/>
<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>8b62cae4-1561-44c9-a890-d83a933804fb</premis:objectIdentifierValue>
@ross-spencer
ross-spencer / dataverse.sql
Last active May 30, 2018 14:01
Microservice_Draft
1.
INSERT INTO `MCP`.`StandardTasksConfigs` (`pk`, 'execute', `arguments`, `requiresOutputLock`, `lastModified`)
VALUES ('7c17bd71-9683-4598-8662-89ac7e0797b6', 'dataverse_v0.0' ,'\"%SIPDirectory%\"', '0', '2018-10-02 00:25:01.000000');
2.
INSERT INTO `MCP`.`TasksConfigs` (`pk`, `taskTypePKReference`, `description`, `lastModified`, `taskType`)
VALUES ('1a6b8183-d988-47cb-af23-48cf5dd71cb9', '7c17bd71-9683-4598-8662-89ac7e0797b6', 'Convert Dataverse Structure', '2012-10-02 00:25:11.000000', '36b2e239-4a57-4aa5-8ebc-7a29139baca6');
curl -v https://is1-ssl.mzstatic.com/image/thumb/Music128/v4/83/55/0d/83550d95-95e6-b04e-f1b4-9464424c763e/0205_jk_seiken_densetsu2_haishin_3000x3000px.jpg/3000x0w.png
* Trying 2a02:26f0:e5:4bf::389...
* TCP_NODELAY set
* Connected to is1-ssl.mzstatic.com (2a02:26f0:e5:4bf::389) port 443 (#0)
* ALPN, offering http/1.1
* Cipher selection: ALL:!EXPORT:!EXPORT40:!EXPORT56:!aNULL:!LOW:!RC4:@STRENGTH
* successfully set certificate verify locations:
* CAfile: /etc/ssl/certs/ca-certificates.crt
CApath: /etc/ssl/certs
* TLSv1.2 (OUT), TLS header, Certificate Status (22):
interactions:
- request:
body: null
headers:
Accept: ['*/*']
Accept-Encoding: ['gzip, deflate']
Connection: [keep-alive]
User-Agent: [python-requests/2.18.4]
method: GET
uri: http://127.0.0.1/api/transfer/unapproved?username=demo&api_key=1c34274c0df0bca7edf9831dd838b4a6345ac2ef
@ross-spencer
ross-spencer / RosettaCSVGenerator.py
Created April 29, 2018 16:02
Rosetta SIP for mismatched DROID and LC
#!/usr/local/bin/python
# -*- coding: utf-8 -*-
import os
import sys
sys.path.append(r'JsonTableSchema/')
import ConfigParser
import JsonTableSchema
from ProvenanceCSVHandlerClass import *
from droidcsvhandlerclass import *
@ross-spencer
ross-spencer / esduplicates.py
Last active April 30, 2020 15:05
Archivematica Elasticsearch Duplicate Finder
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""Module docstring."""
import collections
import json
import logging
import operator
import sys