February 29, 2004
DBIx::Tree - Perl module for generating a tree from a self-referential table

When you've got one of those nasty self-referential tables that you want to bust out into a tree, this is the module to check out.

Storing Hierarchical Data in a Database

Storing trees is a common problem, with multiple solutions. There are two major approaches: the adjacency list model, and the modified preorder tree traversal algorithm.

In this article, we'll explore these two methods of saving hierarchical data.

Relational Modeling: Trees and Graphs

The lesson here is that often the obvious way to model data (such as adjacency lists of tree or graph edges) is not the most efficient data model with which to query or compute. Alternatives such as the nested-set implicit representation of a tree-like hierarchy, or the transitive closure of a graph structure costs very little to create, and provides one-step mechanisms to extract informative subsets of the data. Commercial relational database products that advertise native support for hierarchical data are often simply transparently building and managing these same representations. Now you know how to it yourself.

February 28, 2004
The Linux Booting Process Unveiled

In the beginning, there was GRUB (or maybe LILO) and GRUB loaded the kernel, and kernel begat init, and init begat rc, and rc begat network and httpd and getty, and getty begat login, and login begat shell and so on.

February 27, 2004
MySQL Gotchas

It's not a bug - it's a gotcha. A "gotcha" is a feature or function which works as advertised - but not as expected.

MySQL has an abundance of gotchas, which can cause much head-scratching to the uninitiated, particularly anyone coming from more fully-featured databases. They are evidently not bugs because they are mostly documented in the manual as known behaviour.

February 26, 2004
Position Is Everything

We're Big John and Holly Bergevin, and together we built this site to explain some obtuse CSS bugs in modern browsers, provide demo examples of interesting CSS behaviors, and show how to 'make it work' without using tables for layout purposes.

February 25, 2004
Using the 2.6 Kernel with Your Current System

This whitepaper is the third in a series from TimeSys’s "2.6 Linux Resource Center" on using the new Linux 2.6 kernel. Authored by TimeSys Senior Product Manager William von Hagen, the whitepapers in this series place special emphasis on the primary issues in migrating existing drivers, applications, and embedded Linux deployments to a Linux distribution based on the 2.6 kernel.

February 24, 2004
Win32 cheat sheet

This sheet summarises all the things I do to make my Win2k machine more useful to me. I've summarised it here partly for my own benefit (I have to repeat the process on each new machine) and partly in the hope that it may be be of use to others.

Linux Security Holes Opened and Closed

In stark contrast to the long waits typical for Windows users wanting to patch software vulnerabilities, recently discovered security weaknesses in the core of the Linux operating system were addressed by major vendors in a matter of just a few days this week.

Two security vulnerabilities in the Linux kernel's memory management code reported by security researcher iSEC were addressed and are now fixed in versions 2.4.25 and 2.6.3 of the Linux kernel. Linux vendors and distributors that have released fix updates include Red Hat, Novell's SuSE Linux and the Debian Project.
Independent security expert Ryan Russell said that regardless of the Windows-Linux debate over which operating system is more secure, there is little doubt that open-source vendors respond more quickly when vulnerabilities emerge.

February 23, 2004
Stress testing an application with JMeter

Ever wonder how much traffic your applications can take before they start to show strains? Or what usage peaks your hardware can withstand? You can avoid the guesswork with JMeter, an Apache Foundation Java project used to simulate and analyze workloads on any given resource.

February 20, 2004
Learning CVS Using KDE's Cervisia

CVS is a tool to record, manage and distribute different versions of files. In other words, CVS is a version control system. It allows easy collaborative work, as each of the contributors can work in his local copy at the same time, without fear of overriding each other modifications. It allows the recovery of past versions (useful for tracking bugs), the creation of branches (for experimental development or for releases) and more.

A Computer Lab with No Windows, Part II

