reinstalling windows sucks

Luckily my parents laptop came with a windows xp pro cd and a valid product key. So, after backing up important files using ubuntu, I proceeded to install windows. I had forgotten how annoying installing windows can be.

After having seen ubuntu the experience is, well, extremely user unfriendly and extremely likely to end in disaster unless you know what to do. For the record, the ubuntu live dvd recognized all hardware out of the box without any intervention. Impressive.
The easy, but tedious, part is putting the windows cd in the tray. Then the installer gives you a few seconds to trigger it by hitting enter. Then you are confronted with a slowly loading text only wizard where you will have to do something very risky: removing a partition and creating a new one. The provided tool for this is outdated by the standards set by linux distributions. The point of this step is to start with a clean disk, so getting this right is important. 99% of the user population would at this point likely make the wrong choice and either end up installing a very old xp over their existing installation or installing it in some weird location on a harddrive that is still full of spyware. OK, been there done that so, clickety and nice clean drive.

Then it starts copying. It reboots. More copying and then some questions about where I am. More copying. Product key. More copying. Modem & Network settings. This fails but I end up being online anyway (network cable plugged in so how hard can it be)? Another reboot. Then during the first boot a wizard with an annoyingly loud shitty music in the background. At this point my laptop’s volume buttons are not yet operational (have to be logged in?). Activation and finally done. It takes about one and a half hours and it requires constant fiddling with wizards so you can’t just leave it alone to do its thing.
Oh wait. We’ve just started. This is an old windows cd, I do not yet have the billion security updates that are the whole point of this operation and that do not install themselves without manual intervention. OK, two hours later I’m patched all the way up to two years ago (sp2). Now the auto update finally kicks in. Another hour, three reboots and 50+ security updates (not kidding) later it is finally over, I think.

Oh wait. Much of the hardware is actually not working correctly. Stuff like my usb ports, pc card slot, video graphics chip are all not working correctly. Nor is my wireless card (smc pcmcia card, plugging it in hangs the system). And damn this internet explorer default page is annoying. And thanks for showing me this unavoidable welcome to windows promo again (you have to watch it to get rid of the annoying traybar icon). And no thanks for the hotmail msn thingy.
Turns out the compaq support site has a nice list of stuff you could install. The problem with this site is twofold: there are multiple things to choose from without any clear guidance on what to install and what not to install. Secondly, all downloads (and there are a lot) are conveniently named sp4325345345.exe where the number is the only thing that varies. The idiot who invented that naming scheme should be taken out and shot. Anyway, I installed half a dozen of their driver packs and everything seems to work now. At least several of the downloads there are crucial to the correct operation of the laptop.

No way my parents could have done all of this on their own. The sad truth with windows is that if it is not configured correctly out of the box, it is really difficult to get everything working correctly. My mother was asking me this weekend if she could do it herself or go to the shop to have somebody do it. If only that were possible :-). In terms of labour cost, the price is a nice low end PC just waiting for all of the above to complete. Of course there is plenty of opportunity for mistakes so realistically it is probably cheaper to just go to dell and buy new hardware & software.

suspend to ram

Over the years I’ve encountered, and resolved many annoying software issues with Microsoft. This one surely counts as one of the more annoying ones.

The problem is that my previous PC had a beautiful suspend to ram feature, which basically means that whenever you put the machine in stand by mode the system turns of almost completely except for a bit of power to keep the memory going. The technical term for this is ACPI S3 mode. My new PC however, suspends using ACPI S1 mode which means it goes stand by with the harddisk still spinning and the fans still blowing, not my idea of stand by. Naturally this was something I wanted fixed really badly. So I enabled the feature in the bios, set all the power options in windows as they should be and …. no success.

