Archive for the 'Hacking' Category

ThinkPad T440p X.org touchpad configuration

Sep 13, 2014

While the ThinkPad T440p is a pretty nice device (and finally also available with a quad-core CPU), its touchpad is definitely a step back compared to previous ThinkPad generations, especially for trackpoint users like me. With the default X.org touchpad configuration shipped with (K)ubuntu 14.04 it is nearly unusable (clicks cause subtle mouse movements, palm detection is horribly broken and using the trackpoint is no fun at all due to touchpad interference).

Fortunately, this can be improved a lot using plain configuration.

Minor Asterisk for FRITZ!Box Update

Feb 6, 2011

I am a little short on time, so I will keep this post short.

In brief: If you had trouble compiling Asterisk against the current Freetz development branch or an Asterisk version built against an older version was regularly crashing when establishing a new connection, this update is for you.

The updated version is available for download at http://github.com/ginkel/asterisk-freetz-build/tarball/v0.5. As usual, code contributions are welcome. The source code is available on GitHub.

Confused? ;-) This post tells you what this is all about.

SCM-SCL011-Treiber ("nPA-Basisleser") unter LGPL?

Nov 24, 2010

Vor kurzem hatte ich mir einen SCL011-RFID-Reader bestellt. Nicht, weil ich mir den neuen Personalausweis zugelegt hätte - bewahre. Ich wollte vielmehr schon immer mal mit RFID herumexperimentieren. Und da es diesen Reader aktuell zum Preis einer Pizza vom Italiener gibt, habe ich zugeschlagen - viel falsch machen kann man bei dem Preis ja nicht.

Heute lag der Reader in der Post und als ich gerade den Linux-Treiber installieren wollte, dachte ich mir, ich schaue mir diesen vorab mal im Detail an. Und was sehen meine müden Augen da? In einem Descriptor (scl011_2.06_linux_64bit/proprietary/SCL011.bundle/Contents/Info.plist), der dem Treiber-Binary beigepackt ist, steht zur Lizenz:

This driver is protected by terms of the GNU Lesser General Public License version 2.1, or (at your option) any later version.

Ich habe beim Hersteller jedenfalls mal den passenden Quellcode angefordert ;-) und werde über die Reaktion hier berichten.

Rails Scalability

Oct 17, 2010

Pretty interesting Google Tech Talk about scaling Rails apps or web apps in general:

Time is running out...

Sep 22, 2010

Well, not for me, but for an integral part of the Internet as we know it today: IPv4. The Internet is getting short on IPv4 addresses and as more and more gadgets get IP-enabled and emerging countries consume the remaining available address space faster and faster it is time to start thinking about switching to IPv6, which should offer sufficient address space for the time being.

Said, done. As of recently, my FRITZ!Box 7270, which I use to connect to the Internet, started offering native, as well as tunneled IPv6 connectivity. I decided to go for a SixXS tunnel, as my ISP does not yet offer native connectivity. I won’t go into all the details of setting this up as it is well-documented elsewhere. Instead, I would like to point out some pitfalls, which I hit, but which can be easily avoided:

  1. Do not try to connect the FRITZ!Box with the tunnel without having a subnet attached to it. It won’t work.

  2. Try to get more than 25 ISK (credits) at SixXS during sign-up. Providing a link to your XING or LinkedIn profile during sign-up should do the trick. Otherwise, you will not be able to bring up your tunnel as you won’t be able to request a subnet with this amount of initial credit. Goto 1. ;-)

If you’re really into adventures, set up a reverse delegation for the revserse lookup of IP addresses from your IPv6 network. You should have a name server at hand, which has excellent IP connectivity. A FAQ covering this aspect is available at SixXS.

Asterisk for FRITZ!Box 7270 Updated to Version 1.6.2.11

Sep 11, 2010

After I had updated my FRITZ!Box to the current “Labor” firmware along with Freetz trunk my existing Asterisk build suddenly stopped working. This was a good reason to bring my asterisk-freetz-build script in sync with the current Asterisk 1.6.2 version as well with Freetz trunk, which I have been using for the most recent firmware build.

The updated version is available for download at http://github.com/ginkel/asterisk-freetz-build/tarball/v0.4. As usual, code contributions are welcome. The source code is available on GitHub.