I believe the Linux terminal server network is, in fact, the best environment for teaching computer programming, operating systems and networking. The shell offers an introduction to operating systems and basic programming skills (simple shell scripts). With a rich library of TCP/IP dćmons and clients, Linux also is the perfect platform for teaching networking. Even though it might be a bit more difficult to start, using text-based command-line input instead of drag-and-drop, most students agree they understand concepts of networking and TCP/IP much more thoroughly when Linux is taught. Many graduates who now are studying at the university/college level said they are considerably farther ahead than their classmates who have exposure only to Windows.

February 19, 2004
Bush Distorts Science

The Bush administration has distorted scientific fact leading to policy decisions on the environment, health, biomedical research and nuclear weaponry, a group of about 60 scientists, including 20 Nobel laureates, said in a statement on Wednesday.

The Bush administration has distorted scientific fact leading to policy decisions on the environment, health, biomedical research and nuclear weaponry, a group of about 60 scientists, including 20 Nobel laureates, said in a statement on Wednesday.

They don't call him "duh-bya" for nothing.

February 18, 2004
A Computer Lab with No Windows, Part I

First of all, this is not an article to debate whether Linux is better than Windows. Although many good reasons exist to run Windows on a personal computer, we as teachers should at least show students that running Windows is not the only solution. I believe in freedom of choice. In fact, the most important element of open-source and GNU/Linux is we are free to access the source code, free to join the community to improve it, free to redistribute and free to develop better software by ourselves.

Public school systems always are underfunded, and because we are using taxpayers' money, we have the responsibility to get the most for our money. By using a Linux terminal server with cheap, "obsolete" thin clients, I have been able to deliver many computer courses that are fully compatible with if not better than what teachers using Microsoft Windows are offering. With the money saved on a Linux terminal server lab, the school can fund other subject areas.

VMware Workstation 4.0.5

Part of what I do involves trying out and working with a large number of Linux distributions. It's important for me to know what's out there and how it compares with other products. When I'm not being a writer, I run a small computer consulting business that makes similar demands. My customers expect me to support and work in a number of different environments and operating systems.

For me and others like me, what often happens is that we have several machines running various operating systems so that we have ready access to proper test environments. In some cases, the solution is to have a spare machine for testing — one on which you install and uninstall various operating systems. A better solution would be to have all these machines on your main system and access whichever operating system you needed at the time, preferably without rebooting. That's where VMware comes into play.

February 16, 2004
Experts Warn of Microsoft 'Monoculture'

Geer and others believe Microsoft's software is so dangerously pervasive that a virus capable of exploiting even a single flaw in its operating systems could wreak havoc.

Just this past week, Microsoft warned customers about security problems that independent experts called among the most serious yet disclosed. Network administrators could only hope users would download the latest patch.

After he argued in a paper published last fall that the monoculture amplifies online threats, Geer was fired by security firm @stake Inc., which has had Microsoft as a major client.

First Exploit from Code Leak

A vulnerability was reported in Microsoft Internet Explorer (IE) version 5. A remote user can execute arbitrary code on the target system.

It is reported that a remote user can create a specially crafted bitmap file that, when loaded by IE, will trigger an integer overflow and execute arbitrary code.

The author states that this flaw was found by reviewing the recently leaked Microsoft Windows source code. The flaw reportedly resides in 'win2k/private/inet/mshtml/src/site/download/imgbmp.cxx'.

That did not take long.

February 13, 2004
Note to Blog Spammers

Just a note to Blog Spammers... you know, the people that come in and put a comment with a link to your web site... hoping to increase the rankings of your site with the search engines.

Anyways...

I get an email for every comment. Deleting them is easy.

If your URL ends in .com then I'm going to delete it. I may make an exception if the comment is on a recent article and seems pertinent... or seems to be from a genuine person.

But, you should just count on it being deleted.

'nuff said.

February 12, 2004
What Does Linux Cost?

