Presentations with code that actually works

I don’t do presentations that often these days. And if I do, more often than not, they contain some form of source code. With most things you write, you refine it over and over. This is especially true with stuff that you present. Applied to code snippets, that can mean you test it initially, but once it is in the presentation it is a burden to copy it back and forth to verify every change, and then start over again with the formatting. So you often end up changing your code snippets in the presentation, without verifying if the code is still valid. Sometimes you find these errors during proof reading, but even famous presenters caught compile errors during the presentation. That’s how it works when you use the traditional PowerPoint style of products. As I expressed earlier, the Office suite and their opaque file formats doesn’t belong to my favourite tools.

Thus after I recently learned LaTex, I wondered if presentations could be done with it. Sure enough TexMaker offers a good set of templates for just that.

Next I wanted to see if I could link in code from external files, and sure enough, there is the listings package for LaTex. Now that enables me to have the code in files that I can actually compile.

But wouldn’t it be cool, if I could compile the code snippets for verification and generate a pdf file from the tex source all at one go? Sure enough there is a cmake UseLATEX package.

Now wouldn’t it be even cooler, if I could edit and generate all from within the same console window, without having to exit the editor, start the editor from a specific directory, or type complicated commands? Sure enough I found out how to write project specific .vimrc files. With everything prepared, I just have to type :make in vim to trigger the process, to get a new pdf file with all code snippets verifyed.

A small project to demonstrate the technique is at: https://github.com/ulrichard/experiments/tree/master/initializerlists

And you can find the resulting pdf file at: https://github.com/ulrichard/experiments/releases/download/initlist_0.1/initializerlists.pdf

Categories: Software, Work | Tags: , | Leave a comment

The phone book of the internet age

When I was a kid, the main means of communication with remote friends was using telephones. If I didn’t know the phone number of their parents, I looked them up in the phone book. The phone books also contained the postal address. So if I wanted to send a letter or a packet, I could also consult the same source for where exactly to send it.

Nowadays we have many more means of communication (mobile phones, email, xmpp, IRC, BitMessage, Twitter, Skype, WhatsApp, ICQ, FaceBook, Hangout, Forums…), but in this plethora of options, discovery is sometimes more difficult. On some services you just search for name, on others you have to know the user handle beforehand. But most important, you need to know on which service to look in the first place. In addition, an increasing number of people choose not to be listed in the phone book, or their online counterparts any more. So when I recently wanted to send a package to a friend who just received a child, I couldn’t find his postal address anywhere and had thus to ask him.

I’m sure in addition to the online versions of the regular phone books, there are lots of registry services where people can sign up to be listed. The problem is though that they are scattered all over the place, and mostly for local communities. There is one notable global directory, but that is for domain names rather than for people. DNS has problems of its own. As I experienced recently first hand, you’re at the mercy of the registrars if something unusual happens. And if you forget to renew, or lost access to the account your friend registered your domain (don’t get me started on passwords), some troll may catch your domain and use it for blackmailing.

Namecoin is here to solve both problems. It is a descendant of BitCoin, the famous cryptocurrency. Namecoin is a decentralized store of information such as domain name registrations, personal information… you name it. As it uses a block-chain it is completely tamper- and censorship-resistant. The rules are very clear. The first one to grab a name gets it. When a name expires it is available again. Registration or update is very cheap, in the range of a few cents. Since it is merge-mined with bitcoin itself, it inherits the protection against 51% attacks.

All you need is an installation of a namecoin full node (I’m not aware of any thin clients). The block chain is a lot smaller than that of bitcoin, so it is no problem to run it on your notebook. Once installed, you can register your domain. The GUI has fields for the required information. If you have a static IP address, you can just use that for registering and skip all the DNS stuff. The client side is a bit harder at the moment. To get the full security the system offers, you need to install a browser plugin, that is still a bit clunky. But there are already DNS providers that resolve .bit domains. That can be a lot more convenient at the cost of some security.

But the reason I’m writing about namecoin is an alternative usage, namely as a kind of modern phone book. I can’t remember how I found the site  nameid.org. I think it was from some guy writing about integrating it with the BitMessage client. As BitMessage addresses are hard to remember, that makes a lot of sense. Using namecoin for OpenID is also a nice idea, but I don’t use that part. I’m still looking for an OpenID solution based on OpenPGP where I can use my OpenGPG Smartcard. There was a great project started in this direction called EnigForm, too bad it has been stalled for some time. But I’m diverting again.

