Just added: More Like This

New feature: More Like This. It took me several hours to implement this one. It should have taken me less than thirty minutes. Hot tip: If you try to run a CGI script and you get Internal Server Error messages, try re-uploading the script in ASCII mode rather than the default binary. Betcha it works after that. When running under Linux or Unix, Perl hates extra carriage returns, and Windows often inserts them.
I think this is the next trend in Weblogs sites. If it’s not, it should be. The idea is this: You assign some keywords to each entry. And at the end of the entry, you put a line that says More Like This and some hyperlinked keywords. So if you like it when I write about baseball or music and you want to see more, click on the baseball or music hyperlink at the end of the entry, and the search engine I stole will go fish around for other entries I gave the same keyword to.

For sites that always write about the same thing, this isn’t very useful. For sites with eclectic content, this is a boon. You can quickly find whatever writings of mine tickle your fancy and skip over the subjects that bore you. How cool is that?

My goal is to put together the best site in the Daynotes circuit. I’ll never have the best content, but if I have reasonably good content and you can quickly find a whole lot of what you’re looking for (be it entertainment, stuff that makes you think, or technical content), I stand a ghost of a chance of reaching that goal.

I actually managed to implement More Like This without modifying any Greymatter code. First, I grabbed Meta Tag Search, a simple CGI script that searches on meta tags, from http://support.cws.net/hosting/cgiscripts.html. I followed the installation instructions. Like I said before, upload it in ASCII mode. You’ll save yourself a few hours and a lot of gray hair. Now, whenever I make an entry in Greymatter, I put a keywords meta tag at the very beginning of the entry. I don’t know if other search engines will find the tags there, but Meta Tag Search will, and that’s my primary concern. Then, at the end of the entry, I add collection of hyperlinks that call Meta Tag Search.

So now it takes a couple more minutes’ effort to make each post, but I think it’s worth it.

More like this: Linux Weblogs HTML CGI
Greymatter

How I set up Greymatter for Weblogging

How I set up Greymatter for Weblogging. First things first: I’m sure everyone’s asking how much hardware you need. I’m using a Pentium-120 with 64 megs of RAM, and it’s plenty fast most of the time. It takes a little while to regenerate all the templates, but other than that it’s mostly sitting idle. Any Pentium-class machine should be plenty. I’d be hesitant about using a 486 because the templates will take an awfully long time to rebuild. Remember, Greymatter’s written in Perl, and Perl’s an interpreted language. Interpreters are slow for the same reason emulators are slow–the translation is real-time.
But Greymatter offers advantages. You can control your destiny. You have total control over your site–it’s running on your Linux box. And you’re free from FrontPage’s tyrrany. Did I hear cheers? Most importantly for me, I set the clock. I can set the clock ahead a couple of hours, make my post at 10 p.m., and it’ll be dated the next day. That can only mean… The return of the infamous Farquhar Time Machine. I can start sleeping in again! Or go to work earlier… Hey, I can start sleeping in again!

Anyway, I had the Pentium-120 already configured with Mandrake 7.2, but I discovered Mandrake 7.2 in high security mode doesn’t seem to allow Web traffic from the outside world. So I installed Mandrake 7.2 again in low-security mode. I used a server installation. The only things I really cared about were Apache and Perl, but I didn’t feel like de-selecting everything. Both will be in there by default. I think Perl’s part of the Development group during installation. I’m not sure what group Apache is in. I don’t recommend running XFree86 on your server. Those memory resources are better used for server purposes. Oh, and one last thing: Don’t use DHCP. Give your Web server a local, static IP address.

Once I was up and running, Apache wasn’t running by default, so I dinked around with a cp /etc/rc.d/init.d/httpd /etc/rc.d/rc3.d/S45httpd so that Apache would start on boot. Then I started Apache by executing /etc/rc.d/rc3.d/S45httpd start. Of course there are plenty of other ways to accomplish the same thing. It was close to midnight and I just wanted the thing open to the world at that point.

Then I pointed my Web browser at the server’s address, and my embryonic Weblog came up.

It won’t happen that way for you, because I already had Greymatter installed and configured before I did all that. In other words, I did things bass-ackwards. You should do it differently. Get Apache working right first. It’s less frustrating that way.

