Biting the Hand That Feeds

Granted, I’m not a Groklaw junkie. Lawsuits are the epitome of bureaucratic boring and are not a creational activity. So, keep in mind that I only read the occasional major headlines from The SCO Group’s escapade in futility. It does come as a relief that the show is finally over.

The situation in many ways paralleled the AT&T UNIX lawsuit of the ’90s. It is every bit as ironic considering, for instance, that BSD folks were largely responsible for the success of UNIX. In SCO’s case, their OS (SVr4 UNIX) is based largely on the work of Research UNIX, BSD, and even includes a wide selection of GNU tools in userland.

Except this time, no offending code was ever demonstrated, just a straw-man argument and utter defeat.

Still, I feel an overwhelming sense of sadness over the whole affair. Santa Cruz Operation and System V UNIX were respectable in their time. My guess is that SCO along with UnixWare (the natural evolution of System V) will fade into oblivion along side the countless other dead UNIX implementations. Linux zealots often take jabs at other implementations, but I think UnixWare could have held a viable, if niche, place in the enterprise had been under proper stewardship.

As time goes on, the UNIX diaspora seems to be waning. We are left with, essentially:

  • Linux, with a mostly GNU userland as the heavyweight contender
  • The BSDs, perhaps equal or greater in architectural quality but relatively unknown giants. We can however lump Mac OS X in here which is the most widely used.
  • Solaris, which might be considered an open source System V fork. An interesting OS that has a a great lineage and potential, but lacks in trust and certainty for contributors at the moment.
  • AIX, a System V and BSD hybrid with plenty of IBM thrown in for good measure. Perhaps the gold bar and only remaining competitive mid-iron standard due to IBM’s silicon prowess.
  • HP-UX, an older System V linage perhaps on a slow deathbed due to reliance on the vapid Itanium

History has been unforgiving to those companies that try to unfairly weasel programmers and users in this market. The lesson is to work with and encourage your development community and not bite the hand that feeds. My eyes are on Oracle for the time being. Sun had a hard enough time nurturing the Solaris community despite being a favorable company, and Oracle can just as easily kill this operating system through boneheaded maneuvers if it is not careful.

But First, Write No Code

Something I see often in person and online are programmers constantly implementing common solutions, reinventing wheels, or embracing NIH.

Before you do this, please consider the Kev009’s Oath“But First, Write No Code”.  This is a solution to a variety of problems in software development, but today’s article is specifically on using external code.

I’ve found that programmers who follow a system similar to mine (detailed below) develop systems that are more stable, maintainable, and sane.  They likely write better code because it means they understand their tools and also read others’ code.  They examine the problem first rather than going in guns blazing.

Steps to decide whether to use an existing solution or write your own implementation:

  1. Scan the area. Google, Freshmeat, SourceForge, standard library, OS libraries, etc. are your friend.  See if the problem you are trying to solve has been solved.  I don’t care how long you’ve been programming or how much you think you know. The ecosystem of a language is constantly changing.Make a list of hits that look similar to the problem you are trying to solve.  Try and get a quick sense of the idiomatic methods of using your language, OS, etc.
  2. Do research. Are the solutions you found in step 1 suitable to the problem at hand?  Consider the pros and cons of each item.  Now, carefully evaluate how idiomatic the items are to your language and environment.If the item is open source, does the community seem active?  If it doesn’t fully map to your problem, does it look like you can modify it to do so?

    Even if you end up developing a solution from scratch, you should at least now have some good references.  Keep in mind, extending an existing project may be considerably less work.  You might even be able to offload maintenance of that component.

  3. Consider the license. This isn’t just for the legal department.  What kind of project you are working on will weigh in heavily.  Commercial or open source?  As a software professional, you need to be abreast with the various licenses in the wild.  As an open source developer, you need to consider how licenses will affect your work being packaged by distributions.An open source library licensed under the GPL is not acceptable for static linking to commercial software.  However, you can link to an operating system provided copy or bundle the dynamic library with your application.  LGPL does not have this restriction.  With both of these, you must supply your changes upon request from end users among other things.

    BSD, MIT, and Apache style licenses allow you to make changes and redistribute under completely different licenses.  Some just want credit in your documentation.  These are very compelling even in commercial development.

    Commercial components may have a per-copy fee associated which may dissuade their use by your organization.  If you don’t get the source, you won’t be able to effectively change or maintain it so you will also be at mercy of that developer.

  4. Make a decision. By now, your list should have been pared down based on licenses and research.  Perform extensive evaluations of the remainder and eventually hone in on the one you think fits best.  You’re going to have to rely on your experience and intuition while making the critical decision.  Perhaps the hardest part:  weighing it against a mythical home-grown solution in your mind.
  5. Implement the decision. Self explanatory.  This either means bootstrapping your own project or fully integrating the external one.  If you are extending an open source solution, consider submitting the patches back to the community for feedback and perhaps integration.  If you are bootstrapping your own solution, you’ve got your work cut out.  Is this only suitable for an internal project, or perhaps it would have its own merit as a new open source project?Be sure to reevaluate early and often.  That library you chose might turn out to be a can of worms, just as the “easy” new solution you had in your head might require years of development.
  6. Subscribe to the announce mailing list. Only if you used an external solution. Does the project have an RSS feed for releases or a low volume announcement list?  Don’t be like Adobe.  Avoid embarrassing security problems.  Also consider how enhancements and bug fixes to the external project might make your own project better, more stable, and more efficient.  This is where the real lasting dividends of using an external solution come from.

