Skip to content

Instantly share code, notes, and snippets.

josch

Block or report user

Report or block josch

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@josch
josch / phenotips_tomcat_mysql.sh
Created Aug 28, 2018
Setting up phenotips on Ubuntu Xenial with Tomcat and MySQL
View phenotips_tomcat_mysql.sh
#!/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.sh
Created Aug 28, 2018
Setting up phenotips on Ubuntu Xenial with Tomcat
View phenotips_tomcat.sh
#!/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=$!
View gist:ba0617edc27018438d0a
#!/bin/sh
set -x
set -e
DEV=/dev/sdb
if ! sudo parted -lm 2>/dev/null | grep scsi | grep "$DEV" > /dev/null; then
echo "refusing to work on a device that is not a scsi disk" >&2
exit 1
@josch
josch / multibootiso.sh
Created Mar 7, 2014
create a disk image for a usb stick which combines all *.iso files found in the current directory into a multiboot image
View multibootiso.sh
#!/bin/sh
set -e
mkdir -p isomount
mkdir -p extmount
mkdir -p mainmount
cleanup() {
sudo umount isomount
@josch
josch / nfql_pygments.py
Created Aug 6, 2013
pygments lexer for nfql
View nfql_pygments.py
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 Jun 5, 2013
attempt to parse deutsche bahn schedules in pln format
View plnparse.py
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 / pearson.py
Created Jun 5, 2013
pearson hash and dolch word list experiments
View pearson.py
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 / deltavision.py
Created Jun 5, 2013
reads a deltavision file and stores all images therein as png
View deltavision.py
#!/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 / pyrsegmentation.cpp
Created Oct 18, 2012
cvPyrSegmentation example
View pyrsegmentation.cpp
#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 Oct 12, 2012
download and satitize debian packages and sources files from snapshot.debian.org
View download.sh
#!/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()
You can’t perform that action at this time.