Wednesday, December 31, 2008

The secret CLI of the SRW2016 switch

I wrote earlier about my new switch. I've now gotten time to play with it - and started testing munin with it. Munin now has a very nice Munin::Plugin::SNMP module to support SNMP plugins - and just minutes ago I managed to verify that it works correctly with authenticated SNMPv3. My main problem was that I didn't specify '-l authNoPriv' on the snmpwalk command line. When I tried the snmp__uptime plugin with SNMPv3 configuration it worked at once. I spent *hours* figuring that out.

It turns out that the web view for the switch really only works with IE on Windows (not even Firefox on Windows) and even uses a ActiveX plugin. This sucks. BUT, the switch has a s3cr1t cli! Firstly telnet to the switch and enable the ssh interface by navigating the menus.

Then ssh to it, log in on the screen and at the menu screen press ^Z. You get a ">" prompt at which you can type "?" or "help" or "lcli". Lcli will ask for your username and password again. And then you're in a IOS look-alike cli interface. There is a wiki for it here with some articles on different things. It can clearly benefit from your contributions.

Thursday, December 25, 2008

Pulse-audio rant


I have always found that audio works better if I disable sound servers. So in KDE I have always disabled artsd. In F10 everything seems to be compiled to first use pulse-audio-server (se amazing architecture diagram on the right), a gnome desktop sound server, and then, perhaps, the ALSA device driver. After my upgrade to F10 it was first only half installed and impossible to get working. After intensive use of strace and google I figured out that installing pulse-audio-utils and rebooting to reset whatever erronous state the machine was in fixed that.

Now that I got Amarok working too I finaly found that everything but the flash plugin in Firefox supports pulse-audio. Wouldn't play Money For Nothing off YouTube. Somehow flash and pulse-audio/amarok excludes each other. Quitting Amarok (small click in the speakers as it shuts down - I've not heard that in ages...) and restarting Firefox took care of that, but what a bother.

Out goes pulse-audio:

# rpm -qa | grep pulse

Find list of offending packages. Then:

# yum remove pulseaudio-libs-glib2 pulseaudio-core-libs pulseaudio

And yet again Alsamixer will show a sane selection of mixer levers. I'm probably some kind of dinosaur but why are the young 'uns keeping up this crap? ALSA is all we (I) need! Go away! In the future George Bush will be dead (he said so himself) and the rest of us will use laptops. We don't need no steenking network sound daemons.

Wednesday, December 24, 2008

Mp3 support for Amarok in Fedora 10


I recently upgraded my one Fedora machine to f10. Being a KDE user I was forced to switch to KDE 4 on yet another machine. I must say: f10 with KDE is very nice looking. I've also been forced to this with Ubuntu 8.10 (U810). The KDE 4 in Ubuntu 8.10 is not as nice looking - mostly thanks to the way cool solar background image in f10.

And that 3D acceleration works on my f10 box (old ATI card) and not on my U810 machine - for reasons unfathomable to me. So finally my KDE has native fadey and wobbely windows without requiring the ingestion of intoxicating substances. Clearly the twenty-ohoh's have reached my desktop too.

Which just leaves me with the need to make my point: F10 comes with Amarok 2. As usual mp3 is not supported but the old ways to fix this are obsolete. Working instructions for f10 was not so easy to find. The Fedora Wiki directs it's readers to buy a gstreamer plugin to enable mp3 playback.

In the end I found instructions for getting the support from rpmfusion - yet another addon repo for Fedora. I had to do this:

# rpm -Uvh http://download1.rpmfusion.org/free/fedora/rpmfusion-free-release-stable.noarch.rpm http://download1.rpmfusion.org/nonfree/fedora/rpmfusion-nonfree-release-stable.noarch.rpm

# yum groupinstall sound-and-video

To paraphrase Dire Straits (first big release on CD way back then): All I want is my MP3! --- I have no idea which one - or ones of the packages were needed to fix the mp3 support.

All I want for Christmas is...


Today (24th) was Christmas in Norway. Just one of the ways Santa manages to get more time to deliver the packages - I'm sure he has lots more coping strategies.

My wife and I are building a house. It'll be done come summer (the roof is on now, roofing tiles and all :-). So I've started to plan ahead for the machine room. The house will have pretty good wiring potential - we'll be able to wire at need (if I have forseen our needs and specified sufficient tubing for wiring). So next obvious need is a switch. Need one with management, VLAN and SNMP support of course; to be able to do interesting things. So my Christmas gift to myself is a Linksys SRW2016, a 16 port 10/100/1000Mbps switch. Way cheap. The management is of the "webview" flavour, but what the hell, it was cheap at the price and has good capabilities. The VLANs will enable me to use as little wiring as posible. The SNMP support will hopefuly motivate me to make Munin a fully fledged MRTG killer (it's important to have dreams! :-) I'll just have to cope with the "webview", whatever.

Best of all, it's fan free and rack mountable. In a few months I'll have to find a cheap 19", 80cm-1m deep rack. If anyone in the Oslo (Norway) area has a rack to spare please write (or call or SMS or MMS)! In the mean-time I have a toy :-)

God Jul!

Friday, December 12, 2008

