Skip to content

Instantly share code, notes, and snippets.

View TauPan's full-sized avatar
🏠
Working from home

Friedrich Delgado TauPan

🏠
Working from home
View GitHub Profile
@TauPan
TauPan / dailystrips.scm
Created August 10, 2012 07:28
modern port of dailystrips (http://sourceforge.net/projects/dailystrips/) to racket, with xpath and xslt
#!/usr/bin/env racket
#lang racket/base
;; downloading and compiling those requires will take ages, but only
;; for the first time!
(require srfi/1
srfi/13
(planet bzlib/http:1:0)
(planet neil/htmlprag:1:6)
;; (except-in (planet lizorkin/ssax:2:0/ssax)
;; ;; conflicts with srfi-1:
@TauPan
TauPan / pastescreensize.sh
Created April 11, 2012 14:22
adapt terminal settings to a remote serial line
#!/bin/sh
stty size|awk '{print "export TERM=screen;export LINES=" $1 ";export \
COLUMNS=" $2 ";stty rows $LINES;stty cols $COLUMNS;reset"}'
# /etc/screenrc:
# register f '^A:exec .!. pastescreensize.sh^M'
# bind + process f
@TauPan
TauPan / resizelayer-read.diff
Created March 15, 2012 13:23
patch from sadrul against invalid reads in ResizeLayer
commit d89aeca5126ed9c08772d6cae50f4221be2e0c54
Author: Friedrich Delgado Friedrichs <fdf@orion.pre-sense.de>
Date: Fri Mar 12 14:08:16 2010 +0100
apply patch from sadrul against invalid reads in ResizeLayer (http://pastebin.ca/1835311)
diff --git a/src/resize.c b/src/resize.c
index 7782c2b..5d1df4b 100644
--- a/src/resize.c
+++ b/src/resize.c
@TauPan
TauPan / pinentry-auto
Created February 7, 2012 10:35
wrapper for pinentry which selects curses or gtk depending on latency
#!/bin/sh
if [ -n "$DISPLAY" ] && [ "$(xprintidle)" -lt 100 ]
then
pinentry-gtk-2 "$@"
else
pinentry-curses "$@"
fi
@TauPan
TauPan / description.md
Created December 13, 2011 21:02
rvm applying patches twice

I have the problem that rvm tries to apply patches multiple times, succeeds and thus totally breaks ruby source (e.g. the gcdata patch gets applied multiple times, successfully and in the ensuing build, miniruby (or wossname?) segfaults). It seems that it's relevant if I interrupted a previous rvm install with Ctrl-C.

The second time I compile, rvm will apply all previous patches twice, sometimes three times.

The only thing that works is rvm implode and get all patches right the first time.

(What also seems to help is not pressing ctrl-c while rvm is building.)

(rvm cleanup all does not help)

@TauPan
TauPan / .muttrc.commitlog-macro
Created October 7, 2011 11:18
mutt macro for viewing changelog mail (e.g. from git commit hook) in emacs
# em is my emacsclient wrapper, you can substitute 'em' with 'emacsclient' and it should work
macro index,pager l \
"<enter-command>unset wait_key<enter><enter><pipe-message>tmpf=\$(mktemp commitlog-XXXXXX.diff); cat > \$tmpf; em \$tmpf; rm \$tmpf<enter><enter-command>set wait_key<enter>" \
"view message in diff-mode in emacs"
@TauPan
TauPan / s-bahn-hamburg.scm
Created July 26, 2011 11:51
Beginnings of a prototype scraper in racket for s-bahn-hamburg.de
#!/usr/bin/env racket
#lang scheme/base
;; downloading and compiling those requires will take ages, but only
;; for the first time!
(require srfi/1
srfi/13
net/url
(planet bzlib/http:1:0)
(planet neil/htmlprag:1:6)
;; (except-in (planet lizorkin/ssax:2:0/ssax)
@TauPan
TauPan / gitediff
Created July 25, 2011 12:27
Viewing differences in git with emacs-ediff
#!/bin/sh
# adapted from http://technotales.wordpress.com/2009/05/17/git-diff-with-vimdiff/
if [ -n "${GIT_EXTERNAL_DIFF}" ]; then
[ "${GIT_EXTERNAL_DIFF}" = "${0}" ] ||
{ echo "GIT_EXTERNAL_DIFF set to unexpected value" 1>&2; exit 1; }
exec emacsclient --eval "(ediff \"$2\" \"$5\")"
else
GIT_EXTERNAL_DIFF="${0}" exec git --no-pager diff "$@"
@TauPan
TauPan / backtrace and full backtrace for all threads
Created July 21, 2011 11:10
coredump from trying to play album of ogg files
Thread 10 (Thread 11588):
#0 pthread_cond_wait@@GLIBC_2.3.2 () at ../nptl/sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S:162
#1 0x0000000000432301 in xmms_ringbuf_wait_used (ringbuf=0x20b3150, len=4096, mtx=0x20b3120) at ../src/xmms/ringbuf.c:405
#2 0x00000000004207ed in xmms_output_read (output=0x20b3010, buffer=0x7ffb5f402e90 "", len=4096) at ../src/xmms/output.c:531
#3 0x0000000000439a85 in xmms_output_plugin_writer (data=0x84f1e0) at ../src/xmms/outputplugin.c:456
#4 0x00007ffb785a8cf6 in g_thread_create_proxy (data=0x1ef99b0) at /tmp/buildd/glib2.0-2.28.6/./glib/gthread.c:1897
#5 0x00007ffb77d17b40 in start_thread (arg=<value optimized out>) at pthread_create.c:304
#6 0x00007ffb77a632fd in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:112
#7 0x0000000000000000 in ?? ()
@TauPan
TauPan / xmms2continue.sh
Created July 20, 2011 09:52
extremely dirty first shell version of xmms2continue
#!/bin/bash
searchterm=$(echo $(curl http://ws.audioscrobbler.com/1.0/user/TauPan/recenttracks.rss|grep -A1 item|grep title|head -1|sed -e 's/<title>\(.*\)<\/title>/\1/'|tr -dc \ A-z0-9))
artist=$(echo $(xmms2 search $searchterm -l artist|tail -2|head -1))
album=$(echo $(xmms2 search $searchterm -l album|tail -2|head -1))
title=$(echo $(xmms2 search $searchterm -l title|tail -2|head -1))
xmms2 stop
xmms2 clear
xmms2 add artist:"$artist" album:"$album" -o "artist date tracknr"
xmms2 jump $title
xmms2 play