Automated logging of TBs and GeoCoins at

16 11 2009

I have taken up a new hobby called Geocaching some months ago, where you run around with a GPS device in order to find hidden “caches” along the countryside. One thing that you can find in these caches are so-called “trackables” which own a tracking number. You enter this tracking number on the website to claim that you have seen and maybe have taken the trackable item.

When attending an event together with other Geocachers, the number of trackable items present can become really big – there were over 80 of them for the last get-together that I went to. Since I don’t want to track all of these items by hand, I remembered about the possibility to automate web browsers with Selenium. After I got a list of the tracking numbers, I wrote a small script to handle the “Discover It!” requests to the website.
Read the rest of this entry »


Bit hack optimizations

20 05 2008

I came across Sean Eron Anderson’s Bit Twiddling Hacks page today, where all these awkward optimizations are collected that are faster than generated machine code from the compiler for common tasks. Using those was common practice when people were still coding in Assembler and needed to get the most out of their CPUs, and it probably still finds use in programming today when speed is of the essence.

A link on that page went to Paul Hsie’s Assembly Language Lab where you can find fast code for dividing by a constant and multiplying with a constant. The latter page has a warning that because it is over 235K of HTML, browsers may fail to render the page correctly. Very cute. 🙂

Help with regular expressions

4 05 2008

Mastering regular expressions can quickly become a non-trivial task. While good text editors like e.g. Kate, KWrite or TextPad have good support for regular expressions, it can be difficult to construct complex regexps, and even more so to find out why they don’t work as intended if they fail.

I have found two resources which help with that: first, the Javascript Regular Expression Validator from net shift media, which takes a regular expression from you and provides two input fields for tests which can be matched against the expression – instantly, no need to press any buttons and wait for an answer. This is very handy to find out if there was a typo in your logic somewhere.

If you need more help in debugging your expressions, then Dr. Edmund Weitz’s RegEx Coach might be able to help. This Windows program (there’s an outdated, discountinued Linux version, too) will take you through the evaluation of your regular expression, step by step:

The Regex Coach screenshot

Educational videos on Reverse Engineering

30 10 2007

You have to debug a program. How can this be done? Two very good resources show you how to do it in video:

Lena’s “Reversing for Newbies” shows you how to use the free debugger OllyDbg. Just watching the very first video already teaches you much about using the debugger.

The Reverse Code Engineering Video Website uses the IDA debugger on the same example programs as above, showing how this graph based debugger can help to understand a program. There’s another video on IDA usage on the official website, too.

par2cmdline with Intel Thread Building Blocks

25 10 2007

Somebody took the sources for the par2 software, added multi-threading support for it with Intel’s Threading Building Blocks and promptly received an award for it. The minimal changes to the original code have been documented. Since the recovery blocks can be calculated independently from each other, parallelizing this process was obvious. Nice to see that somebody did this for a software which I love both for its application of mathematics and practical use.

How to recover a lost PPPoE password

10 10 2007

Our DSL provider recently upgraded our internet connection to 6 Mbps. This lead to problems with our DSL modem, though, because it was over 5 years old and wasn’t designed for this. As a result, the modem didn’t sync anymore and we were left without net access for a couple of days until a replacement was shipped to us. The problem: The replacement was DSL modem and router in one, and required configuration, including the original login and password for our DSL service. The documents couldn’t be found and we didn’t want go through the hassle of resetting our account and wait for a new password, so I tried to retrieve it from the old DSL router (a D-Link box) instead. Here’s how:
Read the rest of this entry »

Automating web browsers with Selenium

24 09 2007

I have a new fun toy to play with: Selenium makes it possible for you to automate web tasks. After you start the Selenium server (a java command line program) you can get access to the browsers you have installed (Firefox, MSIE, Opera, Konqueror, you name it) and use the Selenium API to simulate user interaction with the browser in your favorite programming language (Java, Perl, PHP, Python, Ruby or C#). You can even use a Firefox extension to record your actions to rapidly develop these test cases. Read the rest of this entry »