Starchy & Husk

I just found proof that the Web is one of man's greatest innovations. Out of the blue and without actually searching, I came across both a site which has more information about Starsky and Hutch than you ever wanted to know, and a site which has instructions on building your very own Zebra3. What could be cooler than owning a bright red '75 Gran Torino with a white rally stripe running down it? Only one thing: owning The Batmobile.

Posted by wee on 09/26/2002 at 11:06 AM | Main Page | Category: Random Stuff | Comments (3)
Great skin

I found a great XMMS skin called NLog. It looks really good normal, and also very good double-sized and window-shaded (which is how I typically use XMMS). Very few skins look that great (or are that useful) that way.

Anyway, worth checking out if you have a shortage of eye candy in your life...

Posted by wee on 09/25/2002 at 11:23 AM | Main Page | Category: Geek Stuff
Did they read it or not?

I happened to notice on linuxtoday.com an ad for a book called "MySQL Weekend Crash Course". I clicked the link, wondering what constituted a "crash course". The detail page for the book has a description, which includes statements like the following:

The problem is, you\'re not really up to speed. Maybe it\'s been a while since you worked with relational databases. Maybe you\'re new to MySQL.
Those slashes in front of the single quotes are there because that text is stored in a database -- which is more than likely MySQL -- and the quotes need to be escaped so that the DB doesn't think they are part of the SQL statement. Anyway, I read the description and the first thought that popped into my head was "So why didn't these guys read this book when they built this site?" and the second thought was "Or maybe they did read it..."

Posted by wee on 09/16/2002 at 02:20 PM | Main Page | Category: Rants
There is only one Lord of the Disc, and he does not share power.

Recently one of my friends, a computer wizard, paid me a visit. As we were talking I mentioned that I had recently installed Windows XP on my wife's PC. I told him how happy she was with this operating system and I showed him the Windows XP CD. To my surprise he threw it into my microwave oven and turned it on. Instantly I got very upset, because the CD had become precious to me, but he said: 'Do not worry, it is unharmed.' After a few minutes he took the CD out, gave it to me and said: 'Take a close look at it.' To my surprise the CD was quite cold to hold and it seemed to be heavier than before. At first I could not see anything, but on the inner edge of the central hole I saw an inscription, an inscription finer than anything I had ever seen before. The inscription shone piercingly bright, and yet remote, as if out of a great depth:

12413AEB2ED4FA5E6F7D78E78BEDE820945092OF923A40EElOE5 I OCC98D444AA08EI

'I cannot understand the fiery letters,' I said in a timid voice. 'No but I can,' he said. 'The letters are Hex, of an ancient mode, but the language is that of Microsoft, which I shall not utter here. But in common English this is what it says:

One OS to rule them all, One OS to find them,
One OS to bring them all and in the darkness bind them.
It is only two lines from a verse long known in System-lore:
"Three OS's from corporate-kings in their towers of glass,
      Seven from valley-lords where orchards used to grow,
Nine from dotcoms doomed to die,
      One from the Dark Lord Gates on his dark throne
In the Land of Redmond where the Shadows lie.
      One OS to rule them all, One OS to find them,
      One OS to bring them all and in the darkness bind them,
In the Land of Redmond where the Shadows lie."'

Posted by wee on 09/13/2002 at 02:59 PM | Main Page | Category: Random Stuff | Comments (1)
Here's a banner for ya...

A while back, I had to set up a system for a former client of my previous employer (my previous employer had no Linux help, you see, while the former client had new Linux machines to set up, so...). One of the things I did was get a banner going for them. It was an added bonus, and completely frivolous. I was up late one night and happened upon a DOD site with a cool banner, so I cabbaged parts of it, and knocked together this:

                        **WARNING**WARNING**WARNING**

This is a privately-owned computer system and is strictly for use authorized
by the system owner only. Users (authorized or unauthorized) have no explicit
or implicit expectation of privacy on this system. System personnel may give to
law enforcement officials any potential evidence of crime found on this
computer system.

Any or all uses of this system and all files on this system may be intercepted,
monitored, recorded, copied, audited, inspected, and disclosed to law
enforcement personnel, as well as authorized officials of any federal or local
government agency, both domestic and foreign. By using this system, the user
consents to such interception, monitoring, recording, copying, auditing,
inspection, and disclosure at the discretion of the owner of this system or
such agents so designated by said owner.

