geek events

September 10th, 2006

Over the years I've been reading the Gentoo newsletters and there have been quite a lot of events happening all over the place (especially in Germany), although I was always far away from it all geographically. But now that I start from Holland, I can make the trip without as much of a hassle. I looked around the web and I found these events of interest in the upcoming year:

That is a lot to choose from, I never knew there were so many. I've already registered for the NLUUG event next week. I was meant to visit FOSDEM this year, but I missed it, so I'd like to go next year. Then there's CeBIT, always wanted to go to that. And since the LinuxWorld Expo is in Utrecht, I have no excuse to miss it. :D

So that, I think, is the plan for this year. As for the other events, maybe in the future sometime. One thing for certain, it sure is practical to live in Holland rather than the high north in terms of geek events. :D

If you want to put together your own agenda, most of these events are listed on Wikipedia.

find sizes of installed packages

September 9th, 2006

Sometimes, especially when disk space is low (or when system backups grow unreasonably large), it's nice to know exactly how much space the biggest packages occupy. Obviously, OpenOffice is never above suspicion, but certain others can take up way more space than you would think.

I wrote a little script to print the size of all packages installed on the system. It uses the CONTENTS file for every installed ebuild to check the size of the files which belong to a package and give a sorted listing of packages by size.

#!/usr/bin/env python
#
# Author: Martin Matusiak <numerodix@gmail.com>
# Licensed under the GNU Public License, version 2.
#
# revision 1 - bugfix for paludis symlink in pkgdb

pkgdb = "/var/db/pkg"


import os, string, stat
from operator import itemgetter

sizes = {}

cats = os.listdir(pkgdb)
for c in cats:
	cpath = os.path.join(pkgdb, c)
	if os.path.isdir(cpath):
		cat = os.listdir(cpath)
		for p in cat:
			size = 0
			
			cont = os.path.join(pkgdb, c, p, "CONTENTS")
			fd = open(cont, 'r')
			
			strings = fd.readlines()
			for s in strings:
				line = string.split(s, " ")
				if line[0] == "obj" and os.path.exists(line[1]):
					size += os.path.getsize(line[1])
			
			fd.close()
			
			sizes[os.path.join(c, p)] = size

pkglist = sorted(sizes.items(), key=itemgetter(1))

for i in pkglist:
	(size, pkg) = ( str(i[1]), i[0] )
	print string.rjust(size, 11), " ", pkg

The output looks like this:

          0   virtual/x11-7.0-r2
         66   kde-base/kde-env-3-r4
        393   kde-base/kdebase-pam-6
        889   sys-apps/coldplug-20040920-r1
...
      94217   net-ftp/ftp-0.17-r6
      94642   kde-base/kcminit-3.5.3
      95629   sys-process/psmisc-22.2
      95931   sys-apps/ivman-0.6.12
      97358   app-admin/gnomesu-0.3.1
...
  122593614   dev-java/sun-jdk-1.5.0.08
  132864794   dev-lang/ghc-6.4.2
  145477793   app-text/tetex-2.0.2-r8
  221943002   sys-kernel/gentoo-sources-2.6.17-r7
  340336824   app-office/openoffice-bin-2.0.3

Unsurprisingly, OpenOffice claims victory, but this is a small reminder about how big kernel sources are. Tetex and GHC aren't minimalistic either.

UPDATE: Paludis bug fixed.

new shopping adventures

September 8th, 2006

Yes, I know I've talked about shopping in Holland before, notably grocery shopping, but this keeps coming up. Aside from deciphering opening hours, figuring out what to buy (using algorithms to determine it), and paying for it, there are new aspects of this activity that come to fore ever so often.

See, in my area there is one Lidl, and a bunch of Albert Heijns. Not much of a choice at all. I'm sick of Lidl, because although they're cheaper, they have the most wacky set of items. All kinds of ultra cheap products that I'm not so confident about buying, but very lacking in the realm of common products. So I stopped going there, which means I'm left with Albert Heijn. Now this widespread Dutch chain is somewhat peculiar.

