Kabelsalat

28.07.2009 21:25

I broke-in the new soldering iron today by making myself a new set of test cables.

A set of test cables

So far I can't complain about my choice of equipment (although this kind of work really doesn't do it justice). It was very easy to heat the contacts on the connectors - I would say the job was easier than with the 50 W Magnastat iron I am used to. But that is probably just my subjective feeling.

The handle does get warm after a while, especially near the end. Considering how thin the handle actually is, it's still doing a pretty good job of keeping your fingers insulated from the 400°C of the heater half a centimeter away. But I guess in the summer time, every extra joule of received heat matters.

Posted by Tomaž | Categories: Life | Comments »

Celebrating moon landings

20.07.2009 22:08

Forty years ago people first touched down on another world. The Apollo project that was in operation for the following years was the closest we ever came to having a regular transit line between Earth and the Moon.

It's sad that such a great piece of engineering was left to be forgotten. Especially now when I read about NASA's struggles to replicate some of the technology they developed four decades ago.

Apollo 9 CSM

Image by NASA

Anyway, for this occasion I ordered a couple of books. First is the Apollo: Through the eyes of the astronauts, a collection of photographs taken on Apollo flights, including the first few that were only testing spacecraft components in orbit (you know, those numbers that came before 11). There's a lot of fantastic shots in there I've never seen before. It's just surprising how out of thousands of images taken, everyone just keeps showing the 10 or so most well known.

The second book I ordered is Magnificent desolation, an autobiography by Buzz Aldrin. I haven't started reading it yet, but judging by the review it got in NewScientist, it must be an interesting read.

Finally, there's a ton of interesting stuff about Apollo on the internet, if you just search hard enough (and leave silly modern computer graphic mockups behind). Original photos and videos are on NASA's web site and some gems can be even found on YouTube (like this amazing video that includes footage from inside the Saturn I liquid hydrogen tank).

Posted by Tomaž | Categories: Life | Comments »

Weller WSD 81

19.07.2009 14:22

On Friday I bought myself a new soldering station - it was one of the key pieces of furniture that were still lacking in my new Ljubljana residence.

I decided to buy one from the Cooper tools' Weller product line. My dad has been using two of their Magnastat soldering irons for most of his professional life as an electronics engineer and except for a faulty thermostat on the older one they have been working perfectly for 30 years. As far as I remember he only had to replace one tip, although granted these irons were used for development and not production work.

Another plus is that after three decades Weller still produces Magnastat tips, even after having released numerous other product lines.

So I have a good reason to believe that the extra cost of buying a brand name was well spent. But I guess only time will tell whether it was really justified.

Weller WSD 81

When I turned it on today for the first time I got intrigued by a little detail. The digital display shows the temperature of the tip as it's heating up and the part that surprised me was that there was no overshoot - the temperature is rising as the tip is heating up and then appears to stop abruptly when reaching the set temperature.

The visual effect was such that I thought for a moment that the display was faked.

With your typical regulated system there's usually some overshoot - when first heating up the temperature does some oscillations around the set value before settling down because of all the delays in the control loop. The initial heat up is basically an impulse response of the system and a system that's very good at holding a temperature has a lot of gain in the feedback loop. And large gain brings you closer to instability, which causes overshoot.

I actually took a video of the process and put the readings into a graph:

Weller WSD 81 tip temperature versus time

The shallowing out of the curve at the end convinced me that the display shows real measurements. Still, I wonder what kind of regulation they use. Just proportional or full-blown PID?

Posted by Tomaž | Categories: Life | Comments »

Hacking the Happy Hacking Keyboard

17.07.2009 20:00

Last time I reported some weird problems with my new Happy Hacking Keyboard Lite2 USB. Escape and down cursor keys appeared unreliable and sometimes skipped keystrokes.

After some experimenting I found out that these two keys wouldn't register if I pressed them under some specific angles.

This got so annoying that I went back to my previous keyboard at work and decided to check if I can do something about it. Sending the keyboard back under warranty was pretty much out of the question: it took a month and coordination of three of my colleagues to get it from United States to Slovenia.

Opening the case is as simple as it gets: eight screws (one under the sticker with DIP switch instructions) and no plastic latches.

Disassembled Happy Hacking Keyboard Lite2 USB

There three layers here:

  • At the bottom is the membrane with switch matrix. It is itself composed of three layers of flexible plastic: bottom contacts, spacer and top contacts. They are only fused together at two spots (in contrast to the Sinclair Spectrum keyboard, where the contacts are hermetically sealed in bubbles in the membrane). This makes it possible to get finger grease on the contacts if your not careful handling it.
  • Flexible domes formed out of silicone-like substance. They act as springs that push keys back out after you press them.
  • Hard plastic keys, latched into the upper cover.