So, what does Linux really cost for business? Thirty bucks for the CD set plus everything your MCSEs think they know about how computing works in business and all the Microsoft technologies, starting with things like rack-mount SMP simulation, domain management, switch-based networking, DHCP, security, network or workload balancing, and server clustering originally developed to paper over gaping holes in their technology -- and therefore inapplicable to Linux.

February 11, 2004
Kernel comparison: Web serving on 2.4 and 2.6

We've shown that, using a typical test scenario -- Apache/WPT on an 8-way SMP IBM xSeries system -- the Apache server has better scalability and performance on the 2.6 kernel compared to the 2.4 kernel. On the same system under the same workload, the Apache server with 2.6.0-test5 kernel more effectively used system resources and served 5 times more Web pages than the 2.4.18 kernel did. This real data demonstrates that a variety of features and changes have helped the 2.6 kernel offer better scalability and performance and become more mature for enterprise-level applications.

Wow!

Words fail me. Do you know how much hardware you would have to buy to get a five hundred percent increase in performance?

Do you think the next version of Microsoft's software is going to run five times faster on the same hardware?

Why Linux?

There are some issues relating to money and convience that are leading me to look away from Windows to Linux as a potential platform for all my PCs. On my shelf I have upgrade copies of Windows XP Pro and Windows XP Home. These upgrades represent over $300 of investment. Both are tied to hardware that is rapidly nearing the end of it's useful life. When I buy a faster PC for my office, and I'm in the process of building one this winter, I'm not allowed to take that Windows XP Pro license off of my old, slow PC and install it onto my new PC. Not only do the license terms forbid my doing that, but, through product activation, Microsoft can enforce that restriction. Likewise, the version of Microsoft Office XP that I paid extra to have pre-installed on the Thinkpad I bought last year is also tied to the hardware; I'm not supposed to install it on any other machine. All this gives me pause. I'm investing a lot of money in software only to have to throw it out when I replace the hardware. By contrast, I have a copy of SuSE Linux 8.0 in my office, and SuSE doesn't mind at all if I pull that copy off of an older PC to install it on a newer PC. Not only can I move that SuSE license around, I don't need to call them up on the phone and kiss their behinds in order to do it.

February 10, 2004
Microsoft Warns on Windows Security Flaws

Microsoft Corp. (MSFT) warned customers Tuesday about unusually serious security problems with its Windows software that could let hackers quietly break into their computers to steal files, delete data or eavesdrop on sensitive information.

Microsoft, which learned about the flaws more than six months ago from researchers, said the only protective solution was to apply a repairing patch it offered on its Web site. It assessed the threat to computer users as "critical," its highest rating.

A Microsoft security executive, Stephen Toulouse, said the flawed software was "an extremely deep and pervasive technology in Windows," and urged customers to apply the patch immediately.

"an extremely deep and pervasive technology in Windows,"

That is code for: the whole OS stinks.

Meanwhile, they would have you believe that IE is 'the most secure browser'.

As long as you are willing to wait six months to get something patched, that is.

February 09, 2004
Platform Wars

I remember when Mac users were considered inferior.

Many people thought that a person used a Mac because Dos/Windows was too hard. That people who chose a Mac did so because they did not have the intellectual capacity to use a PC.

Yet, when I ask someone if they have a Mac or a PC... if they don't know... they usually have a PC.

I think that says a lot about intellectual capacity.

February 07, 2004
Migrating to Linux kernel 2.6 -- Part 1

The following whitepaper is the first in a series by William von Hagen on using the new Linux 2.6 kernel, with a special emphasis on the primary issues in migrating existing drivers, applications, and embedded Linux deployments to a Linux distribution based on the 2.6 kernel. Material presented is largely vendor-neutral.

Why Heather Can Write

My last two columns have centered on what parents and schools can do to help kids develop media literacy. This month, I will reverse directions and examine how participating in popular culture may help kids to master traditional literacy skills. We often act as if schools had a monopoly on teaching, yet smart kids have long known not to let schooling get in the way of their education.

