SATA Hard disc showing up as a Removable Drive

After spending the better part of a day trying to reinstall my neighbors computer using his old Windows XP Home disc (no service packs installed) and burning 4 slip-streamed discs – in an attempt to get the pesky nForce4 controller on the ECS motherboard to play nice – I finally got the system up and running again. Mind you, not using the custom Windows XP CD’s. No, for some reason after the slip-stream, the CD key is no longer accepted (thanks Microsoft for that one).

No, the reinstallation involved the slow and painful upgrade of Windows XP from the vanilla version to SP3 with every upgrade known to man. Of course this process failed once when I tried installing every driver and tool during eachothers installation (and probably during the service pack upgrade) so I wound up with a system which threw a BSOD on each boot and forced me to start all over again. *grmbl*

Now, after everything is up and running again, the only problem that remained was the fact that the SATA hard drive is showing up as a Removable disc. This is probably because the initial installation was using a legacy IDE emulation interface on the nForce4 controller. But as soon as I installed the SATA driver, the full 250GB became available (it showed up as a 128GB disc during the text mode setup) and Windows switched to the faster SATA interface.

My guess is that Windows for some reason now detects the SATA drive as a new drive and assumes for some reason that it is hot-swappable (it should be in theory but still should not show up as such). To fix this, you need to tell the nVidia drivers to stop marking SATA drives as removable. As such, the trick described below might not work if you do not have a nForce SATA controller.

WARNING: Messing with the registry can destroy your Windows installation. If you know what you are doing you should be fine, if not, please stop now.

  • Go to ‘Start’
  • ‘Run’
  • Type ‘regedit’ and hit enter
  • Find the following folder ‘HKEY_LOCAL_MACHINE\CurrentControlSet\Services\nvata’
  • Some people might have a 64-bit installation, they should have a ‘nvata64’ folder instead
  • On another computer of mine, the folder was called ‘nvatabus’ instead of ‘nvata’
  • Create a new DWORD value in this folder (by right clicking and selecting ‘New DWORD value’)
  • Name the new value ‘DisableRemovable’ and set the value to 1 (decimal or hex doesn’t matter)
  • Close RegEdit and reboot your computer

If everything worked out, you should no longer see the hard disc showing up as a removable device. Don’t forget to reboot to make the changes active!


Antec Fusion with SoundGraph VFD under Ubuntu

After deciding to upgrade my Ubuntu Intrepid to Jaunty a million things broke – most of which were flimsy solutions at best – making me spend hours to figure out how to fix them.

One of those little gems is the LCD on my Antec Fusion case, or rather it is not an LCD but a VFD. Even better, SoundGraph is the original producer of these gems but seems to think that the entire IT industry is only using Windows as they don’t support linux. At all. Nice.

Of course, most of these devices work alike so if you figure out the guts of one you pretty much have the recipe for all of them. I had installed my HTPC over 6 months ago and after trying a million patches I finally ended up with a Lirc 0.8.3 installation with a patched lirc_imon driver which managed to drive the display as well as work with all the buttons, knobs and the remote.

Sure, I had to tweak the patch a little to get the right payload and replace semaphores with errrr…. something else, but who can complain when it finally works?

So after finding all the previously ‘helpful’ sites again, and people sending each other around in loops for instructions, I figured out what to do. Ignore all the guides out there. There you have it.

So, the instructions? Easy, LIRC 0.8.5 will have native support for the iMon devices and it already works better than any patch out there. Go to the LIRC website and follow the instructions to compile LIRC from CVS. As a hint, if you are running Ubuntu: as soon as you pulled in the CVS tree, run ‘./’ followed by ‘./configure –prefix=/usr –with-driver=imon’ and finally ‘make’ followed by ‘make install’.

Thats all there is to it, now load the lirc_imon driver and to test, configure LCDd to connect to ‘/dev/lcd0’ and behold, your GraphMon VFD works! Lets hope the fine folks at LIRC decide to push the next release out the door soon so everyone can just get the vanilla package from their distribution vendor.


Postfix and Cyrus SASL authentication

It has been a while since I’ve had the time to blog about something. Mainly that is because my study is demanding a lot of time and because I am working on some new thing which keep me pretty occupied. I will write about those things some other time.

Right, on to Postfix and Cyrus SASL. Most of my servers are running some flavor of *nix and because I started to like the low effort CentOS needs to keep running, I rebuild all my Gentoo based systems (which took hours to compile and then manually upgrade thanks to the ever changing configuration of a gazillion programs) to CentOS versions – including my Postfix + Courier-IMAP + MySQL mail system. This setup is pretty common as the first guide I found on the HowTo forge for CentOS 5.x was almost verbatim what I had done while porting from Gentoo to CentOS. Also, see the Gentoo guide I used to set it all up (also usable for CentOS).

