View start-qemu-debian.bash
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`" |
View commandline.txt
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 |
View rename_photos.py
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 |
View thinkpad_t420_samsung_syncmaster_205bw_modes.sh
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 |
View download_issuu_document.py
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
#!python | |
# encoding=utf8 | |
# download the images of a document from issuu.com | |
import requests | |
import urlparse | |
import os | |
import os.path | |
# link to the jpg of the first page |
View waitgroup.go
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
package main | |
import ( | |
"fmt" | |
"sync" | |
"runtime" | |
) | |
func worker(id int, c chan int, wg *sync.WaitGroup) { | |
wg.Add(1) |
View dotfiles-install.playbook.yml
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
# vi: set ft=yml | |
--- | |
- hosts: all | |
sudo: no | |
vars: | |
dotfiles_dir: "{{ansible_user_dir}}/.dotfiles" | |
handlers: | |
- name: purge cached system packages | |
shell: apt-get clean |
View goog-query.lua
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/lua | |
--[[ | |
a parser for google-like search queries | |
]]-- | |
lex_keywords = { | |
-- keywords with quotes | |
"([a-zA-Z]+)%s*:%s*[\"\']([^\"\']+)[\"\']", | |
-- keywords without quotes |
View mm-wms.py
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
# -*- coding: utf-8 -*- | |
from mapmatters.client import wms as wmsclient | |
from mapmatters.parser import wms as wmsparser | |
WMS_URL = "http://www.example.com/wms" | |
wms = wmsclient.WmsClient(WMS_URL) | |
parser = wmsparser.Service(wms.capabilities) |
View set_keywords.sql
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
CREATE OR REPLACE FUNCTION posting_set_keywords(postingid integer, kw_array text[]) | |
RETURNS void AS | |
$BODY$ | |
begin | |
-- remove keywords which do not anymore exist | |
delete from test.posting_keyword where | |
posting_id=postingid and | |
keyword_id in ( | |
select pl.keyword_id | |
from test.posting_keyword lk |
OlderNewer