See, in Norway, if you go to Rema1000, you know that it's open 9-21 (9-18). Weekdays until 9pm, Saturdays until 6pm. And it doesn't matter which Rema1000 store you go to, every single one has the same opening hours. There may be some exceptions for stores that are dead in the center of a city, there may be longer opening hours in the summer, things like that. But for the most part, 99% of the time, you know that this store is open at certain hours everyday.

Albert Heijn, meanwhile, doesn't play like this. They categorize their stores by location and size. And then set opening hours individually for each store based on that. And based on the season. And based on the formation of ice glaciers in Antarctica, seemingly. What this means in practice, is that whenever I need to go shopping, and it isn't within the dead certain opening hours (10-18), I have to check when they're open. A few months ago when it was cold, I couldn't find a single open Albert Heijn in all of Utrecht on a Sunday. Last Sunday there were 5. Next week noone knows. Today (Thursday) they're open until 21, but in winter usually until 18. So while they enjoy rolling the dice in Albert Heijn head quarters, I'm left wondering.

Another thing that's causing me distress is being pulled over for speeding. As such, my location is sub-optimal, I live about 100m away from the main police station in Utrecht. And I don't care to bike any more in line with party policy around that building either, I still do what I've always done - bike with common sense. The other day I did something less than brilliant. I was crossing a street (with no traffic) on a red light and there was a car coming up on my left (I was on the bike sidewalk). It was turning right, while I was going straight. Turns out it was a cop car on a half-siren (lights flashing, no sound effects). I didn't see it until I was actually in the middle of crossing. It's a good thing they were busy.

Then I get to the store (did you think we were done with that topic?) and I'm parking my bike. It doesn't have a kick stand, so I have to lean it up against something. It's after 8pm, so the main shopping rush is long gone, there aren't that many bikes left in the little bike parking lot. As I'm locking my bike, through the rear wheel, the front leans over to the right a bit and falls on the bike that was standing next to it. So the bike is now in free fall, it falls onto the bike next to it and both of them go down. This wouldn't happen at rush hour, the parking lot is densely populated then. But at this time, the bikes are about 1m apart and this domino effect is made possible. I finish locking mine up, then I go over to the other two and put them up. As I'm doing this, a guy comes up to one of them, it's his bike. I say "sorry about this" and he gives me the most distant and careless "no problem" ever. I almost expected him to say "dude, that's exactly how I park my bike, I just throw it on the pavement". Well, most of the bikes in circulation are from World War 2, so it's not like I knocked over some delicate machinery, but you would still expect people to care at all. I bet I would get stick (or at least nasty stares) over this in Poland. :D

So I go into Albert Heijn and here's the thing. There's no bread after 11. They put out the bread in the morning, people buy it and if you come in at noon, it's all gone. All they have left for you is either some fancy, expensive bread, or alternative bread products, like bread with raisins dipped in sugar etc. This used to be a problem for me, my bread consumption is really high. But recently I stopped buying bread and I only get Wasa knekkebrød.

Then I go to the checkout and here's another Dutch quirk. In Norway, we have a conveyor belt leading up to where the cashier sits, then another belt right in front of her, finally a third conveyor belt beyond that. So all in all, the length of the whole thing is about 4m or so. This ensures that even when people do volume shopping (ie. a shopping cart and a half), there is enough space for them to unload their stuff, then load it into plastic bags. There's also a sliding divider at the end that separates your items from the next person's. Over here, (it does depend on the store a bit), the belt going to the cashier is shorter. So there's a lot less space on it. Then the belt from the cashier is shorter too, in some cases it's not even there, just a small counter where your items accumulate before you load them up. This makes it more awkward around checkout, there's less space, you try to stack your stuff in layers so that you can unload it all onto the belt and put the basket away. Then after you pay for it, sometimes your stuff gets mixed up with the person coming after you. If there's no belt going from the cashier, you make people wait for you to load up your stuff before the next person can go as there's simply no space. At Lidl, they actually have an extra long belt to the cashier (implying that people will be buying in high volumes) and then just a small counter afterwards (so after being scanned, their items will fall on the floor unless you bring trained packaging personnel).

Unfortunately, there is no Plus in my area. That seems to be the-supermarket-for-Norwegians, their stock is arranged logically, their checkout counter is normal size, they accept credit card on payment etc. It's also a little cheaper than fancy Albert Heijn. Sort of the Rema1000 equivalent.