And if this is all Greek to you, feel free to read my original blog post, which is a little more verbose.

Asterisk for FRITZ!Box 7270 Updated to Version 1.6.2.9

Jul 5, 2010

It has been a while since I published my guide to cross-compile Asterisk for the FRITZ!Box 7270. This guide and build script was based on Asterisk 1.6.0.19.

Asterisk development has not stopped, though, so the current Asterisk branch - currently at revision 1.6.2.9 - got out of sync with the asterisk-freetz-build script.

Now, what is so great about community-based software is that it facilitates contributions by others: Recently, I received an e-mail from Thomas Rueter, who provided me with a set of patches to compile Asterisk 1.6.2.8 using asterisk-freetz-build. His patches served as a basis for a revamped asterisk-freetz-build v0.2 package, which is capable of cross-compiling Asterisk 1.6.2.9 and chan_capi 1.1.5 for Freetz 1.1.x.

If you just want the updated package, you can grab it here. In case you are interested into contributing to its development, a copy of it is now available on GitHub.

And if this executive summary does not make too much sense to you ;-), feel free to read my original blog post, which I also updated to reflect the version change.

US International Keyboard Layout w/o Dead Keys for Microsoft Windows

May 3, 2010

As much as I would like to completely switch over to Linux, for some tasks I am unfortunately still stuck with Microsoft Windows. This comes with the issue that Windows natively does not ship with the keyboard layout that I am routinely using under Linux: US International (No Dead Keys).

Fortunately, there is an easy solution available: Using the The Microsoft Keyboard Layout Creator it was a matter of seconds to remove the dead keys from the the stock US International keyboard layout.

The resulting keyboard layout file is available for download for your convenience. You can easily import this file into the Microsoft Keyboard Layout Creator and turn it into installable keyboard layout DLLs.

Hash It! 1.1.0 adds ccSLD support

Apr 30, 2010

A couple of days ago I visited the UK and also took my Android smartphone with me. After accessing some loal .co.uk web sites I quickly noticed that Hash It! would not figure out the right site tag for them when it was invoked from the Android web browser via the “Share” intent.

So, I just rolled an update, Hash It! 1.1.0, which adds support for the most common ccSLDs (country code second-level domains), such as .co.uk, .ac.uk or .com.sg.

Hash It! 1.1.0 is available via the Android Market. Details are also available at: http://android.ginkel.com/

Enjoy!

Java Method Signature Name Mangling

Apr 25, 2010

As with any modern programming language that supports method overloading, Java uses name mangling to distinguish methods that share the same name, but only differ in their parameters. Now, actually figuring out the exact algorithm used by javac by googling the Internet turned out to be quite tricky. Eventually, I dug up the following description, which at least serves as a starting point:

http://asm.ow2.org/doc/faq.html#Q7

P.S.: This would not even have been an issue if HTC would open-source their proprietary code for the HTC Desire…

Hash It! Updated to Version 1.0.2

Apr 20, 2010

It has been a while since I last worked on Hash It!, but thanks to the bug report of an attentive user I just uploaded a new version (1.0.2) of Hash It! to the Android Market. Bottom line: Hash It! now works correctly on Android 1.5.

Hash It! is licensed under the GPLv3 and as such comes with full source code for your entertainment.

Further details on how to download it to your mobile phone as well as the changelog are available at: http://android.ginkel.com/

Get it while it is still hot! ;-)

Android: Maps API Key Issues

Apr 19, 2010

When using Google Maps from within your Android application you need to obtain an API key in order to be able to retrieve Maps data at run-time. This API key is derived from the fingerprint of the signature key used to sign the application’s APK. Consequently, if the signature key used by your application at a given point in time no longer matches the one used to register the Maps API key, using the MapView will silently fail (the map will just display a gray grid instead of the expected map data). So far, so good.

As it seems, the Android ADT Eclipse plug-in also comes with an undocumented “feature”: If no “Custom debug keystore” is set in the Android Build Preferences, it will apparently use a different key to sign the APK when deploying it to a phone connected via USB than when deploying it to the Emulator. So, all your Maps applications will suddenly start to fail displaying map data once they are deployed on a real device for testing purposes.

