Skip to content

Instantly share code, notes, and snippets.

<?xml version="1.0" encoding="UTF-8"?>
<!--
Used on the XML coming from the SUB Göttingen Opac short XML records to extract
the PPN attribute of the contained SHORTTITLE elements as one PPN per line.
Example URL for the XML:
http://opac.sub.uni-goettingen.de/DB=1/XML=/SHRTST=10/CMD?ACT=SRCHA&IKT=1016&SRT=YOP&TRM=test&ADI_BIB=a,b,c,e,k,l,n,r,x,z,i148,i165
Stored at: https://gist.github.com/750094
<?xml version="1.0" encoding="UTF-8"?>
<!--
Used to extract the <record> elements from SRU replies and dump the rest of the records.
Example URL for input XML:
http://gso.gbv.de/sru/DB=2.1/?query=pica.ppn%3D%22309041996%22&version=1.1&operation=searchRetrieve&recordSchema=pica&recordPacking=xml
Stored at: https://gist.github.com/750153
@ssp
ssp / ExifTool commands
Created January 27, 2011 19:50
exiftool commands
# Move Description tag to Title tag
exiftool '-Description>Title' *
# Move Title tag to Headline Tag
exiftool '-Title>Headline' *
# Rename from tag, adding number if necessary for uniqueness,
# without changing file dates.
exiftool '-FileName<${description}%-c.jpeg' '-DateTimeOriginal>FileModifyDate' *
@ssp
ssp / cookiekiller.py
Created July 21, 2011 15:10
Script and LaunchAgent for deleting Safari cookies on Mac OS X
#!/usr/bin/env python
"""
COOKIE KILLER
2010 by Sven-S. Porst <ssp-web@earthlingsoft.net>
Script with simple heuristics to kill the most obviously crap cookies in WebKit.
Available at http://gist.github.com/324414
Better quit cookie users before running the script.
👒
👀
🐽
👅
👕
👖
@ssp
ssp / pz2-log-analysis.sh
Created January 23, 2012 16:47
pazpar2 log analysis
# Try to grep rough usage information from a pazpar2 log:
# Count how often each service has been initialised and
# add a + to the service name if pz:allow is used.
# Both for current and archived logs
cat pazpar2.log | grep "command=init" | sed "s/.*search.pz2?command=init&service=\([-a-zA-Z0-9]*\)/\1/g" | sed "s/.pz:allow.*/+/g" | sort | uniq -c
zcat pazpar2.log.2.gz | grep "command=init" | sed "s/.*search.pz2?command=init&service=\([-a-zA-Z0-9]*\)/\1/g" | sed "s/.pz:allow.*/+/g" | sort | uniq -c
@ssp
ssp / gist:1778585
Created February 9, 2012 08:54
Solr URLs
Delete all documents:
/solr/update/?stream.body=%3Cdelete%3E%3Cquery%3E*:*%3C/query%3E%3C/delete%3E
Opac Abfrage geänderte MSC 2000 vs 2010
von: http://msc2010.org/msc2000to2010.html
msc 05e25 or 05e35 or 15a90 or 34d40 or 34m20 or 34m37 or 35a05 or 35a07 or 35j45 or 35j55 or 35j85 or 35q72 or 35q80 or 39a11 or 65q05 or 97c90
GSO: 388 Treffer
Göttingen Opac: 435 Treffer
@ssp
ssp / gist:3205626
Created July 30, 2012 08:09
grep searchterms from query logs
# limit to:
# * searches
# * not SX20 presentation (used for Neuerwerbungen RSS feed)
# extract:
# * query term in TRM parameter
cat access_log | grep SRCHA | grep TRM | grep -v SX20 | grep -v "XML=1" | sed -e "s/.*TRM=//" -e "s/[& ].*//" -e "s/+/ /g" > searchterms
@ssp
ssp / Template
Created July 30, 2012 13:28
xmlinclude Opac Nutzung
plugin.tx_xmlinclude.settings {
parseAsHTML = 1
cookiePassthrough.1 = DB
cookiePassthrough.2 = PSC_1
XSL.51 = fileadmin/xsl/Opac.xsl
useRealURL = 1
}
page.CSS_inlineStyle (
#content h1 {