Skip to content

Instantly share code, notes, and snippets.

We can make this file beautiful and searchable if this error is corrected: Unclosed quoted field in line 4.
title,url,change
"The effects of Racer 5 India Pale Ale, Bear Republic Bre on librarians",http://era.lvh.me:3000/items/75304ee2-b398-4f9b-9e3a-ac6184ba575b,"{""visibility""=>[""http://terms.library.ualberta.ca/public"", ""http://terms.library.ualberta.ca/authenticated""], ""updated_at""=>[Wed, 19 Feb 2025 20:18:01.903024000 UTC +00:00, Wed, 19 Feb 2025 21:53:11.875437000 UTC +00:00]}"
The effects of Celebrator Doppelbock on librarians,http://era.lvh.me:3000/items/1114f5e1-1066-4ed4-97cf-f8b9cefbfa18,"{""visibility""=>[""http://terms.library.ualberta.ca/public"", ""http://terms.library.ualberta.ca/authenticated""], ""updated_at""=>[Wed, 19 Feb 2025 20:18:01.972254000 UTC +00:00, Wed, 19 Feb 2025 21:53:11.929598000 UTC +00:00]}"
The effects of Samuel Smith’s Oatmeal Stout on librarians,http://era.lvh.me:3000/items/c158881f-cf20-4b5c-a8f5-e2bc41765e03,"{""visibility""=>[""http://terms.library.ualberta.ca/public"", ""http://terms.library.ualberta.ca/authenticated""], ""updated_at""=>[Wed, 19 Feb 2025 20:18:02.050
builder = Nokogiri::XML::Builder.new do |xml|
xml.send('input-forms') {
xml.send('form-value-pairs') {
CONTROLLED_VOCABULARIES[:jupiter_core].keys.each do |vocab_key|
xml.send('value-pairs') {
xml.send('value-pairs-name', vocab_key.to_s)
if Item.rdf_annotation_for_attr(vocab_key).exists?
xml.send('dc-terms',RDF::URI(Item.rdf_annotation_for_attr(vocab_key).first.predicate).pname.to_s) # TODO acts_as_rdfable
else
xml.send('dc-terms',RDF::URI(Thesis.rdf_annotation_for_attr(vocab_key).first.predicate).pname.to_s) # TODO acts_as_rdfable
We can make this file beautiful and searchable if this error is corrected: It looks like row 4 should actually have 18 columns, instead of 4 in line 3.
community id,community title,collection id,collection link,collection title,item,thesis,edits in last month,edits in last quarter,edits in the last year,duplicate files,shared objects,file size,public,authenticated,embargo,private,draft
21fdad84-77ca-4935-9111-a37a650674e7,The department of Cat,08296bc7-3635-4138-9f79-f554f655c079,http://era.lvh.me:3000/communities/21fdad84-77ca-4935-9111-a37a650674e7/collections/08296bc7-3635-4138-9f79-f554f655c079,The annals of 'Cat International',26,1,41,41,41,1,3,132474,23,1,2,1,0
012f68f2-773f-48ca-9a2f-626a0c7091ef,The Everything Department,0d9542d7-fd21-4335-9b78-0318f20f75b0,http://era.lvh.me:3000/communities/012f68f2-773f-48ca-9a2f-626a0c7091ef/collections/0d9542d7-fd21-4335-9b78-0318f20f75b0,Articles about the relationship between Libraries and non-Libraries,5,3,64,64,64,14,0,1190960,4,0,4,0,0
012f68f2-773f-48ca-9a2f-626a0c7091ef,The Everything Department,1207633a-c4c2-4373-b8b6-0f8279d53df8,http://era.lvh.me:3000/communities/012f68f2-773f-48ca-9a2f-626a0c7091ef/col
@pgwillia
pgwillia / collection_sizes.csv
Last active December 5, 2024 19:45
ERA collections total file sizes
We can make this file beautiful and searchable if this error is corrected: It looks like row 7 should actually have 4 columns, instead of 2 in line 6.
collection link,collection title,collection size,collection size for humans
http://era.lvh.me:3000/communities/3fab823b-df63-4964-92cd-4d96fb5df3bd/collections/1580d0cc-7c29-44f7-b8ea-983e7588a054,The annals of 'Cat International',132474,129 KB
http://era.lvh.me:3000/communities/3fab823b-df63-4964-92cd-4d96fb5df3bd/collections/336277df-b05f-49c0-856c-b9224642126a,Theses about cats,132474,129 KB
http://era.lvh.me:3000/communities/541e0055-813d-4178-ac36-a94b79cd4127/collections/388bb612-5d5c-4cb9-9f7d-15ccb3f32046,The annals of 'Dog International',132474,129 KB
http://era.lvh.me:3000/communities/541e0055-813d-4178-ac36-a94b79cd4127/collections/808aecb8-c30a-4cdd-b8ad-fea08e45596d,Theses about dogs,132474,129 KB
http://era.lvh.me:3000/communities/11d1643e-0ea8-4b2f-adaa-3a2d2018f803/collections/e9ad79cb-bc09-4fbb-8847-d16711ade4e1,The annals of 'Unicorn International',1323434,1.26 MB
http://era.lvh.me:3000/communities/11d1643e-0ea8-4b2f-adaa-3a2d2018f803/collections/7ffbc573-ff92-4d00-95ee-a60eaf584ca8,Theses a
@pgwillia
pgwillia / destroy_papertrail_report.rb
Last active May 12, 2025 16:57
Reports from ERA/jupiter a) of all destroyed objects tracked by papertrail b) of all items/theses with handles c) items and theses that are drafts or private d) visibility after embargo values d) items and theses with no DOI
CSV.open('destroyed.csv', 'wb') do |csv|
csv << ['item type', 'item id', 'item destroyed at']
PaperTrail::Version.where(event: 'destroy').each do |item|
csv << [item.item_type, item.item_id, item.created_at]
end
end
@pgwillia
pgwillia / docker-compose.yml
Last active July 15, 2024 15:19
Found a openstack swift with keystone. Has potential for testing changes to pmpy. More documentation at https://github.com/kklopfenstein/openstack-swift-keystone-docker. Start with `docker compose up -d`
services:
swift:
# useful if you need to re-run the tests/spec
# https://docs.openstack.org/ocata/cli-reference/swift.html
# manual steps to set environment variables and create container
# swift auth -v -U test:tester -K testing -A http://localhost:8080/auth/v1.0
# swift auth
# swift post ERA
image: kklopfenstein/openstack-swift-keystone-docker
environment:
# Sample configuration file for PushmiPullyu.
# Options here can still be overridden by cmd line args.
# Pass this file at config/pushmi_pullyu.yml and PushmiPullyu will
# pick it up automatically. Or pass this file into pushmi_pullyu on command line
# via `pushmi_pullyu -C path/to/pushmi_pullyu.yml`
# PushmiPullyu will run this file through ERB when reading it so you can
# even put in dynamic logic, like consuming ENV Variables.
require 'application_system_test_case'
class ItemEditTest < ApplicationSystemTestCase
test 'download path is stable after edit' do
admin = users(:user_admin)
item = items(:item_admin)
item.save
# Need to add file to item to be able to go through editing wizard.
@pgwillia
pgwillia / W29 - Digital Services Outage events for Oncall.ipynb
Created July 24, 2023 21:13
Notebook to generate stacked histograms of oncall notifications for ERA, OJS and DMP
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@pgwillia
pgwillia / after.txt
Last active September 21, 2022 20:42
How does pushmi_pullyu work?
$ tree 05296aa6-4ced-4cf0-a612-b008fd40a404_after_file_delete/
05296aa6-4ced-4cf0-a612-b008fd40a404_after_file_delete/
└── 05296aa6-4ced-4cf0-a612-b008fd40a404
├── bag-info.txt
├── bagit.txt
├── data
│   ├── logs
│   │   ├── aipcreation.log
│   │   └── files_logs
│   │   └── a8592fcf-af2c-4f44-921a-b98a0be467c3