Linux and Brother MFPs

I've spent some time at my parents' lately. My dad has a huge beast called Brother DCP-9045CDN in the basement office. It's a "MFP", or multi-function printer. It's a scanner/colour printer combo that can also copy. It has a 35 page automatic paper feeder tray.

Ages ago when multifunction devices were introduced it was the age of "winprinters" and "winmodems" - dumb printers and modems that needed pretty advanced and hardware close drivers to work. The multifunction devices were exactly the same. Some of these worked with Linux but everyone were better off avoiding the win* hardware. Winmodems have since gone the way of the dinosaur it seems. I've not researched MFPs in general but this Brother device is very Linux friendly. So friendly is that Brother provides drivers in both RPM and DEB formats.

I'm plesantly surprised and happy :-)

Looking into this device I found that the printer supports PCL and BR-Script. BR-Script seems a very capable Postscript clone. No need for downloading drivers: just open your CUPS (the Linux/Unix/OS X printer software) configuration interface and configure it as a br-script brother device. This printer has the IP address 192.168.2.45, so I tell CUPS the printer URL is lpd://192.168.2.45/AUTO/ (does anyone know what the IPP URL for these devices are?) CUPS has a good set of Brother drivers and I selected the one described as "Brother DCP-8040 BR-Script3". Once set up it printed at once.

To use the scanner I needed to go to Brother.com and follow the links do support/download drivers and select Linux. I downloaded the .deb package, ran dpkg -i on it on my Ubuntu 8.04 (Hardy) machine. I guess if I hadn't fiddled with this Firefox would have run a GUI installer on the package for me so I just would have had to click "OK". The package contained SANE drivers. SANE is the standard scanner framework on Linux. I just had to run "brsaneconfig2 -a name=dcp9045 model=DCP-9045CDN ip=192.168.2.45" as root - very clearly documented on the site. Then I ran "kooka" (KDE scanner program) from the KDE menu, it asked me what scanner I wanted to use, I selected the Brother one. Insert paper in the scanner press "scan" and it just worked.

*grumble* When Linux is as easy as 1-2-3 - where is the fun in it? >:-)

Thursday, December 11, 2008

Neonode goes bankrupt

If you read my previous posting about the current state of phones you may have been worried for me. Or not. I ended up getting a Neonode N2. For the size, not for the feature list. The feature list is sort of lacking, but they made up for it by very nicely and thoughtfully solving a gaggle of other things.

The one item I've ever owned that got the most "what the hell is that?" or "that's some small phone!" comments. That quite popular phones were this small around 2001 is clearly forgotten.

I like it for it's logical and direct interface. I would have bought their next model. But they went bankrupt. I wonder where I'll have to turn for my next phone.

Thursday, September 18, 2008

Getting the most out of Atom with Ubuntu - upgrading it the right binary architecture

From most howtos I find it appears that people tend to run i386 Ubuntu (if they run Ubuntu) on their Atom devices. I may have stopped using Gentoo because it was too much work, but I'd still like to get my Atom box faster - without going as far as compiling the whole environment myself.

For ages I've heard people go on about how cool it is to bootstrap e.g. Xen hosts or do interesting things in chroot environments on Debian and Ubuntu. Not having worked with or even played with Xen I at least finaly get to play chroot games.

The scenario is that I have:

  • A rather freshly installed PPC machine with faulty memory. I put quite a lot of hours into installing and configuring all the software: Apache, postfix with tweaks, courier, squirrelmail, squarecircle web mail, a caldav server using postgresql, lots of stuff. Hours. If I could transfer the disk image from the PPC machine to the Atom machine and replace the PPC binaries and libraries with ditto Atom ones, then the new machine will work exactly like the old one without any further configuration.
  • A new Atom machine up and networked with a Live CD (or Live SD as the case may be). This new machine is LPIA architecture (Low Power Intel Architecture), e.g. Atom. The Live CD has the machine up on the network and it has the address 10.0.0.128. The new filesystems are mounted under /mnt.
All this will apply equally for a transfer from i386 to Atom, or PPC to Atom for that matter.

Before you start. This is not a "supported" upgrade procedure. If you break your computer and can't fix it again you get to keep both parts. Proceed only if you accept this.

To prepare on the PPC I installed and ran debfoster, a program that can enforce your package choices. It will throw out the programs you don't want and install those you want that are missing. It keeps a file called keepers to account for these. After running debfoster I know all the packages I need to install - everything will follow these. Make a backup copy of it called keepers-keep.

Then I transfer the old machine to the new one by running this as root on the old machine:

  rsync -avHx --numeric-ids --progress --delete \
  -e ssh / root@10.0.0.128:/mnt/


The first thing you should know about this command is that it can wipe out whole systems if you type the command a bit wrong. By all means, be careful, and read the whole man page unless you're already familiar with rsync.
This command can be repeated later if mistakes are made on the new machine.

Now the machine is transferred, but the PPC binaries won't run on either i386 or lpia. The executable disk contents have to be reinstalled with packages that are the correct binary architecture.

Here is a little transcript:

# ld.so.cache from another architecture causes problems
rm /mnt/etc/ld.so.cache
# That this is missing distresses dpkg no end

