20080129

WiFi in the TF

Ok, forget completely about xsupplicant - it's horribly written software. I had to correct several sections of code just so it would compile, and then I later realized that it was truncating the ESSID string to an improper length.

I managed to get WPA-EAP / EAP-TLS working with wpa_supplicant, and it wasn't so hard after all.

Requirements:

You should have been given 4 files from the TF administrator - Root.der, Client.der, Server.der, and xyz.p12, where xyz is your username. You should also know your passphrase.

You should have wpa_supplicant installed (it should pull in OpenSSL as a requirement). If you don't have wpa_supplicant installed, then do 'emerge -av1 wpa_supplicant'.

Important: Do not install wpa_supplicant with the gnutls USE flag; gnutls has a broken implementation of eap-tls right now, resulting in errors such as 
  • "Failed to read client cert/key in PEM format: Base64 unexpected header error" 
  • "Failed to read client cert/key in DER format: ASN1 parser: Error in TAG." 
If you have wpa_supplicant installed with the gnutls USE flag, then simply run  'USE=-gnutls emerge -av1 wpa_supplicant' as root, or better yet, add 'net-wireless/wpa_supplicant -gnutls' to your /etc/portage/package.use file.

Steps:

1) Switch to the root user. Copy all 4 files to /etc/wpa_supplicant.

sudo -s
mkdir -p /etc/wpa_supplicant # should be created by wpa_supplicant
cp Root.der Client.der Server.der xyz.p12 /etc/wpa_supplicant


2) According to 'man wpa_supplicant',

"Wpa_supplicant supports X.509 certificates in PEM and DER formats. User certificate and private key can be included in the same file. If the user certificate and private key is received in PKCS#12/PFX format, they need to be converted to suitable PEM/DER format."

cd /etc/wpa_supplicant
for i in Root Server Client; do 
    openssl x509 -inform DER -in ${i}.der -out ${i}.pem
done
openssl pkcs12 -in xyz.p12 -out xyz.pem -clcerts
# we do not want anyone reading / modifying the keys aside from root
chmod u+rw,go-rwx {Root,Server,Client}.{der,pem} xyz.{p12,pem}

When converting your public / private key from pkcs12 format above, it will ask you for an 'Import Password', which is null. Simply hit enter. Next it will ask you for your PEM passphrase, which is the one you should already be familiar with.

3) From 'man wpa_supplicant.conf', append the following to /etc/wpa_supplicant/wpa_supplicant.conf :

# Technische Fakultaet
network={
     ssid="TFconnect"
     key_mgmt=IEEE8021X
     eap=TLS
     identity="xyz"
     ca_cert="/etc/wpa_supplicant/Root.der"

     ca_path="/etc/wpa_supplicant/"
     private_key="/etc/wpa_supplicant/xyz.pem"
     client_cert="/etc/wpa_supplicant/xyz.pem"
     private_key_passwd="your secret passphrase"
     eapol_flags=3
}


4) Now use your common method of starting wpa_supplicant. I assume your wireless device is called wlan0, but sometimes it's simply called eth1. For Gentoo, I do

cd /etc/init.d
ln -sf net.lo net.wlan0


5) The -D argument can vary. Mine is wext, but yours could be madwifi or madwifi-ng. Add something like the following to /etc/conf.d/net, if you don't already have a configuration for wpa_supplicant.

modules_wlan0=( "wpa_supplicant" "dhcpcd" )
wpa_supplicant_wlan0=( "-D wext -c /etc/wpa_supplicant/wpa_supplicant.conf" )


6) Lastly, run

/etc/init.d/net.wlan0 restart

20080120

Python is Pissing Me Off

For the record, I just want to say that I hate Python at this very moment. In fact, I downright loathe it.

FIX THE FSCKING BUILD SCRIPT FOR CROSS BUILDING ALREADY!

20071128

All I Want for Christmas

