Dude, that Dell\’s, like, totally bent!

I fought with everything I had to get something else. So did one of my coworkers and my boss. But it was for naught. Late on Thursday afternoon, a pile of Dell servers showed up outside my office.

I did the only sensible thing to do: I ignored them until Friday morning.

I didn’t like how the box was taped. That shouldn’t make much difference. But what I really didn’t like was what happened after I pulled the PowerEdge 1750 out of the box.

It bent.OK, maybe “flex” is a more appropriate word. I’m used to working with HP servers. They have a one-piece chassis. Although their 1U offerings weigh about the same amount as these Dells, when you pick them up, they remain straight.

I think that’s a useful feature for something you want to shove into a rack.

Why, of course I suggested drugs as a possible explanation. I can’t let the obvious joke slip by.

I was happy to see that these servers, unlike the last Dell I worked on, actually use a ServerWorks chipset rather than a cheap Intel desktop chipset. The Intel stuff is cheaper, but then all you’ve really gotten is a Dell Dimension in a rackmount case. In all honesty, I’ve run Linux on Intel and Sis and Via chipsets and turned those systems loose as servers, but when you’re spending money rather than repurposing systems, you should spend the money to do the job right.

I was less happy when I went to install Linux on it. The standard Debian 3.0 wouldn’t see it. It was the first time I’d found a system that Debian 3.0 wouldn’t boot.

A Google search quickly turned up a custom Debian boot CD for Dells, which I used to do the installation. Once installed, we compiled a custom kernel so the system would work right. I used to routinely recommend that. That was before I had 125 servers to stay on top of. These days I’m more inclined to use the standard kernel whenever I can–that way, when a vulnerability shows up, I can just apt-get update and reboot, rather than having to compile a kernel and then reboot.

I’m not in love with HP’s service–that’s a story in and of itself, but the short version is that the last time I used their 4-hour-response-time service, it took a day longer than regular warranty service would have taken–but HP’s servers sure make my life less complicated than Dell’s do.

In honor of Charlemagne\’s birthday…

I have posted my genealogy, including Charlemagne, online.

As for why a Scot is making a big deal about Charlemagne’s birthday, well, I’m descended from him. But I guess I could have said I did this to celebrate Walter Percy Chrysler‘s birthday. Or William Austin, but you probably haven’t heard of him.Actually I’m just being silly. I’ve had this running since this past weekend, but this is the first time I’ve gotten around to mentioning it.

You can view anything that happened prior to 100 years ago without a password. Stuff newer than that is protected, in order to protect privacy and protect my relatives from identity theft. As dead people’s birthdays come up, I may open their records, but I’m not going to sift through 2,300+ records all at once looking for people who have died since 1904 to open them up.

I used a program called GeneWeb, which comes with Debian but is available for other Linux distributions, Mac OS X, and Windows. It’s a nice package. In some ways it’s clunkier than Family Tree Maker, but for some things, like entering entire families, it’s much nicer and faster. There’s always a trade-off with software like this.

It’s a nice tool for online collaboration. Now my mom and aunt can enter information too, and all our stuff will be in sync, which has always been a major problem for us.

I don’t recommend leaving a package like this open to the world for modification just because a lot of people with nothing better to do like to vandalize public websites. (That’s why this site requires registration these days.)

Anyway, feel free to look around and play with it. I’m going to go back and finish entering the names of Charlemagne’s children.

Well, I’m a Slowlaris administrator now

Let me run down <strike>my list of qualifications</strike> what I know about Solaris.1. They call it "Slowlaris" because it initially wasn’t as fast on the same hardware as its predecessor, SunOS.
2. I don’t know if Slowlaris 9 is faster than older versions of Slowlaris, so I don’t know if this counts as something I know about it.
3. Slowlaris is based on System V Unix. SunOS was based on BSD.
4. Slowlaris runs primarily on proprietary hardware from Sun, based on a CPU architecture called SPARC. A handful of Sun clones exist, but I think Fujitsu is the only big third-party manufacturer.
5. There is an x86 version of Slowlaris. Sun keeps going back and forth on whether to continue making it or not, since they don’t make much money off it. It’s being made now. Professional Slowlaris admins argue that its availability makes it easier for up-and-coming admins to learn the OS without buying expensive Sun hardware–they can run it on their six-month old computer that’s too slow to run Doom 3.
6. "Sun" was originally an acronym for "Stanford University Network."