After visual inspection the most obvious problem appeared to be a couple of pieces of plastic freely floating on the membrane. They were most likely leftovers from the molding process (i. e. molding flash). Some keys (including the two I had problems with) also had irregularities on the bottom, so the surface that pushed onto the dome wasn't even. I carefully removed the excess plastic with a scalpel.

After assembling the keyboard back, the problem seems to be gone, but I guess it will take a couple of days of use to see if I really fixed it.

This is the second keyboard in a row that I had to repair after getting it brand-new from the factory (the first was on my Eee 901). They really don't make them as they used to (even when you pay $1.50 per key).

Posted by Tomaž | Categories: Digital | Comments »

Motor-generator set and TEMPEST

14.07.2009 22:18

A few days ago I read of another attempt at recognizing key presses by analyzing noise generated by the computer on the power line. That's another one to add to the list of so called TEMPEST attacks - ways to gather information via side channels without having physical access to the computer itself, for example via stray radio-frequency transmissions or signals leaking to power and other lines connected to the machine.

The general consensus seems to be that the best way to prevent any secrets from leaking out of your datacenter through power lines is to have a motor-generator set between your private and public power grids (basically you have a large electric motor on the public side powering a generator that powers the private side). The idea is that since power is transmitted via a mechanical shaft any electrical signals present on the private side would be lost.

Why exactly is that so? A motor turning a generator is a dynamic system just like an electronic filter (or the suspension system of your car for that matter). The basic mathematics that comes from system theory doesn't change with the implementation (whether it's electrical, mechanical or something more exotic). The only thing that matters in the end is the transfer function between the input signal on the private side and the output signal on the public side.

Motor-generator set diagram

Let's look at the simplest example: a DC motor connected to a voltage source that is powering a DC generator via a heavy shaft. The input signal, that is emissions on the private side, is modeled by the alternating component of the source voltage ui and the output signal on the public side is the generator's open-circuit voltage uo. This model is a bit different from reality where the source of the signal is on the generator side, but this way it's easier to understand and the conclusions hold for the other case as well.

Since there's no load in the generator, its torque on the shaft is 0 and the output voltage has a nice linear relationship with the angular velocity ωm of the shaft (in the ideal case):

u_o = k_g \omega_m

On the other side of the shaft, the electric motor provides again a linear relationship between its driving voltage, the torque M exerted on the shaft and the angular velocity of the shaft:

M = k_u u_i - k_\omega \omega_m

Plug this relationship into the rotational version of Newton's second law, and you get the following linear differential equation for angular velocity:

M = \alpha J
\dot{\omega}_m J + \omega_m k_\omega = k_u u_i

Where J is the total moment of inertia for the rotating part of the machine (shaft and rotors of motor and generator). Now do a Fourier transform:

(j\omega) \Omega_m J + \Omega_m k_\omega = k_u U_i
\Omega_m = U_i \frac{k_u}{k_\omega} \frac{1}{j \omega \frac{J}{k_\omega} + 1}

Add the simple linear relation for Uo and you get the final, idealized transfer function:

U_o = U_i \frac{k_g k_u}{k_\omega} \frac{1}{j \omega \frac{J}{k_\omega} + 1}

If you ignore the constants in that equation, you can see that this is an ordinary transfer function for a first order low-pass filter. It has a single pole (at J/kω), which means that the attenuation of the filter falls by 20 decibels each frequency decade.


This is a frequency characteristic you might get for example for a simple RC or LR filter. So why go through all the difficulties of having to maintain a mechanical machine in your basement?

The answer is clear when you consider that the cut-off frequency for such a mechanical beast can easily be in the order of millihertz (think about how long it can take for a large motor to ramp up). Add a flywheel to the shaft (increasing J) and you can push it down for another few of orders of magnitude. Useful signals you might want to eavesdrop start beyond the kilohertz range, so you're seeing at least 120 dB of attenuation - well beyond any chance of recovering the already weak original signal from thermal noise.

To make an electronic filter with this performance you would need some pretty large coils and capacitors. And also keep in mind that a large amount of DC power needs to pass through the filter with a little loss as possible, which makes any kind of an active filter a big problem. There are no op-amps that will power a datacenter from their outputs.

An additional problem with electronic filters in this role is also that when you're talking about this level of attenuation, it's hard to get it right. Large coils get problematic because of stray capacitances between the windings and so on. Large physical separation between the private and public sides is just about the only thing that reliably reduces cross-talk.

A mechanical system doesn't have these hard-to-predict channels and a rotating shaft provides a convenient way to separate electric parts as much as required.

Posted by Tomaž | Categories: Analog | Comments »

Happy Hacking Keyboard