Christmas is a stressful time for me. Mainly because it involves transporting myself back home, and doing last minute Christmas shopping. For the last two years that's involved taking a last minute flight over the Atlantic. I haven't had very much time to get a haircut, let alone go Christmas shopping. I wish I could say that I've been thinking about giving gifts all year, and figured-out exactly the right gift to give to each of my relatives. The truth is, I haven't.

Mainly during the times when I've been a student, I haven't found the excitement over giving or receiving gifts at Christmas. Maybe that's because I've been historically fairly broke for the holidays, or maybe it's because I've gone through the entire year without any major hankerings because I've been too busy! Who knows. I usually get more excited when I give gifts.

While I've been a student, I find it great just having an excuse and having the ability to get together with family in mass quantities for the holidays ;-)

With a new baby on the way in May, I'm sure that many of my relatives will be giving me lots of 'stuff' for Christmas. I assure you, I will very likely have no place to put anything, and I definitely will not be bringing anything with me back to Germany. Maybe hold off on the 'stuff' buying until March or so. As it stands, I have 3 good suitcases full of 'stuff' that I will need to somehow transport back to Canada before March. I would also have no place to put it in Canada and my storage space there is already aux gratis and running out.

This year, the only gifts I would imagine receiving are small chunks of money that I would hope to put toward an education fund for our new arrival in May.

And maybe a video collection of works by Bob Ross :) I've always thought his show was super relaxing to watch.

And now, back to the joy of programming :)

20071118

IEEE.tv Article Interviews John Stevens

John Stevens, CEO of Visible Assets, was recently featured in an interview at the RFID conference in Dallas. Actually, the conference took place 26-28 March, 2007. I only just noticed the interview because I started subscribing to IEEE.tv through Mozilla Thunderbird's RSS news reader. I also happen to work for Visible Assets, and so I thought I'd take this opportunity for some shameless corporate promotion :)

In the interview, John explains some of the details about RuBee(tm), the pending IEEE protocol (IEEE P1902.1), and how Visible Assets applies the relatively young technology of long-wavelength radio tags. At Visible Assets, we basically sell a service that builds upon RuBee(tm). Through the grouping of distributed, collaborative, and localized networkable transceivers, RuBee(tm) securely enables the authorized end user to asynchronously monitor their assets from anywhere in the world. All communication between the transceivers and the end user are event-based, which cuts down on bandwidth over long distances, enabling local monitoring in real-time and remote monitoring with extremely low latency.

RuBee(tm) is protocol that can overlay the common IEEE 802 standard. What that means in human terms, is that every tag can be assigned an IP address, just like the computer on which you read this article. When IPV6 takes over, boasting an addressable space of 2128 (about 3.4×1038), that means that every single tag will have a globally visible, unique address on the internet. Pretty astonishing, isn't it.

If I slapped a tag on my favorite toothbrush, flew to Japan, and visited an internet cafe, I have the potential to be disappointed that I forgot my favorite toothbrush on the other side of the planet. But hey, at least I would know that it was safe and sound back home ;-) That's really a crude example. Our primary clients are those who need high data reliability when monitoring their assets, such as those in the medical, pharmaceutical, agricultural, and defense sectors.

RuBee(tm) is the main feature of our infrastructure. Therefore, I should take the opportunity to share some information about the unique technology that we, at Visibile Assets, bring to the RFID spectrum.

Our tags do not belong in the same category as RFID, although they could conceptually be used in many of the same situations where RFID is used today. It should be noted that our tags operate at the lowest end of the RF spectrum (below 450 kHz), and should therefore be considered a complement to RFID. This difference in carrier frequency results in some fundamental contrasts between our tags and conventional RFID. Namely,
  1. RFID has very short range with low penetration, while our tags have very high penetration and a considerably longer range,
  2. RFID electro-magnetic (wireless) signals are largely composed of electric (E) fields, while our tags contain 99% magnetic (B) fields
  3. RFID signals have a high bit-error-rate (BER), while our tags have a low BER
  4. RFID tags are generally passive devices, whereas our tags can be passive, or optionally active devices for wireless data-acquisition applications (temperature, pressure, etc)
