Reading CHM (.chm) files on Linux

How do you go about reading CHM files on Linux? Luckily, a few CHM readers are available. If you have Qt/KDE installed, you can go for KchmViewer. If you are a Gnome fan, you can compile Gnochm. There is also XCHM but it is a pain to compile (because of so many missing libraries and third-party packages whose functionalities it uses). I could not get KchmViewer to run because I don’t have Qt-3.3 (I am still using KDE-3.1). Gnochm compiled successfully, but refuses to run due to missing Python modules that provide an interface to Gnome’s GConf (compiling which is a fuss in and of itself). I played with XCHM once. I think it will suffice to say I did not get anywhere with it.

Am I even reading CHM files on Linux? Hell yea! What am I using, if the above didn’t work for me? Archmage! It is a wonderful tool to convert CHM files into HTML. Additionally, it can listen on a port for requests and serve the CHM file in HTML, and also provide an AddHandler for Apache to make it recognise and display CHM files. Isn’t that cool, now? The only packages and libraries required for archmage to run are PyCHM and chmlib, which, unlike any of the three CHM viewers mentioned earlier, are a breeze to compile and set up.

Re: sed tee, “Search, replace, and commit back.”

Earlier, I described a way to replace all occurrences of a particular pattern with another in a file and write the change(s) back into that file. BBBart on #linuxpakistan on irc.freenode.net suggested another way of doing it that does not involve calling another process. It uses the “-i” switch to sed(1), something I did not know of owing to the particular manpage for sed(1) on my system not documenting it. Here’s the alternative:

ayaz$ sed -i bak 's/pattern/replace/g' file

Note, however, that I have GNU sed version 3.02 installed and it doesn’t recognise the “-i” switch. I guess this funtionality is introduced in latter versions of sed.

Buying desktop PC. Suggestions?

I am planning on buying a desktop PC. Throw in your suggestions.

I want a moderately powerful system, with a fast processor and a large physical memory. I don’t do graphics, and I am not into games. The bulk of the heavy-duty work I would be doing on it will comprise running VMware, Matlab, hardware simulators and interface and programming applications, and, of course, Linux. My budget is tight. Any configuration not needlessly extravagant within 10K is desired.

I would love to hear what you’d recommend.

antiword: Reading .doc (MSWORD) files on the Linux CLI.

What more can you possibly ask for? antiword speaks for itself. I think it is the most useful piece of software ever created.

You can’t write .doc documents with antiword. Why in the world would you ever want to do that, in your right mind? Use plain-text or, better yet, LyX. And while softwares like Abiword, KOffice, and OpenOffice provide sound alternatives to reading .doc documents, they are both sluggish and fraught with errors and missing features. antiword doesn’t claim to be GOD – it is simply fast and effective when you want to quickly and easily access .doc files. If that wasn’t enough already, antiword let’s you do that from the command-line.

The ability to read complex .doc files quickly from the command-line: now that is one heck of powerful functionality bundled up in a small, fast package.

And for the screenshot fans, there is something here. :-)

Slackware 11.0!

It is with great joy and excitement that I would like to tell everyone of you that Slackware 11.0 has been released. Since 10.2, this has been the first official release in about an year. The announcement is here. You can order a copy from the Slackware store, or download the ISOs either through BitTorrent or through Slackware’s official mirrors.

I am so happy, and I am so eager to get my hands on a copy of Slackware 11.0 and get it running on my laptop. ;-)

A bucketload of thanks and congratulations to Pat and those who make Slackware possible.

sed tee, “Search, replace, and commit back.”

If you are a command-line *nix guy like I am, chances are good you have come cross a point where you wanted to replace a certain pattern in a file and write the change(s) back to the file. If you haven’t already figured it out, sed(1) and tee(1) will help you do that in a single line.

ayaz$ sed 's/pattern/replace/g' file | tee file

Google would be damn proud to hear …

Leaning on a comfy leather chair in one of the computer labs at the campus, I was most curiously asked by a classmate thoughtfully looking at the screen of the monitor in front of me, “What are you doing? Using GOGGLE?”

Freely redistributable firmwares and open documentation: Is Intel going to give in?

Firmware is a piece of code that is stored in a read-only section of a piece of hardware. It not only bootstraps the device, but also defines, activiates and makes useable the functionality of that device. Without the firmware, the device is not usable.

Since firmware carries code laying out the logic of operation of the various functions the hardware for which the firmware is written perform, the firmware is considered a technology secret, and thus, is not distributed freely (under a free license). Most big vendors of hardware do that. Not only keeping the firmware from being distributable, the vendors also tend to procrastinate releasing the proper documentation for the hardware. When that happens, people who buy those hardware are restricted from writing software to use those hardware. In other words, the customers are dependent on vendor-supplied drivers to make use of the hardware.

That is all good and great, but when there is a need to bundle in the vendor supplied driver with a Free and Open Source operating system, things start to fall apart.

Free and Open Source developers prefer to reverse engineer such hardware, and write equivalent free and open source drivers. But, without freely redistributable firmware, and lack of open and proper documentation, the end result, while usable to a remarkable extent, is still buggy and unsatisfactory (in some cases). What is required? To persuade vendors to release firmware in a freely redistributable license along with proper documentation.

Only, doing that isn’t so easy as it may sound.

Theo de Raadt, from the OpenBSD project, has released an open letter to the Free and Open Source community. In his letter, he urges the community to contact Intel to persuade them to release firmware blobs and documentation for their wireless chips.

There are many other vendors who already release firmware for their hardware in a freely redistributable form, and it is only a matter of time before Intel follows suit. A good thing about the Free and Open Source community is that they are inclined to buy hardware that is compatible with, supported by and stable on the Free and Open Source systems they use. From that perspective, and since there already are many vendors out their who have released their firmware and whose hardware are amply supported by Free and Open Source systems, when it comes to Intel’s wireless chips, the Free and Open Source community has many options. If Intel continues to persist in ousting the interests of their customers (as well as their interests, in the long run) by not releasing the firmware in a freely redistributable form, they will only stand to gain a lesser share of the market.

Interestingly, two years ago Ryan McBride wrote this letter to the Texas Instruments (TI) people to convince them to release firmware blogs and documentation for their ACX100 wireless chipsets. Suffice it to say, not only his letter but also the mails sent by the community to various people at Texas Instruments convinced TI to release the firmware in an open license.