Skip to content

Instantly share code, notes, and snippets.


Keybase proof

I hereby claim:

  • I am torsten on github.
  • I am torsten ( on keybase.
  • I have a public key whose fingerprint is E054 EF92 AC0F B3E7 9BA3 5F8A 6B9B FA0C CE67 02B9

To claim this, I am signing this object:

torsten / aslr-test.c
Created Mar 25, 2009
Testing address space layout randomization on Leopard
View aslr-test.c
A small program to test address space layout randomization (ASLR) on Leopard,
by Torsten Becker <>, 2009.
The presentation from a Apple guy at
suggests to compile with -pie but it doesn't work for me, I get the same
output every time which means it's not random, check it yourself:
$ gcc -fPIC -Wl,-pie aslr-test.c && ./a.out
torsten / not_nil.m
Created Mar 30, 2009
Prove: [release] doesn't set a variable to nil
View not_nil.m
// gcc not_nil.m -lObjC -framework Foundation && ./a.out
#include <stdio.h>
#include <stdarg.h>
#include <Cocoa/Cocoa.h>
@interface FooClass : NSObject
torsten / glextensions.c
Created Jun 8, 2009
Prints all available OpenGL extensions
View glextensions.c
// gcc -g -framework OpenGL -framework GLUT glextensions.c -o glextensions
#include <stdio.h>
#ifdef __APPLE__
#include <OpenGL/gl.h>
#include <GLUT/glut.h>
#include <GL/gl.h>
#include <GL/glut.h>
torsten / navajo.rb
Last active Sep 3, 2015
Navajo, a stupid simple Apache replacement (kinda)
View navajo.rb
#!/usr/bin/env ruby
# Copyright 2009-2014 Torsten Becker
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, including
# without limitation the rights to use, copy, modify, merge, publish,
# distribute, sublicense, and/or sell copies of the Software, and to
# permit persons to whom the Software is furnished to do so, subject to
# the following conditions:
torsten / detect_gdb.c
Created Mar 30, 2010
Detecting an attached gdb on Mac OS X
View detect_gdb.c
#include <sys/sysctl.h>
#include <unistd.h>
#include <err.h>
#include <errno.h>
#include <stdio.h>
int main()
int mib[4];
torsten /
Created Oct 24, 2010
.zshrc lines for a "untar" command which automagically unzips .gz and .bz2 tarballs
untar() {
ruby -e 'f=$*[0];exec"tar","#{f=~/gz$/?"z":(f=~/bz2?$/?"j":
(raise"Incompatible Archive File"))}vxf",f' -- "$@"
torsten /
Created Nov 1, 2010
.zshrc lines for fetch/wget style downloading with curl and ruby
fetch() {
ruby -e 'u=$*[0];q=39.chr;exec %Q{curl #{q+u+q} > \
#{q+u.gsub(%r{^.+/},"")+q}}' -- "$1"
TARGET = "iphone-nano"
QT = core gui
CONFIG += warn_on
HEADERS = src/IPhoneFrameWidget.h src/MainWindow.h src/helpers.h src/apps/App.h src/apps/Menu.h src/apps/ClockApp.h src/apps/MusicApp.h src/apps/PhotoApp.h
SOURCES = src/ src/ src/ src/ src/apps/ src/apps/ src/apps/ src/apps/ src/apps/
torsten / google-ssl+links.user.js
Created Dec 29, 2010
Greasemonkey script, adds the missing links to Google Images, etc when using Google SSL Search.
View google-ssl+links.user.js
You can’t perform that action at this time.