Skip to content

Instantly share code, notes, and snippets.

View edsu's full-sized avatar

Ed Summers edsu

View GitHub Profile
@edsu
edsu / redis-wikipedia-extlinks.txt
Created January 19, 2011 14:57
redis db of wikipedia externallink stats
@edsu
edsu / datapkg-output.txt
Created January 27, 2011 15:42
datapkg info ckan://linkedlccn
ed@rorty:~$ datapkg info ckan://linkedlccn
## Package: linkedlccn
id: d9d8a9c5-622c-4085-80f3-308f597d05aa
name: linkedlccn
title: LinkedLCCN
version: 1
license: OKD Compliant::Other (Public Domain)
author: Ross Singer
author_email: rossfsinger@gmail.com
from cts.srb import ServiceRequest, ServiceRequestList
from cts.client import get_http_client
http = get_http_client(endpoint=settings.CTS)
http.add_credentials(settings.CTS_USER, settings.CTS_PASSWORD)
task = ServiceRequest.accept_next_from_queue(queue="sampler",
serviceType="bag.QualityReviewBag.review",
http=http)
print task
Traceback (most recent call last):
File "<console>", line 1, in <module>
File "/home/esummers/projects/sampler/sampler/transfer.py", line 60, in tasks
http=http)
File "/home/esummers/.virtualenvs/sampler/src/pycts/cts/srb.py", line 169, in accept_next_from_queue
sr.update_from_response(sr._location, headers, data)
File "/home/esummers/.virtualenvs/sampler/src/pycts/cts/base.py", line 51, in update_from_response
super(TransferObject, self).update_from_response(url, headers, data)
File "/home/esummers/.virtualenvs/sampler/lib/python2.6/site-packages/remoteobjects/promise.py", line 231, in update_from_response
super(PromiseObject, self).update_from_response(url, response, content)
ed@li144-162:~$ mysql -u root -p
Enter password:
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 52868
Server version: 5.1.41-3ubuntu12.9-log (Ubuntu)
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
mysql> create database test;
Query OK, 1 row affected (0.30 sec)
================================================================================
Backend error message
---------------------
Error: in
Pig Stack Trace
---------------
ERROR 2997: Unable to recreate exception from backed error: Error: in
org.apache.pig.impl.logicalLayer.FrontendException: ERROR 1066: Unable to open iterator for alias b. Backend error : Unable to recreate exception from backed error: Error: in
<?xml version="1.0" encoding="utf-8"?>
<rdf:RDF
xmlns:bibo="http://purl.org/ontology/bibo/"
xmlns:dc="http://purl.org/dc/elements/"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">
<bibo:Book rdf:about="http://catalog.hathitrust.org/Record/006055265#item">
<dc:creator>Burton, Robert, 1577-1640.</dc:creator>
<dc:subject>Melancholy</dc:subject>
<dc:title>The anatomy of melancholy</dc:title>
</bibo:Book>
@edsu
edsu / vannevar.ttl
Created March 31, 2011 05:39
rdf-ized, and viaf-ized SNAC data for Vannevar Bush
@prefix foaf <http://xmlns.com/foaf/0.1/> .
@prefix arch <http://purl.org/archival/vocab/arch#> .
<http://viaf.org/viaf/15572358/#foaf:Person>
a foaf:Person ;
foaf:name "Bush, Vannevar, 1890-1974." ;
arch:appearsWith <http://viaf.org/viaf/21341544/#foaf:Person>, <http://viaf.org/viaf/30867998/#foaf:Person>, <http://viaf.org/viaf/5076979/#foaf:Person>, <http://viaf.org/viaf/6653121/#foaf:Person>, <http://viaf.org/viaf/79397853/#foaf:Person> ;
arch:correspondedWith <http://viaf.org/viaf/13632081/#foaf:Person>, <http://viaf.org/viaf/16555764/#foaf:Person>, <http://viaf.org/viaf/18495018/#foaf:Person>, <http://viaf.org/viaf/20482758/#foaf:Person>, <http://viaf.org/viaf/20994992/#foaf:Person>, <http://viaf.org/viaf/32065073/#foaf:Person>, <http://viaf.org/viaf/41170431/#foaf:Person>, <http://viaf.org/viaf/44376228/#foaf:Person>, <http://viaf.org/viaf/46092803/#foaf:Person>, <http://viaf.org/viaf/49966637/#foaf:Person>, <http://viaf.org/viaf/51816245/#foaf:Person>, <http://viaf.org/viaf/52483290/#f
@edsu
edsu / geodict.txt
Created April 1, 2011 15:55
running geodict (https://github.com/petewarden/geodict) on chronicling america ocr
ed@rorty:~/Projects/geodict$ curl -s http://chroniclingamerica.loc.gov/lccn/sn84026749/1911-03-30/ed-1/seq-1/ocr.txt | ./geodict.py
New York
New York
New York
Washington
United States
Mexico
Mexico
Washington
Mexico
@edsu
edsu / twitter2pinboard.py
Created April 18, 2011 13:12
suggests pinboard users you might want to add to your network based on your twitter friends
#!/usr/bin/env python
"""
twitter2pinboard.py is a little hack to help you build your pinboard
network based on your Twitter social network. I imagine pinboard will
be adding something like this shortly since they've got some beta Twitter
support now. So rather than turning this into a full on webapp it's just
a command line tool for now.
twitter2pinboard.py uses the Twitter API to look up your friends (people you