what I like about Firefox2

September 7th, 2006

Firefox 2 is in beta currently, beta2 release candidate 2. So that means it's going to be some weeks before v2.0 goes gold for public consumption. I was a little hesitant about installing the beta, knowing that in the past upgrading Firefox has brought with it bugs and certainly shut off popular extensions.

What most attracted me to it was whispers that the memory leaks have been greatly reduced, and performance improved. Firefox (originally Phoenix) started out as a nice stripped down version of Mozilla. Then gradually, it accepted so many features that it became rather heavy, especially on slower machines. It is a good thing that performance is being addressed continually, even though I doubt Firefox will ever match up to Opera in that regard. I haven't run any benchmarks to verify, but the new Firefox does seem a little faster. Noticeably, scrolling is faster.

A welcome new addition is a built-in session saver. I have been using the SessionSaver extension since the dawn of man basically, finally it is a built-in feature. When you close Firefox (or it crashes), it will restore your tabs and pages opened in them (new option in the settings).

Tab handling has improved. Every tab has a close icon, but you can also close tabs by middle-clicking on them. I thought this was a bug to begin with, I accidentally closed a window while filling in a form, but it's just a quick way of closing tabs. If you do close a tab accidentally, use History > Recently Closed Tabs to bring it back.

A new feature is a built-in spell checker (supporting a range of languages) for all form input. It highlights typos as you write, with the familiar red underline. While this isn't something I consider a major breakthrough, I'm sure a lot of people will love it.

Finally, a bug fix. in Firefox1.5, when you have the bookmarks drop-down menu open and you scroll with the mouse wheel, it will cycle between tabs. In Firefox2, it does the logical thing - scrolls the drop-down menu.

Extension wise, Adblock and Flashblock both work, Dictionary lookup doesn't yet.

DRM getting to be a serious pain in the ass

September 6th, 2006

No pun or euphemism this time, the title says it all. Years ago Jon Lech Johansen broke the code that prevents DVDs from being played on software that isn't supplied by the movie industry, in an effort to play back store bought DVDs on his linux system. He was sued (with considerable pressure from our friends in the US), and cleared of any wrong doing. To complete the story, needless to say, there was not even one piece of software for linux at the time, supplied/endorsed by the industry, to play DVDs. And there isn't today, as far as I know.

So today people can play DVDs on linux, but not in a legal way (depending on where you live, hopefully not in the US). Jon's work has also given rise to projects like divx, xvid and the general mass distribution of movie titles, because he released the code openly (which made it possible to read DVD discs), and not just in a ready-made application. So much for DVDs.

Let's switch to music. If you buy and mp3 player today, most likely it will only work with the egregious Windows Media Player and put all kinds of restrictions on how you can transfer songs to it and how you can transfer songs from it. Not to mention that it completely kills your choice of what music player to use with your mp3 player. Not only that, most players don't support a free and open format like ogg vorbis, they will support mp3, wma and whatever proprietary bs.

If you buy and iPod, you can use it with iTunes (and probably Windows Media Player), but you certainly cannot use it on linux. That is, until someone wrote the code to allow you access to it. You also don't get to play ogg files. iRiver, the manufacturer I have given much credit (and a couple of sales through recommendations, in fact) switched their newest product lines to the Windows Media Player hell, so now if I buy a new player from them, I can't use it on linux anymore. There are companies that do support (or at least not block) linux on their players, but they're few.

So you see, when you buy a song from iTunes today (which you shouldn't, if you value your freedom), you don't actually own the song. You own it on iTunes and your iPod (and probably Windows Media Player), but no further. Not on your iRiver, not on another device or even music player software. I read a blog entry where someone described how they bought a Seinfeld DVD only to find out it was completely useless to them as the person could not play it in linux, because of DRM restrictions.

DRM (Digital Rights Management), ie. restrictions on how you can use digital content, is an abomination and I encourage anyone buying any kind of digital content to be very vigilant about what exactly they are paying for. Check all labels on the box, ask the salesman if necessary (chances are he won't know much). If you buy online, check the licence agreement (or simply google/wikipedia for an opinion on the company's restriction policy). Above all: research, research, research. Or be stuck with a product you can't use and a store that won't let you return it.