The only thing I never got going – because I never needed it – was SMTP authentication. Now, when other people send mail to your server they will not need to authenticate: the server is the end-point for the email and as such it will accept any mail sent to the domains hosted on it. So when do you need authentication? When you want to relay.

Now, relaying has a bad name on the internet, try to Google for it and see what comes up. But relaying itself is not a fluke, its a solution. In my case, I have 2 reasons for relaying.

First, at work and at my parents, I can send mail just fine using the ISP mail servers (which I have to change every time I switch locations *sigh*) but the mail servers are a bit too well educated. My domain is currently an alias (CName to be exact) for a DynDNS address. When sending mail, the mail servers resolve and expand the domain I claim to send from and rewrite the address. This means that sending to mailing lists becomes impossible and other people wonder what a address is…

Secondly, at home I can’t send mail at all because the idiots at my ISP (I will write about the woes another time) told their mail servers that the server had to match the sender (domain wise). Because of the fact that I am not allowed to link the DNS to my IP directly, this will resolve in – yet again – 2 different domains and in this case the mail is bounced back to me.

In both cases it would be very handy to be able to just send mail using my own mail server as it will deliver mail directly to the correct remote servers, using the correct names etc.

On a side note, the government has decided that is would be a great idea to store all mail traffic for everyone in the country to fight crime. As usual, declaring such a policy will simply tell everyone who is planning to blow up stuff to use alternate means of communication – most of it being encrypted and voiding the whole purpose. To that end, I like the idea of using my own mail server on an encrypted channel so my mail remains private and let everyone listening in what dark secrets I send around. (On a side note: yes, the server to server communication can not be encrypted unless both servers know how to – but the first bit is safe).

Now, on with the details. I assume you have Postfix running with MySQL, so it is delivering mail to a maildir on your server or forwarding it somewhere else. Courier (IMAP/POP3/whatever) is running as well and can access the mail delivered for Postfix and as such, your whole mail server is up and running. Now comes the catch: Courier has a authentication library which should be able to authenticate against MySQL. Most installations will use Cyrus SASL instead because it has more features (and in my case was easier to set up as I am using postfixAdmin to administrate the server).

You NEED Cyrus SASL 2 with the SQL plugin installed, if you use Courier Authlib you need a different guide or change the authlib you are using. If you use CentOS like me, run: ‘yum install cyrus-sasl-sql’ to grab the right plugin.

Now, open up ‘/usr/lib/sasl2/smtpd.conf’ to create the specific SASL authentication file for Postfix. On a side note: in my case, I didn’t have to start the service for this to work. Anyway, insert this:

pwcheck_method: authdaemond  log_level: 2  authdaemond_path: /var/spool/authdaemon/socket

The first line tells Postfix to use the Cyrus SASL daemon (instead of the Courier Authlib one). The second line is optional but is handy when debugging, increase if things don’t work so you can see what is happening. The 3rd line is crucial: this is the path to the socket of the Cyrus SASL daemon. On CentOS 5.x you should have it here, on other distributions you need to search for the socket and put it in there.

Now you have set up the SASL authentication settings, it is time to tell Postfix to check the SASL pipeline when someone tries to authenticate. Add the following to your

# SASL settings  broken_sasl_auth_clients = yes  smtpd_sasl_auth_enable = yes  smtpd_sasl_authenticated_header = yes  smtpd_sasl_security_options = noanonymous  smtpd_sasl_local_domain =  # Used by SASL to identify the Postfix client  smtpd_sasl_path = smtpd

These settings are pretty safe, won’t turn your box into an open relay (the bad sort of relaying abused by spammers) and will still make it possible to use pretty much every mail client out there. Note the last line: that line sets the key word when Postfix will try to authenticate: that is why the SASL configuration is called smtpd.conf. Another reason to use this name is the fact the smtpd is the name of the daemon that will request authentication and on some distributions, it will automatically search for that name.

Now safe, restart postfix and try to authenticate (set your mail client to connect to your server when sending mail and to use the same username and password you need when recieving mail). If everything went well, you can now send mail to anyone, from anywhere using your very own address and just one mail server!

If you get this:

[postfix/smtpd] warning: SASL authentication failure: cannot connect to Courier authdaemond: Connection refused