With Apache installed and running, point a Web browser at it. You should see some kind of Apache welcome screen–it’ll vary based on your Linux distro, but it’ll basically be some kind of show-off screen. You see it? Great. You don’t? Get Apache working. How? I dunno. Make sure it’s running, first of all. Type the command pidof httpd. You should get a couple of numbers. Maybe a lot of numbers. If all you get is a blank line, then Apache’s not running. If it’s running but not responding, you’ve probably got a problem with the configuration file. The default configuration file for Apache, unlike the default configuration of a lot of programs, does work reasonably well. The defaults will certainly do for a Weblog. Start with the default config, get it working, then get fancy later.

Working? Great. Open up port 80 on your DSL router and point it to your server’s address. Don’t expose any other ports. This improves security immensely. Now go to www.grc.com and run Shields Up!, then Probe My Ports. Port 80 should be open. If it’s not, either your Linux box is too secure (I wish I could offer some advice there but I don’t know much about un-securing a Linux box) or your router’s not forwarding the port right.

By default, in Mandrake at least, Apache puts its HTML files in /var/www. So, first, clear out /var/www/html. Next, I put all of the Greymatter files in /var/www/cgi-bin. Then I created directories named Archives in both /var/www/cgi-bin and in /var/www/html. The documentation is pretty good about what files need permissions of 755 and what needs 777 (yuck!) and what needs more restrictive settings, like 644 or 666.

As an aside, the archives directory being chmodded to 777 makes me nervous. That means that if I install Greymatter to a server that shares space with someone else, the entire world can see that directory. They can’t manipulate anything inside there as long as the files inside have more restrictive permissions, but I always cringe every time I see anything with 777 permissions. I knew people in college who’d just chmod everything to 777 because then it meant everything just worked all the time. Unfortunately, anyone who had telnet access to the machine could then go into that directory and change anything. I’m not as concerned about that, since I don’t share this PC with anyone. But 777 still doesn’t give me warm fuzzies. Unix ain’t Christianity. In Unix, 666 is ok (but 644 is much better), and 777 is a hacker’s delight, and therefore, pure evil.

After you chmod all your files, assuming your server is at 192.168.1.2, go to http://192.168.1.2/cgi-bin/gm.cgi. Greymatter should pop up. Go to the configuration screen and run down the line:

Local log: /var/www/html
Local entries: /var/www/html/archives
Local CGI: /var/www/cgi-bin
Website log path: /
Website entries path: /archives
Website CGI path: /cgi-bin

Set the other stuff the way you want it. Now hit Save Configuration. Now, immediately run Diagnostics and Repair. This will ensure that all files are where they need to be and permissions set correctly. If it can’t find something, do what you have to to satisfy it.

Now you’re ready to start editing templates and adding entries. You’ll need to exercise your HTML skills for that, or rip off someone’s templates. I didn’t look too hard, but I’m sure there are people out there offering Greymatter templates. If you have to, use an HTML generator to draw what you want, then take the code and put it in the template. I know HTML, so I coded mine by hand. That’s why they’re still sparse. The basic layout is there; I need to flesh it out. And I haven’t entered every template yet myself.

Now, for backups and stats… Backups are easy. I use the command tar -c /var/www >/home/dave/backup.tar. It only takes a second. You can compress the tar file and throw it on a floppy with the mcopy command. Or if Samba’s also configured and running, backup to a network-accessible directory and pull the file over to another machine.

For stats, I use LiveWebStats, but I don’t like it. Any Apache log analyzer will work.

There’s one other issue with Greymatter. It sends passwords plaintext, and thus, they’ll show up in your logs. So don’t make your stats public, at least not your referrers. If you’ll have remote editors, you need to consider that vulnerability–an editor’s password can potentially be intercepted.

Setting up Greymatter is a lot of work, but it’s a one-shot deal. You make your design, then it’s content-driven. Change your design, and it applies to the whole site. Nice. And when you publish, you only publish your new stuff.

But overall, I like Greymatter an awful lot.

Tiny assembly language Windows utilities

Tiny utilities. While I was debating whether to go buy a copy of Extreme Power Tools, I thought I remembered seeing a couple of programs similar to what they offer. So I went hunting and found other stuff, of course.

People tend to get annoyed if you just link to their files, so I linked to the pages that contain links to the files. Some of these pages get pretty heavy, so use your browser’s search function if you have trouble locating the file. Also, there are a few files on one of these pages that can be misused, such as buffer exploits and a program to reveal hidden passwords in dialog boxes. Whether they were intended to be misused, or to demonstrate insecurity, I’m not sure. That said, there are some other utilities on these pages that didn’t seem too useful to me, but they may be useful to you. I don’t want to throw out the baby with the bathwater, so here are a couple of dozen free utilities, linked using proper netiquette.

