Skip to content

Instantly share code, notes, and snippets.

@mark-cooper
mark-cooper / check_archon_classifications.rb
Created March 22, 2017 18:34
Check Archon returns all classifications
require 'httparty'
require 'json'
require 'set'
def ok_status?(code)
code.to_s =~ /^2/
end
BASE_URL ="http://localhost/"
$batch_start = 1
DELIMITER //
CREATE FUNCTION generateLocationTitle(_id INT)
RETURNS TEXT
READS SQL DATA
BEGIN
DECLARE _title VARCHAR(255) DEFAULT '';
SELECT
REPLACE(
CONCAT(
@mark-cooper
mark-cooper / TOP_CONTAINER_MIGRATION.md
Last active June 3, 2016 05:56
Top container migration -- what happens?

Top container migration

Reminder: regarding top containers you may have an issue if you don't use barcodes and do reuse numbering sequences within the same resource or accession. Otherwise, review the upgrade documentation and relax =)

What happens during the top container migration? Example (fairly) typical tree with parallel sequencing (reused box numbering sequences):

Record 1
-
@mark-cooper
mark-cooper / Vagrantfile
Created September 9, 2015 05:44
Local no-thrills, no-assumptions vagrant box for dev
# -*- mode: ruby -*-
# vi: set ft=ruby :
$cpu = ENV.fetch('DEV_CPU', 4)
$ram = ENV.fetch('DEV_RAM', 4096)
Vagrant.configure(2) do |config|
config.vm.box = "ubuntu/trusty64"
config.vm.box_check_update = true
config.vm.hostname = "dev"
@mark-cooper
mark-cooper / initialize-plugin.sh
Created December 11, 2014 16:32
Make it so archivesspace can find plugin gems by installing gems to the base gems folder
#!/bin/bash
plugin="$1"
export ASPACE_LAUNCHER_BASE="$("`dirname $0`"/find-base.sh)"
cd "$ASPACE_LAUNCHER_BASE/plugins/$plugin"
if [ "$plugin" = "" ]; then
echo "Usage: $0 <plugin name>"
@mark-cooper
mark-cooper / EAD_XML_TO_PDF.md
Created November 4, 2014 17:12
ArchivesSpace EAD XML to PDF

ArchivesSpace EAD XML to PDF

These instructions describe how to do this locally. There are two motivating reasons:

  1. ArchivesSpace Rack time out errors when attempting to export pdf.
  2. Batch pdf processing (assuming batch EAD export not covered here).

Pre-reqs

#!/bin/bash
plugin="$1"
export ASPACE_LAUNCHER_BASE="$("`dirname $0`"/find-base.sh)"
cd "$ASPACE_LAUNCHER_BASE/plugins/$plugin"
if [ "$plugin" = "" ]; then
echo "Usage: $0 <plugin name>"
require_relative 'utils'
Sequel.migration do
up do
$stderr.puts("Adding more types to the list of extent_extent_type enum values")
enum = self[:enumeration].filter(:name => 'extent_extent_type').select(:id)
# additional DACS recommended extent types
@mark-cooper
mark-cooper / permgroups.txt
Created January 30, 2014 00:37
ArchivesSpace: 1.0.4 permissions and groups
ArchivesSpace (v1.0.4) permissions and groups
ROLES:
repository-managers
Managers of the EXAMPLE repository
The ability to manage a given repository
The ability to create and modify the major archival record types
The ability to create and modify event records
The ability to view a given repository
@mark-cooper
mark-cooper / circ_policies.sql
Last active January 4, 2016 09:39
Evergreen ILS: SQL for viewing circulation policies
-- NO LIMIT SETS (example limit to PERM GROUP)
SELECT
m.id, m.active, a.shortname as org_unit, p.name as profile, circ_modifier,
copy_circ_lib, copy_owning_lib, user_home_ou, ref_flag, juvenile_flag,
is_renewal, circulate, d.name as duration, r.name as recurring,
mx.name as max, m.grace_period
FROM config.circ_matrix_matchpoint m
LEFT JOIN actor.org_unit a ON m.org_unit = a.id
LEFT JOIN permission.grp_tree p ON m.grp = p.id
LEFT JOIN config.rule_circ_duration d ON m.duration_rule = d.id