This list is widely applicable.  You’ve got a seriously high bar to reach if you are developing containers of <T>, sorting methods, GUI frameworks, parsers, text and binary file formats, and much more so try and follow it the next time you code.

KDE SC 4.4 – Steady, Incremental Improvements

I haven’t noticed any killer features in KDE SC 4.4 and I’ve been running it since Beta 1. I’ve noticed a lot of subtle improvements.  Things like app stacking and selection in the task bar seem much more responsive.  All around, plasma looks subtly better and my favorite KDE apps seem to just keep getting better.

KSysGuard is really impressive and now has the ability to connect to remote hosts for monitoring.  However, the biggest change is in the greater ecosystem.  It seems all the external apps like Amarok, K3b, and digiKam are coming along to fruition.

Other than that, this is a smooth release and shows that the platform is starting to mature.  I think the Summer release distros will be able to do a good job delivering a nice desktop experience based on KDE 4.4.  I’ll end with my obligatory “try KDE 4.4 if you had previous bad KDE4 experiences”.

2010 SpamAssasin Public Service Announcement

If you run a public mail server, there is a good chance you run SpamAssassin.

There is a New Year’s SNAFU in which any dates 2010+ are marked “grossly in the future”.  That is a problem since it is now 2010.

Run sa-update and restart SpamAssassin ASAP, or install the following rule to local.cf:

score FH_DATE_PAST_20XX 0.0

Thanks to LWN for pointing this out to me before too much damage was done.

Sun Ultra 27 Review – The Ultimate Linux Workstation

Sun Microsystems has a powerful and favorably priced entry in the x86 workstation space with the Ultra 27.  Such is the power of this workstation and its natural fit for *nix workloads, combined with a compelling price tag, I pronounce it the Ultimate Linux Workstation in its class.  He’s a short overview and review as well as a video entry at the end.

Ultra 27 Front View

Ultra 27 Front View

The Ultra 27 is a single socket system but packs a powerful quad core punch. With the Nehalem Xeon (similar to the consumer Core i7), markets that used to demand dual socket systems can now comfortably look to cheaper single socket alternatives. With the return of HyperThreading, the chip handles 8 hardware threads and unlike its previous guise in the Pentium 4, HT contributes noticeably and favorably to performance.  Due to the extreme performance and number of execution threads, I think the Nehalem Xeon represents a paradigm shift where most high end systems will no longer carry two discrete CPUs.

The Ultra 27 competes in the same league as the Lenovo ThinkStation S20, HP Z400, Mac Pro Quad and various other boutique workstation manufacturers. Through channel vendors, all but the Mac can be comfortably configured for around $2000.