To work around this issue, set the “Custom debug keystore” setting (empty by default) to the same value as the “Default debug keystore”.

PHP Unicode support - or the lack thereof

Mar 31, 2010

Well, I just had the pleasure to fix special character (umlaut) handling in a legacy PHP application. To put it short: It has been a while since I saw so many i18n issues as I figured out in PHP (version 5) during the last hour:

  • PHP strings are just plain byte arrays. Their content is non-portable as it is dependent on the current default encoding.

  • The same applies to the representation built by serialize. It contains a length-prefixed byte representation of the string without actually storing any encoding information.

  • Most PHP (string) functions have no clue about Unicode. For a detailed list including each function’s risk level, refer to: http://www.phpwact.org/php/i18n/utf-8

Note to self: Never ever use PHP for a new project.

Duplicity - Backup to the Cloud

Mar 7, 2010

Due to current events I started to think about options for a backup solution that would be able to cope with a complete disastrous loss of hardware. So, off-site storage was warranted.

What I came up with is a backup solution based on Duplicity and Amazon S3.

Storing personal data in the cloud may ring one or another alarm, but with Duplicity the data is safe from prying eyes as all backed up data is sent through GnuPG using public-key encryption before being transferred to Amazon’s data center. You should, however, make sure that one of the private keys used for encrypting the backup is locked away in a safe place, so you have it handy when it is time to perform a restore.

As far as storage costs are concerned, storing 50 GB of data in the AWS S3 cloud for a month costs around 6 EUR, which I personally consider quite competitive for redundant off-site data storage.

Naturally, one drawback remains: Bandwidth usage. It takes a while to load the first full backup into the cloud as the upstream of most DSL lines is rather limited. After that initial load has completed, however, Duplicity is capable of appending incremental backup sets to the existing backup data, so the incremental backups complete much faster.

P.S.: It may sound a little weird that I chose Amazon Web Services as a storage provider after my recent trouble with Amazon.de, but after some thorough market analysis AWS remained as the only feasible option.

Das funktioniert doch alles nur zufällig...

Feb 16, 2010

…ist einer der Gedanken, die einem bei einem Blick hinter die Kulissen so mancher Software in den Sinn kommen, wenn verschiedene Komponenten scheinbar mit heißer Nadel miteinander verbunden wurden und sich Bugs gegenseitig ausnivellieren.

Während diese Feststellung bei den meisten Softwarepaketen eher zu einer Fluchtreaktion des Betrachters führt, ist es umso erstaunlicher, dass es klugen Köpfen gelungen ist, das leichtfüßige Nebeneinander verschiedener Komponenten ohne strenge Bindung zum Paradigma zu erheben und darauf eine agile Softwareentwicklungsplattform aufzubauen. Das war die Geburtsstunde von Ruby on Rails.

Hiermit ist es möglich, umfangreiche Applikationen ohne das sonst häufig übliche Abhängigkeitswirrwarr zwischen den verschiedenen Komponenten zu bauen, das die Wartung ebendieser Applikationen sonst häufig zur Geduldsprobe werden lässt. Vielmehr verbinden sich Komponenten über Konventionen - ohne dass in den meisten Fällen eine direkte Abhängigkeit definiert werden muss.

Das ist dann in etwa so, als würde man einen Sack voller Lego-Steine ausschütten und wie durch Magie entsteht daraus ohne weiteres Zutun der Todesstern. ;-)

Mir gefällt’s jedenfalls…

ActionMailer and mod_fcgi

Jan 26, 2010

Lately, I have been playing around a lot with Ruby on Rails and am currently finishing my first full-fledged application. While I am using WEBrick directly launched from my Eclipse development IDE in my development environment the production site is currently using Apache + mod_fcgi to run the application. This is where all the problems started. ;-)

The application sends out e-mail notifications (using ActionMailer) for various state transitions, which worked flawlessly on the development machine. In the production setting, however, sending mails failed complaining that it cannot find the associated mail template:

ActionView::MissingTemplate (Missing template event_mailer/approval_requested_notification.erb in view path app/views): app/models/event_observer.rb:3:in `after_enter_awaiting_approval' /usr/lib/ruby/1.8/observer.rb:185:in `notify_observers' /usr/lib/ruby/1.8/observer.rb:184:in `each' /usr/lib/ruby/1.8/observer.rb:184:in `notify_observers' (eval):10:in `create_or_update_without_callbacks' app/controllers/event_controller.rb:71:in `request_approval' public/dispatch.fcgi:24