My mistake was to assume that this is a hardware/bios problem. So I kept checking the asrock site for bios updates and browsed through their FAQ, double checked bios settings drivers, etc.. Since this isn’t a problem with their hardware, bios or drivers after all, no solution was found this way. Next stop was google, but I still had the asrock keyword as part of the query so nothing useful came out of that. Then I just gave up and for the past few months I’ve been shutting down the pc completely.

This morning I googled for “force s3 standby” and ended up on this site. I learned a things here:

  • My system supporst S3 just fine, I checked using this sleeper tool.
  • Users with completely different hardware are experiencing the exact same issue (and are equally frustrated).
  • There’s a registry hack you can do but it doesn’t do much good on its own.
  • There’s lots of useless advice on enabling/disabling wake up from standby options on usb devices (my mouse and keyboard are ps/2!).
  • There’s a tool called dumppo which supposedly does something useful.

Ok, the next google query concerned dumppo, which got me here. It appears that this is a Microsoft provided (but totally undocumented) utility that you can use to check and change the ACPI settings. Sure enough my “Min sleep state” was set to S1. The reason? I installed windows XP before I enabled suspend to ram in the bios. Doh! Apparently the ACPI settings are determined forever during setup and no functionality to fix this is included with the OS. After the installation you’re screwed no matter what you toggle in any control panel, bios or other screen. Windows XP just keeps insisting that S1 is the way to do standby.

Dumppo (download from microsoft) apparently is the only way out (short of reinstalling XP). A simple “dumppo.exe admin minsleep=s3” on the command line fixes the problem. Of course this wisdom is not officially documented anywhere on the Microsoft site. There must be millions of users out there that are unable to suspend to ram because of this. Basically all computers sold in the past few years are technically capable of suspend to ram. Many of them have the option disabled in the bios by default.

Anyway, problem solved :-). Just one of these issues ordinary users will never ever figure out. I must have solved hundreds of these issues over the years.

New PC & moving itunes library

Update 30/07/2009I just bought an imac and moved the same, but now consolidated, library over to it. Check out the instructions here.

Whoohoo! My new hardware has arrived, last week. I’ve been busy playing with it so that explains the small delay in posting.

Right now I am still going through the tedious procedure of getting everything the way I want it. I have a local network so I can access my old PC. However, dragging my external HD between the two machines is much faster.
Tediousness includes copying my itunes library. Tricking itunes into accepting the old library is somewhat of a challenge. But that’s what’s google is for. Since I found google’s answers a bit disappointing (lots of drag this folder there type of stuff from Apple users), I’ll post some detailed instructions for real users who do not “consolidate” to the itunes folder but choose to keep their music organized manually. To add some difficulty, my new machine has no second harddrive so the paths are different after copying.

If all goes well everything is moved (music, playlists, play statistics, ratings) AND I can sync my ipod with the new pc without that requiring it to be wiped and refilled with the moved library. I’m moving the library, not recreating it.

