Skip to content

Instantly share code, notes, and snippets.

View mjgiarlo's full-sized avatar
:shipit:
not updating my status

Michael J. Giarlo mjgiarlo

:shipit:
not updating my status
View GitHub Profile
#!./bin/python
import os
import sqlite3
import web
import pymarc
class index:
def GET (self):
web.header('Content-Type', 'text/html')
@mjgiarlo
mjgiarlo / gist:326689
Created March 9, 2010 15:21 — forked from rsinger/gist:325368
Benchmarking scripts in different languages. Scripts open a 19GB JSON file and do stuff with it.
perl 5.10.0:
real 97m48.002s
user 92m7.045s
sys 1m5.712s
python 2.6.4:
real 91m8.783s
user 85m40.705s
sys 1m0.568s
# 2010-05-18: Using owl:unionOf to clarify semantics of disjunct classes
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
@prefix owl: <http://www.w3.org/2002/07/owl#> .
@prefix dcterms: <http://purl.org/dc/terms/> .
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
@prefix dbpedia-owl: <http://dbpedia.org/ontology/> .
@prefix aiiso: <http://purl.org/vocab/aiiso/schema#> .
@prefix instid: <http://lackoftalent.org/i2/core#> .
# 2010-05-18: Changing owl:sameAs property to skos:exactMatch where object is on dbpedia to avoid unintended conflation
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
@prefix owl: <http://www.w3.org/2002/07/owl#> .
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
@prefix dc: <http://purl.org/dc/elements/1.1/> .
@prefix dcterms: <http://purl.org/dc/terms/> .
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
@prefix skos: <http://www.w3.org/2004/02/skos/core#> .
@prefix dbpedia-owl: <http://dbpedia.org/ontology/> .
$ sudo apt-get install futz
Reading package lists... Done
Building dependency tree
Reading state information... Done
E: Couldn't find package futz
$ sudo aptitude install futz
Reading package lists... Done
Building dependency tree
Reading state information... Done
#!/usr/bin/env python
import os.path
import sys
TEMPLATE = """[Desktop Entry]
Encoding=UTF-8
Name=%(basename)s
Type=Link
URL=%(url)s
#!/usr/bin/env python
import os
import sys
from lxml import etree
from operator import itemgetter
metadata_dir = '.metadata'
@mjgiarlo
mjgiarlo / opensrf newb
Created October 30, 2010 00:46
Working through "easing gently into opensrf", I can't seem to invoke my method via srfsh
# First, basic system stuff
$ uname -a
Linux cardinal 2.6.35-22-generic #35-Ubuntu SMP Sat Oct 16 20:36:48 UTC 2010 i686 GNU/Linux
$ cat /etc/lsb-release
DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=10.10
DISTRIB_CODENAME=maverick
DISTRIB_DESCRIPTION="Ubuntu 10.10"
@mjgiarlo
mjgiarlo / opensrf.py oddities
Created November 9, 2010 01:25
Looks like start_all has a bug?
# Start up the router, perl, and c services
$ osrf_ctl.sh -a start_router -l
$ osrf_ctl.sh -a start_perl -l
$ osrf_ctl.sh -a start_c -l
# Start all python services via start_all (produces an error)
$ opensrf.py -d -p /opensrf/var/run -f /opensrf/etc/opensrf_core.xml -a start_all -l
* starting all services for localhost
* starting psu.stewardship.versioning
* starting psu.stewardship.fixity
@mjgiarlo
mjgiarlo / arkpy script usage
Created March 10, 2011 16:03
showing arkpy scripts spitting out noids and arks
mjg@mjg-desktop:~/workspace/arkpy$ ./bin/arkmint --help
Usage: arkmint [options]
Options:
-h, --help show this help message and exit
--authority=AUTHORITY
Name Assigning Authority Number
--template=TEMPLATE identifier template: e is an xdigit:
0123456789bcdfghjkmnpqrstvwxz; d is a digit:
0123456789; k is checkchar: special xdigit