Skip to content

Instantly share code, notes, and snippets.

@ssp
ssp / elag-couchdb.text
Created May 28, 2013 21:08
Notes for CouchDB Bootcamp at ELAG 2013.
+ Part I: Getting to know CouchDB (10:00-12:30)
+ Hello
+ me = ssp@SUB
- https://github.com/ssp/
- http://www.sub.uni-goettingen.de/
- who are you?
- what are you doing?
- how do you think CouchDB could be interesting for you?
+ What is CouchDB?
- http://couchdb.apache.org
input {
stdin {
type => "stdin-type"
}
file {
type => "apache"
path => ["/var/log/apache2/access_log", "/var/log/apache2/error_log", "/var/log/apache2/ssl_request_log"]
}
@ssp
ssp / demo-yaz-client.output
Last active December 14, 2015 17:19
Alle Ausgabeformate der ZVDD Z39.50 und SRU Schnittstelle.
vlib:zvdd/test> yaz-client -f test-all.yaz-commands
Connecting...OK.
Sent initrequest.
Connection accepted by v3 target.
ID : 81
Name : Metaproxy/YAZ
Version: 1.3.53/4.2.51 d5ea9ffb52a014f258ac9e41ca34a6d9ba4b45c8
Options: search present scan namedResultSets
Elapsed: 0.002588
Sent searchRequest.
@ssp
ssp / zvdd-validator-test.sh
Last active December 14, 2015 15:48
zvdd-validator Testbefehl
# für URL
echo "<xmlinclude-root/>" \
| xsltproc --stringparam argument-formParameters-type url \
--stringparam argument-formParameters-url "http://www.zvdd.de/dms/metsresolver/?PPN=urn%3Anbn%3Ade%3Absz%3A14-db-id3549774668" \
--stringparam argument-formParameters-xml "" \
--stringparam argument-formParameters-file "" \
--stringparam argument-formParameters-file-error "" \
--stringparam argument-formParameters-file-tmp_name "" zvdd-validator-load.xsl - \
| xsltproc schematron/zvdd-validator.xsl -
@ssp
ssp / table-line-breaks.html
Last active December 14, 2015 02:19
Example for line breaks in tables. It’s messy.
<!DOCTYPE html>
<html>
<head>
<title>table line breaking tests</title>
<style>
body { word-wrap: break-word;}
table { background: rgba(200, 200, 250, 0.7); }
body>div { background: red; width: 200px;}
td, .cell { border: 1px solid green; }
@ssp
ssp / xmlpassthrough.xsl
Last active December 12, 2015 05:39
XSLT hack for Solr results to pass the content of a specific field through unchanged. Allows for structured XML content in Solr results.
<?xml version='1.0' encoding='UTF-8'?>
<!--
XSL hack for retrieving structured XML data from Solr fields without re-parsing.
It assumes that the <str> field »xml« contains valid XML, replaces the
<str> tag by an <xml> tag and includes the field content without escaping.
To use this, place the XSL in the »conf/xslt« folder
and invoke the XSLT Response writer [1] for this XSL by appending
&wt=xslt&tr=xmlpassthrough.xsl
@ssp
ssp / kmlexport.xsl
Last active December 11, 2015 11:38
Extrahieren von Koordinaten und Ortsnamen aus Wikimedia Toolserver KML Daten.
<?xml version="1.0" encoding="UTF-8"?>
<!--
Extrahieren von Koordinaten und Ortsnamen aus vom Wikimedia Toolserver erstellten KML Daten.
2013 Sven-S. Porst, SUB Göttingen <[email protected]>
-->
<xsl:stylesheet
version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:kml="http://earth.google.com/kml/2.1">
@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 <[email protected]>
-->
<xsl:transform xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
<xsl:output method="text" />
@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 / 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)