Skip to content

Instantly share code, notes, and snippets.

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:2966967
Created June 21, 2012 16:51
UnicodeChecker + Spotlight + command line
# Assuming you have UnicodeChecker’s Spotlight support installed on your Mac,
# you can use mdfind to find unicode characters on your machine.
# A bit of command line wrangling later you may find the character names.
mdfind roman numeral uccharacter | xargs -I FILENAME -L 1 sh -c 'plutil -convert xml1 -o - "FILENAME" | xpath "//string[preceding-sibling::key/text()=\"name\"]/text()"; echo ""' 2>/dev/null
@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 {
@ssp
ssp / base-attribute.diff
Created August 31, 2012 10:09
diff on Metaproxy’s router_flexml.cpp to allow base attributes when reading tags
--- a/src/router_flexml.cpp
+++ b/src/router_flexml.cpp
@@ -119,6 +119,8 @@ void mp::RouterFleXML::Rep::parse_xml_filters(xmlDocPtr doc,
id_value = value;
else if (name == "type")
type_value = value;
+ else if (name == "base")
+ ;// Ignore XInclude base attribute.
else
throw mp::XMLError("Only attribute id or type allowed"
@ssp
ssp / emf-converter.sh
Created November 13, 2012 14:54
Convert Windows EMF to usable graphics files with a crazy chain of tools.
#! /bin/sh
# Convert Windows EMF to usable graphics files with a crazy chain of tools.
# 2012 Sven-S. Porst, SUB Göttingen <porst@sub.uni-goettingen.de>
# Configuration
BASEPATH=/Users/ssp/SUB/edfu/emf
WINE=wine
METAFILE2EPS=$BASEPATH/metafile2eps-linux/metafile2eps.exe
PS2PDF=ps2pdf
INKSCAPE=/Applications/Graphik/Inkscape.app/Contents/Resources/bin/inkscape
@ssp
ssp / git-big.md
Created December 2, 2012 13:00
git with a lot of data

Testing how git behaves when dealing with many files

  • XML: ** 391041 files with 1 authority record each as XML (100 directories with about 3500-4000 files each) ** taking about 1,5GB of disk space
  • JSON: ** another copy of the same data in 350MB of JSON batch upload files for CouchDB

git add . … 200 seconds CPU time @ 25% CPU

@ssp
ssp / extract-count-years.sh
Last active December 10, 2015 13:48
Count the most frequent years of WorldCat’s mos frequently held items.
# Picking up Karen Coyle’s idea to gather the publication years from all items in WoldCat’s most widely held items.
#
# Data available from OCLC at: ftp://anonftp.oclc.org/pub/researchdata/worldcat/WorldCatMostHighlyHeld-2012-05-15.nt.gz
# The downloaded file is expected to be in the current directory.
#
# Join the following commands together:
#
# 1. gzcat the file to access the text
# 2. grep for the lines containing »datePublished« (this only seems to exist for about half the records?)
# 3. sed with a regular expression to extract four digits after the »datePublished> "« (possibly prefixed by a p or c)
@ssp
ssp / flv-to-mp4.sh
Last active July 7, 2022 17:54
Command to repackage a MP4 video from a FLV container to a MP4 container.
#!/usr/bin/env sh
# Stored at: https://gist.github.com/4452136
# Assumes the given path points to a FLV file with MP4 video.
# Use ffmpeg to repackage the file.
ffmpeg -i "$1" -acodec copy -vcodec copy "$1".mp4
# old version:
# Not used anymore as VLC seems to have a bug that creates broken
@ssp
ssp / xmlpaths.xsl
Last active June 29, 2022 02:15
XSL to determine all tag paths in an XML file.
<?xml version="1.0"?>
<!--
Stylesheet to list all tag-name paths in an XML file, including attributes.
2013 Sven-S. Porst <porst@sub.uni-goettingen.de>
-->
<xsl:transform xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
<xsl:output method="text" />