Using wget as a downloader in Chrome

Downloading with the default downloaders in Firefox or Chrome never was my favourite way of archiving things away. You lose two metadata information – the modification time of the downloaded file is set to the download time and the URL path is stripped, you only see the filename in your download folder.

Therefore I usually copied and pasted the URLs into a terminal and prefixed the URLs with “wget -m”. Before that I had to create a matching folder and cd into it.

This grew cumbersome, but the real reason for searching for a solution within the graphical browsers was the fact that more and more sites have download protectors installed that require a sane referrer, or maybe even session cookies.

I searched the net for a solution and stumbled over a Chrome extension created by Google, called Chrome Download Assistant. There are several other solutions, but this was the simplest and still widely used solution that suited my needs.

The default setup has a wget download handler, which preserves the downloaded file’s timestamp (if provided by the server), but loses the URL path. The wget command called looks effectively like (this is with version 4.0.7):

wget -c --referer="$REFERER" -O $FILE_NAME "$URL"

The extensions allows to add you own download handler, but there isn’t much documentation besides the source as to what variables are available. As of 4.0.7 the following variables can be used:

variable description
$URL The URL of the object that is to be downloaded
$REFERER The referring URL to the object to download (the misspelling is historical and required)
$FILE_NAME The full path to the object on the local storage (as envisioned by chrome)
$DOWNLOAD_PATH The directory components of $FILE_NAME

I constructed a custom downloader like

wget -mc --referer="$REFERER" -P "$DOWNLOAD_PATH" "$URL"

Unfortunately this didn’t work as there was a bug ignoring all but the first argument, but this is fixed now.

There is another smallish issue remaining in that $DOWNLOAD_PATH is only set for certain predefined downloaders. So the above line effectively uses $HOME as a download root. Until this is addressed one can explicitely hardwire a download location or just use $HOME.

Posted in Uncategorized | Leave a comment

DOSBox and greek

I recently migrated a network of Windows XP stations and servers to Fedora Linux. Most of the migration project was the classical service migration stuff, but there were some challenges like running old DOS programs (for which there are no sources to rebuild).

The overwhelming majority of (DOS) software projects from the 90ies in Greece were based on Clipper. For projects where you do have the source you can use Harbour, a Clipper-compatible compiler that builds for Linux and several other platforms as well. The others need an emulation layer like Wine, DOSEMU or DOSBox. The first two gave up on the old Clipper program. Wine directly referred to DOSBox, and DOSEMU had a Blinker fatal error 1202.

So I went with DOSbox, which is probably the safest bet with old DOS programs anyway. The next issue to overcome was to use proper codepages for keyboard and screen to represent the Greek language. There were different codepages available for placing the Greek characters in the upper half of the 256 block available. The dominant one was codepage 747, a variant of codepage 437. The main traits of the latter were limited support for several Western European languages and box drawing characters. Codepage 737 swapped out the support for the Western European languages to add the Greek alphabet in lower, upper and accented versions.

Since then the Greek support in various operating systems has roughly seen two transitions, one to ISO/IEC 8859 (ISO-8859-7) and then to Unicode. Support for legacy codepages has been constantly vanishing from the sources, terminal emulators, pagers like less and others are not anymore capable to support codepage 737.

Fortunately DOSBox still has support for codepage 737 and in fact is quite easy to invoke – just add -c “KEYB el459 737″ to the command line, for example

dosbox OLDDOS.EXE -c "KEYB el459 737" -securemode -exit

The command above will use a dual keyboard layout, which needs to be switched with the left Alt key and one of the two Shift keys (no toggling, the left Shift key switches to English and the right one to Greek).

Posted in Uncategorized | Leave a comment

Setting up a new home

I sometimes wonder what kind of geek I really am. On the one hand I love playing with new tools, configuring them, adjusting them, and extending them to new functionality. On the other hand I am sometimes very cautious with new gadgets coming along my way.

It took me ages to get my first mobile phone, I was using fvwm into the new millennium and I just recently made the switch from mutt to evolution. Until Gabe Rubin invited me to facebook about the end of 2008 I had no real online social presence, just a ton of mailing list posts (actually I had an old orkut account, but I somehow had lost interest quite early on that).

Usually my reasons were lack of features – what good would a phone be if it couldn’t connect to the net? After all my primary communication medium was emailing. Why should I give up all the nice features of fvwm to track an early KDE or later GNOME? Which one would be the winner (history shows both are)?

When the neophile is also hooked on feature richness you sometimes get this behavioral dilemma. Drilling into a new gadget and exploiting all its features means that you get a lock in on this particular technology or software. When a new gadget comes along you find that migrating over means losing some of the previous functionality.

In a similar way I never really liked any of the emerging pretty-homepage solutions. I also initially didn’t like the idea of presenting myself in the open. With the current state of affairs, e.g. with everyone and his cat having a homepage and blogging off, I don’t feel that exposed anymore, I guess. ;)

Actually I did have an old web page that was more like a dry-and-sober business card. I set it up when I went into freelancing many moons ago, so people googling me could get my email and phone details. But it was less than representative, and it was German based (a “.de” address). Since September `07 I live in Greece, so I needed something new. ATrpms, my primal FLOSS pet was also in desperate need of a face lifting, so I evaluated CMS/blog software and finally came up with a combination of concrete5 and WordPress.

Both parts of the new framework are under construction, especially the design elements, which are not really much more then the default themes. Ideally I will find a nice theme and massage it into both systems to make them indistinguishable, but that may take a while. Until them I’ll add some content, after all it should be the content that matters.

Have fun!

Posted in Uncategorized | Leave a comment