My job at Visible Assets, Inc. is to design and implement low-level software and high-level hardware. In some sense, I transform our transceivers from simple radios into intelligent nodes within the aforementioned distributed, collaborative system. We call the end product a Sidewinder and of course, one could say that it is indeed an internet appliance (INAP) in the trademark-free sense of the word.

Currently I'm doing a master's degree in Digital Communications during the day, but then at night I assume the role of my secret identity as embedded systems engineer for Visible Assets. Right now I'm implementing a fairly sophisticated software stack in probably the best C code I've ever written in my life!! Needless to say, it keeps me reading up on all of the distributed / intelligent systems literature that I can get my hands on.

In the interview, John really spells out a highly technical subject in such a way that the average layman can understand, which isn't a very common ability among engineers. Don't let that fool you though. There are only a few people who understand our technology through and through, and John is one of them.

That's only one of the reasons I really like working under him. John has a great relationship with all of his employees. Last year we had our staff Christmas party at his home, which is more of a personal touch than I've seen at any other company. He gave this great speech which was followed by a cheerful toast, and it really motivated me - I'm working on some pretty cool stuff!

John gets so excited when he finds out about new progress that we've made. The only analogy I can give is to compare him to a child with a new train set. He's always excited to figure out how things work and he loves talking about all of the development details, like what challenges we faced, where we made compromises, and new and interesting ways we've used to overcome obstacles.

Nice interview John! I'm looking forward to showing you what's been keeping me so busy lately.

Other articles about what we do at Visible Asests:

Converge! Network Digest [20060609]:
IEEE Begins Work on Wireless, Long-Wavelength Standard
Sensors Specialty Markets [20060612]:
New Wireless Standard for Healthcare and Livestock Visibility Networks
RF GlobalNet [20060612]:
IEEE Begins Wireless, Long-Wavelength Standard for Low-Cost Radio Tags
RF Design [20060614]:
New IEEE standard to bring local network protocol to thousands of radio tags with long battery lives

RFID Journal [20060619]:
Visible Assets Promotes RuBee(tm) Tags for Tough to Track Goods
IDTechEx [20070208]:
IEEE RuBee(tm) Network Standard Meeting
Epson [20070507]:
Visible Assets, RuBee(tm) Technology Leader, Announces Investment from Epson Electronics America

20071116

P2P Distributed Filesystem for Portage Binary Packages

After my latest post about the exponential size of a potential Gentoo / Portage database of binaries (indexed by use flags, build dependencies, etc) I just came up with a fairly interesting idea.

Who else (who we all know and love) has as much (and likely far more) data to index? Obviously, Google ;-) Googles method of indexing data is using their distributed filesystem.

So why couldn't binaries based on Portage ebuilds be indexed in such a fashion. Well, since the volume of data, indexed by use flags, build dependencies, etc, would be so massive, it's unlikely that any single, community-driven server could host such data alone.

If the community was involved, though, it wouldn't be too far fetched to make the binary-distribution distributed filesystem available on Peer-to-Peer networks. The same hashing technique could be used for each of the various packages that's being built. Furthermore, as has been pointed out by others already, the environmental impact that Portage has is probably intriguing, considering that every package installed by the average user is compiled from source.

And let's be honest with each other - the bottom line in using software is using it, and not building it.

++ for P2P networking AND Gentoo :)

Update [ 2007-11-30 ]: I also mentioned this once on Daniel Robbins' blog - Funtoo

20071114

Error in glibc's select() function

While doing some programming for work, I discovered that the select() function provided by glibc does not accurately describe when data is ready to read from a socket.

The purpose of select() is to block on a file descriptor until data becomes ready, unless a specified relative timeout expires or an error occurs.

When data is ready, select will return a positive number corresponding to one of the sockets contained in one of the file-descriptor sets that were passed as parameters. If a timeout occurs, zero is returned. If an error occured, -1 is returned and errno is set appropriately.