Well, after putting some thought into possible differences between development and production and ruling out any relevant configuration differences in config/* all that remained was the fact that dev uses WEBrick while production uses mod_fcgi. One thought lead to another and it turned out that WEBrick sets the application root as the current working directory during startup while mod_fcgi does not.

So, the workaround is simple: Set the current working directory to the application root in config/environment.rb, such as:

Dir.chdir(File.dirname(__FILE__) << '/../')

26C3 - A Picture is Worth a Thousand Words

Dec 31, 2009

GSM Encryption (or the Lack Thereof)

Dec 31, 2009

At 26C3 there were a couple of pretty interesting talks dealing with GSM security and how it can be easily broken through active (IMSI catching) and passive (rainbow table attacks on the A5/1 cipher) attacks.

Now, researcher’s are pushing to phase out GSM’s A5/1 cipher replacing it with modern, non-proprietary cryptography as countermeasure to the weaknesses facilitating A5/1’s susceptibility to passive eavesdropping. While this is certainly not a bad idea, it will end up with all but secure GSM calls considering that for GSM calls only the wireless interface benefits from the encryption. It will prevent John Doe from listening to your GSM calls using a wiretapping device placed in front of your apartment, but by no means will it lead to end-to-end security for GSM calls.

So, instead of attacking the wireless interface a malicious hacker would have to turn to the (fixed) telephone network to get hold of your calls.

In the end, only end-to-end encryption of calls will be able to prevent such attacks, so this is IMHO what we should be striving for in the long run.

Transferring Text Messages (SMS) from Nokia to Android

Dec 25, 2009

Around a month ago I replaced my old Nokia 6300 cell phone with the Android-based Motorola Milestone (aka. Motorola Droid). While I could easily transfer all contacts by adding them to my GMail contacts list the text messages (aka. SMS) were stuck on the old phone without any official way to transfer them to the Milestone. Fortunately, there is a solution using Gammu, some Perl scripting and the Android SMS Backup & Restore application.

Running Asterisk on a FRITZ!Box 7270

Dec 20, 2009

Around a week ago I started experimenting with running Asterisk on my FRITZ!Box 7270 to replace my DECT phone, which has been getting a bit long in the tooth, with a SIP client running on my new Motorola Milestone HTC Desire cell phone so that when I am at home and my cell phone is signed in to my WLAN I can use it as a mobile handset for calls arriving on my landline.

As it turned out it is a little bit tricky to get Asterisk to compile for the FRITZ!Box, so this posting is supposed to summarize the steps I had to take and also comes with a neat helper script, which should automate most of the required preparation and compilation steps.

Garmin Oregon 300 Firmware 3.30

Nov 21, 2009

In a previous post I outlined how to apply a firmware update for the Garmin Oregon series under Linux without the use of Garmin’s proprietary web updater. In the meantime, Garmin has released a new firmware revision, version 3.30, so if you’d like to update your device to that new version, just grab the .gcd file and follow the instructions in my previous post.

Garmin Oregon 300 Firmware Update Under Linux

Sep 20, 2009

During the recent beta period Garmin regularly released its beta Oregon firmware in a format that could be easily downloaded and installed on the Oregon by unzipping it copying it to the unit when connected as a mass storage device. Unfortunately, Garmin changed this policy again after the beta phase ended, the official firmware only being available through their proprietary (Windows-based) WebUpdater.

Ascom/Swissvoice DECT Phone Hacking

Jan 1, 2009

Or: How to enable the “Support” menu of Ascom/Swissvoice DECT handsets…

While playing around with the DECT base station built into my new AVM FRITZ!Box Fon WLAN 7270 I just got a day ago I actually managed to get the handset into an endless loop signing on to the base station, failing, beeping and starting all over. I remembered having read about a support menu built into the handsets of these phones and after a little trial and error managed to revive my phone by disabling DECT in the FRITZ!Box base station (to stop the endless looping) and clearing the phone’s registration via the handset reset built into the support menu.