Train spamassassin for a virtual user under qmail

December 25, 2006 – 14:38

cd /var/qmail/mailnames/foo.com/johndoe
sa-learn –spam –dbpath ./.spamassassin/bayes –showdots Maildir/.Junk/cur
or
sa-learn –ham –dbpath ./.spamassassin/bayes –showdots Maildir/.NotJunk/cur

Arrow Operator in Java 7? Hmm…

December 12, 2006 – 21:44

(Traceback to Weiqi Gao’s post)
Considering “.” is used as the accessor universally for all properties and methods in C#, as well as most script languages Java 6 has just made easier supporting, I for one would be very interested in learning the rationale behind using -> for property access - it’s got to be a conscious decision.

Another thing that had some coffee-spilling effect on me was the “Closures, Lambdas and friends” part. On the first look, I thought they were adding “friend” support in Java 7 (as in C++), which would have been a good thing. :)

My Ubuntu Experience: I Broke It!

November 18, 2006 – 18:04

So after getting myself comfortable enough in the new Ubuntu home, I thought it was time to expand it - quite literally - I wanted to carve a new partition out of what was now one big 66GB NTFS partition, and to move /home to there so that it would be kept separately from the rest of the system. more…

My Ubuntu Experience: Networking

November 16, 2006 – 00:26

The Marvell Yukon Gigabit onboard NIC coming with my ASUS motherboard had some problem hooking up with the DLink router. You would think, when both devices are 100baseT by default, the auto link speed negotiation ought to have been a mere formality. But, everytime after the system just boot up, it would take anywhere between 5 seconds to 30 minues for the two to shake hands and achieve a viable link. The visible symptom is the DHCP requests kept getting ignored, and in turn no IP can be obtained from the router for the system.

In Windows, I had to go to the driver configuration, disable the "auto sensing", and explicitly set the NIC to 100baseT. In Ubuntu, this is done by adding the following script to /etc/network/if-pre-up.d:

CODE:
  1. #!/bin/sh
  2.  
  3. ETHTOOL=/usr/sbin/ethtool
  4.  
  5. if [ ! -x $ETHTOOL ]; then
  6.   exit 0
  7. fi
  8.  
  9. if [ "$IFACE" = "eth0" ]; then
  10.   echo disabling $IFACE auto negotiation
  11.   $ETHTOOL -s $IFACE autoneg off
  12. fi

Everytime when the network interfaces are initialized, this script (along with everything else in that if-pre-up.d directory) is executed before dhcpclient is involved.

Update:
Use sudo ifdown -a to bring down all interfaces, and sudo ifup -a to bring them back up.

My Ubuntu Experience: Java

November 15, 2006 – 01:58

I'll catch up later the couple of "episodes" which I'm skipping over and jumping to the Java set up part. Ubuntu comes with gcj and other GNU-based java facilities, which mostly are still only equivalent to JDK 1.4.x. So they needed to get chucked right away, and replaced with the Sun JDK 5. It's pretty straightforward to install JDK 5, Eclipse, and the rest of the arsenal I work with on the daily basis. The only part involving manual setting was when enabling the Java Plugin and Web Start in Firefox. Here's The Plugin Portion of it. more...

My Ubuntu Experience: Installation

November 11, 2006 – 19:40

Prev: Pilot

Installing Ubuntu 6.1 ("Edgy Eft") was smooth. I have 3 NTFS partitions on the harddrive. One of them was deleted to make room for Ubuntu. It's about 24GB. Made 2 partitions - 2GB for swap, and the rest for /. I know it'd be better to have things like /var and /home in separate partitions, but there can only be up to 4 patitions on one harddrive, so that's that.

As for the other two NTFS partitions, the installer discovered them and offered to mount them to the linux file system. The default root mount point for them was a little strange to be called "/media". So I changed them to, well, /win/c, and /win/e. Later on I'm planning on converting E: to FAT32 or FAT32+ext3, so the duo can safely share files. For now, though, the first thing after booting into my new Ubuntu installation was changing /etc/fstab, and replacing the "defaults" in options for those two mount points to "ro". That makes them read-only.

My Ubuntu Experience: Pilot

November 11, 2006 – 12:52

I have decided to gradually migrate my main work environment to Linux, and only keep Windows for gaming and other MS proprietary things. It's something I have been wanting to do for the past decade, I would give it a try about every two years and see that Linux wasn't "quite there yet", and give up. The dedicated server I rent for digiZen (i.e. the one serving you all this babbling of mine right now) has been running Fedora Core for over a year. I've been happy both using and maintaining it. On the other hand, none of the Linux distros (including a home-made one starting with me building from the kernel source) had been satisfactory and up to par as a day-to-day desktop environment.

Well, about a couple months ago, the "Genuine Windows" update notification popup finally got on my nerve, to the point of "ok, it's that time again." After playing around a Ubuntu installed in VMWare, I got confident enough to take it one step further into the typical dual-boot setup. A couple of nights later, I am happy to report that I'm working in an environment capable of supporting about 90% of my daily tasks. And I'm pretty confident that, with more googling and tweaking, and the great wine as the last resort, I'll be pushing that number to very close to 100%.

That's not to say, everything went as smooth as I would have liked it. I'm starting this series to keep some notes on the pitfalls and (usually unpleasant) surprises.

Next: Installation

Why I think CICE is too complex for the gain

October 11, 2006 – 22:55

IMHO, Concise Instance Creation Expression, the Lee-Lea-Block Proposal for Closures in Java, carries a more hefty price tag than it seems: more...

Spring Controllers with Prototype Scope

October 9, 2006 – 20:44

Most of the time, we configure the controllers in our Spring MVC application to be singletons, because of the their stateless nature. However, being configured as normal Spring beans, Spring controllers can also be declared with the prototype scope. more...

A Spring Singleton is not a Singleton

September 14, 2006 – 22:03

OK, I know this sounds like another one of those "a white horse is not a horse" arguments, but from my observation on the Spring forums and other blog reading, some clear distinction between the semantics of a Spring singleton and a classical Java singleton has become much necessary. The overloaded term has caused quite some confusion, especially for someone who has just started picking up Spring. more...