Skip to content

Instantly share code, notes, and snippets.

@josch
josch / debconf-selections.txt
Created November 11, 2011 09:49
debconf installer preseed
# Services to use:
# Choices: security updates (from security.debian.org), volatile updates (from volatile.debian.org)
apt-setup-udeb apt-setup/services-select multiselect
# Non-existing physical volume
partman-auto-lvm partman-auto-lvm/no_such_pv error
# Check the integrity of another CD-ROM?
d-i cdrom-checker/nextcd boolean false
# Install GRUB?
grub-installer grub-installer/grub_not_mature_on_this_platform boolean false
@josch
josch / deltavision.py
Created June 5, 2013 13:33
reads a deltavision file and stores all images therein as png
#!/usr/bin/env python
#
# reads a deltavision file and stores all images therein as png
# this reader is fairly limited
#
# it expects a deltavision video in which there are two types of images, stored
# interleaved: ABABAB... Both types only have one channel. Each pair A and B is
# combined into an RGB image such that A is green and B is red
#
# example usage:
@josch
josch / pearson.py
Last active July 12, 2021 07:54
pearson hash and dolch word list experiments
from random import shuffle
from itertools import permutations
# dolch word list excluding "Santa Claus" (94 words)
words = [ "apple", "baby", "back", "ball", "bear", "bed", "bell", "bird",
"birthday", "boat", "box", "boy", "bread", "brother", "cake", "car",
"cat", "chair", "chicken", "children", "christmas", "coat", "corn",
"cow", "day", "dog", "doll", "door", "duck", "egg", "eye", "farm",
"farmer", "father", "feet", "fire", "fish", "floor", "flower",
"game", "garden", "girl", "good-bye", "grass", "ground", "hand",
@josch
josch / phenotips_tomcat.sh
Created August 28, 2018 11:09
Setting up phenotips on Ubuntu Xenial with Tomcat
#!/bin/sh
set -exu
directory=ubuntu-xenial-robot
debootstrap --variant=minbase --include=dbus,systemd-sysv xenial "$directory" http://archive.ubuntu.com/ubuntu/
systemd-nspawn --boot --resolv-conf=copy-host --directory="$directory" &
pid=$!
@josch
josch / phenotips_tomcat_mysql.sh
Created August 28, 2018 11:10
Setting up phenotips on Ubuntu Xenial with Tomcat and MySQL
#!/bin/sh
set -exu
directory=ubuntu-xenial-robot
debootstrap --variant=minbase --include=dbus,systemd-sysv xenial "$directory" http://archive.ubuntu.com/ubuntu/
systemd-nspawn --boot --resolv-conf=copy-host --directory="$directory" &
pid=$!
@josch
josch / multibootiso.sh
Created March 7, 2014 14:04
create a disk image for a usb stick which combines all *.iso files found in the current directory into a multiboot image
#!/bin/sh
set -e
mkdir -p isomount
mkdir -p extmount
mkdir -p mainmount
cleanup() {
sudo umount isomount
@josch
josch / nfql_pygments.py
Created August 6, 2013 11:57
pygments lexer for nfql
class NFQLLexer(RegexLexer):
name = 'NFQL'
aliases = ['nfql']
filenames = ['*.flw']
tokens = {
'whitespace': [
(r'\n', Text),
(r'\s+', Text),
(r'\\\n', Text),
(r'#(\n|.*?\n)', Comment.Single),
@josch
josch / plnparse.py
Created June 5, 2013 13:59
attempt to parse deutsche bahn schedules in pln format
from urllib2 import Request, urlopen
from gzip import GzipFile
from cStringIO import StringIO
from zlib import decompress
from struct import unpack
from time import sleep
from datetime import timedelta, date, datetime
from lxml import etree
def get_id(station):
@josch
josch / pyrsegmentation.cpp
Created October 18, 2012 14:21
cvPyrSegmentation example
#include "opencv2/highgui/highgui.hpp"
#include "opencv2/core/core.hpp"
#include "opencv2/imgproc/imgproc.hpp"
#include "opencv2/imgproc/imgproc_c.h"
#include <iostream>
using namespace cv;
using namespace std;
@josch
josch / download.sh
Created October 12, 2012 19:09
download and satitize debian packages and sources files from snapshot.debian.org
#!/bin/sh
# this script first downloads and then sanitizes debian Packages and Sources
# files from snapshot.debian.org for every 5 days since the start of
# snapshot.debian.org
dist=sid
arch=i386
dates=`cat << END | python -c "import sys; exec sys.stdin.read()"
from datetime import date, timedelta as t
last = date.today()