touch /mnt/var/run/motd
# Old dpkg database can be tricky
mv /mnt/var/lib/dpkg /mnt/var/lib/dpkg.old
mkdir /mnt/var/lib/dpkg
# And so we go!

debootstrap --arch lpia hardy /mnt http://ports.ubuntu.com/


That was the easy bit. Now to fix some things, and install the rest of the packages we used to have:

# Some fixes
mount -o bind /dev /mnt/dev
mount -o bind /sys /mnt/sys
mount -o bind /proc /mnt/proc
LC_ALL=C chroot /mnt bash
ln -sf mawk /usr/bin/awk
apt-get -f install
cat >/etc/apt/sources.list <EOF

deb http://ports.ubuntu.com/ubuntu-ports/ hardy main restricted universe multiverse
deb-src http://no.archive.ubuntu.com/ubuntu/ hardy main restricted universe multiverse

deb http://ports.ubuntu.com/ubuntu-ports/ hardy-updates main restricted universe multiverse
deb-src http://no.archive.ubuntu.com/ubuntu/ hardy-updates main restricted universe multiverse

deb http://ports.ubuntu.com/ubuntu-ports/ hardy-backports main restricted universe multiverse
deb-src http://no.archive.ubuntu.com/ubuntu/ hardy-backports main restricted universe multiverse

deb http://ports.ubuntu.com/ubuntu-ports/ hardy-security main restricted universe multiverse
deb-src http://security.ubuntu.com/ubuntu/ hardy-security main restricted universe multiverse

EOF
apt-get update
apt-get install localepurge
for f in $(cat /var/lib/debfoster/keepers); do
apt-get --yes install $f
done

Now check that grub, linux-image and such boot-time necessities are installed, and install the boot loader in MBR and get it configured:

grub-install /dev/sda
update-grub

If it complains about not being able to figure out your BIOS devices you may want to create /boot/grub/device.map with these contents:

(hd0) /dev/sda
(hd1) /dev/sdb

At this time it might boot if you try. My next problem was that udev had taken away eth0 and named it eth2. On a Debian(Ubuntu machine the file that decides what the interface name is is named /etc/udev/rules.d/70-persistent-net.rules. You can edit that file. You may find that the two first lines are some sample stuff ending in NAME="eth0" and NAME="eth1" and that your ethernet device is at the end and named eth2. Remove the two first lines, change the NAME to eth0 for the correct last line. Then reboot again. Now the ethernet should be at eth0 and you can configure it with NetworkManager or in /etc/network/interfaces or whatever.

And now it should be working. If you want the wireless to work follow the usual instructions.

SD-cards reach their true potential

SD cards used to be toys used with small cameras and mp3 players that are too easy to loose between the sofa coushins (much less MicroSD!)

Then I got an Acer Aspire One with 120Gb harddisk. Along with the harddisk comes Windows Home Edition. Let it install so I can see if the machine works. It works. Amazing what the chinese can manage for such a nice price. The whole "small portable PC sold very cheaply" concept works for me. The largest problem in the picture is the teeny weeny small screen.

Now, how to get Linux (Ubuntu 8.04.1 which supports the Atom architecture) on it? No CD/DVD-drive in the beast, and I have no USB-CD/DVD drives. I do have some spare SD cards though.

Turns out that I can download a Live CD ISO image (the Ubuntu desktop CD is also a live CD), and the very nifty UNetbootin and get a Live SD card to boot live environment or install from. Then I need a memory card reader for the SD card since the AAO (apparently) can't boot from any of its builtin SD card slots (why is that?). Then you can persue the AAO documentation in the Ubuntu Wiki to get the OS installed and all the different bits working.

Didn't even have to waste a CDR.

And, somewhat to my amazement (not having read everything about it beforehand...) the Atom CPU is hyperthreaded too, almost as good as two cores.

Let me (once again) state the obvious: Something is afoot here. It's cheap and good.

Now to get the install "transmigrated" to "lpia" which is the formal architecture name for the Atom boxes. There are lpia repositories at ports.ubuntu.com, and i386 and lpia are binary compatible. I also have some other Ubuntu boxes where I can debotstrap a disk image that I can transfer. Will probably post about that later.

Thursday, September 11, 2008

Travel by SMS

I've recently traveled some between Oslo and Copenhagen for work. Whatever company I fly the tickets will be electronic, and I can check in using machines and my credit card or a printed paper with a barcode or somesuch. This is cool.

But when I fly SAS ("Scandinavian Airlines System" originaly, not "Special Air Service", the British special forces) I can check in by SMS, no need to get on the Internet or visit a machine. Even cooler.

Now all I have to navigate is the security line. If I fly SAS. If only they weren't so expensive.

Saturday, August 23, 2008

Business idea

I've read that RIAA and the like hire "protection agencies" to "protect" their IP on Peer-to-peer networks. Sort of like a protection racket.

Tonight I discovered, much to my embarrassment, that I've been running an open proxy for a while, and that it had been located by some service scanner and used. This explains why my tiny little server has been out of breath lately.

Looking at the access logs is a bit astonishing - maybe I'm naive. It's full of ad-URLs. So my proxy has been used to aid ad-fraud.

xx.xxx.xxx.xxx - - [23/Aug/2008:22:25:07 +0200] "GET http://ad.yieldmanager.com/imp?z=0&Z=0x0&s=310488&y=30 HTTP/1.1" 404 370 "http%3A%2F%2Fwww.btflash.net%2Findex.html" "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0; .NET CLR 2.0.40" xx.xxx.xxx.xxx - - [23/Aug/2008:22:25:08 +0200] "GET http://cpvtext.cpvfeed.com/cpv_inline.js?p=112491 HTTP/1.0" 404 380 "http://www.credit4loan.com/" "Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.7) Gecko/20040614 Firefox/0.8" xx.xxx.xxx.xxx - - [23/Aug/2008:22:25:08 +0200] "GET http://banner.adtrgt.com/cpv_inline.js?p=112842&cb=8699342731 HTTP/1.0" 404 378 "http://www.2onlinegame.com/" "Mozilla/4.0 (compatible; MSIE 5.01; Windows NT 5.0)"

The source IPs have been removed to protect the guilty. As you see I return 404 now. But there is obvious potential in aiding Google and the like in detecting ad-fraud. Could be a million dollar business. Good luck and remember to send me 10% finders fee ;-)

