Fixing subpixel rendering on OS X secondary monitors

Quite a while ago Apple did a 10.6 update which basically destroyed the rendering on my secondary monitor.  Beside my 27" iMac I use a 24" Dell U2410 turned vertically.  I like this orientation a lot for writing code or working through long pieces of text.  And because I use it almost exclusively for working with text and fonts,the fact that Apple broke subpixel rendering in my fonts was more than a little noticeable.  I tried in vain to find a solution on the web, but all I ever came up with were other "Me too!"s, as thousands of people bemoaned the results of this "update."  I learned to live with it.

This weekend I was in the mood to fix a few things I never get time to do, and once again I went looking for a solution.  Surely after so long someone had solved this.  Within a few minutes I had my answer:

You can force OS X to use LCD font smoothing on all displays with this Terminal command:

defaults -currentHost write -globalDomain AppleFontSmoothing -int 2  

The number 2 here corresponds to Medium - Best for Flat Panel. You may also use 1 for light smoothing, and 3 for strong smoothing, as per the original OS X font smoothing options.
To see the effects of this, you have to restart your application(s). Doing so, for me, the results were amazing. There, once again, and it all its glory, was my beloved "coding monitor" properly showing fonts.