The Itunes library consists of only two files, its own itunes music folder and whatever external directories you imported (two in my case). One of the two files is a binary file, the other one is an xml file with data on all your songs, including path names, statistics, ratings, etc. Essentially, the xml file contains everything we want to migrate except for the mp3s. Unfortunately, moving the itunes library is not as simple as copying the files to the new machine. Sadly, Apple deliberately made it hard to do what you are about to do. So here’s a step by step guide (windows specific though Apple probably is about the same):

  1. At all times, keep at least one intact backup of all files mentioned in this post. Never work on the originals. Preferably, leave the original library untouched, you can always go back to that.
  2. Start by copying your mp3 folders to your new machine. That may take a
    while. Make sure they are where you want them to be. It took 20 minutes for my folders using an external HD, not
    counting the time it took to create the backup from scratch on
    the external hd (basically I used my incremental backup). Also copy both Itunes files (xml and itl) and the itunes mp3 folder (if not empty)
    onto the external hd.
  3. Now dowload, install, run & close itunes. It will create an itunes
    directory for you the first time it starts, that’s where it will look for its files. Replace the stuff inside this directory (My Documents\My Music\iTunes) with the
    backups on your external hd (including the itunes music folder). Now here comes the tricky part. Thanks for
    this post for putting me on the right track! DO NOT start itunes again until after the steps below.
  4. First fix the pathnames in the xml file. They still point to the old location. Open the file in a capable editor, the thing to look for is search and replace functionality. Search and replace the parts of the path names that are now different: your itunes music folder and any other folders you imported in your old library. Save the file.
  5. Now this is important: iTunes will ignore whatever path info is in the xml file! Unless the itl file becomes corrupted. We can fix that! Open the itl file in an editor, delete the gibberish inside, save. Your itl file is now corrupted, normally this is a bad thing. You still have the xml file though (and a backup of the itl).
  6. Start itunes, it will ‘import’ your music and afterwards complain that the itl file is corrupted, let it fix it.
  7. Check if everything is there. In my case I messed up with the search and replace and some files were missing. Just go back a few steps, copy your backups and retry.
  8. Done. Everything now is on the new PC. What about the ipod? Just plug it in!. You already installed iTunes on the new machine so you have the drivers for your ipod. The key or whatever itunes uses to recognize you ipod is in the xml file. And now also in the recreated itl. Apparently the xml file is sort of a backup of the itl. I suspect the itl is a bit more efficient to manipulate programmatically. I have no idea if this preserves any itunes store stuff you purchased. Presumably, this involves deauthorizing your old machine and authorizing the new one. I never used the itunes store so it’s not an issue for me.

The only thing I lost in the transition is some iTunes preferences that are easy to restore. For example I had some of my playlists set to shuffle. The imported playlists no longer had the shuffle enabled. Big deal. The preferences probably aren’t part of the library. I noticed that the shuffle settings do not sync to the ipod either. This is annoying actually because the shuffle settings is deep down in some menu on the ipod and I only want to shuffle playlists. I like my album songs served up in the order that they were put on the album.

I’ve used winamp for most of the past decade (I think from 1996?). Only when I got my ipod a few months ago, I started using iTunes, by choice. There is an excellent winamp plugin which will allow you to sync winamp with your ipod. Presumably, moving a winamp library is a lot more easy since winamp uses a file based library rather than a database. However, the main developer has left AOL, so winamp development seems a lot less interesting these days. AOL seems to just pile on commercial crap with every release. So I’ve given up on it for now.

wireless hell (2)

The story below has gotten a little long so I’ll summarize for the benefit of those with similar problems:

I applied various solutions to the connectivity and stability problems I encountered:

  • My PC froze up every half hour. This required a reboot and then unplug/replug the usb stick and then repair the connection.
  • I noticed gaim reconnected every few minutes. Connection was marked as good and then it was suddenly dropped.
  • Sometimes my router could not be found at all and then one minute later it had an ‘excellent’ connection

Here are the solutions I applied:

  • Look for firmware upgrade. In my case there wasn’t any but if there is this may be your solution
  • Look for driver updates for your wireless card/usb stick. Generally the software on the cd is obsolete. This applies to any hardware you buy.
  • See if you can live without the wireless monitor thing that was installed along with the driver.
    • Uninstall the software and driver
    • make sure you have the (downloaded) driver somewhere on disk
    • reboot
    • windows may recognize your usb stick on boot, opt to select the driver yourself and then to locate the driver yourself
    • If windows does not detect your hardware, go to control panel-systems-device manager. Likely there is an exclamation mark at the icon of the device. You can fix the problem by rightclicking, properties and then install the new driver. Alternatively you can use the find new hardware wizard.
    • If all goes well, you can now configure your wireless connection through the default windows wizard. It is less feature rich than your monitor app, which is just fine if all you want is a network connection.
    • Some of the more advanced/non-standard features may not be available to you. Most notably, non standard speeds such as 108mbps. This does not really as matter as much as you might think since those speeds are based on compression rather than actual bits. Hard to compress data like multimedia, photos and compressed binaries do not really benefit that much from this network layer compression.
  • You may have disabled upnp in the past. In it self this is a good thing because you probably don’t need it. Unfortunately, in my case the driver depends on this service. So, go to control panel-administrative tools-services and set the upnp service from disabled to automatic (this means it will start if it is required).
  • If connectivity problems remain the reason may be interference from other devices. Most wifi cards default to channel 1 (this is a busy channel). Depending on where you live you may select from 11 or 13 channels. Some of these channels have overlapping frequencies. Channels 1, 6 and 11 do not overlap. You can configure the channel on your router and may need to configure it elsewhere to. I set the channel to 11 and the number of disconnects has dropped substantially.
  • Figure out type and brand of the faulty hardware (and possibly of the chipset in that hardware) and google for your problem. Likely you will find this site if you have the same hardware as me: a motorola sbg900e cable modem and a siemens gigaset 108 usb wlan stick. You may find it useful anyway even if you don’t have the same hardware.