The listed file sizes are the size of the executable, not the download. The downloads are larger because they include additional files, usually source code.

Files from http://titiasm.cjb.net :

Memory Info. Want to know how much memory your system is using? Here ya go. This is faster than running Norton SysInfo or Microsoft System Monitor. 5.5K.

EdPad. Assembly language Notepad clone. Unfortunately it lacks search/replace. See TheGun for a closer NotePad replacement. 16K.

Resolver. A tiny utility to match Website URLs to IP addresses, and vice-versa. 4.5K.

Files from http://spiff.tripnet.se/~iczelion/source.html :

MP3play. A minimalist MP3 player. Also capable of playing WAV. MID, RMI, AIF, AU, and SND files. Supports playlists. Hint: Right-click in the program window to access its features. 10K.

Also includes miniMP3, a 3.5K player that just plays a single file you specify.

WordEdit. An RTF word processor/help file editor in assembler. Aside from being able to read Word 6 documents, it would make a fabulous WordPad replacement. Includes multiple-level undo and redo, font and color support. Major features missing from a full-blown word processor: spelling/grammar and print preview. Delete the included file splash.dll to eliminate the splash screen and long boot delay. 112K.

FileMan. A graphical two-pane file manager, like Norton Commander. 87K.

Clipboard. Intended mostly as a demo program, but it’s useful beyond its original design. Intended use: Put it in your Sendto folder and you can send file paths to the clipboard from a right-click on the file. Nice. But additionally, having a large object on the clipboard can slow down your system. Some programs ask when you exit if you want to clear it. Others don’t. This program pastes the command-line parameter you feed it to the clipboard, so a shortcut to this program that passes a single-character argument effectively clears your clipboard. Neat, huh? 2.5K.

EWCalc. A scientific calculator. Additionally, it’ll do decimal/hex/octal/binary conversion. 30.5K.

PlayCD. A simple CD player. 7.5K.

QuickBar. A lean replacement for the MS Office toolbar. 20K.

HTTP Downloader. Feed it an url, and it downloads a file through HTTP, like Unix wget. 20.5K.

TheGun. A slightly enhanced replacement for Notepad. Edits large files, includes Ctrl-A hotkey for select all, and includes search/replace. Source not included. 6K.

QuickEdit. A more full-featured editor, includes HTML-to-text conversion and strips carriage returns. Download includes TheGun and a quick-and-dirty textfile viewer. Source not included. 27K.

Files from http://www.rbthomas.freeserve.co.uk/:

Screen savers. I hate screen savers, as everyone knows. Normally I use blank screen. This package includes a 6.5K 32-bit assembly language replacement for blank screen. (Microsoft’s blanker is 16-bit!) The others in the package prove that even when written in assembly, graphics-heavy screen savers eat up far too much CPU time.

RWave. Records and plays back WAV files. A suitable replacement for Sound Recorder. 5.5K.

Timer. This program isn’t a substitute for a common utility, but it’s useful for me. I’ve never gotten around to getting a timer for my kitchen. Now I can let my computer do the job. If your apartment’s as small as mine, or if you have a computer in your kitchen (why? Never mind. I don’t want to know.) yours can too. 31.5K.

More for less, but who wants it? And David Huff reports the P4 prices will plummet today. I thought I mentioned that, but maybe not. The 1.7 GHz model will launch at the insane price of $350 (Intel had planned to launch it at $700 or so). Margins? We don’t need no stinkin’ margins! Intel’s definitely running scared.

Enough of that. Time to take a hint from Frank. What else is there in life? I realized one night last week that I hadn’t gone record shopping in a long time, so I hit the local used shop. The pickings were a bit more sparse than usual, but I’d written down a couple of longshots to look for and I found them, along with a couple of surprises. First I found Starfish, by The Church, which features the track “Under the Milky Way,” a mainstay of ’80s radio and compilations. That’s probably the standout track, but for a band usually considered a one-hit wonder, it’s a really good album.

The other big surprise was Look Sharp!, which was Joe Jackson’s 1979 debut. I was surprised to find it’s mostly a guitar-bass-drum album. Jackson’s a piano player–and a darn good one. Jackson’s piano appears, but he’s rarely playing the lead instrument. The tracks that everyone remembers (“Is She Really Going Out With Him?” and the title track) are definitely the best parts of this album, but it was a strong effort. I can see where his following came from. But it was weird hearing him do what amounts to punk rock with a dose of literacy.