So most of what I know about Slowlaris is either trivia, or holdover generic Unix know-how. But I told my boss since it’s System V, I should be able to adjust to it almost as easily as I could adjust to a Linux distribution from someone other than Debian. I’ll just be typing –help and grepping around in /etc even more than usual.

Yep, it’s been that kind of <strike>week</strike> month.

Optimizing dynamic Linux webservers

Linux + Apache + MySQL + PHP (LAMP) provides an outstanding foundation for building a web server, for, essentially, the value of your time. And the advantages over static pages are fairly obvious: Just look at this web site. Users can log in and post comments without me doing anything, and content on any page can change programmatically. In my site’s case, links to my most popular pages appear on the front page, and as their popularity changes, the links change.

The downside? Remember the days when people bragged about how their 66 MHz 486 was a perfectly good web server? Kiss those goodbye. For that matter, your old Pentium-120 or even your Pentium II-450 may not be good enough either. Unless you know these secrets…

First, the simple stuff. I talked about a year and a half ago about programs that optimize HTML by removing some extraneous tags and even give you a leg up on translating to cascading style sheets (CSS). That’s a starting point.

Graphics are another problem. People want lots of them, and digital cameras tend to add some extraneous bloat to them. Edit them in Photoshop or another popular image editor–which you undoubtedly will–and you’ll likely add another layer of bloat to them. I talked about Optimizing web graphics back in May 2002.

But what can you do on the server itself?

First, regardless of what you’re using, you should be running mod_gzip in order to compress your web server’s output. It works with virtually all modern web browsers, and those browsers that don’t work with it negotiate with the server to get non-compressed output. My 45K front page becomes 6K when compressed, which is better than a seven-fold increase. Suddenly my 128-meg uplink becomes more than half of a T1.

I’ve read several places that it takes less CPU time to compress content and send it than it does to send uncompressed content. On my P2-450, that seems to definitely be the case.

Unfortunately, mod_gzip is one of the most poorly documented Unix programs I’ve ever seen. I complained about this nearly three years ago, and the situation seems little improved.

A simple apt-get install libapache-mod-gzip in Debian doesn’t do the trick. You have to search /etc/apache/httpd.conf for the line that begins LoadModule gzip_module and uncomment it, then you have to add a few more lines. The lines to enable mod_gzip on TurboLinux didn’t save me this time–for one thing, it didn’t handle PHP output. For another, it didn’t seem to do anything at all on my Debian box.

Charlie Sebold to the rescue. He provided the following lines that worked for him on his Debian box, and they also worked for me:

# mod_gzip settings

mod_gzip_on Yes
mod_gzip_can_negotiate Yes
mod_gzip_add_header_count Yes
mod_gzip_minimum_file_size 400
mod_gzip_maximum_file_size 0
mod_gzip_temp_dir /tmp
mod_gzip_keep_workfiles No
mod_gzip_maximum_inmem_size 100000
mod_gzip_dechunk Yes

mod_gzip_item_include handler proxy-server
mod_gzip_item_include handler cgi-script

mod_gzip_item_include mime ^text/.*
mod_gzip_item_include mime ^application/postscript$
mod_gzip_item_include mime ^application/ms.*$
mod_gzip_item_include mime ^application/vnd.*$
mod_gzip_item_exclude mime ^application/x-javascript$
mod_gzip_item_exclude mime ^image/.*$
mod_gzip_item_include mime httpd/unix-directory
mod_gzip_item_include file .htm$
mod_gzip_item_include file .html$
mod_gzip_item_include file .php$
mod_gzip_item_include file .phtml$
mod_gzip_item_exclude file .css$