…you have a problem. Ignore the bit that says Courier authdaemond – you are trying to connect to Cyrus but Postfix doesn’t know this and as you are using the Courier interface, it will tell you something that is incorrect. The message means that it couldn’t find the socket, it is not allowed to access the socket or a similar issue is preventing it from working.

Step 1: Do NOT hardlink the socket to the SASL directory to include it into the Postfix root jail. This will work as long as the system is up: if the authlib daemon is restarted, it will recreate the socket and your hardlink will be dead – sending you off on a goose chase (guess how I found out that one… afterwards I also found this conversation about it)

Step 2: Make sure the socket file is where you told Postfix it would be. Try restarting all services and make sure the timestamp on the socket changed when you restarted everything. If it didn’t change, you are referring to the wrong file. Try to delete it, restart everything again and you won’t see it reappear. Search for it again and fix the path in the smtpd.conf file.

Step 3: When accessing the socket, you need more than read and write access to the socket. You also need r/w access to a random regular file in the directory holding the socket. This is how sockets work and if I understand correctly, a hidden file is used once a program opens the socket to continue the session – hence you need to be allowed to create that file. On CentOS, open ‘/etc/group’, find the line that says ‘daemon:…’ and add ‘postfix’ to that line, use a comma if one or more names are on that line already. Now Postfix is part of the daemon group which owns the socket directory on CentOS. If you have a different distribution, find out who owns the directory, who is running postfix (usually this is the user + group ‘postfix’ or ‘mail’) and fix it.

Step 4: Restart all services or the whole system if you get here. Read the log files again looking for hints what went wrong. If you still have problems, try to Google for it or leave a comment.

Good luck!


Windows 2003 Server and 404 errors in reporting

I’ve ran a few times into a strange phenomenon when dealing with clean installed Windows 2003 SBS servers. In particular Windows 2003 SBS R2 with SP1 – but I’m sure other versions are affected as well.

The symptoms: A clean installation of the server refuses to show the Backup overview and Server Performance and Server Usage Reports. Instead you get a 404 error telling you the page can not be found. If you send reports by mail, those users will see the same thing.

When you navigate to http://localhost/Backup or http://localhost/Monitoring or http://localhost/Remote – all 3 sites give you a 404 error while for example http://localhost/ClientHelp and http://localhost/exchange work just fine.

Please note that if you can’t see these last 2 pages as well or you do not get error 404 but something else, you probably have a different problem.

The problem:
Windows SP1 and consecutive updates pull in updates for Microsoft ASP.NET and add ASP.NET 2.x to the server. The defaults then become to use ASP.NET 2.x instead of 1.1. The reporting modules do NOT work with ASP.NET 2.0 or higher.

Open up server management, expand on the left pane the ‘Advanced’ section. Next, expand, ‘IIS’, ‘YourServerName’, ‘Websites’ and finally ‘DefaultWebsite’. Click on ‘DefaultWebsite’ and the right pane should show a listing of components in your default site.

In the right pane, do for each broken service (‘Backup’,’Remote’ and ‘Monitoring’) the following: right mouse click on the name and select ‘Properties’. In the popup select the tab called ‘ASP.NET’ and look for the selected ASP version. Most likeliy you will see something like ‘2.0.x.y’. Switch the version to ‘1.1.x.y’ and click ‘Apply’ and then ‘OK’. You now switched that folder to the correct version, now repeat for the other broken services.

Check if you can now open up the pages that previously gave you a 404 error – they should work. Note that displaying them can take a while because they have to parse the Windows event logs to show you the reports.


HighPoint RocketRAID 1742 in CentOS 5.2

After having a bit of a fight with CentOS and its broken Realtek 8169 driver (called r8169 and which also claims Realtek 8168 devices but screw up when detecting the link status) I finally got to play with a RocketRAID 1742 controller from HighPoint. Where Promise dropped the ball with supporting hardware RAID on linux (basically you get 2 or 4 extra SATA ports but the RAID controller plays dead), HighPoint promised us true RAID under linux without any wonky software drivers.

Note that the RPM package for the DKMS rr174x driver is attached on the next page.


Network login script for Windows XP Home

I just needed a script to log in on a Windows 2003 Server from Windows XP Home. Of course you can enter your password each time you need to access the shares – or you could just drop this little script in your Startup folder (call it ‘network_login.vbs’ for example).


{codecitation class="brush:vb"}’ VBScript to map a network drive. And provide a message box
‘ Author Berend Dekens
‘ Based on code from Guy Thomas
‘ —————————————————————–

