Ever since reading the book “Kryptographie und IT-Sicherheit” where I first learned about how SmartCards work, I wanted to do some SmartCard programming. In the book it describes some inner workings of Smart Cards, and that some of them have a small Java VM inside. But it turned out that the entry was not as easy as in many other fields. First of all, you have many smart cards (SIM of your mobild phone, Credit Card, Debit Card, Health insurance card, …), but usually they are protected so you can’t install anything of your own. Technically, it would be possible to have many applications on the same card, like CreditCard, DebitCard, HealthInsurance, PublicTransport, and so on. But with very few exceptions, the issuers don’t feel confortable sharing a card with someone else. Then there seem to be many different standards, and the companies seem to bee keen to obscure as much as they can. And then you also need kind of specialized hardware, but that’s the easier part.
Author: ulrichard
-
Installing to an external harddisk with qemu
The harddisk of my aunt’s pc was broken, and I had an old disk around that I could use for replacement. Now I wanted to install it prior to go there. Of course there is the option to take my harddisk out, and use my PC to install her harddisk. But I wanted to use my machine for other things during that time. So I checked, if I can configure VirtualBox to use an external harddrive connected with an IDE to USB converter. I didn’t find such an option. So I read up a bit on qemu. I used qemu before, and quite liked it. Qemu is fully commandline which is cool sometimes, while other times I like to have a GUI such as with VirtualBox. This time it didn’t matter, I only needed to be able to install an iso onto the external harddisk. And it’s as easy as this:
sudo qemu -boot d -cdrom ~/Downloads/linuxmint-12-gnome-dvd-32bit.iso -hda /dev/sdc -m 512
The sudo is only required because as a regular user I don’t have write permissions on /dev/sdc.
edit 5.Aug 2012:
On Ubuntu 12.04 replace qemu with qemu-system-i386 or qemu-system-x86_64
-
Reviving my vintage 3d shutter glasses
Many people don’t even know that there were 3d rushes before the one that’s currently fading. In a previous one, some ten years ago, I bought a very expensive ASUS graphics card with shutter glasses. It was really cool for gaming with the 21 inch CRT, but nothing compared to the graphics of today’s games. I still have the glasses, and I wondered many tmes, if I could use them with current equipment. There have been pages on that topic for a long time, but only now I found a page that has all the details to get me interested enough. It features a preload library with which you can hook into the process of switching the image. It has different color schemes as well as sequential for shutter glasses. It uses the V-Sync of the VGA connector to trigger the glasses. But VGA is not so common these days. Luckily, the preload lib is opensource. That allowed me to modify it so as to communicate to an Arduino or orher micro controller through USB FTDI.
-
A sink for the kids to play
When the new kitchen was installed in our camper, I didn’t throw everything of the old one away. Only the part with Mirella’s bad memories. I kept the faucet so that I could use it for the kids one day. Recently I exchanged the pump and the water tank. With the old parts I had almost everything I needed. The only things left to buy were a crate and a drain. Mirella gave me a bucket where I could drill a hole for the drain. Assembling it was easy, and Levin was lost in playing for hours…
-
Robot arm part 2 : ROS connection
As the name implies, ROS is not just another library to get familiar with. It is an operating system for robots. That is also quite different to a traditional operating system. As I didn’t want to learn a whole bunch of stuff first, I learn about the concepts and facilities as I move along.
After I modeled the robot arm with a urdf xml file, and it moved in the simlator, I wanted to connect ros to the physical arm. I found some tutorials for rosserial on how to connect to an arduino. So, I adapted these examples to the robot arm. The microcontroller board has many similarities to an arduino, but some things are different. First, I compiled the firmware. I had to copy some files from rosserial_arduino, and modified them accordingly. Hooking up the servos as ros subscribers is actually quite easy. The arduino examples use a standard python script on the computer. It looked as if I could use the same. But the robot arm only runs when the RTS level is high. As most libs and programs don’t do that by default, my robot arm did nothing. So, I copied some scripts from rosserial and modified them. In the process I learned about the statserial program that displays the status of the different serial pins. Now, the arm moved to the initial position and waited. Meanwhile I tried to connect to it with the modified python script, but I still got “Lost sync with device, restarting…”.
-
Optimizing compile time of a large C++ project
The codebase of our PointLine CAD is certainly quite large. sloccount calculated roughly  770’000 lines of C++ code. I know, this is not a very good metric to describe a project, but it gives an idea. Over time the compile time steadily increased. Of course we also added a lot of new stuff to the product. We also used advanced techniques to reduce the risk of bugs, that have to be paid with compile time. But still, the increase was disproportionate. We mitigated it by using IncrediBuild. Just like distcc, it distributes the compilation load across different machines on the LAN. If I’m lucky, I get about 20 cores compiling for me.
About once a year, one of us does some compile time optimization and tunes the precompiled headers. I did so about three years ago, and then this week it was my turn again. Reading what I could find about precompiled headers on the internet and applying that, I could get only a small speedup, roughly 10%. So I cleaned up the physical structure of the codebase. Here are some things I performed: (more…)
-
OpenCL First Steps
There is an increasing noise about GPGPU computing and how much faster than CPU (even parallel) it is. If you didn’t hear about all that, GPGPU is about using the computer’s graphics card(s) to do general purpose computations. The key to the performance lies in the parallel architecture of these devices. From what I read, an average graphics card has 64 parallel units, but they are not as versatile as the CPU of which a typical PC these days has 4 cores. That means, if the task is well suited, it can boost performance significantly, but if not, it’s nothing more than a lot of wasted work.
So I wanted to see for myself. To get started I read the book “OpenCL Programming Guide“. It gave a good overview. But now it was time to give it a try.
-
CyanogenMod and Ubuntu on my Samsung Galaxy S
I wanted to install a real debian based linux distro and Cyanogen on my Android smartphone for a long time. First I was scared off by voiding the warranty on a new phone. But now it’s one and a half years old. And recently they announced that there will be no more firmware upgrades for my device.
First step was rooting. There are lots of tutorials and descriptions online. Most of them are way too compilcated. Effectively, you just have to find a rooted kernel suitable for your device, and then: (more…)
-
packaging libboost compiled with llvm clang
I read many articles and posts over the last year or so, citing how great llvm clang is. On one side it shall have a static checker that makes lint redundant, and on the other side the optimizer has an -o4 where the -o3 shall be comparable to other optimizers. On top of that, compilation speed shall be really fast. And the part that makes it interesting for folks like Apple (who uses and contributes), is that it’s licensed under a BSD style license. What more could you want?
-
Earthquake
Today early morning I sat in front of my desk, when I suddenly felt everything slightly moving. Robert who sits next to me felt it as well, but most of the others in the office didn’t.
Last time I sensed an earthquake was in 2007 on our South America camper trip in Argentina . Unbelievable that five years passed already since we were there.
I followed a feed with recent earthquake events for a while, but it didn’t show anything relevant at first. Browsing the page, I found the event which had a magnitude of 5.1. The epicentre was near Parma in northern Italy.

On this map, you see the position of people that reported that they felt the quake.