So, you can pick a short name (“ulrichard” in my case), and register selected information about you (email, blog, phone number, postal address…) with namecoin. The process is not as straight forward as with domain names, as the GUI has no fields for that yet. So you have to construct the json string yourself. The wiki documents the various fields and their types. You then only have to provide your short name as kind of digital, updateable business card. Yes, and updateable business card, isn’t that cool? Since not all people have namecoin installed, instead of the short name alone, you can provide a link to a website that nicely formats the information : https://nameid.org/?name=ulrichard . Once namecoin is integrated with other services, you no longer need to send mass-messages to all your friends when you change your eMail-address or phone number, you just update your namecoin id record.

Categories: Software | Tags: , , | Leave a comment

Trezor BitCoin HardwareWallet

Today I received my Trezor BitCoin HardwareWallet. When I ordered it in June 2013, the expected delivery Date was October. But as it happens all that often with BitCoin related hardware, the dates get pushed back. They offered a device with plastic case for XBT 1 and one with an alloy case for XBT 3. After the Bitcoin price skyrocketed end of last year, they stopped taking pre-orders. The devices we early backers received, have a nice “First Edition” label at the back.

The trezor is the first hardware wallet for BitCoin that is mass produced. It has a small screen, two buttons and a microUSB connector. So it is actually a lot more secure than if you just stored the private key on a SmartCard, as could be done with a HW1 or a YubiKey NEO if the software was finally released. You can see the balances on the different addresses in the client on the computer. When you want to send some coins, you see the receiving address and the ammount on the small screen of the trezor. Once you confirm using two button presses, the trezor signs the transaction, and the client on the computer propagates it to the BitCoin network.

Build quality and form factor look quite nice. It is actually a bit smaller than I expected, which is a good thing. Fifteen Swiss Francs in Coins would require about the same space. I guess it helps in that regard that it doesn’t require a battery, but is powered from USB.

The first thing I did was setting it up with the browser plugin from https://mytrezor.com. It’s an easy process where you have to write down the seed which consists of 24 words. Then I sent a small amount back and forth. Only after seeing this succeed, I transferred bigger amounts to the addresses of the device.
Then I wanted to test the electrum plugin that slush recently noted, would be merged soon. I found it in a pull request on github. It didn’t work initially, but several people were quick to help. After all issues were sorted out, also sending with the trezor from electrum works fine.

It wouldn’t be a security device if it worked without entering some kind of secret. Entering the secret on the computer would make it less secure, as some malicious software could record it. Entering it on the device with only two buttons would be cumbersome, as not that many people these days are fluent in morse code. So, I was curious, how they solved that problem. The solution they came up with is actually quite nice. They display a 3×3 grid of buttons with question marks on the cumputer, while the trezor shows a 3×3 grid with digits 1 to 9 in random positions. That way, you enter your pin on the computer using a mouse or touch screen, using the positions found on the trezor screen. Even after playing with the trezor for only some hours, it’s evident that a lot of thought went into it.

I wonder what will happen next in that space.
I was not fully convinced by the HardBit. Indeed it turned out, somebody found out how to activate WiFi and bluetooth of the repurposed SmartPhone. That makes it way less secure. The developers seem eager and friendly, but it might be just not the most secure platform to begin with.
Recently I backed an interesting project called PRISMicide on Indiegogo, but with only 8% funding after half the time, it looks as if they won’t make it.
The picture and description of the BitSave from ButterflyLabs look really slick. But they have a history of overpromising and delivering late.
And finally, I’m sure SatishiLabs, the creators of trezor, will work on a follow up device that is even smaller and communicates with SmartPhones.

Categories: Projects, Software | Tags: , , | Leave a comment

veteran at last

Today my Jaguar XJS finally gained veteran status. That means it is now officially recognized by the Swiss authorities as an oldtimer car. This in turn means lower taxes and insurance, but comes with the requirement to not drive more than 3’000km per year. Also the rate of technical examinations changes from 2 to 6 years. To gain that status, a car has to be at least 30 years old, and in very good condition. All parts need to be original, and the vehicle is not allowed to have modifications. At the first attempt after I woke it from the winter sleep, the regular technical check was no problem. But it didn’t get the veteran state, as the examiner found some barely visible traces of rust  in the lower fold of the driver door. So I had this fixed by a plumber. And this time it got the veteran status.