Teachers sometimes complain that popular culture competes for the attention of their students, a claim that starts from the assumption that what kids learn from media is less valuable than what schools teach. Here, however, much of what is being mastered are things that schools try—and too often fail—to teach their students. (It has been said that if schools taught sex education the same way they taught writing, the human race would die out in a generation.)

February 05, 2004
Dual Head Video

If you've ever done software development with a dual head machine, you'll never want to use less than two monitors again.

All of the work I've done on this machine so far has been with the DVI cable from my LCD monitor plugged into the video card. The card is an MSI FX 5900 and is serious overkill for simple software development. It has a DVI port and a VGA port. The monitor came with two cables, and the analog cable is the one being used by my main box since the graphics card on it doesn't have DVI.

Since Neptune, my main development box until this morning, is on the fritz I unhooked the monitors from it and slid my new box (Prometheus) into the spot under my desk to get to work. Now, Neptune has a Matrox G450 and when not in X it simply mirrors the same data to both VGA ports. I figured my new video card was doing the same thing.

Apparently not.

It seems that if you have something plugged in to the VGA port, then it simply doesn't output anything to the DVI port. I have got to get X working dual head.

Well, I ran adminmenu and let it reconfigure X for me so it would pick up the correct frequencies for the CRT monitor. Then I reinstalled the NVidia graphics driver (v5336) and the DVI monitor started working at the console.

Sweet.

Too bad it isn't working in X. I think the refresh rate, which is set for my Hitachi SuperScan 769 is too high for the LCD. Now, I need to configure the second head.

I spent a little time working with a "TwinView" setup. It was pretty easy to get going, just follow the directions (Appendix I). Thing is, I like each monitor to basically have it's own environment. That way I can have different background colors... different menu's... whatever.

So, I'm going to set up the system according to Appendix R. To do so, you will need to know the BusID of the card. Make sure that X is not running and then issue this command from the console:

XFree86 -scanpci -verbose

You will see somewhere in all of the output your graphics card.

A bit of copy and pasting from Neptune's config files and I'm done.

Click More to see my XF86Config-4 file.

################################################################################
# XFree86 configuration for version XFree86 4.x
#
# Configuration created by Libranet Adminmenu
################################################################################

Section "Files"
#FontPath "unix/:7100"
FontPath "/usr/lib/X11/fonts/misc"
FontPath "/usr/lib/X11/fonts/cyrillic"
FontPath "/usr/lib/X11/fonts/75dpi"
FontPath "/usr/lib/X11/fonts/Type1"
FontPath "/usr/lib/X11/fonts/TrueType"
FontPath "/usr/lib/X11/fonts/Speedo"
FontPath "/usr/share/fonts/truetype"
FontPath "/var/lib/defoma/x-ttcidfont-conf.d/dirs/TrueType"
FontPath "/var/lib/defoma/x-ttcidfont-conf.d/dirs/CID"
EndSection

Section "ServerFlags"
EndSection

Section "Module"
Load "ddc"
Load "dbe"
Load "extmod"
Load "glx"
Load "record"
Load "bitmap"
Load "freetype"
Load "speedo"
Load "type1"
Load "vbe"
Load "int10"
EndSection


Section "InputDevice"
Identifier "Default Keyboard"
Driver "keyboard"
Option "CoreKeyboard"
Option "XkbRules" "xfree86"
Option "XkbModel" "pc104"
Option "XkbLayout" "us"
EndSection

Section "InputDevice"
Identifier "Default Mouse"
Driver "mouse"
Option "CorePointer"
Option "Device" "/dev/input/mice"
Option "Protocol" "IMPS/2"
Option "Emulate3Buttons" "true"
Option "ZAxisMapping" "4 5"
EndSection

Section "Device"
Identifier "nVidia0"
Driver "nvidia"
BusID "PCI:1:0:0"
Screen 0
EndSection

Section "Device"
Identifier "nVidia1"
Driver "nvidia"
BusID "PCI:1:0:0"
Screen 1
EndSection

