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
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
View iphone-nano.pro
TARGET = "iphone-nano"
TEMPLATE = app
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/main.cc src/IPhoneFrameWidget.cc src/MainWindow.cc src/helpers.cc src/apps/App.cc src/apps/Menu.cc src/apps/ClockApp.cc src/apps/MusicApp.cc src/apps/PhotoApp.cc
INCLUDEPATH += src
@torsten
torsten / fetch.sh
Created Nov 1, 2010
.zshrc lines for fetch/wget style downloading with curl and ruby
View fetch.sh
fetch() {
ruby -e 'u=$*[0];q=39.chr;exec %Q{curl #{q+u+q} > \
#{q+u.gsub(%r{^.+/},"")+q}}' -- "$1"
}
@torsten
torsten / untar.sh
Created Oct 24, 2010
.zshrc lines for a "untar" command which automagically unzips .gz and .bz2 tarballs
View untar.sh
untar() {
ruby -e 'f=$*[0];exec"tar","#{f=~/gz$/?"z":(f=~/bz2?$/?"j":
(raise"Incompatible Archive File"))}vxf",f' -- "$@"
}
@torsten
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
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
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
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>
#else
#include <GL/gl.h>
#include <GL/glut.h>
#endif
@torsten
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
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 <torsten.becker@gmail.com>, 2009.
The presentation from a Apple guy at
http://www.slideshare.net/guest4c923d/jordan-hubbard-talk-lisa-presentation
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.