The first longshot was an album I’ve been looking for used for years: Doolittle by The Pixies. The Pixies are very much an acquired taste, but I acquired it. How to describe them? Dark, usually. Weird, always. This was generally regarded as their best album.

And the last longshot was Oyster by Heather Nova. Who? Yeah, I know. I once saw her mentioned in the same context as Aimee Mann and Dot Allison, so I kept an eye out. I think the comparison to those two is a bit shallow. Yes, the three of them are all blonde, female, and write their own songs, and both Nova and Allison play guitar (so does Mann, but she’s mostly a bass player). I recognized “Walk This World” as a song that got a fair bit of airtime on alternative radio about five years ago. Like Allison, her lyrics can get a bit suggestive sometimes, though there are plenty of people who get more so. Compared to Madonna, they’re both tame. But comparing them to an MTV-manufactured pop star is heresy, so I’ll stop now. The variety of styles Nova dabbles in on the album surprised me. Some tracks are dreamy and atmospheric reminiscent of Allison’s band One Dove, but right in the middle of the album is some pure hard rock in the form of a song called “Maybe an Angel.” Somehow that song avoids being over the top like a lot of hard rock does, and it’s far and away the best song on the album. And I’ve thought about those Allison-Mann-Nova comparisons. She’s dreamy and atmospheric like Allison, and often introspective like Mann, so maybe that’s the basis. At any rate, I’ll be keeping an eye on her, and not just because she has a really cool name.

04/08/2001

How far we’ve come… While I was hunting down tax paperwork yesterday (found it!), I ran across a stash of ancient computer magazines. For grins, I pulled out the May 1992 issue of Compute, which celebrated the release of Windows 3.1. I would have received this magazine nine years ago this month.

Some tidbits I liked:

“Windows 3.0… entered a hostile world. OS/2 loomed on the horizon like a dragon ready to devour us, and MS-DOS, stuck in version 4.0, had lost its momentum. It looked as if Digital Research…was the only company trying to make DOS better.” –Clifton Karnes, pg 4

That’s what happens when there’s no strong competition. I don’t get the OS/2 and dragon metaphor though. What, people didn’t want a computer that worked right? I didn’t get it at the time. I had an Amiga, which at the time offered OS/2 features and a good software library.

“Some people even started talking about Unix.” Ibid.

Some things never change.

“The masses are happy, and nobody talks about Unix much anymore.” Ibid.

That certainly changed.

“You can now buy a 200 MB drive for just $500.” –Mark Minasi, pg 58

That now-laughable line was from a Mark Minasi column that talked about strategies for getting drives larger than 512 MB working. Strangely, that problem still rears its ugly head more often than it should, and its descendant problem, getting a drive bigger than 8 gigs working, is even more common.

“A 286-based notebook is a very capable machine; with a decent-size hard disk and a portable mouse, you could even run Windows applications on one (except for those requiring enhanced mode performance such as Excel).” –Peter Scisco, pg 72

Don’t let any of the end users I support read that line. That’s funny. Later in the same article, Scisco discusses the problem of battery life, a struggle we still live with.

“The last dozen modems I’ve installed here at Compute have been compact models. It’s almost like the manufacturers are trying to get better mileage by leaving out parts and making the cards smaller. These modems don’t reject line noise very well.” –Richard Leinecker, pg. 106

Now there’s a problem that only got worse with time.

An ad from Computer Direct on page 53 offered a 16 MHz 386SX with a meg of RAM and dual floppy drives (no hard drive) for $399. Your $399 gets you a lot more these days, but that price got a second look for sure. A complete system with a 14-inch VGA monitor and 40-meg HD ran $939. The same vendor offered an external CD-ROM drive (everything was a 1X in these days) for $399.

An ad on page 63 proclaimed the availability of the epic game Civilization, for “IBM-PC/Tandy/Compatibles.” Yes, these were the days when you could still buy a PC at Radio Shack and expect to be taken seriously.

A free memory tester and a Linux tip

I lost my notes for today somehow, and I’ve been home a grand total of 14 hours the past 48 hours (I think), so you’ll have to excuse this quickie.

Free memory tester. I found this over the weekend:

www.memtest86.com