Section "Monitor"
VendorName "Hitachi, Ltd."
ModelName "Hitachi CM769"
Identifier "Hitachi"
HorizSync 31.0-115.0
VertRefresh 50.0-180.0
Option "DPMS"
EndSection

Section "Monitor"
Identifier "Samsung"
VendorName "Samsung"
HorizSync 30-81
VertRefresh 56-85
Option "DPMS"
EndSection

Section "Screen"
Identifier "Screen0"
Device "nVidia0"
Monitor "Hitachi"
DefaultDepth 24
SubSection "Display"
Depth 1
Modes "1280x1024" "1152x864" "1024x768" "800x600" "640x480"
EndSubSection
SubSection "Display"
Depth 4
Modes "1280x1024" "1152x864" "1024x768" "800x600" "640x480"
EndSubSection
SubSection "Display"
Depth 8
Modes "1280x1024" "1152x864" "1024x768" "800x600" "640x480"
EndSubSection
SubSection "Display"
Depth 15
Modes "1280x1024" "1152x864" "1024x768" "800x600" "640x480"
EndSubSection
SubSection "Display"
Depth 16
Modes "1280x1024" "1152x864" "1024x768" "800x600" "640x480"
EndSubSection
SubSection "Display"
Depth 24
Modes "1280x1024" "1152x864" "1024x768" "800x600" "640x480"
EndSubSection
EndSection

Section "Screen"
Identifier "Screen1"
Device "nVidia1"
Monitor "Samsung"
DefaultDepth 24
SubSection "Display"
Depth 1
Modes "1280x1024" "1152x864" "1024x768" "800x600" "640x480"
EndSubSection
SubSection "Display"
Depth 4
Modes "1280x1024" "1152x864" "1024x768" "800x600" "640x480"
EndSubSection
SubSection "Display"
Depth 8
Modes "1280x1024" "1152x864" "1024x768" "800x600" "640x480"
EndSubSection
SubSection "Display"
Depth 15
Modes "1280x1024" "1152x864" "1024x768" "800x600" "640x480"
EndSubSection
SubSection "Display"
Depth 16
Modes "1280x1024" "1152x864" "1024x768" "800x600" "640x480"
EndSubSection
SubSection "Display"
Depth 24
Modes "1280x1024" "1152x864" "1024x768" "800x600" "640x480"
EndSubSection
EndSection

Section "Screen"
Identifier "Install Screen"
Device "nVidia0"
Monitor "Hitachi"
DefaultDepth 15
SubSection "Display"
Depth 1
Modes "640x480"
EndSubSection
SubSection "Display"
Depth 4
Modes "640x480"
EndSubSection
SubSection "Display"
Depth 8
Modes "640x480"
EndSubSection
SubSection "Display"
Depth 15
Modes "640x480"
EndSubSection
SubSection "Display"
Depth 16
Modes "640x480"
EndSubSection
SubSection "Display"
Depth 24
Modes "640x480"
EndSubSection
EndSection

Section "ServerLayout"
Identifier "Default Layout"
Screen "Screen0"
Screen "Screen1" RightOf "Screen0"
InputDevice "Default Keyboard"
InputDevice "Default Mouse"
EndSection

Section "ServerLayout"
Identifier "Install Layout"
Screen "Install Screen"
InputDevice "Default Keyboard"
InputDevice "Default Mouse"
EndSection

Section "DRI"
Mode 0666
EndSection

Quick List

Here is a quick list of things I need to do to get my new machine to be minimally usefull for my software development.

For a point of reference, we are talking about web development serverd by Apache in a Mod_Perl environment using Mason as a framework.

  • Get dual head video working.
  • Configure Apache
  • Install Mason
  • Install Rrequired Perl modules
  • Install CVS software (TkCVS)
  • Get a copy of my code
  • Install MySQL
  • Restore and configure MySQL databases
  • Install and configurePHPMyAdmin
  • Configure Mason and Apache to run code

