Installing Subclipse on Mac OS X

I’m very happy to see that Subclipse has come along. Installing it on Ubuntu was a breeze: just get the plugin through Eclipse, and install the svn-javahl package to get the native part. On the Mac, it’s a little more complicated. Even if you specify --with-javahl to ./configure, the Java bindings don’t automatically get built or installed. You have to specifically invoke make javahl and make install-javahl. Then, put symbolic links for /path/to/subversion/lib/libsvnjavahl-1.jnilib and /path/to/subversion/lib/svn-javahl.jar in /Library/Java/Extensions. Now, when you install the Subclipse plugin through Eclipse, it will find its native counterpart in place.

Getting WAMP to Talk Amongst Themselves

Have you, as I was just now, been repeatedly confounded by PHP flat-out refusing to load its MySQL module on Windows? I have just finished banging my head against this particular wall for a day or so and would like to share the Apache Way to solving the issue.

The problem is, as is so frequently the case, DLL Hell. The php_mysql.dll module loads libmysql.dll, but apparently it has to be the version against which it was compiled. The required DLL is bundled with PHP, but what if an older, incompatible version of that DLL is found earlier in the search path? You’re hosed, that’s what if, and the module load fails with a message to the log file like so:

PHP Warning: PHP Startup: Unable to load dynamic library 'D:\\php-5.2.3\\ext\\php_mysql.dll' - The specified procedure could not be found.\r\n in Unknown line 0

I suppose that would be a missing symbol in the underlying library on other platforms. A quick Google put me on the right track and sure enough the indispensable Process Explorer utility tells me that httpd.exe has C:\WINDOWS\system32\libmysql.dll loaded. Yup, that’s our problem. No, I didn’t build that box. That box must have been built by someone who thought copying crap into the Windows directory is ever a good idea.

How do we solve this the Apache Way? Not by copying DLLs around, that’s for sure. The Apache configuration language has the LoadFile directive for this particular purpose. Loading the correct DLL right before the PHP module:

LoadFile "d:/php-5.2.3/libmysql.dll"
LoadModule php5_module "d:/php-5.2.3/php5apache2_2.dll"

makes PHP pick up the right symbols to run with MySQL.

How Henning Made Me Actually Do It

Like yachtsmen, programmers are lazy. Being a little bit of both, I guess that makes me doubly lazy, and a byproduct of this seems to be that I just don’t get around to signing the keys that emerge from the ApacheCon Keysigning sessions I organize.

Henning the Fussbal FanFor programmers, laziness manifests itself in the wish to write programs to perform repetitive tasks, not infrequently spending more time writing the program than it would have taken to just perform the task by hand. Of course the merit of writing such a program is that others can use it to perform the same repetitive task, without having to write the program first. A couple of days ago, Apache’s Henning Schmiedehausen posted PGPSigner, a utility that helps you sign all the keys on your list from the Keysigning session.

This is absolutely great, it just helped me do in five minutes what I had already put off for close to a month, and the keys from the last keysigning session are now signed, uploaded to the keyservers (pgpkeys.mit.edu and minsky.surfnet.nl) and mailed to their owners insofar their mail got through. I used the Signing Party Keyring that contains the keys of all the attendants.

Small patch to make the startup script suck in the jars in the lib directory:


Index: pgpsigner.sh
===================================================================
--- pgpsigner.sh (revision 1009)
+++ pgpsigner.sh (working copy)
@@ -31,4 +31,8 @@
exit 1
fi

-java -jar target/${APPNAME}-${APPVERSION}.jar "$@"
+for j in `ls lib/*.jar` ; do
+ CLASSPATH="$CLASSPATH:$j"
+done
+
+java -classpath $CLASSPATH -jar target/${APPNAME}-${APPVERSION}.jar "$@"