Gzipping anything below 400 bytes is pointless because of overhead, and Gzipping CSS and Javascript files breaks Netscape 4 part of the time.

Most of the examples I found online didn’t work for me. Charlie said he had to fiddle a long time to come up with those. They may or may not work for you. I hope they do. Of course, there may be room for tweaking, depending on the nature of your site, but if they work, they’re a good starting point.

Second, you can use a PHP accelerator. PHP is an interpreted language, which means that every time you run a PHP script, your server first has to translate the source code into machine language and run it. This can take longer than the output itself takes. PHP accelerators serve as a just-in-time compiler, which compiles the script and holds a copy in memory, so the next time someone accesses the page, the pre-compiled script runs. The result can sometimes be a tenfold increase in speed.

There are lots of them out there, but I settled on Ion Cube PHP Accelerator (phpa) because installation is a matter of downloading the appropriate pre-compiled binary, dumping it somewhere (I chose /usr/local/lib but you can put it anywhere you want), and adding a line to php.ini (in /etc/php4/apache on my Debian box):

zend_extension=”/usr/local/lib/php_accelerator_1.3.3r2.so”

Restart Apache, and suddenly PHP scripts execute up to 10 times faster.

PHPA isn’t open source and it isn’t Free Software. Turck MMCache is, so if you prefer GPL, you can use it.

With mod_gzip and phpa in place and working, my web server’s CPU usage rarely goes above 25 percent. Without them, three simultaneous requests from the outside world could saturate my CPU.

With them, my site still isn’t quite as fast as it was in 2000 when it was just serving up static HTML, but it’s awfully close. And it’s doing a lot more work.

 

Linux kernel 2.6.0 is in Debian Unstable

Fresh on the heels of the Linux Kernel 2.6.1 release, Kernel 2.6.0 made it into Debian Sid (unstable). I haven’t tried it yet, as I messed things up on my main Linux box when I tried to upgrade to a pre-release version of 2.6.
I really ought to put a Linux partition on my Athlon system and upgrade it to Debian Unstable with a 2.6 kernel.

For those of you who currently have a working Debian box, it might be apt-get upgrade time. See why I like Debian? You can upgrade to all the latest stuff with, at worst, two commands: apt-get update and apt-get upgrade, or apt-get update and apt-get distupgrade. No chasing down RPMs and dependencies, no waiting around for stuff to compile and wondering if it’ll work on your system. It lets you be cutting edge, yet conservative.

Easy and secure remote Linux/Unix file transfers with SCP

Sometimes you need to transfer files between Linux boxes, or between a Linux box and some other box, and setting up Samba or some other form of network file system may not be practical (maybe you only need to transfer a couple of files, or maybe it’s just a one-time thing) or possible (maybe there’s a firewall involved).
Well, you should already have SSH installed on your Linux boxes so you can remotely log in and administer them. On Debian, apt-get install ssh sshd. If you’re running distro based on Red Hat or UnitedLinux, you may have a little investigative work to do. (I’d help you, but I haven’t run anything but Debian for 2 or 3 years.)

The cool thing about SSH is that it not only does remote login, but it will also do remote file transfer. And unlike FTP, you don’t have to stumble around with a clumsy interface.

If you want to transfer files from a Windows box, just install PuTTY. I just downloaded the 240K PSCP.EXE file and copied it into my Windows directory. That way I don’t have to mess with paths, and it’s always available. Make sure you’re downloading the right version for your CPU. The Windows NT Alpha version won’t run on your Intel/AMD/VIA CPU. Incidentally, Putty.exe is a very good Telnet/SSH client and a must-have if you’re ever connecting remotely to Unix/Linux machines from Windows.

SSH includes a command called SCP. SCP works almost like the standard Unix CP command. All you to do access a remote file is append a username, followed by the @ sign, and the IP address of the remote server. SCP will then prompt you for a password.

Let’s say I want to move a file from my Linux workstation to my webserver:

scp logo.jpg root@192.168.1.2:/var/www/images