This more or less solved my problems. I still encounter the occasional disconnect. But it now reconnects immediately, by itself. A smart download manager, gaim and most media players should survive the brief disconnect without intervention.

If the above does not solve your problem, bring back the hardware to the store and change it for a different brand. Seriously, having to go through all of the above constitutes a really bad end user experience. Things are definately not working as advertised and you are entitled to complain, loudly! Most shop people are totally incompetent so be understanding of their ignorance but insist on a replacement or refund. Don’t accept the same brand unless you are sure you had a hardware failure. If you do so anyway, make a deal with the shop that if the replacement doesn’t work either he’ll refund.

If someone from Siemens reads this: you people suck. Your software is absolute crap and you know it.

Howto start jEdit

At work I am (in)famous for being responsible for getting jEdit onto everybodies desktop. Despite this everyone uses textpad :-/. These primitive souls are perfectly happy (or ignorant?) not using syntax highlighting, not having their xml validated, not being able to search and replace using regexs, not being able to indent their xml files, not having autocompletion, etc.

Anyway, one of the nastier aspects of jEdit is integrating properly with windows and configuring it. Older versions included a convenient but broken .exe frontend. Newer versions require some manual setup to get going.

First of all, the jvm matters. jEdit runs faster and prettier with jre 1.5. Second of all, select native look and feel unless you really like the shitty java look and feel.

A crucial thing is to provide enough memory AND specify a small enough minimum heapsize. Contrary to the popular belief, java programs are quite efficient. jEdit for example can run with just 10MB of memory heap. Unless of course you open up big files or multiple files in which case you may need more than that. The trick with Java is that you can specify upper and lower limits on the memory heap. The garbage collector will never shrink the heap below the minimum or grow it above the maximum. With jEdit, most of the time you don’t need that much, so specify 10Mb as the minimum. You may need more sometimes though, especially when you are running lots of plugins so specify 256 as the upper limit (probably way more than jEdit will ever use).

Another crucial setting is -reuseview which will allow you to reuse already running jedit windows for opening new files.

Use the following settings for a shortcut:


javaw.exe -Xms10M -Xmx256M
-jar "C:/Program Files/jEdit 4.2/jedit.jar" -reuseview

I also have a nice cygwin shell script to be able to open a file straight into jEdit.


#!/bin/bash
currentpath=`pwd`
javaw -Xms10M -Xmx256M
-jar "c:/Program Files/jEdit 4.2/jedit.jar" -reuseview `cygpath -w $currentpath/$1` &

An ‘open in jedit’ context menu option can be obtained by importing this registry setting (create text file jedit.reg and paste stuff below, save, double click on the file)


Windows Registry Editor Version 5.00

[HKEY_CLASSES_ROOT*shellOpen with jEdit]

[HKEY_CLASSES_ROOT*shellOpen with jEditcommand]
@="javaw -Xms40M -Xmx256M -jar \"C:\\Program Files\\jEdit 4.2\\jedit.jar\" -reuseview \"%l\""

