Categories
How-To's

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!

Categories
Linux / Gentoo Linux

Kblogger coming to KDE 4.3

In a previous article I wrote about KBlogger and its nomination for a vapor-ware award. Most of the commits up until then seemed like KDE global search and replace changes, rather than actual work on the KBlogger application itself.

On the Kblogger page on kde-apps, an anouncement was made that the 3rd alpha was released in Febuari 2009. After installing and playing around for a bit, it felt more like a working blogging tool than it did before.

The downside was the numerous features which didn’t work:

  • Settings autodetection leaves you hanging and makes setting up a blog account more of a guess than anything else
  • If kwallet is not installed or activated (the service needs to run), kblogger crashes
  • If you try to read the category list on a Moveable Type API site, you get a ‘Method not supported’ error
  • Reading previously posted articles works (sort of) unless you have media attached in which case it crashes

The biggest problem is not the continuous crashing of the application but rather that I haven’t been able to post one article on any of my sites using Kblogger – it truely is an alpha quality application, if that.

It seems like the development is still going, even if the kde-apps page and homepage seem to be dead. Hopefully, they will work out the crashes and get it going in some form before KDE 4.3 ships out in June 2009.

Because of the current state this seems doubtful but according to the plans, it is still a part of KDE 4.3 PIM-libs – although it was on the schedule for 4.0, 4.1 and 4.2 as well.

In a desperate attempt to make the KDE 4.3 deadline, the current Kblogger feature plan seems to have dropped support for media management. This means that a lot of the current issues become a problem for later on and the core of the program (the blogging engine) is the only thing that needs to be fixed.

Lets hope this June we get a pleasant surprise but I am currently putting my money on KDE 4.4 or even KDE 4.5 as a release platform. On the bright side, perhaps the SVN versions become stable enough to use in the mean time.

On a side note, I am still looking for a blogging program for KDE 🙂

 

 

Categories
Gentoo Linux

QuickCam Communicate STX on Linux

Looking for instructions to get your latest Logitech webcam to work on linux? Your in the right place! Need a replacement for gspcav1 or spca5xx? Have no clue what I just said but you need a new webcam driver? Please, read on…

Categories
How-To's

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 ‘./autogen.sh’ 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.

Categories
Programming

Release of new utility: Bacula Reports 0.9

I write a lot of code, most of it unsuitable for release to the public but this little gem is worth a public release.

After using Bacula to backup all my servers (both Windows and Linux) for some time, the large number of mailings you get when using it on a small server park drove me insane. Even when using filters to sort out new mail, it is hard to see if everything is going as it should be.

Enter Bacula Reports: a mail aggregator for Bacula 2.x and 3.x.

Bacula Reports consists of a faux mail command (which does not send out reports by mail but rather analyses and stores them) and a report generator which aggregates all the stored reports into one mailing with an overview and some HTML styling to make it more readable (if you don’t want HTML, modify the template to generate plain text).

By integrating the scripts into the Bacula configuration at 2 points (a mail command used for sending out reports and a job to send out the combined report), the storm of daily mails changes into one neat report at the end of the backup cycle.

Normal error messages and operator messages are unaffected and will be delivered as they used to be, only the backup reports per job are redirected to Bacula Reports.

Requirements:

  • A linux server (32 or 64 bit, tested on CentOS 5.2 and Gentoo 2008)
  • A working Bacula 2.x or 3.x installation
  • PHP as a command line interpreter (run ‘php –v’ to see if you have it)
  • 10 minutes of your time to set everything up

The cool thing of the scripts is that they require only 2 small changes in the director configuration to reroute the status mailings and if you don’t like it or run into trouble, reverting is normally a matter of simply commenting out the modified lines and restoring the old ones.

One drawback for some people: it requires PHP on the command line (as stated before). The reason for this is very simple: I want to use the same code in the future for a web GUI and my unix-scripting skills are virtually non-existing compared to PHP or Java.

Even though its PHP, the scripts have a small footprint and run very fast – they should be easy to add to any existing Bacula environment.

{jd_file file==5} {jd_file file==6}

Categories
Gentoo Linux

KDE 4 random crashes (when launching Konsole)

After upgrading my laptop to the latest of the latest and even recompiling pretty much the whole system after that, I was still facing a whacky system which crashed on me on seemingly random times.

After a while I noticed that when I log in, hit alt+F2 and fire up ‘konsole’, the whole X server comes down crashing on me. Resulting in a few seconds of dark terror and a fresh login panel.