Tuesday, August 5, 2008

"Pay in your own currency"

One of the newest legitimate "scams" around is the option of "pay in your own currency" in all sorts of places where they accept credit cards. Today amazon.com offered me to pay in NOK (Norwegian kroner) instead of USD. It has been a while since I shopped there (I prefer amazon.co.uk due to the shorter shipping times inside Europe) so they may have offered this a while now.

Seems nice safe to pay in your own currency does it not? I'm sure a lot of people would think so, including my mom.

As all services this comes at a price. Credit card companies use pretty good exchange rates between the store currency and your own credit card bill currency. The store will not use as good rates. So if you let the store charge you in NOK (or whatever) they're ripping you off.

In the amazon webstore it was pretty easy to see what the "native" currency was. In some webstores it's harder. For example my domain pedler is in Canada, but the prices are quoted in US dollars. Do I ask to be charged in USD or CAD? ... Since the price was quoted in USD I chose to be charged in USD as well.

So: Just say no to yet another premium service you don't need!

Friday, June 20, 2008

All mobile phones suck

I want a new phone. The old one is broken. I'm using the family's vintage backup phone. The first phone I was happy with for more than a year was my old nokia 8890. I bought it so I could use it when traveling in the US, and I did, I even read and sent some small emails on my palm via IR to the phone. You can see it to the left here. It was small, light, and some of my colleagues called it a pimp phone. This was before phones became internet platforms. After the 8890 I got a 7110. The greenish phone with a spring loaded cover just like in the Matrix. The spring, not the tint. It was Nokias first WAP phone. WAP of the time was some catastrophy, data access over GSM was line switched and the minutes were dear. I soon came to miss my 8890 but instead I got a Sony Ericsson phone. It didn't last either. The first phone I ever had that got worn out after a year. I sort of hated it. The UI was flashy, but the CPU could only almost carry it off.

Time passed and Nokia long at last announced the first generation 8800. Steel and glass, and a bit heavy but I liked it. Very much. After two years, last fall, it broke, the microphone stopped working. It sucks to not be heard when you're talking in the phone. I switched to the vintage backup phone. No camera in it. I have a child now, and sending MMSes to my wife from our time away from her (away from my wife) is a missed pleasure.

Nokia now makes the third generation 8800s. This generation has decent battery life, decent picture resolution, and 3G support. Pretty good feature list. And they're so bloody expensive that I'm petrified of buying one. The original 8800 was merely very expensive.

I want a smallish phone with "current" features and not a freakish price. Nokia has none. Sony Ericsson has none. No-one has any iPhones are sort of nice, but way too large. OpenMoko is a very interesting concept, but the handset is too large. ... The closest I've come is Neonode N2. Looks nice, interesting UI, high geek factor. Only two things are against it: User reports indicate poor reception and there is no SyncML to syncronize with our calendar server. Oh, and poor availability in Norway.

There is as of yet no happy ending to this tale. I implore the worlds mobile phone manufacturers to make a small nice phone with a fast nice UI. And good reception. And SyncML. And fer gosh sakes! Sell it in Norway! Norway is a very good early adopter market!

*sigh*

Tuesday, May 6, 2008

Family data-center: calendar sharing

Actually, the Internet file-sharing I wrote about previously has been totally uninteresting to my wife. Internet available calendars on the other hand!

When we were just two and she studied and studied for years we had few or no scheduling conflicts. When she started to work it was still manageable, we still only had each other to take into consideration. When we got our daughter the cup runneth full. The little critter was clearly the most important person, and our schedules had to be adjusted to her being among us: Kindergarten x-mas and easter breakfasts, parent-conference there, drop-offs and pickups adjusted to meetings and travel needs. This clearly needs a technological solution!

To be fair, I got this idea from my colleague Bjørn. His wife is a nurse, she works all kinds of hours on a weekly basis, he consults with a client that has all sorts of needs early and late and weekends and what not. And he runs a boy scout troop. They needed calendars long before they procreated.

