Rants and Ruminations 98 to 104 of 149 articles InfoSyndicate: full/short
Using the Canon Digital Rebel with linux   13 Jan 05
[print link all ]

After some nice entries on management, hiring, firing, nice photographs etc., it is time to get down to technichal detail again (yes, I have been programming today as well, maybe more about that later). So, if you don't use linux or are not in to digital photography with large RAW images, this post is not for you... See you next time ;-)

From my trip to Arizona I returned with a Canon Digital Rebel digital camera, which features exchangable lenses, SLR (the viewfinder looks through the lens with a mirror) and 6.3 mega pixels :-), and everything can be automatic or adjusted by hand. One thing I like about it especially, is that it is a photo camera: no diary, not games, no "boot up splash image", no movies. A very nice camera, even though I had to return it after two days because of a mechanical failure.

Since the images are large, I have a 512 MB compact flash card with it - I prefer to buy equipment that uses simple, cheap, industry standard components (as opposed to SD cards, Sony specific memory etc.). The camera is apparently supported under linux by gpoto2, but not by the version I have installed currently (SuSe 8.2) not wishing to install extra software (which would prove to be slow, given that the camera and my laptop support usb 1.0 only) I decided to get a compact flash reader for my laptop - which proved to be industry-standard cheap: 7 Euro and 50 cents at my local computer shop.

If you read the manual (pcmcia howto) carefully, it is easy. Of course I started reading after encountering problems. lsmod found pcmcia-core and ide-cs installed, which means pcmcia is installed, and there is an ide-hard drive attached to it. The compact flash card acts as a harddisk, which is nice. /var/log/messages.

cat /var/lib/pcmcia/stab
Socket 0: ATA/IDE Fixed Disk 
0       ide     ide-cs  0       hde     33      0

tells me the flash card is assigned to /dev/hde. Now I could mount it, if I had noted this line in the pcmcia howto:
A common error when using IDE drives is try to mount the wrong device file. Generally, you want to mount a partition of the device, not the entire device (i.e., /dev/hde1, not /dev/hde
instead, when doing

mount -t vfat /dev/hde  pcflash
I got the error 'wrong fs type bla bla bla'... After having found this in the manual it works flawlessly, doing
mount -t vfat /dev/hde1 pcflash
as usual with systems administration stuff, it is one small letter making a big difference. It seems that it is possible to mount it automatically as well using /etc/pcmcia/ something, I'll check that out later, now I want to do something with my pictures! (view them for instance...).

eat it RAW

Charles Vermeulen asked me innocently 'can your camera do RAW images', sure it can... RAW images are, unlike JPEG images, compressed without information loss (so-called 'lossless compression'), kind of like ZIP, but with meta-data about exposure, white-balance etc. The digital rebel spits them out, together with a small thumbnail (in JPEG) so you can see what the picture is about in your browser. Since there is no standard for RAW images, each manufacturer makes them differently.

Luckily, there is dcraw by Dave Coffin, which is reportedly faster and more accurate than the software provided by Canon (I am going to check that out, but the windows software for my Digital Ixus / Elph was so buggy it was hardly usable, so I find it believable for now). Dave's code is also used in commercial packages such as Photoshop.

Compiling dcraw is easy, just follow the instruction on the homepage, and one .c file leads to one executable. Dcraw transforms the raw image into PPM, which is universally read under linux.

Having GIMP (the GNU Image Manipulation Program, the open source equivalent of Photoshop) read RAW files was a bit more work. Again, basic instructions on how to use gimptool to create a plugin are on Dave's page. But, you must have installed the gimp development toolkit. SuSe provides packages for that through YAST, and after that, it is simple, although you have to run gimptool in a user's directory where you have used the GIMP before, otherwise gimptool doesn't know where to put the freshly created plugin.

And then, it just works, you can choose to use 4 colour RGB (whatever that is), use the camera's white balance or not (apparently just metadata) and some other options I do not yet understand.

Checking OpenOffice documents for correct spelling in your mothers' tongue   13 Jan 05
[print link all ]
Having completed the TagCleaner, so I could clean HTML output from OpenOffice, I noticed I still hadn’t gotten around getting the Dutch spell-checker to work under SuSe Linux. In complexity of configuration OpenOffice sometimes matches commercial office suites… sigh. Documentation exists, but it is a bit hard to find, it took me half an hour to get to it.

These are the steps (for OpenOffice 1.02):

  • go to yast, and install myspell-dutch (or your own language instead of dutch :-)). Installing the package updates your open office dictionary configuration file (dictionary.lst) automatically.
  • add the dutch dictionary (and hyphenation list if you want to) by going to Tools->Options->Language->writing aids. Behind the ‘edit’ button on the right you can then add the dutch dictionary. More details for this step are outlined here: distribution.openoffice.org/cdrom/Dictionaries.html
  • to use the dictionary in your document, you have to change the language, which is un-intuitively hidden behind Format->Character, where you have to look in the Font tab, where there is a ‘language’ drop-down list. I wonder how it ended up there… I would have expected this feature in paragraph styles under ‘language’, which doesn’t exist.

Careful Attributions   13 Jan 05
[print link all ]
I try to give credit to my sources in this blog, when I can remember where I found something. In the last day of the new year In the post on IT Conversations I made a slip, I wrote Kay Johansen where it should have been Kay Pentecost. Sorry Kays...