I found that if select was called, a timeout occurred, then data became ready to read on the socket, if select was called one more time (after data has obviously arrived), then select fails to notice. That implies that glibc select() only checks for socket readiness whenever the kernel signals that the socket is ready, and not when it is initially called.

From the select(2) man page, there exists no such condition stating that the data must become available after select has been called and not before.

That's a major bug if I've ever heard of one. Hmm... it's too bad my project can't wait until the next release of glibc, when someone might have corrected this.

Firefox Keyboard Shortcut for CloseOtherTabs

Do you ever find yourself surfing the net with several tabs open and suddenly experiencing an overwhelming urge to un-clutter your browser?

I certainly do. The most frustrating part about it all is that one is forced to select some tab, right-click, and then select 'Close Other Tabs'.

The Default keyboard shortcuts in the en-US version of Firefox are somewhat backward in my opinion. Practically every window manager has its own 'Close Window' shortcut key. In Windows it's Alt+F4, like it is in Gnome.

So why does Firefox need to duplicate a function that the window manager most certainly has? Firefox has its own built-in 'Close Window' shortcut which is 'Ctrl+Shift+w'. This key combination would be much better suited for 'Close Other Tabs'.

I hope that they at least make a Preferences section in Firefox 3.0 so that people can customize the shortcut keys.

20071103

Upgrading to Gnome 2.20 with Gentoo

Hi Everyone,

I thought I would post my experiences upgrading to Gnome-2.20 on my Gentoo box. In general, the upgrade was painless, but there were a few pitfalls that can be easily avoided.

This post was originally written on November 3rd, 2007, and most of the Gnome-2.20 packages were marked ~x86.

  1. Add these entries to /etc/portage/package.keywords.
    [ Updated: 2007-11-14 ]
    [ Updated: 2007-11-16 ]
  2. Due to bug #196621, you will need to edit your yelp use flags in /etc/portage/package.use
    gnome-extra/yelp -debug
  3. emerge -avD '>=gnome-2.20'
Ta-da!

[ Update: 2007-11-16 ]
Note: After performing the initial upgrade, then performing an emerge --sync at a later date, some of the package versions may have disappeared. Since all packages in the above file use absolute package versions, another attempt to do an emerge -D --with-bdeps y '>=gnome-base/gnome-2.20' could result in slot-version collisions within emerge (see bug #199359).

Lastly, I'm not sure if this will be the case for everyone, but I had to re-emerge gok, notification-daemon, gnome-applets, and gnome-python-desktop because gnome-applets was emerged in improper order, pulling in a previous gnome library. You can verify this by running revdep-rebuild -pv before re-emerging these packages.

emerge -av1 gok notification-daemon gnome-applets gnome-python-desktop

Currently, I'm not using the binary ATI drivers (ati-drivers-8.42.3), but I'll test it out and see if there are any conflicts.

Unfortunately, I would also like to upgrade to >=xorg-x11-7.3 / >=xorg-server-1.4, but ATI's current drivers for x86 will not work with >=xorg-server-1.4. Since I'm only using the open source radeon driver at the moment, I'll give that a shot before I test out ati-drivers-8.42.3.

Happy Gnome-ing :)

20071030

Restore-Points in Gentoo Linux

Today I was very tempted to upgrade my Gnome desktop to version 2.20, which is in the Portage tree, but not yet marked stable. Then I thought to myself - remember what happened the last time you attempted something like this? I spent the entire day simply trying to figure out which packages to downgrade.

Gentoo's Portage package management system is excellent because of the fine-grained control provided to the administrator over which packages and which options (USE flags) are installed. Again, on the plus side, a local repository of binary packages can be created (with FEATURES=buildpkg) so that packages need only to be compiled from source at least once. I write 'at least once' is because a package will need to be recompiled whenever a version number changes (obviously) or whenever the USE flags are changed. None of us really like that, but it's a fact of life.

Now, taking a slightly deeper perspective into the concept of a local repository, there are a few different ways of organizing this. If you think of all of the variables involved with the instantaneous state of a portage-based system, ignoring overlays for now, the collection of all installed packages becomes a (lengthy) one-dimensional 'tuple' at any particular point in time.