Being an old fart/dinosaur I resisted this idea for a long time. Fortunately calendars proved surprisingly easy.

I use Thunderbird as IMAP(mail) client. There is a humongous plug in for Thunderbird called Lightning that gives it calendar abilities. There is also a standalone version of Lightning called Sunbird. In the most basic form these store .ics, Ical files locally on your machine. But that does not make them internet available. The next step up is storing the .ics files on your webdav server -- see, suddenly the webdav server became much more desirable! This is very easy, just give lightning a HTTP or HTTPS URL pointing to the webdav file and it will read and write directly to it.

There is a downside to this easy solution: You can only have one program/user attempting to update a calendar at a time. Your whole calendar is just one large file, and it can take several seconds to retrieve or save, and if someone tries to save the shared calendar at the same time, your're so SOL. So, some discipline is needed to use this. That includes shutting down all unused calendar clients, as my wife discovered some days ago, she lost her whole calendar due to some such mishap.

There is a fix to this, it's called caldav. Calendar over DAV i.e. over HTTP. The relationship between caldav and ics over webdav is the same as the relationship between Maildirs and mail-spool-files. The first works well even with multiple clients accessing and updating it at the same time, and the second sucks and is prone to corruption and data-loss.

If you're OK with not having a web interface to your calendar - there is a way to implement caldav without installing a whole groupware suite. After all you installed a working e-mail solution years ago, no need to redo that. The caldav implementation I chose/fount is called davical. It is implemented in PHP and uses Postgress for storage. It was a bit fiddly to install, maybe I did it wrong, maybe their docs were slightly outdated.

davical used to be called rscds, and therefore lives at http://rscds.sourceforge.net/. There are Debian .deb and Red Hat RPM files at source forge. Once you have them installed and read and followed http://wiki.davical.org/w/Installation_Stuff you can give your calendar URL as shown in http://rscds.sourceforge.net/clients.php. The first time I did this, and imported an old calendar with the help of Lightnings export/import functions, davical sat there quite stunned a while. And then it worked. It's fast to delete from, it refreshes quite fast compared to huge calendars in ICS files and so on.

Family data-center: file sharing

One of the joys of Linux is easy, well, relatively easy anyway, setup of Internet services.

Todays service is webdav, a file sharing protocol for the Internet based on HTTP. You will need a Internet connected Linux box that you can connect to somehow through the use of dynamic DNS or some such. My home based Internet server is an oooold laptop running Debian Etch (PII, 366MHz, 190MB, 10GB disk). Very easy to maintain, upgrade and install new stuff on. I will assume you use a modern Linux distribution in the following, and also assume that it's Debian.

Next you need Apache, and to enable the modules dav and dav_fs. On most Linux machines you can run these commands as root: "a2enmod dav; a2enmod dav_fs". And create the directory dav under the Apache Document Root to store files in. Often this will be /var/www/dav . It must be owned by the user Apache runs as, on debian that's the "www-data" user: "chown www-data /var/www/dav".

Now configure Apache. In /etc/apache2/conf.d create a new file called dav.conf:

<directory /var/www/dav>
Order Allow,Deny
Allow from all

Dav On

AuthType Basic
AuthName "Langfeldt.net WebDav"
AuthUserFile /etc/davpasswd
Require valid-user
</directory>

This sets up access control for the directory and enables DAV in it. The password file is created by the htpasswd command as root. To create a first account called "janl" run "htpasswd -c /etc/davpasswd janl". For subsequent accounts or password changes drop the "-c" option. If you take out your web browser and direct it to http://yourserver/dav" you should be greeted by a password dialog. Your browser should then show a mostly empty directory listing. Firefox can only show webdav directories, but the KDE "konqueror" is able to also copy files into a webdav directory. In
konqueror the URL is "webdav://yourserver/dav" or "webdavs://yourserver/dav" if you have SSL on the web server. You can use webdav with Gnome too of course.

Now you can store files on the webdav volume and access it from anywhere in the world, whenever. in.solit.us has a useful help page at http://in.solit.us/about/webdav .

That's all for today. I'll return with something that may give you more cred with the wife: family calendar services.

Monday, March 24, 2008

Widescreen is theft

Everything has to be widescreen these days. In a TV I'm all for it. On my computer it's theft. Screen sizes used to be 1024x768, 1280x960, 1400x1050, 1600x1200 or even 1920x1440. Now they are widescreen and the resolution is 1024x576, 1280x720, 1400x787, 1600x900 and 1920x1080 (or thereabouts, sometimes they're 16:10 not 16:9). See, they didn't give us wider screens, they gave us less tall screens! They stole our pixels!

If my primary use of computers was looking at movies or TV this would be fine. But it's not! I web-surf, read and write e-mail, edit Wiki pages, work spreadsheets, program. For all of these more lines on the screen is better: it results in less scrolling and better overview.

Friday, March 21, 2008

KDE4 - ooooh, that hurts

I have been using KDE since before Gnome was usable (and Gnome is still not usable ;-) KDE has the useful property of having nice defaults and a good interface to change them in. Whenever I install KDE anew I only need to click around for 2 minutes or so before it's not only usable but cozy. Also KDE people seem to know such classics as "Apple User interface guidelines" (I hope that's the title, I have version 1 in a box somewhere and Amazon does not seem to have it) which has had a tendency to make their GUI usable in other ways too. So when I switched to Ubuntu I naturally started using Kubuntu, the KDE desktoped version of Ubuntu.