07.07.2009 22:52

For a while I've wanted to switch my regular keyboard with one of the micro keyboards that started appearing on the market (those are keyboards that more or less only have the typewriter set of keys on them).

These days I spend most of my computer time editing code in Vim. I never had much use for the numeric keypad and only touch keys outside the typewriter area when I'm not using the text editor. I often have a pen and a (paper) notebook on the desk, so I find the center of table real-estate too valuable to waste on keys I only use occasionally.

Despite my efforts I couldn't find any quality micro keyboard in Slovenia. So I decided to order a Happy Hacking Keyboard Lite2 USB from a shop in US. Two weeks ago it finally arrived and I've been using it at the office ever since. These are my first impressions.

Happy Hacking Keyboard Lite2 USB

The initial impression is that it's solidly built. The tactile feedback of the switches is very nice, with enough resistance and key travel. Because the keyboard is that small, the general feeling I have is more like a laptop than a regular desktop.

The small form factor made me change my typing style a little. I used to press right shift together with the punctuation keys on the left of enter with my right hand. But that is really awkward with the position of the right shift on this keyboard, so I have to consciously force myself to use the left shift for shifting characters on the right side.

HHK has the control key in the right position (left of the letter a). It took a while to get used to, but after two weeks it turned out to be more convenient than the standard bottom-left corner position for common operations (shell control, copy-and-paste outside Vim, Firefox).

I don't miss the function keys at all. In two weeks I needed them a couple of times, mostly for closing an odd window or a shortcut in x-chat. Cursor keys are another matter and I feel that it's harder to find them because they are slightly lower than the rest of the keys.

I'm using the setting that replaces the delete key with backspace. It's a bit weird that this isn't the default - I can't imagine living without easily accessible backspace, while I can easily demote the delete key to a fn-key combination.

Now for the bad part. There are a couple of things that made the whole experience a bit underwhelming.

Every once in a while shift appears to get stuck. The effect is the same as if one of the shift keys would be continuously depressed. It's not caps lock, because it also affects punctuation and number keys. Bashing randomly on both shifts fixes that and I'm not sure if this is a problem with the keyboard or a bug in software - I've seen similar issues on other computers, but never this often.

Worse than that, the keyboard sometimes misses out keystrokes. Most often the escape key is ignored, which is very annoying in Vim. I haven't yet figured out what's the cause of that. If I slowly press the escape key it registers reliably, so I'm again not sure if it's a hardware problem. It's possible I simply don't push it enough when I'm touch typing or that I hit the escape key too much off-center.

I can't really blame the manufacturer for the third annoyance, but I'll mention it nonetheless: while I can't stand the Slovenian keyboard layout for writing code, it still essential to me when writing Slovenian text (I refuse to let go of our national characters). The problem with HHK is that "ž" ends up in the upper-right, on the left of "9", which is just about the worst place it can be.

In conclusion, after two weeks I'm still slower at typing code with HHK than I used to be with the standard keyboard. Typos and the annoyances I mentioned above seem to be the main culprits. Apart from that it's an enjoyable keyboard to work on and I'll give it another couple of weeks to see if practice will make any of its problems fade away.

Posted by Tomaž | Comments »

New phishing season

05.07.2009 18:24

Apparently a new wave of phishing attacks on a Slovenian electronic banking site Klik has begun and news about that are doing rounds in the local media.

What I find worrying is that everyone is giving out just two pieces of advice on how people can recognize a fake site:

  • Be careful of any unannounced changes in the interface (for example new password prompts, on-screen keyboards or amusingly bad language)
  • Check that there's a yellow lock in the status bar (i.e. you're using SSL)

While this is useful advice, it's also insufficient: the fact that the current phishing web sites don't use a valid SSL certificate and that they have very obvious visual differences to the legitimate site is merely due to the incompetence of the scammers. It's easy to make a fake site that will satisfy both of these "official" authenticity checks.

Surprisingly, the official reports and warnings in the news fail to mention the importance of checking the URL of the site that is requesting the password. That should be the very first thing to check when entering any kind of sensitive information on a web site. The URL is one of the few things that is hard to fake in a browser. Or how about a warning that the bank will never request your personal information over email? That would certainly do more good than the instruction to "close the browser as quickly as possible when you suspect something"

In fact there is no mention at all of how one ends up on this new fake site. Do you get there after clicking a fake link in a scam email or IM message? Or perhaps some malware on your computer redirects requests to a fake server (and so the URL bar actually shows the correct address?) Is there a domain squatter with a typo domain doing this?

Among all the fear mongering going on, there's precious little real information available. I even tried to find the actual scam site by using phrases from a few published screenshots and found nothing.

Posted by Tomaž | Categories: Life | Comments »