Skip to content

Instantly share code, notes, and snippets.

View mcritchlow's full-sized avatar

Matthew Critchlow mcritchlow

  • UC San Diego
  • San Diego
View GitHub Profile
@geerlingguy
geerlingguy / ansible-role-test.sh
Last active January 18, 2024 17:37
Ansible Role Test Shim Script
#!/bin/bash
#
# Ansible role test shim.
#
# Usage: [OPTIONS] ./tests/test.sh
# - distro: a supported Docker distro version (default = "centos7")
# - playbook: a playbook in the tests directory (default = "test.yml")
# - role_dir: the directory where the role exists (default = $PWD)
# - cleanup: whether to remove the Docker container (default = true)
# - container_id: the --name to set for the container (default = timestamp)
@escowles
escowles / rights-examples-rsdotorg.ttl
Last active August 29, 2015 14:16
rights-examples.ttl
# namespaces
@prefix dcterms: http://purl.org/dc/terms/
@prefix edm: http://www.europeana.eu/schemas/edm/
@prefix hydrarights: http://projecthydra.org/ns/auth/acl#
@prefix premis: http://www.loc.gov/premis/rdf/v1#
@prefix premiscopy: <http://id.loc.gov/vocabulary/preservation/copyrightStatus/
@prefix rsdotorg: http://rightsstatements.org/vocab/path/tba/
@prefix skos: http://www.w3.org/2004/02/skos/core#
@prefix ucsd: http://library.ucsd.edu/ontology/dams4.2#
@prefix xx: # either dcterms or edm pending discussions
@no-reply
no-reply / CHODatastream.rb
Last active August 29, 2015 14:06
Hydra Connect RDF Workshop Walkthrough
# lib/models/datastream.rb
class CHODatastream < ActiveFedora::NtriplesRDFDatastream
property :title, predicate: RDF::DC.title
property :creator, predicate: RDF::DC.creator
property :date, predicate: RDF::DC.date
property :location, predicate: RDF::DC.spatial
end
@staltz
staltz / introrx.md
Last active May 7, 2024 09:38
The introduction to Reactive Programming you've been missing
@escowles
escowles / Gemfile
Last active August 29, 2015 13:57
MADS RDF demo using ActiveFedora 7.0.0.rc3
source 'https://rubygems.org'
gem 'active-fedora', github: 'projecthydra/active_fedora', branch: 'master'
gem 'linkeddata'
@escowles
escowles / Gemfile
Last active August 29, 2015 13:57
list and extract entries from a zip file over http
source 'https://rubygems.org'
gem 'zipruby'
@jpstroop
jpstroop / owl_to_rb.rb
Created October 22, 2013 23:20
OWL to RDF::Vocabulary
require 'linkeddata'
include RDF
# args
@ns = 'http://library.ucsd.edu/ontology/dams/#'
@class_name = 'UCSD_DAMS'
@i = 'https://raw.github.com/ucsdlib/dams/master/ontology/dams.owl'
@o = 'ucsd_dams.rb'
#
class Work < ActiveFedora::Base
  has_metadata "descMetadata", type: ArticleMetadataDatastream

  section :required_information, label: "Required Information" do |section|
    section.attribute :title, datastream: :descMetadata, required: true
  end

  section :secondary_information, label: "Secondary Information" do |section|
    section.attribute :contributor, datastream: :descMetadata
@chrisroos
chrisroos / gpg-import-and-export-instructions.md
Created September 9, 2011 10:49
Instructions for exporting/importing (backup/restore) GPG keys

Every so often I have to restore my gpg keys and I'm never sure how best to do it. So, I've spent some time playing around with the various ways to export/import (backup/restore) keys.

Method 1

Backup the public and secret keyrings and trust database

cp ~/.gnupg/pubring.gpg /path/to/backups/
cp ~/.gnupg/secring.gpg /path/to/backups/
cp ~/.gnupg/trustdb.gpg /path/to/backups/

or, instead of backing up trustdb...