Option Explicit
Dim objNetwork
Dim strDriveLetter, strRemotePath, bSaveMapping, strUserName, strPassword
strDriveLetter = "Z:"
strRemotePath = "\\\sharename"
bSaveMapping = true
strUserName = "yourname"
strPassword = "mysecretpassword"
‘ Purpose of the script to create a network object. (objNetwork)
‘ Then to apply the MapNetworkDrive method. Result Z: drive
Set objNetwork = CreateObject("WScript.Network")
objNetwork.MapNetworkDrive strDriveLetter, strRemotePath, bSaveMapping, strUsername, strPassword
‘ Extra code just to add a message box
WScript.Echo "The networkdrive "& strDriveLetter & " is now available"
‘ End of MapNetworkDrive Example Logon Script. {/codecitation}


Compiling Courier 0.60.0 into RPMs for CentOS 5.2

In this article I will explain how to build RPM packages from the tar.gz packages on the Courier site in order to install Courier and/or its components using the RPM based installer in CentOS.

Server crashes always come when you least expect them. My trusty server just came down with a bad case of broken SATA controllers (don’t know how to cure that). Of course, the socket A cpu (Athlon 2600XP) motherboard is long out of fashion and so we wind up with the purchase of a new server (technically an HTPC but I’ll post something about that later on).

One of the key packages I use for years is Courier MTA. This software is supported fine by Gentoo but because the number of servers that I need to maintain is steadily growing, the drive for cutting edge kernels and software is fading as upgrading Gentoo systems can be a time consuming process.

So in the reinstall I decided to drop the mail, web and ftp services into a virtual CentOS machine so I could move the server to a different computer in case of the physical host failing.

The first thing that became obvious was the lack of Courier RPM’s out there, simply because the Courier package from the site can be converted into RPM’s with ease. If you are reading this then you probably have not compiled packages before and you need some help.

Disclaimer: I am using a setup which uses MySQL based authentication so I will remove the other database packages as soon as I am done – if you need those, be sure to omit those commands.

Start out by installing ‘rpmbuild’ as we will use it to build the packages:

yum install rpm-build

Next, get the latest source tarball from here.

As a normal user (running as root will give you an error so don’t bother) run the following:

rpmbuild –ta courier-0.60.0.tar.bz2

In my case I got this error telling me I don’t have enough permissions to write where the rpmbuild tool wants to put its files:

error: Failed to rename /usr/src/redhat/SPECS/rpm-spec.uykL0j to /usr/src/redhat/SPECS/rpm-spec.uykL0j: Permission denied: No such file or directory

This is a bother because Courier requires you to be non-root and rpmbuild requires you to be root. I solved this by temporarily changing the /usr/src/redhat owner to be me:

chown berend:users /usr/src/redhat –R

Running rpmbuild again now shows us a list of missing dependencies, in my case I had to install:

yum install expect libtool-ltdl-devel gdbm-devel pam-devel gnutls-devel mgetty-sendfax pcre-devel openssl-perl gamin-devel

One of the missing requirements is the ‘/usr/lib/ltdl.h’file – this is part of the libtool-ntdl-devel package. Another is ‘/usr/include/fam.h’ which is provided by gamin-devel.

The primary missing package however, is courier-authlib-devel. We can solve this by going back to the download page and downloading the courier-authlib tarball. After grabbing it, run rpmbuild on it:

rpmbuild –ta courier-authlib-0.61.1.tar.bz2

On my system the following was required to be able to build the RPM:

yum install libtool libtool-ltdl-devel openldap-devel mysql-devel zlib-devel postgresql-devel gcc-c++ redhat-rpm-config

Note that if you skipped installing the dependencies for courier itself, some of those packages are needed for courier-authlib as well.

After calling rpmbuild again on the courier-authlib tarball, the compiler should kick in and the build will complete on its own. After the build is complete, install courier-authlib-devel to be able to build Courier itself (you can later remove this if you don’t need it), you need to run this as root:

rpm –i /usr/src/redhat/RPMS/i386/courier-authlib-0.61.1-1.i386.rpm rpm –i /usr/src/redhat/RPMS/i386/courier-authlib-devel-0.61.1-1.i386.rpm

If did everything right, calling rpmbuild on the courier tarball will now fire up the compiler on courier itself, resulting in a neat pile of RPMs in ‘/usr/src/redhat/RPMS’ – most of which have self-explanatory names or are dependencies of each other.

Before installing Courier, lets clean up the mess we had to make to get here, run this as root again:

