12 Dec 2004 shlomif   » (Master)

Postfix - #2

After the Postfix configuration according to the Postfix on Mandrake page was done, I still had a problem that mail to root got sent to root@localhost.iglu.org.il, instead of delivered to the local mailbox of a certain user. Asking the people on the IRC did not help, and neither did reading the documentation.

Eventually, I temporarily subscribed to the Postfix Users mailing list and asked the question there giving all the configuration files as input. Magnus Back answeredme that I should have added teh appropriate host to the mydestination directive in the configuration file. That solved the problem, and now all the messages arrive at the hard-disk.

New Hardware Blues: PowerMust UPS

My father bought a UPS so power jumps won't affect the computer. It's a PowerMust 600 UPS. He hooked it to the computer via the USB cable, and got it talking with Windows. With Linux there's more problems. What the vendor supplies is an application written in Java for which the installation hanged right at the end. It's a several megabyte monolith and I'd rather not keep it running on the computer.

For the progress I made in the time being in getting the UPS to talk to Linux, see this thread in Linux-IL and the thread "Getting a PowerMust 600 UPS to work with Linux using the USB Connection" in the nut mailing list. It's not working yet, but there's progress.

Submitting an ed2k URL through Mozilla

My sisters recently switched to using MLDonkey on Linux to download files. Noa said that in Windows she could click on an ed2k:// URL and it would queue the file for download in eMule. So she wanted someting similar in Linux.

So I looked for a way to allow Mozilla to submit such "ed2k" URL's through kmldonkey_submit to MLDonkey. I had to register a new protocol handler. So I searched google, and did not find anything usable. The closest thing I found was this page that explains how to add a protocol handler for the mailto: protocol. Based on its instructions I was able to add a protocol handler for ed2k like this:

Put the following into the file user.js in your profile directory:

user_pref("network.protocol-handler.app.ed2k", "/usr/bin/kmldonkey_submit");

That's it!

KMLDonkey Crashing

I had a problem that KMLDonkey crashed upon connection. I worked my way through the code to see what happened. It was pretty hard because it seemed that it forked itself, and then got hanged up (needing to be resumed with kill -CONT.) Eventually, I was able to do so (by debugging kmldonket_submit which is less idiosyncratic) and found that it read a message length prefix and allocated space for the message, only it was too large, and it failed to allocate this space (and thus crashed).

I fired up Ethereal and tried to see what was the problem, it turned out KMLDonkey was communicating with the server in the text protocol. This made me recall that I changed the port of the core in the KMLDonkey configuration. Reverting it to one port below solved the crashes.

Technion Grades Listing

My Technion grades were given in a printout with a fancy colourful background. I ended up scanning it and converting it to PDF, but the PDF is quite large. (90,428 bytes). To resolve it, I ended up inputting the grades data to a text file, and wrote a Perl script to generate an HTML out of it. The generated HTML is 7,441 bytes-long (less than 10% of the original PDF size). And I'm still using UTF-8 encoding. If I convert it to ISO-8859-8 (= extended 8-bit character set with Hebrew characters), I can reduce its size even more. It's also 1,972 bytes when compressed with gzip and 1,733 when compressed with bz2.

Work on Shlomif::NavMenu

I did a lot of work on Shlomif::NavMenu (my HTML navigation menu Perl module) recently. While at first being stuck on how to write a good tree traversing class, I eventually decided to simply take the function I had now for generating the site map and gradually refactor it. This turned out to be very straightfoward and enjoying, and I was able to get what I want. Then I ported the regular navigation menu generation to the tree traversing class.

Eventually, I was able to eliminate the use of Yosef Meller's modules which I used it first. This caused the module to have 1,097 lines-of-codes instead of 1,510 (as reported by SLOCCount).

This was all done while adding tests, and now I have 117 individual tests there. I have totalled 79 subversion commits since I started working on November 30 or November 31. And I still have a lot of work ahead.

Bash Filename Completion