Jaguar hast two main model lines, the saloons and the sports cars. Initially, I only knew about the saloons that mostly older executives drove. I always liked these cars, and imagined I would someday drive one myself, when I’m old and rich. Now, I still don’t consider myself neither old nor rich. But at the end of 2001 I ran into a very beautiful XJ6 series 2 with vinyl roof, that was for sale, and even affordable. Too bad, the rust already won on that car, such that it was not worthwile to restore. But that was enough to infect me with the Jaguar bug. Now that I knew that older Jag’s were affordable, I wanted to have one, and the search began. That’s how I found my 1984 XJS HE V12. I bought it in the summer of 2002 when it had 75’000 km. Because there was a strange noise coming from the gear box during the test drive, I got it a bit cheaper. Later we found out that a missing  rubber holder on the propeller shaft was responsible for the noise. This was easy to fix. In fact, I cannot confirm at all the bad reputation that the Germans like to impose on British cars. The biggest repair I had in the 12 years was refurbishing the power steering, because it leaked oil. And the funniest problem was a fizzly sound from the engine, when I had the car only for a few weeks. I thought some pipe of the exhaust gas recirculation was broken. My brother then found out that one spark plug was loose. There was no noticeable reduction in performance. Well with 11/12 of 294 = 270 hp there was still plenty of power. In contrast, when two spark plugs of our camper failed in south America, 2/4 of 95 = 48 hp, the lack of power was more noticeable.

The guy in the tyre shop told me long ago, that XJS were used for racing. But only after owning the car for almost ten years, I found out that they were actually very successful. While reading the book “TWR and Jaguar’s XJS“, I learned, that some of the XJS’s greatest victories were the 1979 canonball race, the 1984 european touring car championship, the Spa 24 hours race, as well as the 1985 Bathurst 1’000 mile race.

Categories: Uncategorized | Tags: | Leave a comment

key signing

I have been using gnupg for a couple of years for digitally signing emails and debian packages and occasionally for encrypting files as well for ssh authentication. I wanted to participate in the web of trust for a while. But so far, all key-signing-parties in my region were on dates, that I couldn’t attend. Then I met the organizer of the last key signing party that I could not attend, on the last BitCoin meetup in Zug. Hence, we exchanged Id’s and key signatures, to sign the keys later. He briefly explained the procedure to me. Back at home, I wanted to sign his key, but was presented with an error message indicating that parts of my private key were missing. A quick search revealed that it was because of my setup, where I have the private sub keys on an OpenPGP smartcard, and the private primary key on an air-gapped machine in a secret place, guarded by orcs. Everything else can be signed using the signing subkey on the card, but other keys have to be signed using the primary key. Now, I began to think about moving all keys that I want to sign to that air-gapped machine and back using qr-codes. I didn’t like that Idea, and found a better solution: store the private primary key on a second smart card. Once it’s done, it works very well, I just insert the second smartcard when I want to sign someone’s key. But the procedure to get there is cumbersome to say the least. Luckily there was a concise description of what steps to perform.

Categories: Software | Tags: | Leave a comment

Generating flight vouchers with LaTex

Learning LaTex was on my todo list for many years. Like most people of my generation, I learned wysiwyg text programs in school, and used them for a long time for most stuff that ended up on paper. Actually, to be exact, the first text processing program I learned in school didn’t fall into the wysiwyg category, but was DOS based. I think it’s name was “Farsight”, but I can’t find any information about it on the internet. Since I am no friend of proprietary lock-in systems, I switched from MS Word to OpenOffice a long time ago, and more recently to LibreOffice. But even though their file format is open, it’s still binary. I know, I know, Word and ODF offer textual formats. I think they are mostly XML based. But the last time, I looked at one of them, I could not believe how overloaded with useless trash they were. The most annoying limitation of binary formats, is when you want to store the documents in a version control system, and compare different revisions. I used html for a while for documentation purposes. Although it is very good for these textual diffs between revisions, I’m not artistic enough to make it good looking. Hence, I thought for a long time that LaTex would be worth learning.

Also, for a long time I wanted to automate the vouchers for our tandem flights at paraeasy.ch. Even-though I knew that this was a perfect match, I had too many other things to do. As I’m currently reading a book about LaTex, I have my perfect hands on exercise. Hence, I prepared a template tex file for the vouchers and one for the invoices. Then I wrapped a python script around, that handles the rest.

The traditional way to keep track of which vouchers are active, and which ones were redeemed, is to keep a list. But after reading all the buzz about smart property, I figured that BitCoin is actually a perfect solution in itself. I generate a unique BitCoin address for each voucher, and load it with some coins. That way I can easily check, if the voucher is still valid. In fact, even other pilots that fly for us, can easily verify the validity of our vouchers. Now the perfect solution would be to load it with the full value, but since the BitCoin price is still quite volatile, the risk would be too high. After all, I need to be able to pay other pilots in case of a BitCoin crash. So I decided to load the voucher addresses with half the value. That way I can better tackle the risk.

As an opensource believer, I pushed my scripts to github, hoping they might be useful for somebody. I didn’t go to full lengths, in making it a configurable drop in solution. So, if you want to use it, leave me a message, and I will help you set it all up, and make it more configurable along the way.

