Skip to content

Instantly share code, notes, and snippets.

@reinout
reinout / addlabels.py
Created Sep 20, 2016
Script to add descriptions underneath eifelbahn.de DVD photos
View addlabels.py
# -*- coding: utf-8 -*-
import codecs
import os
# Directory with the hi-res images from the DVD
SOURCE_DIR = '../hg-eqb1-a'
# Directory where you want to place the files '.' is the current dir.
TARGET_DIR = '.'
# Export the .rtf with the image descriptions as plain text. The output should
View create_plugins_xml.py
import glob
import os
import zipfile
from ConfigParser import ConfigParser # TODO python 3
START = '''<?xml version="1.0"?>
<plugins>
'''
View geoserver_layers_from_nginx_extract.py
"""Script to report on geoserver layer usage.
I've run it on p-web-map-d9 like this::
cd /var/log/nginx
mkdir /tmp/logs
cp access.log* /tmp/logs/
cd /tmp/logs
gunzip *.gz
cat access.log* |grep -v ^127.0.0.1 > alles.txt
View monkeypatch_setuptools.py
# Hopefully temporary fix for
# https://bitbucket.org/pypa/setuptools/issues/450/egg_info-command-is-very-slow-if-there-are
import os
TO_OMIT = ['var', '.git', 'parts', 'bower_components', 'node_modules', 'eggs',
'bin', 'develop-eggs']
orig_os_walk = os.walk
@reinout
reinout / keybase.md
Created Sep 18, 2014
Keybase verification
View keybase.md

Keybase proof

I hereby claim:

  • I am reinout on github.
  • I am reinoutvanrees (https://keybase.io/reinoutvanrees) on keybase.
  • I have a public key whose fingerprint is F529 E418 37C0 7BBB 8699 E644 E62A 0F25 646A 99EE

To claim this, I am signing this object:

View update_ratings.py
from collections import defaultdict
import plistlib
# I copied files locally.
# NEW is what gets written.
# CURRENT is the current "iTunes Library.xml" file (or rather, my copy).
# OLD is an old backup with lots of good ratings.
OLD = 'itunes.xml'
CURRENT = 'itunes_2012.xml'
NEW = 'updated.xml'
View fabfile.py
from fabric.context_managers import cd
from fabric.contrib.files import exists
from fabric.decorators import hosts
from fabric.decorators import task
from fabric.operations import run
from fabric.operations import sudo
PACKAGES = [
# 'python-mapnik',
'binutils',
@reinout
reinout / default.cfg
Created Jun 7, 2012
Buildout config file to get a cache running
View default.cfg
# This file should go into ~/.buildout/default.cfg
# Also create the three directories in here.
[buildout]
eggs-directory = /Users/reinout/.buildout/eggs
download-cache = /Users/reinout/.buildout/downloads
extends-cache = /Users/reinout/.buildout/configs
You can’t perform that action at this time.