yum remove libtool libtool-ltdl-devel openldap-devel mysql-devel zlib-devel postgresql-devel gcc-c++ redhat-rpm-config gdbm-devel pam-devel gnutls-devel mgetty-sendfax pcre-devel openssl-perl gamin-devel courier-authlib-devel  chown root:root /usr/src/redhat –R

Note that we omit ‘expect’ from the remove command as it is needed by courier and its packages.

And there you have it, a complete guide to building your own Courier RPM packages on CentOS 5.2. All that is left is to actually install the RPM’s and set up Courier but that is beyond this little howto.


Windows Live Writer and Linux, How To Do It

I’ve seen lots of discussions floating around the internet, talking about people attempting to install Windows Live Writer. Some are using Mono, others the .NET Framework – all of them are using Wine. In this article I’ll explain How I Did It.

In this case the limits of Wine and Mono become visible. The .NET frameworks work partially in Wine so relying on them is useless (to be precise: all the external libraries needed in this case screw up this valiant attempt).

In the other corner we have Mono. Because WLW is in fact a Win32 executable, we have to use Mono in Wine (install the Windows version of Mono using Wine) but even the big anti-Microsoft framework fails here.

To be honest, Mono keeps failing every time for me. This is because Mono can run managed (byte-code only) executables fine, even the ones compiled for .NET (unless I’m mistaken). However, the windows in a GUI program are drawn using a native interface for .NET, one that Mono does not have as it uses a cross-platform windowing toolkit called GTK#. In short: any program that is used in a modern desktop environment and which is designed for .NET will not run on Mono. Thanks for the effort there guys…

So WLW on Linux is a no-go. And every other blogging tool out there for the Linux platform pretty much sucks or costs muchos dineros. I still have hopes for KBlogger but after 3 months its still at alpha 2 – so I stopped hoping that would be any help any time soon. I was using Bleezer before but it keeps screwing up source code which I am trying to post (I am hoping WLW will do this a LOT better). But how do we get out of this dark age, you might wonder? The solution? VirtualBox!


How to make Bleezer look good

Like I posted in a previous entry, I hate the way Bleezer looks on linux. The screenshots look great but I guess the author is using MacOS.

Personally, I like the Substance Look and Feel, even if its a bit heavy to render (the GUI gets a little sluggish if the windows get complex). I downloaded the 4.3 release from the Substance site and used the docs to figure out what argument to feed Java.

Note that Substance has multiple skins, all are a little bit different from eachother. This is why the Substance package has multiple classes you can select for the L&F.

Back to Bleezer. I tried making Bleezer use the Substance L&F by means of the command line. Something like this was supposed to work:

java -cp .:substance.jar -jar Bleezer.jar

However, it did not. For some reason you get this:

Exception in thread "main" java.lang.Error: can't load javax.swing.UIManager.initializeDefaultLAF( javax.swing.UIManager.initialize( javax.swing.UIManager.maybeInitialize( javax.swing.UIManager.getUI( javax.swing.JPanel.updateUI( javax.swing.JPanel.<init>( javax.swing.JPanel.<init>( javax.swing.JPanel.<init>( javax.swing.JRootPane.createGlassPane( javax.swing.JRootPane.<init>( javax.swing.JFrame.createRootPane( javax.swing.JFrame.frameInit( javax.swing.JFrame.<init>( com.bleezer.Bleezer.<init>( com.bleezer.Bleezer.main(

After trying a million tests to make sure the JAr file was included I finally ran a decompiler over Bleezer and it looks like Bleezer will only attempt to set the L&F on Windows and MacOS. This means the linux users are stuck with the Metal L&F and Bleezer does not provide an option to change the skin.

In a previous post I showed how you can override the L&F for Bleezer using the command line. For some reason, that same trick won’t work here so we’ll work around it.

The solution is to add the Bleezer JAR to the class path and then manually specifiy which class should be run. Using this trick, you can make Bleezer use the new L&F.

Putting it all together you could make a launch script to fire up Bleezer using the new Look and Feel:

#!/bin/bashjava -cp .:substance.jar:Bleezer.jar com.bleezer.Bleezer

And here is the end result, before:

…and after:



Alcatel Speedtouch under Gentoo linux


This is my first How-to so bear with me 🙂

This guide is written for people who want to use an old Alcatel Speedtouch ADSL modem under linux. The first part of the guide will tell you how to set up the uplink using the modem. After that, I’ll explain how to turn the gentoo machine which controls the uplink into a internet router.

Note: this is a copy from the original article I posted on Gentoo Wiki. By now there might be differences in the content but this is the original.
Updated: Reformatted by hand to clean up the HTML to fix the layout.