It’s a memory test disk. Self-booting, about 74K in memory, builds from DOS, Windows, or Linux (and possibly others too). I use and recommend RAM Stress Test, by Ultra-X Inc. ( www.uxd.com ), but this seems nearly as good and it’s free. If you’ve got frequent bluescreens, download this and try it on your PC. A lot of problems are caused by bad memory, and the power-on memory test usually won’t find it. Neither will most DOS-based memory utilities.

MemTest is still no substitute for buying brand-name memory, though I’d never let commodity memory sit on the same table with my hardware without testing it first. About 1 in 1,000 brand-name sticks are bad, as opposed to about 1 in 12 commodity sticks, in my extensive experience. One of the first things I do when faced with an unstable system is test the memory overnight, just in case.

Linux (and Unix) tip of the day. If you vaguely remember a command but can’t completely recall it, type the part you remember, then hit tab. A list of possibilities will appear. Hopefully the command you’re looking for is among them.

And if any of the possibilities sound interesting, type man command. The online documentation will come up and explain usage.

Don’t let anyone fool you. You never master this OS. You just learn how to find what you need to get a job done quickly. And hopefully you develop a long memory.

Outta here. And if you’ve mailed me over the last couple of days, my apologies. I’ll get back to you tonight after work.

Playing with Squid

Mandrake Squid. To turn a Mandrake server install into a Squid server, here’s all you have to do. Issue the command squid -NCd1 to build the cache directory structure. Then, issue the command mv /etc/rc.d/rc3.d/K25squid /etc/rc.d/rc3.d/S25squid so that Squid runs at startup (assuming your server’s set to run in text mode, as servers should be–why waste all that memory and CPU cycles keeping a GUI running when those resources can be dedicated to server tasks?). If it you boot and run GUI mode automatically, (maybe you want to run Squid on your workstation), add the command mv /etc/rc.d/rc5.d/K25squid /etc/rc.d/rc5.d/S25squid to the mix.

Now to start Squid, you can do one of two things. You can reboot, which is the Windows way of doing things, or you can just start the daemon, which is the Unix way of doing things. I like the Unix way. Run Squid’s startup script manually by issuing the command /etc/rc.d/rc3.d/S25squid restart. (There are other ways to do it too of course but I like this way.)

Single-floppy Squid. And just in case you haven’t seen everything yet, you can get a single-floppy FreeBSD-based Squid server. Head over to www.ryuchi.org/~ilovefd/1fdsquid/1fdsquidus.shtml for the goods. It uses the system’s hard drive for storage. You want a semi-powerful CPU (a Pentium-133 is sufficient for a small workgroup) and a fair bit of memory (I’m thinking 64 megs is the minimum). That’s less power than you need for a Windows workstation these days, but considering you can do a light-duty Unix-based fileserver with a 33 MHz 486, it’s a comparatively powerful machine.

Rare DOS disk utilities

Mailbag:

RAM disk; Your book; Mobos; Monitors; Net folders

I’ve been doing a bunch of work in DOS the past few days, and I’ve found some useful disk tools. A lot of people use the shareware WinImage or GRDUW to create images of floppy disks. That’s with good reason, seeing as floppies are so unreliable–this way, you’ve got a backup on a hard drive or CD-ROM drive, and it’s so much more convenient when you need a particular disk to just grab a blank, make a fresh copy from an image, and go do your thing. But I found some DOS utilities, some recent and others oldies but goodies, that give you the functionality of these shareware utilities but with the advantage of being free, smaller, faster, and in most cases running on a wider variety of operating systems–all good things. So they don’t have a nice clicky mousey interface… I don’t like using a mouse anyway. Maybe you’re like me, or maybe you like powerful utilities and don’t mind giving up the mouse to be able to use them.

So here goes.

Creating disk images. My favorite is  Diskwarez DF — of course I like this utility, seeing as it bears my initials. DF is a short and sweet utility for creating and writing disk images compatible with Rawrite and the Unix dd utility. Runs under DOS and under Windows 9x and NT in a command window. There are dozens of DOS disk imaging utilities out there, but this one has the advantage of being compatible with a very common cross-platform standard. Check out the Diskwarez site, as it’s got tons of info on disk programming, as well as some other utilities like free disk editors. Despite the name, it’s not a pirate site–Diskwarez software is distributed under a free license somewhat similar to the GPL.

If you prefer self-extracting images, you can use the similarly named DOSDF to create them.

