Skip to content

Instantly share code, notes, and snippets.

View mark-dce's full-sized avatar

Mark Bussey mark-dce

  • Data Curation Experts
  • Minneapolis, MN
View GitHub Profile
@mark-dce
mark-dce / gist:6e96f6188292ea897953
Created October 8, 2014 21:38
Namespacing problem
With a gemfile like this:
source 'https://rubygems.org'
gem 'nokogiri', '~> 1.6.3.1'
....
And a model defined like this
class Record < ActiveRecord::Base
def to_pbcore_xml
@mark-dce
mark-dce / gist:4178164b5c4b078d281e
Created March 3, 2015 16:24
XML Tidy version of Alexandria Fixture cusbspcsbhc78_100239.xml
<?xml version="1.0" encoding="UTF-8"?>
<mods:mods xmlns:mods="http://www.loc.gov/mods/v3" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xlink="http://www.w3.org/1999/xlink" xsi:schemaLocation="http://www.loc.gov/mods/v3 http://www.loc.gov/standards/mods/v3/mods-3-4.xsd">
<mods:titleInfo usage="primary">
<mods:title>Unidentified man on Flying A Studios lot</mods:title>
</mods:titleInfo>
<mods:name usage="primary" type="corporate" authority="naf" authorityURI="http://id.loc.gov/authorities/names" valueURI="http://id.loc.gov/authorities/names/n87914041">
<mods:namePart>American Film Manufacturing Company</mods:namePart>
<mods:role>
<mods:roleTerm type="text" authority="marcrelator" authorityURI="http://id.loc.gov/vocabulary/relators" valueURI="http://id.loc.gov/vocabulary/relators/cre">Creator</mods:roleTerm>
</mods:role>
@mark-dce
mark-dce / gist:952e3f45c7dd10d2157b
Created April 16, 2015 18:31
Getting scalar error on object creation

With these classes:

class CodexMetadata < ActiveFedora::OmDatastream

  set_terminology do |t|
    t.root(path: "fields")
    t.title
    t.author
  end
MARKs-MB:sufia-centos mark$ git pull
remote: Counting objects: 53, done.
remote: Compressing objects: 100% (23/23), done.
remote: Total 53 (delta 17), reused 4 (delta 4), pack-reused 26
Unpacking objects: 100% (53/53), done.
From https://github.com/acozine/sufia-centos
* [new branch] java8 -> origin/java8
deaccf5..0837488 master -> origin/master
Already up-to-date.
MARKs-MB:sufia-centos mark$ git checkout java8
@mark-dce
mark-dce / gist:90bb32ea6f5deb502d05
Created August 14, 2015 18:46
Ansible adrl-prod.yml run
MARKs-MB:sufia-centos mark$ git checkout master
M vanilla.yml
Switched to branch 'master'
Your branch is behind 'origin/master' by 14 commits, and can be fast-forwarded.
(use "git pull" to update your local branch)
MARKs-MB:sufia-centos mark$ git pull
Updating deaccf5..1504cba
Fast-forward
README.md | 14 +++++++---
adrl-prod.yml | 26 ++++++++++++++++++
@mark-dce
mark-dce / gist:7bd0d9be51c3175c3697
Created August 14, 2015 19:33
Services role output for marmotta failure run
TASK: [services | install zip utility] ****************************************
ok: [hydra-head]
TASK: [services | download fits zip] ******************************************
ok: [hydra-head]
TASK: [services | unpack fits] ************************************************
ok: [hydra-head]
TASK: [services | make fits executable] ***************************************
@mark-dce
mark-dce / gist:f975a251cb089a437d04
Created August 15, 2015 01:43
Mark's vmware adrl-prod.yml
- name: provision production centos 7 host for ADRL 2.0
hosts: vanilla-hosts
remote_user: centos
vars:
server_name: hydra.local
rails_secret_key_base: 8b392d82866851f73cc415a65bf7e6dd630cc0e64298d65b4ad47a9f51ca33575ae8a4ae02584527c193cb2dff7a8ecf1abca6dc6efc3030442c11ec916fa098
capistrano_user: deploy
capistrano_group: deploy
install_user: ucsb
install_group: ucsb
@mark-dce
mark-dce / gist:895767c5d8f8e4c498d4
Created August 15, 2015 01:44
Mark's vmware.rp capistrano config
# Simple Role Syntax
# ==================
# Supports bulk-adding hosts to roles, the primary server in each group
# is considered to be the first unless any hosts have the primary
# property set. Don't declare `role :all`, it's a meta role.
set :stage, :vmware
set :rails_env, 'production'
server '172.16.243.137', user: 'deploy', roles: [:web, :app, :db, :resque_pool]
# Extended Server Syntax
@mark-dce
mark-dce / gist:046dc7b44889434a04f0
Created August 15, 2015 01:45
VMware fusion server Ansible run
MARKs-MB:sufia-centos mark$ ansible-playbook adrl-prod.yml
PLAY [provision production centos 7 host for ADRL 2.0] ************************
GATHERING FACTS ***************************************************************
ok: [hydra-head]
TASK: [generic-centos | format volume for /opt] *******************************
ok: [hydra-head]
@mark-dce
mark-dce / gist:71b1dd160ebe5c7270b4
Created August 15, 2015 01:47
Mark's vmware capistrano deploy
MARKs-MB:alexandria-v2 mark$ bundle exec cap vmware deploy
INFO [1193ee70] Running /usr/bin/env mkdir -p /tmp/alexandria-v2/ as deploy@172.16.243.137
DEBUG [1193ee70] Command: /usr/bin/env mkdir -p /tmp/alexandria-v2/
INFO [1193ee70] Finished in 0.174 seconds with exit status 0 (successful).
DEBUG Uploading /tmp/alexandria-v2/git-ssh.sh 0.0%
INFO Uploading /tmp/alexandria-v2/git-ssh.sh 100.0%
INFO [36364840] Running /usr/bin/env chmod +x /tmp/alexandria-v2/git-ssh.sh as deploy@172.16.243.137
DEBUG [36364840] Command: /usr/bin/env chmod +x /tmp/alexandria-v2/git-ssh.sh
INFO [36364840] Finished in 0.018 seconds with exit status 0 (successful).
Please enter branch (master):