Luckily, blogs are made from bytes, not concrete. I use rublog to publish my blog. It is very basic, and publishes everything from text files. So I can easily correct slip-ups like this, by correcting the blog entry and after saving the text file, change the date back to the original date. Charles Vermeulen recently told me he had bought a program for this purpose. You don't have to buy software to get this feature. Unix has the

touch
command which allows you to change dates. Linux distributions have it, and Mac OS/X probably as well. Under the other desktop operating system, it is included in cygwin, which provides the familiar and powerful unix command line for the OS that hasn't improved its' command line since DOS 1.0 .

touch works like this:

touch -d 20041231 ITConversations.html
Use -d for changing the date, and then the year, month and day and the filename after the space. Quite simple.

To prevent slip-ups with links, I have made a small program that automatically inserts hyperlinks to people I quote regularly. That way, I only have to correct mistakes once...

TagCleaner, or how I got my OpenOffice documents to behave on my website   13 Jan 05
[print link all ]

Failure is not an option - if your system keeps on running...   13 Jan 05
[print link all ]
It is nice to have Linux servers run for months on end. What is not so nice, is that your system administration skills and policies have to match that…

I had moved willemvandenende.com over to a new high-bandwidth server outside my house, all was well, except there was a strange idiosyncracy, when starting the web-server, it complained it couldn’t find a script with a strange name (net.defaultroute~ - I couldn’t figure out what the tilde was doing). Oh, what the … I thought, I’ll figure it out when I have some time, the system doesn’t seem to be running any worse…

Until the folks operating the (virtual) server boxes decided to install a kernel patch (there was a security whole in the Linux kernel - very rare). They were nice enough to send us and advance warning that they were going to reboot our machine. I thought, well, not much can go wrong.

I was, of course, wrong! When rebooting the machine, it started to look for the net.defaultroute~ (notice the tilde), and it couldn’t find it (of course not). Now the machine couldn’t give itself a name, and was hence unreachable.

As Murphy would have it, this happens in the busiest week of the year. And I still don’t know how to solve the defaultroute~ thingy, so it remains down. After a few days, I finally realized, that I have a backup server (the one in my attic that runs all the other domains) and that I could simply point www.willemvandenende.com to that…

Then of course, when I woke up this morning… no network… the ADSL modem had given up (this happens about once a year).

Lessons learned:

  • Most of my system administration troubles happen in late November and throughout December (the whole thing seems to have an MTBF (Mean Time Between Failure) of about a year, and then everything comes at once. The rest of the year it is just simple power failures and such.
  • Having known flaws in your system administration, even if they are minor is not an option, just as with XP style programming: it works best when there are no known defects.
  • (again) test rebooting your server, and see if all services come up again.

Struck by lightning...   13 Jan 05
[print link all ]
As you may have noticed, willemvandenende.com was down over the weekend. The site runs from a webserver in my attic over an ADSL connection. Thursdaynight, heavy lightning struck near my house and in other places in the neighbourhood as well. The KPN did not succeed in fixing everything on friday. Apparently, repair crews worked on other towns during the weekend, so finally on monday a friendly mechanic came by to sort out various problems.

His visit highglighted an interesting problem with layered network architectures. The technician mainly looked at the physical level (is there signal), and knows how to make the phone over ISDN work again as well (KPN mechanics carry spare NT1 boxes for converting line signal to ISDN with them as well). For repairing ADSL I was somewhat left to my own devices. The ADSL modem/router seemed to work - but like the NT1 it didn’t really… Due to the lightning the modem could no longer connect. I found this out because I have a spare ADSL modem handy, due to previous troubles…

Suse Linux on the Asus l5800c   13 Jan 05
[print link all ]
I’ve got a shiny new Asus 5800 laptop, running SuSe linux 8.2 on it. Most stuff works straight away from the installation DVD. The wireless lan does not work (its’ a broadcom, and I read somewhere it is not supported at all under linux) and it is better to turn ACPI off with the kernel option ‘acpi=off’ at boot, otherwise the machine will overheat and shutdown.

With some work X and the gigabit network card operate properly.

XF86Config

Forget about using Yast to configurate X, because it makes a mess of it, do the X configuration manually.

Linksys gigabit ethernet card

The linksys card has to be compiled into the kernel separately, but this is easily done. Install the ‘kernel sources’ package, go (as uesr root ) to /usr/src/linux and type ‘make oldconfig’, so that the current system configuration is represented in the kernel configuration. Then unzip the linksys install script somewhere (e.g. in /root/) and run it. The install script takes care of everything for you - it checks system prerequisites, and compiles the ethernet driver module so it fits with your kernel.

After compiling the kernel module (you don’t need to reboot like in Windows :-) ), do ‘modprobe sk98lin’ and ‘ifup eth0’ and everything should work as usual. At home and everywhere at clients, I use ‘dhcpcd’ to the rest of my network configuration for me, so that’s no effort either.

I finally got it to work without overheating. Add ‘acpi=off’ and ‘noapic’ to the grub command line (in /boot/grub/menu.lst) .

More info about this laptop on tuxmobil.org/asus_l5800c.html and tuxmobil.org/asus.html

Copyright © 2009 Willem van den Ende