Bigger, faster, better floppies. The other feature of GRDUW is to format high-capacity floppy disks and floppies that give faster access than disks formatted with Windows Explorer or the DOS format utility. Enter FDFORMAT . You can do that and plenty of other cool things with this utility. You can gain more usable space on a 1.44-meg floppy without resorting to weird disk formats just by reserving fewer root directory entries. For example, FDFORMAT A: /D:16 gives you the maximum available space on a 1.44-meg floppy by reserving just 16 root directory entries (if you’re storing large files you don’t need more than 16 anyway, probably).

For extra speed, use Sector Sliding: FDFORMAT A: /X:2 /Y:3 speeds up the disk by 50-100 percent by arranging the tracks in a more optimal order. Supposedly you can gain even more speed by playing around with the gap length, but the author says disks are less reliable when you do this. If you’re more interested in speed than in reliability, add the /G:32 switch to the command listed above.

And by default, the boot sector on disks formatted by FDFORMAT automatically try to boot to the hard drive rather than giving you the dreaded “Non-system disk or disk error” message. Why couldn’t Microsoft think of that?

And of course you can also format high-capacity disks. Use the /F168 option to format a 1.68-MB floppy, and the /F172 option to format a 1.72-meg floppy. These switches can be combined with the others as well. Keep in mind that extra-capacity disks aren’t bootable.

FDFORMAT’s downside is it won’t run from inside Windows NT or Windows 9x. The best thing to do with it is to format a disk with it on a PC booted into DOS (DOS mode from Windows 9x’s boot menu is sufficient), then take that disk and use the aforementioned DF or DOSDF utilities to make an image of that disk, then when you need to format a new high-speed disk or a new disk that won’t give you errors when you leave it in the drive, use the image.

Formatting bad disks. And finally, for those dreaded Track 0 Bad errors that render a disk unusable, there’s FR , which uses workarounds to try to make the disk usable again. Typically I get rid of floppies with bad sectors pretty quickly, but if it’s an emergency, this program might bail you out. I used to get around Track 0 errors by formatting the disk in my Amiga–for some reason the disk always worked after that–but seeing as I usually don’t have my Amiga set up, this is an alternative.

And wouldn’t you know it, as soon as I wrote that I found a better way. SmartFormat also does Track 0 workarounds, uses the date and time to create unique disk serial numbers (instead of Microsoft’s license-plate method), provides a fast format that’s up to 60% faster than Microsoft’s method, and can optionally format 1.72-meg disks. SmartFormat runs within Windows, usually.

Mailbag:

RAM disk; Your book; Mobos; Monitors; Net folders

02/17/2001

Fixing an NT server. Or, troubleshooting Ghost on SCSI drives. One of the week’s challenges was figuring out how to Ghost an NT server. I wanted to back up a current configuration of a test server, but when I ran Ghost, it would die about 80 megs into the backup with a sector not found error or some other weirdness.

So I went back into NT, copied a ton of Ghost images to the drive, and watched. No problems. Hmm. So I called in some help. I showed him I could copy effortlessly to the server’s FAT partition. So then I deleted the files, booted off a DOS floppy, and at the command prompt I got ready to fill the disk. First, MD 1 to make a destination directory. Error. Crap!

We thought it over for a while, then he thought of something: what’s that partition’s placement on the drive? So we fired up Partition Magic and looked–it ran into cylinder 1152. Bingo. The 1024-sector limit isn’t a problem with IDE drives these days, but depending on your SCSI BIOS, it can be a problem with SCSI drives. And any self-respecting server uses SCSI drives.

So I deleted the FAT partition, moved the NTFS partition to the end, then created a new FAT partition in the middle of the drive. Bingo. No more complaints from Ghost.

I know it’s tempting to put your FAT disaster-recovery partition at the end of the drive, where performance is slowest, since you’ll rarely touch the thing. Unfortunately, if you cross cylinder 1024, you’ll get burned. So remember this rhyme while setting up servers: Keep FAT before cylinder 1024. You’ll be glad you did.

What, nothing on yesterday? Surely you jest. Of course there’s mail. But after fighting an NT server and Macs yesterday, did I want to deal with mail? Of course not. Look for it tomorrow.

Can’t resist a preview? Fine. One reader quoted The Great Benjamin Franklin: “Those who are willing to sacrifice a little liberty to gain a little safety deserve neither liberty nor safety.” Amen, Ben. Were that there were more like you…

