This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# from https://wiki.archlinux.org/index.php/xrandr | |
# create modeline output based on the monitors resolution | |
cvt 1680 1050 | |
# use that modeline for creating a new resolution | |
# also remove all non-resolution charaters from the mode | |
# name - otherwise arandr will crash | |
xrandr --newmode "1680x1050" 146.25 1680 1784 1960 2240 1050 1053 1059 1089 -hsync +vsync |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
# | |
# Rename all images in a directory to timestamp when they have been taken. | |
# also rename existing sidecar files | |
import sys | |
import glob | |
import pyexiv2 | |
import os.path | |
import shutil |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
bash | |
==== | |
hotkey to put current commandline to text-editor: CTRL+x+e |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# qemu start command for images provided on http://people.debian.org/~aurel32/qemu/amd64/ | |
set -eu | |
IMG=$(dirname $0)/images/debian-wheezy.qcow2 | |
VM_MEMORY='1024' | |
SSH_PORT=2223 | |
VM_NCPUS="`grep -c ^processor /proc/cpuinfo`" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Go-like defer statement (C++11) | |
* | |
* g++ --std=c++0x -o def def.cc | |
* | |
* also see http://blog.korfuri.fr/post/go-defer-in-cpp/ | |
*/ | |
#include <functional> | |
#include <iostream> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
http://stackoverflow.com/questions/1371460/state-machines-tutorials/1371654#1371654 | |
State machines are very simple in C if you use function pointers. | |
Basically you need 2 arrays - one for state function pointers and one for state | |
transition rules. Every state function returns the code, you lookup state | |
transition table by state and return code to find the next state and then | |
just execute it. | |
*/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# copy only the .svn diretories form all subdirs | |
rsync -avP --include="*/" --include='.svn/***' --exclude='*' from/ to/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
http://photography-on-the.net/forum/showthread.php?t=879433 | |
http://photography-on-the.net/forum/showthread.php?t=929789 | |
http://www.pixtus.com/forum/product-reviews/138424-benro-trcb069-travel-angel.html | |
http://www.benro.de/stative/travelangel.htm | |
http://www.canonclubitalia.com/public/forum/Benro-Travel-Angel-recensioni-con-t351810.html | |
http://blog.sebastianbober.com/2011/10/15/gear-review-giottos-vitruvian-vgrn8265-with-5501-652-ball-head/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
set -e | |
TSTAMP=$(date +%Y%m%d-%H%M%S) | |
ODFFILE=$1 | |
ODFDIR="$ODFFILE-unpacked" | |
[ -f "$ODFFILE" ] || exit 1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
set -e | |
TSTAMP=$(date +%Y%m%d-%H%M%S) | |
INDIR="$1" | |
OUTFILE_BASE=$(echo "$INDIR" | sed 's/-unpacked//g' | sed 's/.odt//g') | |
OUTFILE="$OUTFILE_BASE.odt" | |
[ -d $INDIR ] || exit 1 |