Better get to it.

I want to blog more...

Might as well start now.

Here is a quick and dirty on what has gotten me to today, and the things I have to do now.

My main development machine has been acting up and I suspect a faulty hard drive. It tests bad sometimes, then remaps the bad sector and tests good afterwards. Nothing repeatable.

Now, when I set the machine up I bought two identical drives. I back up my main drive to the second drive.

I just finished building and installing the OS on a new machine to replace my main machine. Confused yet?

Well, it also has two identical drives. But, I decided that these will be set up as a RAID to help alleviate drive failure problems like I'm seeing in my current main dev box. Oh yeah, the drives are SATA drives.

Getting Debian Linux set up to RAID (level 1) on SATA drives has been a learning experience, to say the least. Especially when I want it to boot from the RAID drives. But, I learned and it is done.

Meanwhile, my main box had a stroke on Monday. Nothing terribly different than it has been doing for the last several months, but I figured that perhaps I should set it up for RAID also.

So, I updated my backups which were a week old. And converted the system over to RAID. Believe me, there was a lot that the one sentence doesn't convey... but this is the "quick and dirty" explanation.

So, feeling a lot better about the system, which hadn't been usefull since Monday, I did about four hours of development work yesterday. Then, I set up the system to download all the files needed to do a 'dist-upgrade' and locked the screen.

I figured that it could download over night and I'd do the installs this morning and have a fresh, updated install to go along with all the hard work.

This morning the system was sitting at a console (I had left X running) and there was an error message about shutting down X. When I relaunched X the second head didn't come up. So, I took the easy path and rebooted. When I launched X this time the second head initialized but none of the window decorations rendered. So, I couldn't resize or move windows. The first head seemed to be working OK.

I checked the syslog and there were all kinds of md errors. I went to single user mode and fsck'ed the partitions. Two of three show major errors. I'm not sure if the drive has finally gone tits up, or what. I do know that it has taken me about 24 hours of work time over the last three days to get to this point and I'm behind schedule with a deadline.

I need to get productive work done to keep my customer(s) happy.

So, I just finished copying the backups of the entire system onto a partition of my new dev box.

And now, you are caught up.

February 04, 2004
Migrating to Linux Kernel 2.6

I spent a whole day migrating my GNU/Linux RedHat 9 system to a 2.6 kernel today. This document is all but complete, but here is the outline of the trouble I had. Issues I dealt with: sysfs, QM_MODULES, rpm, module-init-tools, Hotplug, Wireless, linux-wlan-ng, prism2_pci, USB, sound, realplay, VMware, and ACPI vs. APM.

February 03, 2004
A happy MythTV user shows the way

While I agreed with many points in Lee Schlesinger's article Easy personal video recording for Linux? It's a myth, I am well satisfied with my MythTV setup. I do agree that a MythTV setup is not economically cheaper than a TiVo unit and that the MythTV project is a rather advanced Linux project. But if you have the experience and are willing to put in the time and persevere, you can be as satisfied with the result as I am.

February 02, 2004
UN Report Says FOSS is Better [PDF]

Users rarely buy only software licenses; they also buy services related to the software. Organizations and firms normally buy solutions involving a combination of software, hardware and services. The services surrounding software products range from consulting, implementation, support, and training to application administration. In fact, even Microsoft has reportedly conceded that, in line with the findings of a survey by the Gartner Group, the cost of software licenses amounts to only 8 per cent of the total cost of ownership, and the other 92 per cent reflects the costs of installation, maintenance, management, and repairs after failures.36 In what seems to be a matching estimate, Raymond (1999b) asserts that a very small portion, perhaps even less than 10 per cent, of software is developed for prepackaged retail sale. The outstanding majority consists of in-house code that is so highly integrated with firms’ business and IT environments that reusing or copying the code “as is” is difficult or unfeasible.

Via Groklaw...