Linux. Well, if you’re chasing single-disk Linux projects, you can do much, much worse than to play with Freesco ( http://www.freesco.org/ ), which crams more onto a single floppy than anything else I’ve seen. So dig out your 386, slap in a pair of dusty ISA NICs, disconnect the hard drive to save power, throw in a couple of SIMMs to get it up to 6 MB RAM, boot off the disk, and tell it what you want. You can have an Ethernet bridge, a modem-to-Ethernet router, an Ethernet-to-Ethernet router, Cable/DSL-to-Ethernet router, or a print server. It even includes a DHCP server and caching DNS, if you like that sort of thing. (If you don’t like a caching DNS, it’s obviously because you’ve never seen one in action.)

Even if you have no need for its routing capabilities, it’s nice to be able to take an obsolescent PC, throw in a cheap NIC if it lacks one, and configure Freesco just as a caching DNS. Stick the PC in a corner anywhere you have a free drop and set it up to boot without a keyboard, configure your desktop PCs to use it, and you’ll reduce network traffic. With one caching DNS per subnet, you’ll get speed gains worth far more than it would cost to haul that old PC away. (And trust me, you want one on your local network–it’s worth the effort to get your 386 or 486 working again, even if you have to go buy a $12 ISA NE2000 clone NIC to drop in it.)

If you want a fast boot, you can install Freesco to a smallish hard drive, but if you do that, set it to spin down the drive because as long as you’ve got 6-8 MB of RAM, it’ll never touch the drive after it’s done booting.

Setup is insanely easy. Boot off the floppy, type setup, login as root, and follow the menu options. Even if you know no Unix whatsoever, you’ll be able to configure this. Check it out–you’ll be glad you did.

Unlike a lot of similar projects, Freesco is based on the 2.0.38 kernel, which is smaller than more recent kernels but networking’s not quite as fast. Still, in most cases the inclusion of the caching nameserver more than makes up the performance difference–not to mention the five-minute configuration time. And its network performance is still faster than NT.

Early experiments in building gateways

Gateways. I worked with Gatermann last night after I got back from church (three Macs and an NT server died yesterday–I needed it last night) on trying to get his Linux gateway running under FloppyFW . We were finally able to get it working with dual NICs, able to ping both inside and outside his LAN (I finally found an old Pentium-75 board that didn’t have compatibility issues). But we weren’t able to actually get his Web browsers working.

I suspect something about the IP masquerading configuration just isn’t right, but it’s been so long since I wrote one of those by hand (and it was really just copycating an existing configuration), so since I have working Linux boxes at home I finally just gave up and downloaded the shell script version of Coyote Linux and ran it. It’s not foolproof because you have to know what kernel module your Ethernet cards use, but assuming you know that (make it easy on yourself–get a pair of Netgear 10/100 cards, which use the Tulip module), but it’s definitely a two-edged sword. It makes it a little harder to configure, but it means it’ll work with a much wider variety of cards. If Linux supports it, so does Coyote, whereas a lot of the other single-floppy distributions just support the three most common types (NE2000, 3Com 3c509, and DEC Tulip). So an old DEC Etherworks3 card will work just fine with Coyote, while getting it to work with some of the others can be a challenge.

I’m disappointed that Coyote doesn’t include the option to act as a caching DNS, because you can fit caching DNS on the disk, and it’s based on the Linux Router Project, for which a BIND tarball is certainly available. I’ll have to figure out how to add BIND in and document that, because there’s nothing cooler than a caching nameserver.

I was messing around briefly with PicoBSD , a microdistribution of FreeBSD, but the configuration is just different enough that I wasn’t comfortable with it. FreeBSD would be ideal for applications like this though, because its networking is slightly faster than Linux. But either Linux or FreeBSD will outperform Windows ICS by a wide margin, and the system requirements are far lower–a 386, 8 megs of RAM, floppy drive, and two NICs. Can’t beat that.

Rarely used trivia department: Using Linux to create disk images. To create an image of a floppy under Unix, use this command: dd if=/dev/fd0 of=filename.img bs=10k . There’s no reason why this command couldn’t also be used to clone other disks, making a single-floppy Linux or FreeBSD distribution an alternative to DriveImage or Ghost, so long as the disks you’re cloning have the same geometry.

Test this before you rely on it, but the command to clone disk-to-disk should be dd if=/dev/hda of=/dev/hdb while the command to clone disk-to-image should be dd if=/dev/hda of=filename.img and image-to-disk should be dd if=filename.img of=/dev/hda .

And yesterday. While the computers (and I’ll use that phrase loosely when referring to those Macs) were going down all around me at work, the mail was pouring in. Needless to say, some people agree and others don’t. We’ll revisit it tomorrow. I’ve gotta go to work.

02/12/2001

Mailbag:

Keyboards; Optimizing Windows

Sweet! In Optimizing Windows, I lamented that no one had made a hardware RAM disk. Leave it to the Aussies, someone did it. I found a reference to Platypus Technologies ( www.platypus.net ) on Storage Review’s forum. It’s pricey–a half-gig disk will run $1,500, while an 8-gig job runs into five figures–but you’ll never find anything faster. It’s a plug-in PCI card that uses SDRAM DIMMs. Whether it’ll take off-the-shelf DIMMs or just Platypus-manufactured DIMMs, I’m not sure.

I’d love to see this catch on and drive the price down. The size seems a bit small, but keep in mind that for, say, a Web server, speed is much more important than size, and a half gig will hold an awful lot of HTML. And there was a time when operating systems and a reasonable number of apps easily fit in half a gig, if you’re thinking workstations.

I’d say I think I’m in love, but that’s not true. This device is 100% Grade-A lust. Now the question becomes how do I convince Computer Shopper UK that they’ve really got to do an in-depth look at this killer device, and that I’m absolutely, positively the guy they have to have do it…?

One-button Linux shutdowns. Here’s a great idea.  A lot of people run headless Linux boxes for firewalls or routers or Web servers or other things. But that once or twice a year you need to shut the machine down–due to power failures, for instance–becomes a real pain without a keyboard or mouse. You have to telnet or ssh in, issue the command… Or keep a monitor and keyboard handy, which just wastes space most of the time.

Here’s a solution: a case-mounted pushbutton with a pair of LEDs. Push the button, the PC shuts down. It plugs into a serial port and needs a small daemon to monitor the serial line.

And it occurs to me that nothing stops you from using the PC’s reset switch and its power and HDD LEDs–or turbo LED if it has one–and with that slight modification, it would require no modification to the case. Just put connectors on the PCB for the switch and LEDs and mount it somewhere inside.

Also, I looked at the source code for the daemon, and it would be extremely easy to mofify this project to do any other task–just go to the runshutdown() function and change the system(“/sbin/shutdown -t2 -h now”); command to execute any other Unix command. The C source code is so simple, even a journalist like me can modify it.

If I were building another Linux-based Cable/DSL gateway, I’d probably pull that line and replace it with these two:

system(“kill -9 $(pidof -x pumpd)”);
system(“/etc/rc.d/init.d/network restart”);

That way, with the push of a button, the gateway could go grab a new IP address.

And if you have multiple serial ports, nothing stops you from building one of these switches for each port and modifying this daemon to run additional commands. A throwback to the Imsai and Altair days, to be sure.

Too bad you don’t see much of this kind of stuff anymore.

Samba. Speaking of Linux, that was one of the weekend’s projects. My church ran out of IP addresses, so I took an old P166, threw a pair of NICs in it, and set up IP masquerading on it (Mandrake 7.2 makes this so nice–just run DrakConf, run Internet Connection Sharing, answer its questions, and you’re in business), then I started assigning 192-net numbers to the PCs that didn’t have addresses. It worked great. Since I had a Linux box with an 8-gig drive just sitting there, I decided I also wanted to set it up as a server. So I tried to configure Samba as an NT domain controller and fell flat on my face. It showed up in Network Neighborhood, but I couldn’t authenticate against it no matter what I tried.

I decided yesterday I was being too ambitious. I reformatted my P120, installed Mandrake 7.2 on it, and configured Samba to just look like a plain old Win95 box. It worked great. They’re not used to having a big network at church, and they’re all on Win98 boxes anyway, so I think I’ll just configure Samba to do user-level authentication, create a few shares, and let it go at that. The primary convenience of the server is the AV booth; one of the staff puts together PowerPoint presentations for the service, which are then loaded on a pair of PCs up in the AV booth for projection on Sundays and Wednesdays. The server will allow them to edit in their office, then go to the AV booth without shuttling around Zip disks. Chances are the DCE, who also serves as the resident PC expert, will also use a share there to store device drivers and other downloaded stuff he finds himself using often. Other than that, the server probably won’t get a lot of work, so trying to create an NT domain with hardcore security probably isn’t a good investment of my time.

So I’ll probably just create an AV share, create a public share that’s read/write accessible to anyone, then I’ll share out home directories and show him how to create user accounts. That way if anyone else wants to use a network drive, it’s there, but not mandatory.

Mailbag:

Keyboards; Optimizing Windows