The price of this system is attractive and affordable to anybody who makes their livelihood off of professional computing. The components on a workstation like this are well engineered and thoroughly tested together. 3rd party vendors will also commonly certify software and hardware against popular workstation offerings. The Ultra 27 is comfortably expandable and can be equipped with Intel’s best CPUs on the market, plenty of disk, and high end graphics. With two PCIe2 16-lane slots and ample cooling and power, the Ultra 27 has a lot to offer anyone in digital content creation, CAD, CAM, CAE or other visualization activities. With the speedy Nehalem chip and 4 disk bays programmers doing large builds or staging large applications should be more than content.

Ultra 27 Rear View

Ultra 27 Rear View

The Ultra 27 comes in a robust light gray case.  The Spartan design is free of all the unsightly plastic that usually adorns HP machines and looks more substantial than either the Lenovo or HP competition.  The interior isn’t quite as beautiful as the Mac Pro’s, but there is plenty of room and the internal drive bay keeps any need for user cable management to a minimum.

Ultra 27 Inside Overview

Ultra 27 Inside Overview

My configuration is as follows:

  • Intel Xeon w3570 Quad Core at 3.20GHz (has intel Turbo Boost to 3.46GHz)
  • 6GB RAM ECC DDR3-1333
  • nVIDIA Quadro FX 380 graphics
  • 500GB 7200 RPM SATA hard disk
Ultra 27 Drive Bay

Ultra 27 Drive Bay

I am upgrading from a previous IBM IntelliStation A Pro which had two physical single core AMD Opteron CPUs.  The increase in performance is remarkable.

It is noteworthy that this system is much quieter than my previous.  Indeed, the large fan is seldom audible even under heavy load.   The heat output is negligible and the components have never been more than warm to the touch even after hours of maximal CPU usage.

Ultra 27 Main Board

Ultra 27 Main Board

The case is for the most part toolless and very clean and spacious inside.  Every aspect of the system can be easily upgraded so the Ultra 27 should be a good investment and grow with time and requirements.

Ultra 27 Case Diagram

Ultra 27 Case Diagram

With well engineered hardware and plenty of power, the Ultra 27 is awesome as a general UNIX-class workstation.  I am happily running Gentoo and even the largest builds are a cakewalk for this box.  I push my computer harder than most people.  Commonly running several browser instances loaded with tabs, several terminals, email, music, the Eclipse IDE, and more, interactivity has not diminished even when running parallel compiles.

I’ll conclude that anyone looking at the Mac Pro should consider the alternative in machines like the Sun Ultra 27.  This computer represents a latest in a powerful linage of Sun workstations and is ideal for just about any demanding workload you can throw at it.

Video of Windows 7 Black Screen of Death

Here’s a video to accompany my previous blog post Windows 7 has definite backlight problems (”Black Screen of Death”).  As mentioned before, I cannot reproduce this in Arch Linux.  The problem began after a recent “Patch Tuesday”.

Microsoft has been denying any problems like this in the media.  Comment if you have had similar experience on Nvidia hardware or Intel graphics.

Windows 7 has definite backlight problems (“Black Screen of Death”)

There is definitely a problem in Windows 7 RTM with the “Black Screen of Death” despite MS propaganda stating otherwise.  This one has nothing to do with 3rd party antivirus software.

The particular problem I am having and see lots of reports on forums is that the backlight is not turning on after an LCD DPMS standby.  What’s particularly bad is that some people are blaming their hardware and buying new inverters for their displays.  My problematic system dual boots Arch Linux and no amount of LCD power on/off sequences will trigger this in Arch.

I suspect though cannot easily prove that the symptoms came after recent “security patches”.  No MS, I don’t have any virus scanners installed so blaming others isn’t going to cut it.  It has gotten particularly bad in my case after the most recent Patch Tuesday.

I can trigger it readily with my LCDoff utility, though it will also happen organically with Windows’ automatic power management.

The question is, to whom or how do I report this?  I don’t want to be told condescending things by a support drone.  With FOSS, I have clear and easy communications with developers.  I’m not aware of an easy way to get that level of interaction from MS.

So, Microsoft, I invite YOU to contact ME if you want to take care of this bug on an easy to reproduce testcase.

DRBD merged with kernel 2.6.33

DRBD has been a long standing external patch in many distribution kernels.  It has finally been merged in the 2.6.33 window.  Colloquially the “Distributed Redundant Block Device”, this piece of code allows you to mirror blocks of storage across multiple nodes.