Edited as suggested in the comments, wordpress conveniently removes slashes when you save the text :-(.

Update 02-04-2011:

It’s been a while since I wrote this and when I hit my own post accidentally with a Google query, I knew it was time to do a little update. All of the above is still valid as far as I know, except I now use a mac. For a mac, or in fact any linux/unix type installation, there’s a convenient way to start jEdit from a bash function. Just include the line below in your .profile or .bashrc (adjust paths as needed of course):

function jedit() { java -Xms15M -jar /Applications/jEdit.app/Contents/Resources/Java/jedit.jar -reuseview "$@" &}

Update 11-07-2011:

The above line of .profile voodoo is now also available on Gist, the code snippet sharing site on Github.

Back online

Yesterday I came home, switched on my pc, started Firefox and got a connection timeout on the start page. From there I followed my usual debug & escalate scheme: try to ping a domain, then an ip number, restart modem (no connection, no line sync), run diagnostics on modem (indeed unable to connect). I then rechecked all the modem and network settings, waited a bit to see if the problem would fix itself (this actually works sometimes). Finally, I concluded that the problem was not on my side.

So I picked up the phone to call KPN. Doh! Telephone was dead as well!. IMHO that was pretty conclusive: things were broken and definately not on my side of the connection. It took four phonecalls (on my mobile phone) to get this knowledge through to KPN who eventually sent over an engineer who indeed concluded I was right (hey phone line seems to be dead!) and then figured out it was probably a problem on the other side of the cable. So he went there, found the problem, fixed the problem and all is well.

Except that I wasted a lot of time that IMHO could have been prevented from being wasted.

What really happened: regular maintenance in my area accidentally broke some cable (the engineer fixed this). I phoned the kpn helpdesk and there they went through their usual error checking procedure: Q: what’s your phone number? A: the same I just typed while in the fucking voice operated menu. Q: did you mess in any way with your DSL connection (this is a dangerous question: if you say yes here they will try to convince you that you caused the problem)? A: no and it has worked fine for two years. This lead to the inevitable conclusion that they had to do a line check (the only technical thing they can do) which they said was fine (it was broken!). They then decided to put an analyst on it who would call me back. This didn’t happen so I called them (tip, keep calling them, it’s the only way to get things done). The next day I called them again. They then claimed that they’d tried to call me several times. To which I enquired how that was possible since my phone was dead (duh!). They explained to me that they’d been trying the mobile number I gave them (they even read it to me!). My phone is one of those modern thingies which shows you an overview of missed calls: none whatsoever. After I explained that to them, things went relatively fast. I had to go home early to meet with the before mentioned engineer.

So what went wrong here:

  • Kpn was the cause of the problem.
  • When I called them they did not detect that the line was broken (WTF!)
  • Neither did they notice that the same day there had been some maintenance in my line (at this point, dots should have been connected but weren’t)
  • They then failed to call me back and even lied to me about that when I called them!
  • I went home early needlessly and wasted a lot of time on a problem that could have been diagnosed and fixed without me coming home early from work.

Why am I posting this? I’ve been here several times. I’ve had multiple incidents over the past few years all of which took way too many phone calls to get fixed. In 2000 when my phone was installed and then my adsl connection, it took no less then five visits of an engineer to get things working. The whole process took weeks. Then when a router in my area broke down and slowed down things to mere bytes per minute, it took three weeks to convince them the problem was on their side (only when I organized myself with some other disgruntled people in my area the problem mysteriously fixed itself). Then when I moved to Nijmegen they informed me my connection had been moved when in fact it had not been. That took about two weeks to get acknowledged and fixed.

In all these cases I did everything by the book and had to endure clueless, uninformed helpdesk employees, lies, the inevitable voice menu, etc.

I’m looking forward to getting rid of them permanently when I move to Finland in a few weeks.