SCP will prompt me for my password. After I enter it, it’ll copy the file, including a nice progress bar and an ETA.

On a Windows machine with PuTTY installed, simply substitute the command pscp for scp.

I can copy the other way too:

scp root@192.168.1.2:/var/www/index.php .

This command will grab a file from my webserver and drop it in the current working directory.

To speed up the transfers, add the -C switch, which turns on compression.

SCP is more secure than any other means of file transfer, it’s probably easier (since you already need SSH anyway), and since it’ll do data compression, it’s probably faster too.

FTE – a DOS-style editor for Linux

I don’t remember what I was looking for, but I found another DOS-style editor for Linux and Unix.

FTE is another editor that harkens back to the look of the typical DOS app of about 10 years ago, similar to SETEDIT. For casual editing, either program will do very nicely, and provide a look and feel comparable to the QuickBasic-derived editor that came with DOS 5 and 6.

Read more

Who wants to build an MP3 jukebox when you can go shopping?

I was going to cannibalize a computer to turn into a Linux-based MP3 jukebox–I figure get the OS up and going on it and figure out later what software to run on it. It’ll take me a while to get the sound card and wireless NIC working in it, I’m sure. Especially in Debian. If it turns out to be too much of a struggle, I can cave and run Red Hat or SuSE on it since they’re likely to just autodetect the stuff. And then I’ll be a Linux wimp, yeah, but hey, I’ll be a Linux wimp with a really cool sound system.
I ended up going to the store. A couple of stores. I needed vitamins and shampoo and fabric softener. It was really weird hearing “A Letter to Elise” by The Cure as background muzak in Kmart. Not that I was complaining.

I also wanted that Plumb CD I asked about yesterday. I could have saved some money by ordering it online, but I was impatient. It had a once-in-a-lifetime song on it and I wanted it. It was a longshot but I looked. Nope, no Plumb at Kmart. Just Newsboys and DC Talk–the kind of stuff my post-college girlfriend Rachel tried to get me into in 1997. I know a lot of people like them but I just couldn’t get into them.

I guess for me it was a good sign. As far as secular music goes, if it’s sold at Kmart I probably don’t like it. So I should probably expect the same for contemporary Christian music too.

Best Bait-n-Switch had it. So I got it, hopped in the car, put it in the CD player, and turned the volume up a bit. Maybe it’s just how my brain is wired, or what’s been on my mind lately, but “Real” just resonates. To me, it’s an instant classic, like “Day After Day” by Badfinger or “If You Leave” by OMD or “Love Will Tear Us Apart” by Joy Division.

I’d tell you about the rest of the album but I’ve had that one song on repeat play for most of the night. I think the last time I did that was six years ago with “Want” by The Cure–which turned out to be a smart move, since there wasn’t much else listenable on that particular record.

More on building under a small Linux environment

Well, I’ve been playing a little bit with Erik Anderson’s uClibc-based development environment mentioned in the previous two posts.
When I compile, I issue the command export CFLAGS='-Os -s -mcpu=i386 -march=i386' to create small-as-possible binaries. Using the default flags, the Links web browser balloons to nearly 2.6 megs on my dual Celeron, mostly due to the debug symbols. It drops to around 760K with those options. Specifying i386 binaries shrinks them down at the expense of some speed on some CPUs (especially 486s and first-generation Pentiums), so you have to set your priorities. It doesn’t matter nearly as much on newer CPUs. But I’m pretty sure if you’re interested in uClibc you’re not just running it on Pentium 4s.

For the record, Links compiles without warnings without doing anything special to its configuration and seems to run without incident (I immediately used it to locate and download more source code to compile). Samba’s more difficult, giving some warnings in various places. It may or may not require some special configuration in order to actually run (I didn’t have time tonight to test it), and of course that could result in some reduced functionality. The binaries total 9.3 meg, which isn’t bad considering it implements a complete Windows NT-compatible file server as well as some simple client utilities for connecting to NT shares on a network. The files themselves are about 20% smaller than on a stock Debian system.

