Fighting with computers

Computers are not always friendly.

Saturday, November 25, 2006

Command line scanning

I needed to get scanned some pages of a catalog. I own a cheap Acer 3300U scanner that works nicely under Linux. It is not fast: It scans a 300dpi A4 color page in 50 seconds and it halves that when using gray instead. Lowering scan resolution to 150dpi reduces the scan to around 15 seconds.

But if you plan to scan more than one page you need to save each one and you have to provide a name for them. That means some mouse clicks and some typing at the keyboard. I was wondering if it was a better way, something like an automated script. I learned that there is a command line tool in the scan-tools package called scanimage that does just that: It allows you to launch a scan from a script. So what I did was to create a simple for loop and I used the loop variable to increase the page count. Each iteration was scanning a new page and converting it to a JPEG file with a sequential name.

After a power problem with the scanner I learned that next reconnection used a different device name, so I included that onto my script to avoid having to change it all the time. This is the final result:

if [ -z "$1" ]; then
echo "usage: init_page end_page"
DEV=`scanimage -L|grep snapscan|cut -d " " -f 2|sed "s/\x60//"|sed "s/'//"`
echo "DEVICE=$DEV"
for((i=$1;i<=$2;i++)) ; do
scanimage -d $DEV -p --mode=gray --resolution=150> page.pnm
convert page.pnm p`printf "%03d" $i`.jpg
echo "Scanned page #" `printf "%03d" $i`
printf "press enter for next page\n"
read x

Wednesday, November 22, 2006

The YouTube of slide shows

I've just came across this service. I'm sure they have been around for a while, but it is now when I learn about it. It seems like a good idea and a useful service. The sample below is just to show you how it works.

It is too bad that animations are lost in the process. But rest looks quite ok (all but some minor alignment problems). It imported the above document from an OpenOffice 2.0 Impress document.

Thursday, November 16, 2006

Making the move ...

As things were quite smooth lately, I chose to spice it up a bit: I've moved four of my blogs to the new Blogger beta. I was quite scared as there was a warning message telling you the process cannot be undone. So if I am not lucky with how it works I can do nothing.

This is the first post and it seems to be working ok. The editing tools look quite the same but loading times look a bit longer. So don't be shy and use this damn "comment" thing to make us know your opinion as a user (no Mom, you do not have to do it).

Update: Good news, what it has been improved is the publishing delay. Now it seems almost instantaneous. No more time waiting for a post to be published. Well done!

Monday, November 13, 2006

Sweet 4GB pendrive

I've bought --from a brick and mortar shop-- a 4GB ECO pendrive (pendrive is also the brand name). It is a stylish and small pendrive with a rotating cap that hides or discovers the USB socket. It works nicely in Linux and it does too in Windows and OSX. However, it takes a non-negligible time to be detected under WinXP. It turns out that the device is not only emulating a hard-drive but a floppy disk too. So if you have a laptop and you still keep one of these old applications that insist on writing on drive A: you might be pleasantly surprised with this unit.

You do not get any differentiation when plugging it in on a Linux box: Two different drives show up (one with 1.5MB capacity and another with 4GB). It seems only the 4GB is recognized by OSX though.

My only complain is that the manufacturer only includes a keyring but not a necklace to carry the unit around. And the rotating cap is made of plastic so your metal keys will ruin its looks in a couple of days.