After running konsole from a text terminal, I spotted the following errors:

 kdeinit4: preparing to launch /usr/bin/konsole konsole(2671): Attempt to use QAction "change-profile" with KXMLGUIFactory!  Undecodable sequence \001b(hex)[?1034h

Because any attempt to trace the program failed, I started to search for other people and their solutions.

I’ve read things about people reinstalling parts of Xorg (namely libX11 as 1.1.5 seems to have some quirks) and parts of Qt 4.5 which should be unstable as well. None of these things worked for me and after restoring the system in the unmodified state, I found someone claiming that removing ‘tweaks’ in the xorg.conf file for the nVidia driver did the trick.

Although I indeed upgraded the nvidia-drivers package, I thought this was one of the bogus stories (like people solvin mounting problems by unplugging printers on the other side of the globe) – but at this point I had nothing to lose.

To my sheer terror I must admit that it actually worked!

I’ve had one occasion where konsole started but the window rendering was all screwed up (white or no background or no window decorations) but I hadn’t linked it to the display driver itself.

For now, everything is stable so I assume that I found the culprit. Please note that one or more of the following will make your KDE 4.2.2 desktop crash randomly:

  • TrippleBuffer
  • BackingStore
    • I have 2 options left in my configuration which are there for a while now and which still seems to be perfectly safe:

      • AddARGBVisuals
      • OnDemandVBlankInterrupts
        • Hopefully this post will safe someone a lot of grey hairs and a couple of precious hours spent on a goose hunt…

Categories
Linux / Gentoo Linux

KNetworkConf in KDE4 and Gentoo Baselayout-2

For a while now, I wondered why they ship KNetworkConf with KDE4 if its not working at all. The GUI shows up fine but none of the interfaces actually show up (making it pretty hard to configure them).

Today I found out why: the configuration panel is not incomplete, it is incompatible. You see, Gentoo is starting to switch to baselayout-2, a new and improved system layout which should solve a million quirks that have been part of the system for years now.

According to this bug report on kde.org, this is because the network listing is no longer the way it was: it is now a new kind of array (bash compatible or something).

Marvelous as this may be, it breaks knetworkconf in KDE 4.2.2 and older. Lets just hope that the new (service) release fixes this ‘ minor’ glitch.

Categories
How-To's

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 ath.cx 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 main.cf:

# 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!

Categories
General blog entries

Power Consumption

Because now and then I wind up in a discussion about power consumption of random electronics I decided to measure the power needs of some random appliances around the house. These are the results:

  On / Powered Standby / Sleep
19” CRT monitor 85W 0W
17” CRT monitor 37W 1W
@Home Digital Cable Decoder 6W 6W
CRT TV 59cm (23”) 60W 6W
LCD TV 26” (66cm) 112W 1W

Please note that these are just an indication, a similar device you own might have different power needs but this gives you an idea at least. Also the TV’s I measured are relatively old (CRT, 15 years, the LCD 7 years) and modern LCD TV’s use less power but are bigger (so the Watts per inch are lower but the total power usage is larger).

Categories
Programming

Amarok2 TrackInfo object in QtScript

I just started playing with QtScript in Amarok 2.0.1.1 and so far the documentation has been a big let down. A lot of things are documented for C++ but the conversion into JavaScript is a lot trickier then it looked.

This is ofcourse because the whole QtScript engine is all new and this will become better over time. In this posting I will show what the TrackInfo object holds, which is returned by Amarok.Engine.currentTrack();

 destroyed(QObject*): function () { [native] } destroyed(): function () { [native] } deleteLater(): function () { [native] } objectName:  title: Hotaka (radio edit) sampleRate: 44100 bitrate: 192 score: 49.5 rating: 0 inCollection: true type: mp3 length: 215 fileSize: 5195160 trackNumber: 1 discNumber: 0 playCount: 1 playable: true album: Hotaka artist: Juno Reactor composer:  genre: Electronic year: 2002 comment: DHA's Music Archive path: /mnt/music/Mp3/Albums2/Juno Reactor/Juno Reactor - Hotaka/01 Hotaka (radio edit).mp3 isValid: true isEditable: true lyrics: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">  <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en" dir="ltr">  <head>      <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />      <title>Juno Reactor Hotaka (radio edit) lyrics</title>  </head>  <body><h3><a href='http://lyricwiki.org/Juno_Reactor:Hotaka_%28radio_edit%29'>Hotaka (radio edit)</a> by <a href='http://lyricwiki.org/Juno_Reactor'>Juno Reactor</a></h3> <pre> Not found</pre><hr/>Additional Info: <ul> <li><strong>url: </strong><a href='http://lyricwiki.org/index.php?title=Juno_Reactor:Hotaka&amp;action=edit' title='url'>http://lyricwiki.org/index.php?title=Juno_Reactor:Hotaka&amp;action=edit</a> </li> </ul> </body> </html> 

So the next time you need some information about the currently playing track you know exactly which fields are available.

On a side note: the isValid boolean tells you if the track info you are parsing is in fact a running track. If Amarok is not playing all fields will be empty or zero. Check isValid before you start processing an empty data object…