Erik Anderson says the majority of Unix software will compile under uClibc, which is probably true. I generally see compiler warnings occasionally even when using a completely mainstream system.

Yes, I’m still alive

I had to take some time away to clear my head and find myself. It’s a survival tactic; the guy other people wanted Dave to be hasn’t been getting the job done.
Besides, anyone who’s worth anything will like the real Dave better than Dave the Chameleon anyway. Those who like Dave the Chameleon better can go find themselves someone else to be a chameleon. There doesn’t seem to be any shortage of people who are willing. But I think it’s rude to ask someone to change before you really get to know him or her, don’t you?

So I’ve been ignoring the site partly because when I’m paying attention to it, it’s really tempting to try to figure out what to write to make myself popular. And partly because it’s a distraction when I’m trying to figure out who I am. Writing is a big part of me, but it’s only part of me.

So I dug out some things I enjoyed in the past. I’ve been reading F. Scott Fitzgerald and listening to Peter Gabriel and U2 (early stuff, long before they got popular) and Tori Amos and Echo and the Bunnymen. The way I used to do things was to go look for stuff that most people overlooked, rather than letting current trends tell me what to like. So none of that’s cool anymore. Big deal.

The majority isn’t always right. Exhibit A: Disco.

I remember when I was in high school, either my freshman or sophomore year, a popular girl a year older than me came up to me and told me I needed to be more of a rebel. I thought about that and came to the conclusion that I was a rebel. She and her crowd were rebelling against authority figures. I was rebelling against conformity.

Oddly enough, I ended up sitting next to her boyfriend in Spanish class not long after that. We couldn’t stand each other at first, but then it turned out we had a lot more common ground than either one of us could have imagined and we became friends.

I can’t help but think of Fitzgerald. Fitzgerald was the spokesman of his generation, a generation not at all unlike ours, a generation that lived to excess and partied harder than any generation before, and up until GenX came along, or since. It’s obvious from Fitzgerald’s writing that he saw the excesses and even though it fascinated him, obviously there was a lot about it that he didn’t like. Yet his lifestyle didn’t change much. The result? The Voice of the Twenties was dead, aged 44, in 1940. Although some of his contemporaries recognized his greatness then, he was mostly remembered as a troublesome drunk.

Would Fitzgerald had lived longer if he’d been more of a rebel of a different sort? Well, I’d like to think so.

I’ve also been playing with computers. I pressed my dual Celeron back into duty and upgraded to the current version of Debian Unstable (I last did that sometime last summer, I think). It’s much, much faster now. I suspect it’s due to the use of GCC 3.2 or 3.3 instead of the old standby GCC 2.95. But I’m not sure. What I do know is the machine was really starting to feel sluggish, and now it feels fast again, almost like it felt to me when I first got it.

I’ve also been playing with PHP accelerators. I know I can only speed up a DSL-hosted site by so much, but my server serves up static pages much faster than my PHP pages, so I want that.

I’ve played around with WordPress a little bit more. It appears the new version will allow me to publish an IP address along with comments. I like that. I’m sick of rude people slinging mud from behind a wall of anonymity. I’m sure they’re much smarter than I am. So they ought to set up their own Web sites, so they can say whatever they want and enlighten the masses. If, as my most recent accuser says, what God wants is for Dave Farquhar and people like him to shut up, it won’t take much to drown my voice out.

OK, I’m done ranting. I’m gonna go in to work tomorrow and be my own person. I’m going to do what’s right, and not what’s popular, even when doing what’s right makes me unpopular. I’m going to stay focused and driven. The possibilities ahead are more important than the mistakes of the past and whatever happens to be missing from the present.

And there’ll be less missing with my vacationing coworkers back in the office.

And everything that’s true about work is true about life at home as well. Speaking of which, when I was out this weekend I noticed I was drawing second looks from girls again. Eating healthy again must be helping. That can’t be bad.

Well, this has to be the most disorganized and unfocused thing I’ve written in years. But I need to post something.

I’ll be back when my head’s more clear.