Skip to content

Instantly share code, notes, and snippets.

Torsten Becker torsten

Block or report user

Report or block torsten

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
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
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 /
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"
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 / 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 / quine.rb
Created Mar 20, 2010
Try it: ruby quine.rb | ruby | ruby | ruby | ruby | ruby
View quine.rb
a,b="a,b=",";puts a+a.inspect+','+b.inspect+b";puts a+a.inspect+','+b.inspect+b
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 / 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 / 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 / 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
You can’t perform that action at this time.