This makes it easier to run the program from the command line as opposed to from within Eclipse. (: Thank you Henning.

Bugzilla 3.0 Has Landed

I am currently playing around with the recently released Bugzila 3.0. Before I upgrade my production instance, I’m doing a clean installation on my desktop box to see what it looks like, and whether or where any upgrade difficulties might be lurking.

Bugzilla uses quite a few Perl modules, and their install guide lists these by their Perl name. However, on my Ubuntu system, I’d like to install these modules through the packages instead of CPAN, so I keep a somewhat clean system. Here is a table that translates between the Debian Package name and the Perl Module name:

Required Modules
Ubuntu Package Perl Module Notes
CGI perl-modules  
Date::Format libtimedate-perl Found the package name through Bugzilla’s checksetup.pl --check-modules, which calls it TimeDate
DBI libdbi-perl  
DBD::mysql  
File::Spec perl-base checksetup.pl speaks of PathTools, which may be a bundle containing this module
Template libtemplate-perl  
Email::Send   No package, installed via CPAN. Note its dependencies Module::Pluggable and Return::Value do have packages as libmodule-pluggable-perl and libreturn-value-perl respectively.
Email::MIME::Modifier libemail-mime-modifier-perl  
Optional Modules
Ubuntu Package Perl Module Notes
GD libgd-perl  
Template::Plugin::GD::Image libtemplate-perl Not in separate package
Chart::Base libchart-perl  
GD::Graph libgd-graph-perl Brings along libgd-text-perl as a dependency
GD::Text libgd-text-perl Sucked in by libgd-graph-perl as a dependency
XML::Twig libxml-twig-perl  
MIME::Parser libmime-perl  
LWP::UserAgent libwww-perl  
PatchReader No Package Installed through CPAN
Image::Magick perlmagick  
Net::LDAP libnet-ldap-perl:  
SOAP::Lite libsoap-lite-perl  
HTML::Parser libhtml-parser-perl:  
HTML::Scrubber libhtml-scrubber-perl  
Email::MIME::Attachment::Stripper No Package Installed via CPAN
Email::Reply No Package Installed from CPAN. Dependency Email::Abstract has a package (libemail-abstract-perl), but dependency Email::MIME::Creator has not and would have to be installed from CPAN. However, this is where we run into trouble: the package does not test cleanly. Perhaps this is because CPAN builds packages in /usr/local, and the rest of Email::MIME was installed in /usr as per usual under Linux packaging systems. Rather than forcing the issue, Email::Reply was not installed.
mod_perl2 libapache2-mod-perl2 This package works with the Apache server installed by the apache2 package
CGI N/A Uprev 3.11 or above required by mod_perl, not available under packaging system which installs 3.10
Apache::DBI libapache-dbi-perl  

A great help for finding already installed modules is dpkg –search . This will tell you which package a given file on your machine belongs to. For instance, it tells me that CGI.pm belongs to perl-modules, which is the default module collection on the system:


sctemme@sarlacc:~$ dpkg --search /usr/share/perl/5.8.7/CGI.pm
perl-modules: /usr/share/perl/5.8.7/CGI.pm

To get the name of a module not yet installed, you can use apt-cache search, and keep in mind that modules are typically named after the Perl module except all lowercase, like TimeDate becomes libtimedate-perl. If the package name proves elusive, grepping through the output of apt-cache search ".*-perl$" should help. When all else fails, go to CPAN.

Another neat tool is apt-file. This doesn’t appear to be part of the standard tools on Ubuntu, but can be installed as a package. First run apt-file update (as root), then you can run apt-file search <pattern>, with as pattern the name of a file you know should be part of a package. It will return the names of any package that has such a file in it.

What do we learn from this?

  1. All but one required module have a corresponding package, and Email::Send installs cleanly
  2. Inbound e-mail can’t be done with the Ubuntu/Debian packages at the moment, since one of the dependencies is broken
  3. mod_perl operation requires a slightly higher level of the CGI interface than is delivered by the packaging system. Since my production system doesn’t use the Ubuntu packaged Apache, I am hardly a mod_perl expert and we are currently doing fine without, I’m not going to worry about mod_perl at this time. Perhaps in the future

So, what does Bugzilla 3.0 look like? Haven’t found out yet, but stay tuned.

Greed and the Phone Company

A PCWorld article proclaimed ?Fancy Phones Sell, but Services Lag?. It discussed the fact that we, the consumers, are all getting the super duper advanced thin phones, but we are not spending our money on the added services offered by the cell phone company, such as ringtones, wallpaper, songs, Internet access and games. So, we’re cheap, and given that we all got those fancy phones for free (with two year subscription) in the first place, perhaps that should not come as too big a surprise.

I had a firsthand experience with this phenomenon today: a couple of times a year, I get to spend some time sitting outside a fitting room in a department store, and what better way to while away the time than to play a little game on my fancy cellphone ($49.99 after rebate)? On the phone, I find a demo version of a game called Bejeweled: swap out adjacent colored jewels, and get points for creating columns or rows of three identicals. Very cute, great replayability. The demo lets you play one level, then presents you with an Exit or Purchase choice. The cheap choice has you back in the game after about four clicks.

So, after a couple of go-arounds I think what the heck, this is cute, let’s spend the money. So I click Purchase. It’s $5.99, which is fine for something with this replayability value. But then I hit the next screen: the purchase expires after 60 days. Fortunately there is a Cancel link. If that $6 had bought me unlimited access, or even just until the phone is replaced, we would have had a sale. A 60 day expiration would not take me to the next shopping expedition, so rather than spending $6 now, and $6 the next time around I remain, a somewhat sad, disappointed consumer with that money still in my pocket. Services lag, indeed.

Apple Roundup

In the past month we have seen the annual Macworld trade show. I spent a day on the show floor, and it is kind of devolving into iPodworld. The big news of course was the iPhone, revealed well ahead of schedule and not universally well received. I want one, but critics point out that the marketplace is very crowded, the technology moves very fast and while the iPhone looks very glam and sexy in the US marketplace, other regions like Japan are already way ahead of where Apple will be six months from now. I think there is a big difference between the phone market and the PC market, where Apple has operated so far. In the PC marketplace, there is virtually no competition. There is one monopolist, Microsoft, who has the marketplace locked up and dictates progress or lack thereof. Then there is Apple, which is trying to carve out a niche for itself in this Microsoft-owned arena, and does so with some success by creating compelling products that play strongly in some areas (media, the home) which allows them to largely ignore the areas where Microsoft is most deeply entrenched (cubicle land, etc.).

In mobile phones, the situation is entirely different. There is no market incumbent that stifles innovation, but a host of players who compete on a fairly level playing field. There’s Motorola, Sony Ericsson, Nokia, LG, Samsung, Siemens, Pantech, Sagem, RIM, Palm, … and those are just the players operating in North America. They are responsible for an incessant cavalcade of flip phones, smart phones, camera phones, music phones, even phones on which you can make and receive calls. The existence of several local markets across the world?the USA, Japan, every European country?with their own culture, requirements and local phone companies allows for a regional variation in phone features, so technologies can mature on a relatively small scale. There is actual competition in this market, which fosters actual choice for the consumer and makes it much more interesting to watch than the PC market. Seeing Apple enter this melee is even more interesting.

Bill Gates flew off the handle, and no one was there to stop him. Many bits have been spilled over the utterly uncritical interview in Newsweek, and it has been soundly refuted. ‘Nuff said.

Apple’s new I’m a Mac, I’m a PC ad pokes fun at what is supposed to be a Security feature in Vista: the fact you have to approve certain actions taken by programs running on Vista that could change or reconfigure your PC. I haven’t used Vista myself but, as John Welch noted in Information Week, Vista doesn’t actually tell you what it is trying to have you approve, and approving doesn’t require anything in the way of authentication. It’s just an ‘Allow, Cancel’ dialog box that anyone who walks up to your PC could click. Any other OS at least requires you to enter your password when authenticating for potentially PC-altering stuff. The ad is the best one yet in the Mac vs. PC series.

The Fight Against Zombie PCs

SpamAssassin’s Justin Mason comments on a talk by one Joe St. Sauver about the Spam Zombie Problem. Joe has some good points, but I’m afraid his proposed solution?a government-issued, free cleanup disk to be applied to infected PCs?won’t cut it.

Joe even contradicts himself in his slide show: first he assesses that the average owner of an 0wned PC does not have the motivation, or wherewithal, to clean up their infection, they are unwilling to pay to have this done and ISPs can’t be expected to help out their users since it’d take hours to properly clean up a zombie PC. However, a cleanup CD to me seems not only a hard sell to the general public, but it also looks like something easily obtained by the bad guys, who can then code around it. Malware can be updated in minutes through its natural distribution medium; good luck updating a stock of CDs sitting at every post office and library.

Nevertheless, Joe makes some interesting points such as:

  • The vast majority of SPAM e-mail is now delivered through virus-infected PCs (zombies) owned by the general public
  • Said general public has no compelling interest in cleaning up their machines
  • The zombie PC problem is out of control
  • This is a world-wide issue
  • Something needs to be done

However, what can we do about this? I agree with Joe that rate-limiting e-mail from consumer PCs and cutting off their direct-to-MX SMTP path is not enough. I don’t use AOL, but I’m sure their widely advertised move to make antivirus software available to their customers for free is in their own best interest. The $250 tax credit Joe proposes seems to me merely a shot in the arm for Dell and Microsoft… especially the latter would love to see the masses upgrade to Vista forthwith. Speaking of which, what exactly does Vista bring to the table in this regard?

Mail Flipping Back to Unread

Rich Bowen remarks that he sees Apple Mail flip recently read messages randomly back to unread status. I am seeing this too and it bugs me.

I searched Apple’s support discussion forums and turned up a discussion on this very topic. It seems the Apple engineers blame the issue on ambiguities in the protocol standard, but one would expect that at least between Apple’s own .Mac mail the client-side and server-side interpretations of the standard would lean the same way.

Another interesting data point is the closing post of the thread, blaming the GPG plugin. I, too, have that installed. I may pull it and see if the problem goes away. I think Apple should support PGP directly in Mail.app anyway, right alongside S/MIME.

Honeynet Founder Lance Spitzner: ?Hackers not afraid of being caught?

The Hack Report has an interview with Honeynet Founder Lance Spitzner where he gets to re-hash what we know about the bad guys: yes they are after your computer, they are in it for the money now and no, there’s nothing law enforcement can do.

And, of course, someone in the comments speaks up and denounces the use of the word ?Hacker? for the bad guys, since ?Hacker? really means ?One who is proficient at using or programming a computer? etc. etc. Of course I agree with this, but it’s too late to shut the barn door.

Give it up. The linguistic battle has been lost: in the eyes of the general public and the industry, ?Hacker? means you’re breaking stuff. End of story. Instead of mincing over words, let’s concentrate on actually fighting the bad guys. What we need is a new moniker for the ethical, the good guy hacker. Let’s rally under a new banner! From now on, the good guys should consider themselves ?CyberPonies?.

Open Source Java and mod_ftp Activity

I have been trying to say something useful about the Java Open Source announcement from Sun, but I keep running into the fact that I’d actually have to read the announcements before opening my mouth, and that simply has not happened.

So, let me simply say that I hope this eventually leads to having the JDK available in the FreeBSD package/ports collection, so one may install it from a package without having to download the source from one place and the patches from another and then spend the better part of a full day compiling your own JDK. Of course there are the Diablo JDK builds at the FreeBSD Foundation, but do those satisfy the dependencies of Java-based apps in the ports collection?

On another note, I have recently found some time to work on the documentation for the mod_ftp module. I’m transforming the documentation donated by Covalent into the format and layout used by the httpd documentation.