Now, what happens if somebody orders a flight voucher on paraeasy.ch?  After the customer fills in all the required fields, and presses submit, I receive an email with a html table containing all the information. I then save the mail with evolution to a folder as an mbox file. Next, I start the python script which performs the following:

  • Generates a new unique number for the voucher.
  • Parses the information from the mbox email file.
  • Generates a BitCoin address that contains the initials of the passenger.
  • Replaces the placeholders in the tex files with the actual information.
  • Generates a qr code with the relevant information, and a gpg signature thereof.
  • Generate pdf files for the voucher and invoice.
  • Add the new entry to the list of active vouchers.
  • Add the pdf files, the updated list as well as the encrypted private key for the BitCoin address to my private git repository.

The system is not finished yet, but it already looks like a big relief. In the future, it might also generate the email to send the pdf file back to the customer.

Categories: Paragliding, Software | Tags: , | Leave a comment

sweet dreams

For my last army service, I was ordered to Eschenbach SG near Rapperswil to help in an arsenal. It’s actually a long story, how it came to that. Compared to a regular service, it was very much relaxed. I could go home every night, which is quite nice, especially if you have a young family. So, every morning when I walked from the train station to the arsenal, I passed a carpenter which had a gorgeous beam bed on display. The beams had crack, and looked really old, but perfectly restored. It didn’t have a price tag, so I assumed it was expensive. And I was not in need of a new bed anyway, so I just remembered it, for when I would need one. That was three and a half years ago.

Our bed recently broke. No, it’s not because I grew so fat. People say, that the mattress and the slatted frame should be replaced after ten years. So it was almost in time. And now I remembered the bed frame from Eschenbach. They did not respond to my eMail, so I had a look around other stores and websites. I found out that these beam beds with cracks are trendy, and that they are mostly made of swamp oak. Finally I found what I was looking for at Möbel Riesen in Brunnen.

They didn’t accept BitCoin directly, so I had to convert the funds first. At the time, the excange rate on MtGox was a steady ten percent higher than with other exchanges. This was quite tempting, even though most people suspected liquidity problems behind the long delays since last summer. So I split the risk, and traded half through BitStamp, and the other half through mtgox. BitStamp was quick and reliable as always, while I still wait for the money from MtGox. Meanwhile MtGox filed for bankruptcy, and I might have to write that money off.

The bed frame arrived earlier than expected, while we had some trouble getting the mattresses and slatted frames in time. So we had to sleep in a funny arrangement for a few days. But now finally, everything is in place. The beams are actually quite heavy, adding up to about 250kg.

As I work in the development of the PointLine CAD, naturally, I was interested in a CAD drawing for the bed frame. The guy from Sprenger Möbel was very friendly, and sent me a jpg, telling me there are no CAD files, as he draws everything by hand.

Categories: Family | Tags: , , , | Leave a comment

celebrating 2’000 flights

Last week, I didn’t even realize that I completed my two thousand’th flight. Only when I updated my flight log book, I found out. I knew that I’m close, but that day I did lots of short speed flights, and one of them was the one.
For the first one thousand flights I needed only four years. I celebrated the event with a couple of friends and a big bottle of Champaign. It was in March 2006 from the Zugerberg, and I top-landed after twenty minutes.
Since I don’t fly as much as back then, the second thousand flights took eight years. I held up the tradition with the Champaign, though. Not on the 2000th flight, which I missed. Instead, we celebrated the 2005th flight today, after I did three tandem flights for Peter from the Rigi.
So here is a small statistic:

Gliders 61
tandem flights 265
speed flights 145
flights with competition gliders 540
countries 20
flying areas 164
Categories: Paragliding | Tags: , | Leave a comment

Lauchernalp Speedflying

During our family ski holiday last week, I went one day to my favourite speedflying location: the Lauchernalp in the Lötschental.

Enjoy the footage:

Categories: Paragliding | Tags: , , , , , , | Leave a comment

My grandfather

Yesterday, my grandfather passed away, roughly 40 days before his 95th birthday. After he suffered a first light stroke ten years ago, his condition slowly worsened. In the end he was not able to walk or eat on his own, and didn’t recognize anyone. But up to age 85, there was no sign of slowing. I sometimes went with him to his friends to assist, when he installed satellite tv receiver or video recorders, and explained them to his retired friends. He was a big fan of technology, as such he used photo and video cameras long before the people of the next generation started to do so. We recently watched a small documentary video he filmed in 1973. But what impressed me the most, was the self built radio that he demonstrated to me when I was a kid. He must have wound those coils in the first half of the last century, when radio waves were more like magic to most people.
Categories: Family | Leave a comment