KDE4 was finished some time ago. When it was first made available for Ubuntu it would not install. But it installed when I tried just now (quiet easter days...).

OW! It's in need of some serious tweaking. I shall have to yearn for 4.1 I think. Meanwhile I'll use KDE3.

After using it for 30 minutes I can say that it is very slick looking. Animations and sound effects where ever. But it is so broken. Let me count the ways:

  1. The "K" (start) menu is now a scrollable window into the application hierarchy. This makes it TOTALY un-navigatable! One of the basic tennents of UI design is that the user should be able to recognize where he is and how he got there. The new K menu gives the user such a small peep hole into the K menu structure that it's totally unusable. True, it has a "search" function where I can enter either "irc" or "konversation" to find my IRC client, but I would still claim that it fails the "mom" test. My mom would not be able to use the new start menu. Even if I helped her over the phone it's not easy enough to use as she can't see where she's at.
  2. I like to have the system bar ("kicker" in kde3) vertically on the rigth side of my screen. It was easy to adapt in KDE3: Adjust the clock size so it fits, the task icons just show, with no text so I can recognize the tasks in the task bar. Perfect. The KDE4 "panels" clock is not size-adjustable and gets cut off. The task thingys are elongated and evenly spaced over the whole task-bar part of the panel, I have no idea why. Not tested in the vertical setting I expect.
  3. There is a "new devices" widget in the panel that is some kind of plug and play manager. When I held the mouse over it a window poped up. When the panel is in the vertical-right position practically the whole of the popup window is outside the screen.
  4. The "log out" widget for the panel does not adjust well to the "tiny" or "small" settings. In KDE3 it re-arranges the "lock" and "log out" icons to fit better, in KDE4 they are resized to "micro" and impossible to see.
  5. The KDE4 panel lets me add "widgets" (I'm not sure this word is a good replacement for "applet" of KDE3), and the widgets appears on the panel somewhere. Re-arranging them seems not possible.
  6. Where did the kde-mixer applet go? I need my sound mixer in the panel!
  7. The new Konsole program has a totally cool way of changing settings. When I mouse over an alternative the window changes at once. BUT, it can't recall from instance to instance that I don't want to see the menu bar. Really not!
  8. I want to use ALT+LEFT and ALT+RIGHT to switch desktops dammit! I don't care if this is a oft used application shortcut because I never use it.
  9. There is no "disable all sounds" button in the notifications control panel. The only thing I want to make sounds is amarok. My desktop needs to be quiet... After growing weary of turning off sounds one by one a while I found out that if I switch tabs I can disable sound-effects entirely by disabling the sound-sub system. I'm sure that's not intuitive. I would hope to be able to disable sounds from the place I can see them enabled.
That's enough I think. Back to KDE3 for me.

Saturday, February 23, 2008

Er teknologi alltid et framskritt?

Saturday, February 16, 2008

The sound of silence

Can you build a completely quiet HTPC box? Can it run on off as little as 300W?

Finally! My MythTV PVR box is no longer the loudest in the living room. The two to three laptops that live there easily out-hums the larger box since I moved the machine into its new "HTPC Classic" cabinet made by mCubed. It is a good looking black aluminum fronted case with a mirror (plexi)glass "visor" across the front and symmetrically placed "on" and "eject" buttons. The DVD players front plastic has been pulled off and the mirror glass on the left side of the visor is taped on in it's place. Looks good and sounds good :-)

I wrote about the machine components earlier. Suffice it to say that it's a simple Athlon motherboard with a dual core Athlon64 X2 65W CPU. It was an ideal choice with regards to price, power and power consumption. I'll concentrate on the case and how it works this time.

The central idea with this cabinet are the huge heat sinks on the (out)sides, and mounting heat pipes on the hot things inside to channel the heat to the heat sinks. No moving parts cooling. Adding to that "vertical silence" aluminum disk casings with heat sinks and an all embracing rubber mat that goes around the disk inside the case. And mounting holes on rubber piles you also get pretty durn quiet disks. I can still hear the occasional seek sound, but there isn't much cause to seek the disk unless it's used. The disks are, according to their S.M.A.R.T. based temperature Munin graphs running at exactly the same temperature as before, except that I stacked them other way so the other one is now the hottest one. Graph shown below. To the left of the gap is before, to the right is now.

There are two interesting questions in this conversion:

  • Will I get by with a 300W PSU?
  • Will things stay cool enough?

Power and cooling


Reading forums and such one easily arrives at the conclusion that any PSU smaller than 500W is just too small for current CPUs and graphics cards and disks and whatever. I had chosen a low W CPU for this, a low featured mother board, and not the coolest graphics card either. The graphics card manages on the power it gets from the PCI-E bus, unlike some others (which need the new PCI-E power connectors or other extra power sources). The Munin graphs for voltages stayed exactly the same, even when playing back video and recording at the same time.

When it comes to temperatures things now are definitely hotter in some places. The GPU used to have a angry small fan. The scary bit here is that the new cabinet is positively perforated, and has 3 large vents in the back at the top, so I can hold my hand over the vents and gauge the temperature for myself. The GPU gets HOT. The NVIDIA measuring tool says it gets to 70-80C now, with heat pipes. It used to be 50C, with the angry fan. I hear from friends that their graphics cards run all the way up to 125C. 80C should be OK then. But I'll still check the couplings some times to see if I can get better heat transfer.

The PVR350 TV input card does realtime MPEG2 encoding in hardware. It has always been sitting in a poorly ventilated corner of the machine, with only its heat sink to defend itself with. Which it has done for many years now, and I've had no idea with how hot it gets. But with the vents I've realized it gets plenty hot. Fortunately, even without a fan in the case it now gets more air circulation than ever, due to the case perforations. It, and the GPU now serves the living room as a low intensity heat source (as it did before, come to think of it). By the time the air leaves the vent it's less than 30C).


Very difficult to build though

The other thing apparent from this graph is that I used almost 4 days (well, evenings, after the kid was asleep) from turning the machine off in the old cabinet and turning it on on the new one. It was bloody hard to mount everything in the cabinet. This was my hardest PC building project yet.

I have mounted my own kitchen, all manner of IKEA things, and a couple of PCs before. Building a mCubed box should not be attempted by anyone that is easily frustrated by such construction projects. Each and every one of the illustrated instruction sheets or pamphlets carry a disclaimer that a un-experienced PC builder should not try this at home. They are not kidding. There are instructions with everything that went into the case. But no where as detailed as IKEA instructions. You're required to figure out a good number of things while you work. The first thing that puzzled me was the CPU bracket spacer pieces. There were two sets, slightly differing, but both the same length. Of course I mounted the wrong ones first. It was obviously the wrong ones once I tried to complete the CPU bracket mounting as the nuts would never engage the screws properly. But I suspect that a number of people tried force before arriving at this conclusion.

Most of the troubles stem from the small inside. On the outside the cabinet is a standard width ATX desktop cabinet, and it's 5cm deeper. BUT, the afore mentioned huge heat sinks take up quite a lot of the width of the cabinet. On the inside there is enough space for a standard ATX mother board, the drive cage and the fan less 300W PSU. After that there is hardly any space for routing power cables, or anything else. In theory I should be able to fit 3 hard drives and the DVD drive into the cabinet, but I'll never get in a third drive, that drive bay is occupied by power cables so they don't have to lie messily around across the mother board. Not that I'm very happy with the degree of neatness I achieved. While mounting I dreamed that Lian Li would buy mCubed (Lian Li make the most easily buildt/mounted PC cabinets I know, they're also quite expensive).

Removing the cables to make room, I set about fitting the heat pipes. The ones for the CPU were easy and the heat pipes were very easy to bend as needed. That was one the least crowded side of the cabinet. The north bridge and the GPU heat pipes were to be terminated on the other side. This side already dominated completely by the PSU. I needed 5 very time consuming tries (over two evenings) to get the heat pipes in place.

In retrospect I notice that there are no pictures of the GPU and north bridge heatpipes mounted at the same time anywhere in the mounting instructions. If it wasn't for the fact that I've seen reviews of complete machines in this case I would have suspected that no-one had attempted mounting both at once before.

It's very crowded in the corner where the north bridge and GPU heat pipes have to go: Power lead to the PSU, TV-input card, mother board power, IDE cable, SATA cable, and a myriad of HDD-led, power-on and such mother board "heads" that have to be connected to get the thing working. And the iMON LED panel USB cable. In addition to all the power cables that are just hanging in that corner.

Another thing is the DVD-tray opening switch. In the baggie with stuff for the cabinet there is a small thing with some clear rubber lens shaped bits. They don't stack well at all. I had to find something else to pad the distance for the DVD-tray opening switch.

Pretty though

On the other hand. Everything is quite nice looking, if crowded. Plexi glass and chrome all over the inside. Black aluminum on the outside. The heat pipes are a bit unevenly finished, but not ugly, and the heat pipe clamps I received had quite coarse rounded milling patterns on them. Somewhere in the history of those metal squares there has been a large milling machine with a uneven cutting tool. No matter, the ample cooling paste that came with everything easily filled in the unevenness where it counted. And the outside is fault-less.

What I don't have to do with this setup is change cooling water every 6-12 months. And no cooling tower in the corner of the room either.

And they provide the screw drivers needed for putting it all together. An especially long stemmed screw driver is needed for fastening the drive and power cages. I would have had to go shopping for tools unless they had provided those I needed. And they also provide enough cooling paste, in every package that needs some. Nice touch.

Recommendations for mCubed

Please, if anyone from mCubed ever reads this, I have some suggestions for the box:
  • Deliver the PSU with a power lead that has a shorter connecting block, or even a 90 degree knee in the block. This will take less space from the heat pipes and stuff
  • On the PSU side of the cabinet make more holes spaced 1/3rd longer apart so that the heat pipes may enter the clamp blocks between the clams. As it is now the clamps are so closely placed that in effect there is only one clamp block
  • The north bridge of most computers hides behind the graphics cards. It is likely that a random user needs 3 90 degree angles to be able to connect the equipment to the clamp block. And it's bloody hard to mount both north bridge and GPU on that side together - see also the previous point.
  • If somehow the PSU could be rotated 180 degrees along the long axis so that the lead connection comes close to the wall of the cabinet this would save space and heat pipe logistics. Drop the knee on the lead then.
  • A FAQ please? What happens if I unbend a 90 degree knee on a heat pipe (I guess it breaks open)? Can I cut a heat pipe or are they based on a fluid heat transport (I guess it's based on fluids due to the way the pipes are sealed in the ends. But does the two lower heat pipes from the CPU work really well then, their up goes towards the CPU, not away as with the two higher ones do)?

Saturday, January 26, 2008

CD cover art in Amarok

I have long since RIPed all my CDs and they're now stored in the basement. I listen to my music on my MP3 player or on various computers that have a copy of the collection (including the living room MythTV media center of course). I use Amarok as player on most of the computers. It has a nice cover manager which can retrive cover art from various Amazon sites or give the URL to a cover image stored elsewhere. IMHO the covers adds to the experience of playing MP3s and I like the feature very much.

But, Amarok keeps the cover art in a cache directory with md5 sum file names. When I copy my collection to a new computer I have to re-find all the covers... This sucks. Amarok has a second way of storing the cover images. If I save a graphics file in a album directory this will be viewed as the album cover by Amarok. So all I have to do is get the covers from the cover manager into the MP3 directory hierarchy. Right!

It turns out that Amarok can be remote controlled by DCOP, "Desktop Communications Protocol", which is sort of like DBUS ("desktop bus" I suspect, it's part of the open desktop initiative which, it appears, will eventually make all the different desktops somehow interoperable by using common protocols).

If I type "dcop amarok" at a shell promot I get a list of all functions available:

qt
KBookmarkManager-/home/janl/.kde/share/apps/amarok/fileBrowserBookmarks.xml
KBookmarkNotifier
KDebug
KDirNotify-1
KIO::Observer
KIO::Scheduler
MainApplication-Interface
collection
contextbrowser
devices
html-widget1
html-widget2
html-widget3
html-widget4
html-widget5
ksycoca
mediabrowser
player (default)
playlist
playlistbrowser
script
Turns out I can do quite a lot with this, like starting and stopping playback. Changing the volume or skipping to the next track.

After some trial and error I found "dcop amarok player coverImage" which will return the path of the cover image of the currently played track: "/home/janl/.kde/share/apps/amarok/albumcovers/cache/130@7ab00582116d9a9034221828a4df648e" and similarly "dcop amarok player path" which returns the path of the currently playing track. So I know what directory the currently playing album is stored in. Just a short script away from what I want then:

#!/bin/bash

# Script to dump cover art into album directories.

# BEFORE YOU RUN THIS:
# - Use the cover manager to find and install covers for everything
# - Load your entire collection in the playlist
# - Set the volume to "0".
# - Run this script - and wait... Note that the script cannot tell when it
# has completed O:-)

# This scrip will for each played track ask for
# - The directory it is stored in
# - The cover image
# - If there is no cover image in the directory given copy the cover image
# there with the filename albumcover.png

# This all takes a good while if you have some thousands of tracks,
# perhaps as long as one second pr. track, so easily hours. But it is
# automatic

OSD=$(dcop amarok player osdEnabled)
dcop amarok player enableOSD false
dcop amarok player play

while :; do
ALBUM="$(dcop amarok player album)"
NOW="$(dcop amarok player nowPlaying)"

echo "** $NOW / $ALBUM"
TRACKPATH=$(dcop amarok player path)
COVER=$(dcop amarok player coverImage)
dcop amarok player next

case $COVER in
*nocover.png) continue;;
esac

DIR=$(dirname "$TRACKPATH")
[ -f "$DIR/albumcover.png" ] || cp -v "$COVER" "$DIR/albumcover.png"
done

dcop amarok player enableOSD $OSD
Now I can use rsync or unison to bounce my collection around - including the covers. ... But wait, it's not quite perfect yet, I'd like my MP3 player to show covers as well! There were several rockbox cover scripts in the Amarok wiki, but none suited me perfectly. Fortunately it's only a question of generating a 100x100 .bmp file called "cover.bmp" in each directory. The "convert" command from Image Magick does this without fuzz. Thus this script:

#!/bin/bash

COVER_SIZE="100x100"
RBNAME=cover.bmp

find . -name 'albumcover.png' -print | while read cover; do
DIR="$(dirname "$cover")"
NEW="$DIR/$RBNAME"
if [ -f "$NEW" ] ; then
continue
fi
echo Converting cover in "$DIR"
convert "$cover" -geometry $COVER_SIZE "$NEW" || exit 1
done

To use it simply cd to a MP3 directory hierarchy and it will find all albumcover.png files and make cover.bmp from them. Then sync to your rockbox MP3 player.