Now, lets say that each binary package stores all of its dependency and USE flags when it is created. Then, theoretically, we could do a complete re-installation of all of the packages on a system with the binary packages alone.

In this repository, for the sake of sparing disk-space, we would likely just dump unique binary packages in a position that would be written down in a massive table. From the simplest perspective, we could simply duplicate the entire table (actually, a look up table) whenever a package or USE flag had changed.

That would probably end up being a horribly inefficient waste of space. But on the completely opposite end of the spectrum, if one was to account for each package, and create variable, off-shooting dimensions of each tuple element whenever a new version was introduced, or when a USE flag was changed,

When a USE flag is changed, then so do the dimensions of each of the elements in those tuples. In fact, what we would observe is a hyper-volume of data pointers where each element is of varying dimension and size. If one was to attempt to visualize this, it would look something like a fractal hyper-image, where the residuals of each change dieing off after some amount of forking.

The obvious trade-off is complexity versus storage space... although, think since this repository would only be storing tuples of locations on disk, then the storage space might not be so high. Although, the size of the hyper-volume would increase exponentially with each new package added. On the other hand, the 'fractal' approach would be much harder to navigate (there might be some way to organize it in a hashing system). I'm not sure if it would be faster or slower.

In any event, one would need to call a tuple out of this repository and then re-install the binary files. The recorded tuple would then be a restore point.

20071020

My Ideal Laptop

It's come to the point that I'm considering upgrading my laptop - but I haven't seen anything on the market that's ideal for me. If you know me personally, you would know that I have been a bit of an environmental nut since I was 10 years old, and that I am also an electrical engineer, embedded systems engineer, and completely obsessed with Linux. As such, I have some pretty interesting ideas of what the 'ideal laptop' would mean to me.

My ideal laptop would be one that is highly portable, environmentally friendly, and energy efficient but with a fair bit of number-crunching and graphics processing power. It should not be assembled or manufactured by poorly treated employees either. My final and least-likely-to-be-realized preference is that my ideal laptop would also be one that could be tracked if stolen[2]. It also goes without saying, that my ideal laptop would utilize hardware with open-source drivers so that one would not be stuck with any inferior, proprietary operating systems.

Throwing all of those ingredients into one pot makes for a fairly difficult main course. The question is, which company will possess the techno-culinary expertise to prepare the appetizers?

There has been much more debate and demand for environmentally friendly computing products than someone from an older generation would think[1]. However, many of the Y-Generation were brought up during the 80's when the environmental movements really began to boom and, therefore, have a much more intrinsic concern about environmental impacts.

On the other hand, the anti-theft system (ATS) is still a relatively new concept. I have personally taken it opon myself to design an personal area network (PAN) ATS for valuables such as electronics or cycles, but between my engineering job, my master's education, and now my baby on the way, I no longer have a plethora of free time for dreaming up gadgets and new designs.

If you can suggest a laptop that is currently on the market today that has similar specifications to those below, please let me know.
If you would like to see a company producing laptops with the specifications below, let your voice be heard & submit a comment.

Mechanical Specs:
  • 12 or 13" Display, ACPI-compliant, with multi-level dimming capabilities
  • Light-weight, aluminum chassis
  • Very quiet, as quite as a MacBook
  • Overall maximum weight of 3.5 lbs ( without AC adapter)
  • Magnetic AC power connector
  • Light-weight, biodegradeable, non-plastic casing.
Core Features:
  • Dual-Core Processor ~ anywhere from 1 to 2 GHz (frequency stepping is a must)
  • 1GB of DDR SDRAM, expandable to perhaps 4GB
  • A graphics chip w/ 64 MB of dedicated DDR SDRAM
Storage:
Networking:
  • 802.11 a/g Wireless
  • 2.1 Bluetooth
  • 10/100 Mbit or Gigabit Ethernet
