Author: ulrichard

  • Harley Davidson gathering in Brunnen

    This weekend was Harley Davidson gathering here in Brunnen. I’m not so much into motorcycles, but I saw some incredibly cool looking bikes. There were a lot of bikes from all over Switzerland, as well as lots from the surrounding countries, and I even saw a bike with a Russian number plate. Saturday they had a big parade, and the whole event was really cool, like a mini open air right around the corner.

    I took some pictures:

  • Raspberry Pi – at last

    The raspberry pi, for those living under a rock, is the $25 linux pc that was announced big almost a year ago. It has a 700Mhz ARM CPU, 256MB RAM and an OpenGL ES capable GPU. To enable hardware hacking it comes with lots of GPIO pins. All in all about the performance of a premium smart phone from three years ago. But at $25 !!! The primary focus are school children, and the foundation wants to bring the fun on computing back to the children. Like every geek who read about it, I couldn’t wait to get one. First, the launch was scheduled for September or October, then postponed to February. The foundation decided they would outsource the shipping to some big electronics companies. They told them that a lot of people would try to get one of the first 10’000 boards, but still they weren’t prepared at all. The websites of the pi foundation as well as farnell and rs components were down the entire day. I got up earlier that day, hoping to be amongst the lucky ones. Later I signed up for a pre order somewhere in the queue for an upcoming batch. As with the first batch, each person could still order only one board. Then about a month ago, I received a mail indicating that it was time to place the order. And today I finally received it. (more…)

  • Correcting the date in the EXIF meta data of a jpeg image

    Lots of cameras have a wrong date configured. Mine is even worse: It has a dead internal battery, so it looses the date and time every time I turn it off. When you take a picture, the wrong date is saved to the meta data tags of the resulting photographs. Afterwards, you import them with a photo management tool such as shotwell, and they show up in the wrong place. Sorting doesn’t give you a chronological order. So I was looking for a simple tool to fix the embedded dates. I found exiv2. To install it, type:

    sudo apt-get install exiv2

    Strangely, it seems to allow only shifting the timestamp and not explicitly setting it. But that’s ok, it is probably the more common case. To adjust the timestamp from 25.7.2009 to 17.6.2012 execute the following:

    exiv2 ad -Y3 -O-1 -D-8 ~/Pictures/2009/07/GOPR050*.JPG

    Update 06.09.2020:

    Turns out it is also possible to set the date on images that had no EXIF data, although the command is a bit more verbose:

    exiv2 -v -M"set Exif.Photo.DateTimeOriginal 2020:09:05 07:17:00" 09/RunAndFly4.jpg

     

  • installing ros on a bifferboard

    I wanted the robot arm to be a bit autonomous from the computer, and I thought the bifferboard should be powerful enough to drive it. So I wanted to install ROS onto it. My bifferboard runs debian squeeze, and that means it’s not just a matter of installing the packages as with ubuntu. There is a dedicated wiki page about installing ROS on debian, so I was of the opinion that it can’t be that hard.  Actually, I once tried to install ros electric already when the bifferboard was still running debian lenny, and I ran into an infinite loop. I was full of hope that this bug had been fixed now with the release of debian squeeze and ros fuerte. But in fact, the first infinite loop was even earlier this time. And after circumventing an issue in pip with the help of a pip dev, I ran into the one I experienced earlier. I was able to find a workaround this time and reported the issue to pyyaml. The bifferboard has no FPU, and from what I can observe in python no inf and strange handling of nan. (more…)

  • recovering files from a repurposed harddrive

    Recently, I was searching for a bunch of photographs on all of my harddisks, and couldn’t find them. I know they had been there on the old notebook and on the old computer, and I thought I had copied them over. I could also not find them on any of my backup harddisks. Neither could I find any of the backup DVD’s containing the files that I was searching.

    So I wanted to see if I could salvage them from an old hard-disk that I formatted and re-purposed. Actually, I installed a new operating system on that harddrive, but didn’t use it a lot. So, with regular tools that query the filesystem directly, you wouldn’t find a trace. From an eposide of hak5 I remembered that scalpel is a tool for just that. Scalpel is a data forensics tool, that scraps through all the blocks of a raw harddisk, searching for headers and footers of known file formats. This works fine as long as the blocks belonging to a file are arranged linearly, which is not always the case. So I did a quick read up on how it works, and gave it a try.

    Here is a good tutorial.

    Basically, all I had to do is un-commenting the line with the jpg header definition, and run scalpel on the raw device file (e.g. /dev/sdc1 ) while providing an output folder. That way, thousands of jpeg’s were restored. Lots of them were corrupted due to them not being linearly distributed on the disk. But still lots of files were usable. I’m still looking for the backup DVD’s, but at least I have a fall-back now.

    Update 30. July 2014:

    If the partition is still intact, testdisk might lead to better results.

  • Roomba vacuum cleaner hacking

    Late last year I got a Roomba vacuum cleaner from a friend. My wife and I wanted to evaluate such a device for a while. The battery was completely dead, and before spending lots of money on a  new battery, for a device that I didn’t know if it still worked, I tried to hook it up with the battery from my old netbook. That didn’t work out, so I ordered an original part. The friend didn’t want the Roomba anymore, so I thought if it’s not good for cleaning, I would use it as base to build some robot.

    We still use it to clean the floor. Well, it doesn’t quite meet the cleanliness requirements of my wife, but she does clean the floor less often manually. Nonetheless, I looked around how to hack the device. I found lots of information on how to connect to it through the serial connector as well as an alternative firmware. The connector is a mini-din 7 and it is said that a MacMini connector should work as well. The local Mac store didn’t have a MacMini cable, so I ordered a mini-din-7 connector from Conrad. I had the cable soldered together quickly.

    Of course the ideal device to connect to the Roomba would have wireless connectivity already in place as you don’t want to span wires across the floor as it drives around. As it turns out I have my old OpenMoko Freerunner still laying around, waiting for a new purpose. A perfect fit, i thought. Especially since I wanted to implement some SLAM for the roomba, and that could well run on the freerunner. (more…)

  • Pilot 4 a day with a Jaguar driver

    Every once in a while I get to do a pilot for a day. That’s our premium offer at paraeasy.ch, and admittedly the most fun to do. Depending on the weather we either do a cross country flight or multiple flights from various mountains. This time, the weather looked promising, but not good enough for cross country. So we set out to do the first flight early from the Rigi. Christoph, todays passenger came with a beautiful Jaguar E-Type, and he is also member of the Jaguar Driver’s Club. The residual cloud cover that should disappear quickly in the morning was lower and more durable than was predicted. So we spent more than an hour para-waiting in the fog. When the fog finally lifted, we had a nice flight with some weak thermals and a couple of tight circles down to Goldau.

    After having lunch on a lakeview terrace in Lauerz, we drove with our two Jaguars to Brunnen. Then we headed to the Fronalpstock. From the main takeoff, we followed the ski slope down to Stoos, flying along the rock cliffs to the alp above Morschach. Next, I took course straight to Brunnen and with lots of excess altitude, we floated around and did some sightseeing. The smooth landing was on the Auslandschweizerplatz, one of my favorite landing zones, near to the lake front.

    For the third flight I came up with something very special. With the steam boat we crossed the lake, and took the bus and cablecar to the Niederbauen. Like on the other mountains before, the view was marvelous. Sadly, the wind at takeoff had an unusually suboptimal direction, hence I was not certain if we really could cross the lake. We took off, and heading towards Seelisberg town I grew more and more confident that we would make it. Along the rock cliffs of the Seelisberg mountain we soared with the birds, making ground without loosing altitude. Above the lake, we did another photo session, and we even had enough altitude left to fly to the Auslandschweizerplatz.

  • Full disk encryption with the crypto stick

    Last week I finished the udacity applied cryptography course. I did not as well as in the other courses, nonetheless I learned a lot and it was (as always) really interesting. We learned about symmetric and asymmetric encryption, hashes as well as key exchange and management. Each week in addition to the regular homework, we got a challenge question. For most of them, I invested some time, but then had to surrender. Well, I still managed to complete some of the challenges. The most fun for me was a side channel attack on the diffie hellman key exchange protocol. We had information on how many multiplications were required for the fast exponentiation of the RSA key on one end. That was enough to decypher the secret message. It was a good illustration of what has to be taken into account when developing real world cryptographic algorithms. And it reminded me of how some smart cards were hacked by closely monitoring the power consumption.

    Now, it was time to put my crypto stick to use. My netbook still ran Ubuntu Maverick due to the horrible graphics card (gma500). So I waited for the release of Linux Mint 13 LTS. In the 3.3 line of kernels there is a poulsbo driver already included.

    First I prepared the crypto stick according to this tutorial. After initially generating the keys on the stick for maximum security, I let myself convince to generate them on the computer to be able to make backups. I could not regenerate the authentication key so far, and thus I can’t use it for ssh at the moment. I’m still looking for a solution on that.

    Then I installed the operating system along with the full disk encryption according to this tutorial. At first it didn’t work, but then I discovered that there was a mount command missing in the tutorial and thus the generated ramdisk was not written to the correct boot partition.

    Here is how it works (as I understand it):

    • grub loads the kernel along with the initial ramdisk which contains everything necessary to communicate with the card.
    • The ramdisk also contains the keyfile for the encrypted root partition. Upon entering the correct pin, the smart card decrypts the key file (asymmetrically).
    • The key file in turn is used to (symmetrically) on the fly decrypt (and encrypt) all accesses to the root partition.

    It was new to me how to put stuff into the vmlinuz ramdisk. Apparently the script to ask for the key and decrypt the key file, as well as the keyfile itself and all the other required stuff can be added by installing a hook that is executed whenever a new ramdisk is created. For example when installing a new kernel.

    Not that I would have something stored on the harddisk, that would require such a level of security. But it’s interesting to set up and see how it works in action. The crypto stick adds a fair bit of security. As it has a smart card built in, a trojan couldn’t get hold of the private key, and a 2048 bit key is way harder to crack than a password that one can remember and type in every time.

  • Driving assistant

    Recently I completed the udacity class “programming a robotic car”, where Sebastian Thrun thought us what makes the self driving cars tick. He drew from his experience of winning the DARPA grand challenge in 2005. Now he’s leading the Google self driving car project. It was a very interesting course. Some stuff was already covered in the ai-class, but was a lot more detailed this time. We got homework assignments in python that we could complete directly within the website’s integrated editor. So, we implemented some of the key components in simpified form. Namely Kalman Filters, Particle Filters, Motion Planners with smoothing, and last and most interresting, SLAM.

    So, a while ago an idea started forming in my head. Todays smartphones should be powerfull enough to run some computer vision algorithms to help the driver identify obstacles, or warn him when he’s about to leave the lane. In fact, some premium cars already have such systems installed. First I looked in the android market, but found nothing. So I started looking around for how to integrate OpenCV in Android. I knew this part had been done before. I was not too keen to start yet another time consuming toy project, as I’m very busy at the moment. Another more extensive search in the Android market revealed some apps. And I was releaved to find some that implemented just what I was thinking about. There are two that I installed on my phone and am currently testing. Although I must confess, instead of increasing the security, they can also distract.

    Drivea

    The first app that I installed was Drivea. It may not be as polished as competing apps, but I like it when yu have the feeling, you know how it works. On my Galaxy S it runs smoothly without any problems other than some inaccuracies in the classifiers. Would be great if ot were opensource, so we all could learn from it, and maybe even contribute to the evolution.

    iOnRoad

    A bit too shiny for my taste. The core of it works really smooth. The classifiers and filters are better tuned than with the competing apps I tested.

  • Jaguar drivers club excursion

    It’s almost ten years ago, when I bought my vintage Jaguar XJS. And in two years time it will turn 30, thus gain official classic status. That means a huge drop in insurance and tax fees. It’s a grand tourer coupe with an incredibly smooth running V12 engine, sporting 294 horsepower. Because it shares the same comfort suspension with the XJ saloon, the regular version is not so great for racing.

    I learned long ago, that there were some XJS used for racing. I saw reports of increasing the displacement from 5.3 to 10 lites or mounting a dual compressor, thus reaching 1’000 horsepower. But only when reading the latest issue of the JDCS Tribune, I learned that the XJS was in fact Jaguar’s most successful racing car. When you read about Jaguar racing cars, what you usually find, are the legendary XK120 to XK150, C-Type, D-Type, the Silk-cut cars, and maybe something about the XJ13. There are some cool old looking videos on youtube.

    But the reason I write about all this is that I was, after years of absence, finally driving with the Jaguar driver’s club again. Levin, my older son, is the biggest fan of cars that I know, and he was looking forward to this day for a month. He was totally excited seeing all these beautiful cars. And during the drive he observed every car he could see, following them and trying to identify.