drbd_overview

This is primarily useful in high availability setups.  By synchronously mirroring storage across two systems, you can run an active-passive cluster where the backup machine will take over if the primary fails.  Using a more advanced clustering file system such as GFS2 or OCFS, you can even do active-active setups although there are certain considerations there.

This is exciting because it alleviates the need for specialized hardware like SAN storage.  Standard Linux servers with direct attached storage may be used and indeed even give appreciable performance.  In practice, redundancy will be even greater than all but the highest end SAN equipment due to the lack of single point of failure.

DRBD also allows for asynchronous mirroring, that is, writes to the primary do not wait on completion to the secondary.  This is useful for cold site backups and perhaps meeting legal compliance in certain industries as well.

Take a look at the DRBD site for more information and use cases.

Getting Beautiful Fonts in Gentoo Linux

Here’s my easy and modern guide to getting pleasant looking fonts on Gentoo with minimal effort.

Wikipedia rendered with the end result of this guide

Wikipedia rendered with the end result of this guide

USE Flags

Enable the following USE flags:

euse --enable truetype type1 cleartype corefonts

and make sure everything is built with them enabled:

emerge -uDNa world

Emerge Fonts

X.org and other apps should pull in some common fonts.  Here are some additional fonts useful for OpenOffice and other programs.  Dejavu provides excellent default fonts which we will enable in the next section.

app-admin/eselect-fontconfig
media-fonts/corefonts
media-fonts/dejavu
media-fonts/font-bh-ttf
media-fonts/font-bh-type1
media-fonts/freefonts
media-fonts/ttf-bitstream-vera
media-fonts/unifont
media-fonts/artwiz-aleczapka-en

Enabling fontconfig options

Use ‘eselect fontconfig list‘ to see a list of available configuration options.

eselect fontconfig list

eselect fontconfig list

Try enabling the following with ‘eselect fontconfig enable <num from list above>’:

10-autohint.conf
10-sub-pixel-rgb.conf
20-unhint-small-dejavu-sans-mono.conf
20-unhint-small-dejavu-sans.conf
20-unhint-small-dejavu-serif.conf
25-unhint-nonlatin.conf
57-dejavu-sans-mono.conf
57-dejavu-sans.conf
57-dejavu-serif.conf

This will give you very nice hinted fonts suitable for the great majority of RGB LCD displays.

The 57- series rules enable dejavu fonts as the default Serif and Sans Serif fonts.  This will improve the look of your desktop environment and programs like Firefox immediately.

~/.fonts.conf

This file controls your user fontconfig settings.  We will reiterate RGB hinting and disable it for bold fonts so they are not overly bold.  There are plenty of other tricks you can perform in this file to get more Windows-like text, but I’m quite satisfied with the following and find it very easy to read.

<?xml version='1.0'?>
<!DOCTYPE fontconfig SYSTEM 'fonts.dtd'>
<fontconfig>
 <match target="font">
 <edit mode="assign" name="rgba">
 <const>rgb</const>
 </edit>
 </match>
 <match target="font">
 <edit mode="assign" name="hinting">
 <bool>true</bool>
 </edit>
 </match>
 <match target="font">
 <edit mode="assign" name="hintstyle">
 <const>hintfull</const>
 </edit>
 </match>
 <match target="font">
 <edit mode="assign" name="antialias">
 <bool>true</bool>
 </edit>
 </match>
 <!-- Disable autohint for bold fonts so they are not overly bold -->
 <match target="font" >
 <test compare="more" name="weight" >
 <const>medium</const>
 </test>
 <edit mode="assign" name="autohint" >
 <bool>false</bool>
 </edit>
 </match>
</fontconfig>

Conclusion

Please share any thoughts and tips in the comments.  I recommend browsing the X.org Font Guide on Gentoo Wiki, though some of the information there is out of date or more complex than the method I just outlined.

boo2pdf Update

I did some minor updates to boo2pdf. Graphics should now be within the page margins.  Please let me know if there are any other common formatting mistakes.

Unfortunately, IBM’s “transmogrifier” utility doesn’t work very well in Wine, so you should preprocess older books in Windows before running them through the boo2pdf web service (download is on that page).

Source code is now available from boo2pdf gitweb.