Peripheral Ports:
  • 4 USB 2.0 connections, with 2 having power distribution capabilities
  • s-video (or something similar) for input / output
  • audio input / output connections
Sensors:
  • Built-in microphone
  • Built-in 2 mega pixel camera
  • GPS receiver
Green Characteristics:
  • Full ACPI Compliance and sleep states for all devices
  • Longer battery life ( please, no optical or magnetic drives )
  • Biodegradeable, non-plastic casing ( corn-based ?)
  • Lead-free chipsets ( possibly free of other toxins as well )
  • AC power adapter with auto-off capabilities and magnetic connector
  • Built-in RFID chip for easy component identification during recycling
Security Features:
  • Built-in biometric sensor (BMS) for secure user authentication (i.e. thumb print)
  • Built-in RFID chip, for anti-theft-system (ATS) / tracking
  • Built-in GPS receiver, for ATS and user application
  • Built-in GPRS data-only transceiver for ATS and user application
  • Secure-bus lines (internal PCB layer, covered vias) for ATS, DRM[3], BMS

If you have any suggestions of something that is currently on the market that closely matches these specifications, aside from the OLPC[4], please submit a comment.

Alternatively, if you would like to hire me as an engineer to design such a laptop please let me know.

[ Update: 20071118 ]
Here is some info from the IEEE regarding standards for greener consumer electronic devices.

List of Similar Laptops & Shortcomings

Dell Latitude D430:

If one navigates to the Dell site and selects the small business / notebook links, one would notice that there is a small image that says 'Windows XP Optional'. When the visitor proceeds to customize the notebook, Windows XP is, in fact, non-optional. Dell, take off whatever the price is of Windoze these days and offer an operating system free and / or Linux installation. Then I might consider buying this notebook.

Dell, I do very much respect the step forward by offering solid-state media instead of magnetic storage. Although the $1000 jack in price seems unfounded, especially when
Transcend has such excellent deals on a solid state disk at the moment, like the ones here and here. At any rate, if I could purchase this notebook without Windows and without an internal optical drive, then it would be a done deal, and I would just buy the flash disk from Transcend.

Apple MacBook:

I really like the MacBook, although the case material is plastic and I've heard horrible things about the Nazi-esque factories where Apple assembles the iPods in China... of course that hasn't stopped thousands upon thousands of people from buying Apple products in the past. I bought my iPod used ;-)

The MacBook is good because it has a dual-core Intel chip running at 2GHz. The screen-size is also a modest 13", which makes for a very portable notebook computer. A few friends of mine have one of these babies, and I very rarely ever feel the machine get hot, and the fan is as quiet as a mouse. The MacBook has a very decent battery life and also has great power management.

Putting Gentoo Linux on a MacBook is also very possible, but can cause conflicts with the Mac OS X. What I would most likely do, is completely remove the Mac Hard disk, and add a Trancend SATA solid-state-disk of 32 GB in size instead. Then I would have the original Mac disk image available if I ever needed to use it and I could format the original magnetic SATA disk and use it externally.
I think that I remember reading a rumor about Apple launching a product targeting at the Japanese market with an SDD and no optical drive. Hopefully that happens soon and they decide to expand to western markets as well.

Since I am attending a university in Germany, I would receive a 10% discount at the Apple.de Educational Store. The student discount in Germany is even more of a deal than that in Canada, after considering taxes.


[1] Some articles about environmentally friendly computing, going as far back as 1998:
Toshiba Satellite 2510, Asus U5, Wal-Mart & Toshiba, OLPC, Consumer Demands

[2] I claim prior art to some of these device specifications going back for several years if a patent lawsuit ever arises.

[3] In full awareness of the current anti-DRM movement, I still feel that artists should be able to protect their works in an open, but still technologically secure manner. My position on DRM is that publically free media should still function on a system that is DRM-compatible, as should DRM-impaired media.

[4] I am in no way knocking the OLPC project, and feel that it's a pioneering endeavor that all manufacturers should strive to match, in terms of energy efficiency. The plastic casing, on the other hand, is a bit of a minus.