Skip to content

Instantly share code, notes, and snippets.

View tingletech's full-sized avatar

Brian Tingle tingletech

View GitHub Profile
@tingletech
tingletech / aws_yum_shib.sh
Created May 23, 2015 05:10
example of `--enablerepo epel`on AWS
sudo yum -y groupinstall "Development Tools"
sudo yum --enablerepo epel -y install \
boost141-devel \
cronolog \
curl-devel \
git \
httpd24-devel \
jq \
libxml2-devel \
libxslt-devel \
@tingletech
tingletech / extract_links.xsl
Created May 19, 2015 20:15
scripts to harvest a collection out of Merritt
# perl sca_category_paths.pl < input.txt > output.txt
{
chomp; # \n
$orig = $_;
s/\$Categories://; # remove $Categories: from heiarachy
s/\$//;
s/::/_/g; # use in some time strings in values, Change Reference - Skipped Assets:2011-11-18 11::18::49
s/\//_/g; # '/' can be part of the value -> _
s/\s/_/g; # ' ' can be part of the value -> _
s/:/\//g; # ':' is the path seperator -> /
from django.contrib.auth.models import AnonymousUser, User
from django.test import TestCase, RequestFactory
from .views import search
class SimpleTest(TestCase):
def setUp(self):
# Every test needs access to the request factory.
self.factory = RequestFactory()
@tingletech
tingletech / voro.ip.md
Last active August 29, 2015 14:20
IP address range to allow access for voro processing

voro is moving from UCOP/Kaiser datacenter to Amazon web services. If you use IP addresses to control access to files you want us to see, please note our new IP addresses.

SUSE voro IP addresses

host                  IP              CIDR
dscl-dev.cdlib.org    192.35.209.243  192.35.209.243/32
dscl-stg.cdlib.org    192.35.209.192  192.35.209.192/32
cdl-dsc-p01.ucop.edu  128.48.120.46   128.48.120.46/32
# set up perl / cpanm
# cpanm --local-lib=~/perl5 local::lib
eval $(perl -I ~/perl5/lib/perl5/ -Mlocal::lib)
# put the role account virtualenv on the $PATH (if not there already)
# virtualenv ~/python
if [[ ! ":$PATH:" == *":$HOME/python/bin:"* ]]; then
export PATH=$HOME/python/bin:$PATH
fi
@tingletech
tingletech / merritt.diff
Last active August 29, 2015 14:20
simple curl clone using org.apache.httpcomponents
BT-macBookPro:workspace tingle$ ./url.gvy http://user:[email protected]/headers
{
"headers": {
"Authorization": "Basic dXNlcjpwYXNzd2Q=",
"Host": "httpbin.org",
"User-Agent": "Apache-HttpClient/4.3.6 (java 1.5)"
}
}
BT-macBookPro:workspace tingle$ curl http://user:[email protected]/headers
{
#!/usr/bin/env python
import sys
import os
from pprint import pprint as pp
import urllib2
import json
from collections import namedtuple
import string
import random
select distinct ?concept ?label ?prefLabel where {
?concept a gvp:Concept .
?concept skos:inScheme aat: .
?concept skos:prefLabel ?prefLabel .
?concept ?b ?label .
FILTER (?b= skos:prefLabel) .
FILTER (lang(?label) = "en") .
FILTER (lang(?prefLabel) = "en") .
FILTER (regex(?label,"^bo","i")) .
}

Resource Description and Access ain’t Markup Language

YAML with RDA: Resource Description and Access terms.

Data entry rule

Any The format uses all terms from rdaregistry.info. Say one were to start a work record, any of the following values could be used as the key to a hash.

http://rdaregistry.info/Elements/c/C10001