Unauthorized or improper use of this system may result in civil and/or criminal
penalties to fullest extent provided by law. By continuing to use this system
you indicate your awareness of and consent to these terms and conditions of
use. LOG OFF IMMEDIATELY if you do not agree to the conditions stated in this
warning.
Feel free to use it if you want. Just save it to /etc/issue, make a symlink called /etc/issue.net which points to it, and then add a line in /etc/ssh/sshd_config which says Banner /etc/issue.net. HUP sshd. All done.

Oh, and while you're editing sshd's config file, add this line:

DenyUsers root bin daemon adm lp sync shutdown halt mail news uucp operator games gopher ftp nobody vcsa mailnull rpm rpc nscd ident apache squid mysql ntp xfs gdm rpcuser nfs nobody pcap junkbust

Just for good measure.

Posted by wee on 09/12/2002 at 08:10 PM | Main Page | Category: Geek Stuff
How I'm observing 9-11

I decided to observe Patriot Day (not Patriot's Day; the apostrophe is important) in a substantive way by doing two things every September 11th:

  1. I'm not going to watch any TV, nor listen to any radio
  2. This year, I joined the Electronic Frontier Foundation, and every subsequent year I'm sending in my $65 membership renewal
Why these two things? Because I think 9-11 is being overblown in the media in order to attract eyeballs, and being overblown in Washington in order to pass draconian legislation aimed at restricting liberty. So I decided that instead of useless, empty gestures like pinning little flags on my lapel, watching the talking heads on TV pimp out the memory of the dead for ratings, or blindly accepting that the government can do whatever they want in spite of what the Founding Father's said and did, that I'd try to do something constructive and positive. I didn't know what form that something would take until just this morning, though.

I was thinking last night about how 9-11 has affected me. I couldn't think of anything positive or uplifgting. Nothing has touched my heart. If nothing else, I've only become more scared of the government. The USA PATRIOT Act essentially means the federal government can wiretap anyone at anytime, with no cause whatsoever. Any sort of privacy, 1st amendment be damned, goes out the window in the name of catching enemies both foreign and domestic. Ashcroft has held hundreds of people in secret jails without having charged them with a crimes. Hearings about those crimes are behind closed doors. People are being detained (or merely assaulted by citizenry) simply because of how they look. Six dollar an hour airport security guards (you get bumped to eight bucks an hour if you have a criminal record) are needlessly harassing kids and old men, some of whom are decorated war heroes. The TIPS debacle meant the mailman would become an agent of Big Brother (luckily TIPS died a richly deserved death before it could terrorize anyone; who thought TIPS was a good idea?).

Thinking about all of this made my head spin. What kind of country will my children live in? None of the things mentioned above will do anything to combat or prevent terrorism. Many of them will merely serve to place the Federal government in the role of terrorist against its own populace. It's all being done in the name of patriotism, and nobody can call any of it into question without be branded as "unpatriotic".

Patriotism is being taken too far, and people have been abusing both the 9-11 tragedy and the word patriot itself. Even Dan Rather has said "I worry that patriotism run amok will trample the very values that the country seeks to defend." Violent nationalism we don't need. The cure can't kill the patient. We don't want the terrorists to win.

I'm as patriotic as a guy can be. I've even got a (lit) flag flying outside my house this very minute. Why not? I'm proud of my country and nationality. But enough is enough. To paraphrase a wiser fellow than me: I don't ever want to forget 9-11, but I don't want to be constantly reminded of it either. I'm going to get on with my life (which hopefully won't include any mention of Lisa Beamer, or which won't have me hear the phrase "Let's roll" ever again), and observe the event in a way that will help preserve what really makes this country great: the freedoms of its people. I'm only one person, but I figure every little bit helps.

Posted by wee on 09/11/2002 at 11:41 PM | Main Page | Category: Rants
How to make the Dell Dimension 4500 work with Red Hat Linux 7.3

I got a new Dell Dimension 4500 at work. It's a very nice machine, but it seems they have issues with regards to Red Hat Linux 7.3: the display/mouse aren't detected properly upon install, DMA won't work with a stock kernel (nor one updated via errata page download or rhupdate), and sound won't work with the integrated audio. These instructions will help correct two of those problems.

How to correct the display and mouse

The flat panel (an UltraSharp 1800FP 18") isn't properly detected (lower resolution, improper bit depth), and the mouse doesn't work properly (the scrollwheel and middle button don't work). Put this XF86Config-4 file in /etc/X11 and retsart X to correct these problems.

BTW, the monitor's specs are:

Size:   18"
Viewable Size:   18.1"
LCD Type:   TFT/Active Matrix
Inputs:   RGB and DVI
Pixel Pitch:   .281mm
Horizontal Scan:   31kHz - 80kHz
Vertical Scan:   55Hz - 85Hz
Vert. and Horiz.
Viewing Angle:
  Typical +/-80 degrees
Brightness:   250 nits
Contrast Ratio:   350:1
Prime Mode:   1280x1024 (SXGA)
Dimensions:   H: 17"
W: 16"
D: 8.8"
Weight:   17.20 lbs
I put those there because Dell took them off their web site, and I hate not having monitor timing specs.

How to build a new kernel which gets around the DMA bug

The IDE controllers (which are Intel 82801DB Ultra ATA Storage Controllers) won't work in DMA mode with a stock kernel. It's apparently a bug, or a controller whose specs changed even though its rev number didn't. I couldn't find a definitive answer either way. I do know that Alan Cox's 2.4.19-ac4 kernel patch solves the problem.

Here are the hdparm results before the new kernel is built (i.e., with an updated stock kernel):
[root@hostname root]# uname -a
Linux hostname.ucsd.edu 2.4.18-10 #1 Wed Sep 11 11:39:21 EDT 2002 i686 unknown

[root@hostname root]# hdparm /dev/hda

/dev/hda:
multcount = 16 (on)
I/O support = 0 (16-bit)
unmaskirq = 0 (off)
using_dma = 0 (off)
keepsettings = 0 (off)
nowerr = 0 (off)
readonly = 0 (off)
readahead = 8 (on)
geometry = 2498/255/63, sectors = 40132503, start = 0
busstate = 1 (on)

[root@hostname root]# hdparm -t -T /dev/hda

/dev/hda:
Timing buffer-cache reads: 128 MB in 0.38 seconds =336.84 MB/sec
Timing buffered disk reads: 64 MB in 23.25 seconds = 2.75 MB/sec

[root@hostname root]# hdparm -c1 -d1 -k1 /dev/hda

/dev/hda:
setting 32-bit I/O support flag to 1
setting using_dma to 1 (on)
HDIO_SET_DMA failed: Operation not permitted
setting drive keep settings to 1 (on)
I/O support = 1 (32-bit)
using_dma = 0 (off)

[root@hostname root]# hdparm -t -T /dev/hda

/dev/hda:
Timing buffer-cache reads: 128 MB in 0.37 seconds =345.95 MB/sec
Timing buffered disk reads: 64 MB in 14.03 seconds = 4.56 MB/sec
As you can see, DMA won't engage and so disk access is slow.

To build the new kernel, first download the new kernel, the patch, and the .config file I made. Put them all in $HOME/download/kernel/2.4.19/. Then do the following as root (this is essentially a sub-mini-howto -- a cheatsheet for me; if you're already familiar with patching and building a kernel, then just do that using the links above):
cd /usr/src
tar zxvf $HOME/download/kernel/2.4.19/2.4.19.tar.gz
gunzip $HOME/download/kernel/2.4.19/patches/ac/patch-2.4.19-ac4.gz
ln -s linux-2.4.19/ linux
ln -s linux-2.4.19/ linux.vanilla
patch -p0 < $HOME/download/kernel/2.4.19/patches/ac/patch-2.4.19-ac4
cd linux
make mrproper
cp $HOME/download/kernel/2.4.19/.config ./
make xconfig (check that options match what are needed, save file)
make dep
make clean
vi Makefile (:s/EXTRAVERSION = /EXTRAVERSION = -ac4/)
make bzImage
make modules
make modules_install
/sbin/mkinitrd /boot/initrd-2.4.19-ac4.img 2.4.19-ac4
make install
/sbin/reboot
Here are the hdparm results after the reboot, with the new kernel selected from the GRUB menu:
[root@hostname root]# uname -a
Linux hostname.ucsd.edu 2.4.19-ac4 #2 Wed Sep 11 14:26:39 PDT 2002 i686 unknown
[root@hostname root]# hdparm /dev/hda

/dev/hda:
multcount = 16 (on)
I/O support = 1 (32-bit)
unmaskirq = 0 (off)
using_dma = 1 (on)
keepsettings = 0 (off)
nowerr = 0 (off)
readonly = 0 (off)
readahead = 8 (on)
geometry = 2498/255/63, sectors = 40132503, start = 0
busstate = 1 (on)

[root@hostname root]# hdparm -t -T /dev/hda

/dev/hda:
Timing buffer-cache reads: 128 MB in 0.38 seconds =345.95 MB/sec
Timing buffered disk reads: 64 MB in 1.65 seconds = 38.79 MB/sec
The machine should be noticeably faster, with less overall CPU usage.

If you want to make sure that the disk settings stick across a reboot (no matter what the -k1 flag is supposed to do, it doesn't seem to want to keep settings), make a small shell script like so:
#!/bin/shell

/sbin/hdparm -c1 -d1 /dev/hda
Save it as /etc/rc.d/init.d/dma. Then link it to the proper run-level you're using, as early in the boot process as you can (e.g., ln -s /etc/rc.d/init.d/dma /etc/rc.d/rc3.d/S04dma).

How to get sound working with the integrated audio

You can't.

The audio chip on the motherboard is a SoundMAX Integrated Digital Audio. Linux, and sndconfig, detect it as an Intel i810 AC97 Audio chip, using the intel_i810 module. Long story really short, the driver doesn't like that card at all. No amount of Google and newsgroup searching turned up statements to the contrary. It seems everyone's having trouble. If someone really wants sound, have them buy a $17 SoundBlaster Live! card and be done with it.

Posted by wee on 09/11/2002 at 06:30 PM | Main Page | Category: Geek Stuff
Customize Opera

I'm a big fan of Opera. I use it on Windows and Linux and it's extremely fast. I like that it starts downloading things as soon as you click a link. So when you're hunting for a place to store the file, it's already got it. I like download completion. I like that it's fairly small (~3MB for the QT shared RPM). I like the MDI-style tabbed windows. But most of all I like the keyboard shortcuts.

For example, to turn on JavaScript, hit F12 and then 'e' (for 'enable'). To turn off pop-up windows, hit F12 and then 'r' (for 'refuse'). Turn then on again with F12 + 'w' (for 'windows'). Turn off plugins (Flash) and GIF animations with F12 + 'p' ('plugins') and F12 + 'g' ('GIFs'), respectively. This makes for a lovely wayback machine-type, neoluddite browsing experience. Just the way I like it.

The best keyboard shortcut, however, is F8. That places the insertion point in the location bar, and highlights the text ther. So you can hit F8, then start typing in a new URL, just like that. More useful is hitting F8 and then 'g' with a space and then 'Hungarian Cheesecake'. You just searched Google for an ethnic cake recipe. You can do a similar thing with F8, then 'e' and search directly at ebay.com. Using 'z' does Amazon, 'w' does download.com, 'x' does Google's Linux area, and 'r' searches Google's newgroups. Once you get used to this, it's second nature. Handy enough to be indispensible.

But one thing I've always thought was lacking was a way to customize this. For example, one thing I like to do is ad hoc spellchecking at Google. I need to know a word, I just hit ctrl+n, F8, 'g werd' and I'm done. Google says "Are you sure you didn't mean 'word'..." when I misspell. If I want to know a definition or something, then I can always click the little link up at the top that says "Searched the web for 'word'". That link goes to dictionary.com. How come I can't just go there directly?

Using F8+d leads you to search for a new domain name. I think I've done that like five times in as many years (and I use whois anyway). Opera does have a dictionary set up, but there's no hotkey for it (and it searches Lycos anyway... ick). So I'd like to search a dictionary web site, but not Lycos. The UI has no way to assign your own keys to these location bar shortcuts, so I've been going through Google all this time. Today I accidentally found out how to make your own location bar shortcuts. Here's how:

Open up $HOME/.opera/search.ini in a text editor. Look for a section like this:

[Search Engine 10]
Name=&Domain Name
URL=https://opera.domaindirect.com/cgi-bin/domainsearch.cgi?do=search&searchdomain=%s
Query=
Key=d
Is post=0
Has endseparator=1
Encoding=iso-8859-1
Search Type=6
Change the 'Key=d' line to just 'Key='. Now look for a section like this:
[Search Engine 18]
Name=Dictionary
URL=http://r.lycos.com/r/opiprefdic/http://www.infoplease.lycos.com/search.php3?in=dictionary&query=%s
Query=
Key=
Is post=0
Has endseparator=0
Encoding=iso-8859-1
Search Type=50
Change the 'URL=...' line to 'URL=http://www.dictionary.com/search?q=%s' and the 'Key=' line to 'Key=d'.

Now you can hit f8+d and search the dictionary. Fast and easy, like Opera should be. BTW, on Windows, the search.ini file lives in the Opera install directory. The format of the file is the same.

Posted by wee on 09/04/2002 at 10:58 AM | Main Page | Category: Geek Stuff
The Gopher Manifesto is back online

The Gopher Manifesto, which used to be at http://www.scn.org/~bkarger/gopher-manifesto/, is gone. So archived a copy from Google's cache.

Posted by wee on 09/01/2002 at 08:31 PM | Main Page | Category: News