While working on the navigation menu class, I wanted to tweak the shell completion so that pressing tab after the gvim command will not display or complete to files whose filanems begin with "." or end with "~". It took me a long time of experiencing to figure out how to do that, but I was eventually able to. Here's how I did it eventually. Add this to the appropriate bash configuration file:

__gvim_completion()
{ 
    local cur
    cur="${COMP_WORDS[COMP_CWORD]}"
    COMPREPLY=( $(compgen -f -X '*~' -- "$cur" |
        grep -v '/\.' | grep -v '^\.') )
}

complete -o filenames -F __gvim_completion gvim

Job News

I ended up being fired from the job I reported here. They weren't happy from me, and I wasn't happy from this job either. Trying to automate buggy Windows software is not my idea of self-fullfillment. Now I'm looking for a job, again. So far I was rejected from a job posted at Linux-IL, and from one posted at Perl-IL. I still have a few leads, though.

Reading

I finished reading two Discworld books: "The Colour of Magic" which is the first Discworld Book, and "Lords and Ladies" which is a rather late book. I liked them both.

I took them both from Michael Perelmutter, and a few days ago, I returned him "Lords and Ladies", he returned "Surely you're joking Mr. Feynman" to me, and I took "The Complete Hitchhiker's Guide to the Galaxy" and "Godel, Escher Bach - An Eternal Golden Braid".. So far I started reading what I did not read from The Hitchhiker's Guide to the Galaxy. I read there the short story titled "Young Zaphod Plays it Safe". It was quite funny, but I did not understand the ending.

I also read the book Managing Weblogs with Slash and wrote a review of it. The technical book that I'm reading now is "Practical mod_perl". So far it was quite interesting at times, and contains a lot of useful information about the various fine details of running scripts using mod_perl.

Calculating the ssh fingerprint of Host Keys

In one of the hosts I have an ssh account on, I was instructed to verify that the new ssh fingerprint matches. I had no idea how to do it, and so tried to look for it and asked for the IRC. It took me some time, but I eventually found this message to the Debian list on how to just that. So what I did was run ssh-keygen -l -f ~/.ssh/known_hosts on the file and I got the fingerprints of all the host keys including the one I was looking for.

Tip: use.perl.org RSS feeds.

I had no idea how to get the RSS feed for the journal of Gabor Szabo. A link to it was nowhere to be found on the page. I contacted the webmaster and he told me to look at the head of the page. Which "head"??? Eventually, I understood that one needs to view the source of the HTML and use the <link rel> links from the <head> tag. And indeed you can find the RSS feed for the journal there.

So now you know. It's a pity the page has no visual cue that there's an RSS feed for it, or where to find it.

Events

I attended a few events recently. Shachar Shemesh gave a presentation about development tools in Linux for in a Welcome to Linux Telux meeting. He got lost in trying to explain about kdevelop and especially about CVS (which beginners should not use, anyhow). Next year, I hope we'll give the lecture in a better format.

Then came the Telux installation party. Few people attended, and most of them were installers. I was responsible for selling the Hamakor merchandise. I also tried to install Linux on a machine which had both a SATA hard-disk and an IDE one. This involved a lot of trickery, and eventually did not work, so we removed the FC 3 installation, which was the only thing that we could get to install.

I missed the Israeli Perl Mongers meeting because I forgot it took place in that particular day. I did attend the Hamakor General Assembly the day before yesterday. Omer Zak drove me there, and drove Eddie Aronovich and I back. The assembly was quite entertaining - the attendees voted several times for various things. I was happy with the decisions, at the end of the day.

Latest blog entries     Older blog entries

New Advogato Features

New HTML Parser: The long-awaited libxml2 based HTML parser code is live. It needs further work but already handles most markup better than the original parser.

Keep up with the latest Advogato features by reading the Advogato status blog.

If you're a C programmer with some spare time, take a look at the mod_virgule project page and help us with one of the tasks on the ToDo list!