Shallow Thoughts : : Feb

Akkana's Musings on Open Source Computing and Technology, Science, and Nature.

Mon, 21 Feb 2005

Flashing a GigaByte/VIA BIOS from Linux

In the storm a couple of days ago, our server crashed: turned out we had some sort of power glitch that killed the UPS. Curiously, the other machines stayed up, including mine. I thought everything was fine, until I tried to power down that evening and found myself in an infinite-reboot cycle.

Since then my machine has been increasingly flaky, sometimes sending no video signal to the monitor at startup, sometimes not booting at all, never able to power down. Dave suggested downloading the latest BIOS and re-flashing.

The motherboard is a GigaByte GA-6VTXE (amusingly, the manual for it doesn't mention the company name anywhere, so I had to google for the model). It turns out that it has an option ("Q-Flash") to flash a new BIOS image without needing Windows or DOS. Hooray!

Sounded good, anyway: but the download images for the BIOS updates were a bit worrisome since they had names like bios_6vtxe_f9.exe. I downloaded the latest and put the .exe on a DOS-formatted floppy. The BIOS saw the file on the floppy, but said it was the wrong size (469k when it expected 256k).

Turns out that the file does need to be extracted from Windows in order to turn that 469k .exe file into the expected 256k image. It can't be unpacked by unzip, unrar or any other Linux utility I've found.

In other words, GigaByte is making their download files twice as big as they need to be in order to introduce an unnecessary Windows requirement into the Q-Flash process, which otherwise would be completely independant of operating system.

Sigh. (And no, the BIOS update didn't fix the problems, which are probably hardware. But it was worth a try.)

(Update: looks like it was the obvious, the power supply.)

Tags: ,
[ 13:28 Feb 21, 2005    More linux | permalink to this entry | ]

Sat, 19 Feb 2005

Me, as an icon

Me! From the Abi-Station Icon generator.

[ 19:40 Feb 19, 2005    More humor | permalink to this entry | ]

Tweaking Emacs' Text Indent: Don't Indent So Aggressively

Encouraged by my success a few days ago at finally learning how to disable vim's ctrl-spacebar behavior, the next day I went back to an emacs problem that's been bugging me for a while: in text mode, newline-and-indent always wants to indent the first line of a text file (something I almost never want), and skips blank lines when calculating indent (so starting a new paragraph doesn't reset the indent back to zero).

I had already googled to no avail, and had concluded that the only way was to write a new text-indent function which could be bound to the return key in the text mode hook.

This went fairly smoothly: I got a little help in #emacs with checking the pattern immediately before the cursor (though I turned out not to need that after all) and for the function called "bobp" (beginning of buffer predicate). Here's what I ended up with:

(defun newline-and-text-indent ()
  "Insert a newline, then indent the next line sensibly for text"
  (if (or (bobp)
          (looking-at "^$"))
(defun text-indent-hook ()
  (local-set-key "\C-m" 'newline-and-text-indent)
(setq text-mode-hook 'text-indent-hook)

It seems to work fine. For the curious, here's my current .emacs

Tags: ,
[ 14:03 Feb 19, 2005    More linux/editors | permalink to this entry | ]

Fri, 18 Feb 2005

Winter Sun and Tuna

Lunch in the backyard, in the sun and cool wind
(I wouldn't mind a few more "rainy days" like this!)
celery and tuna salad
(have to eat it outside, a courtesy to d, who dislikes the smell)
flavored with fresh dill from the garden
(a welcome winter volunteer that pushed up next to the geraniums last week)
watching the puffy cumulus clouds billow and grow and change
and threaten to grow into thunderheads, forgetting they're in California now
with a little lenticular stratus tucked inside of one of them
(what's that about?)
The resident phoebe chirps, hunting, while
a lone intrepid bushtit whizzes in from across the street
checks out the guava tree, then the orange tree, then zips off to the bush at the edge of the yard
(never seen a bushtit flying alone before. A bushtit bellwether?)

Far off to the west, a blue balloon flies free,
rising against the billowing clouds.

[ 17:38 Feb 18, 2005    More misc | permalink to this entry | ]

Sign of the Times

Lina discovered this.

Google for "matriarchal".

Google asks:

Did you mean: patriarchal

[ 11:12 Feb 18, 2005    More misc | permalink to this entry | ]

Thu, 17 Feb 2005

Turning off Ctrl-Space in Vim

One of those niggling problems that has plagued me for a long time: in the editor vim, if I'm typing along in insert mode and instead of a space I accidentally hit control-space, vim inserts a bunch of text I didn't want, then exits insert mode. Meanwhile I'm still merrily typing away, typing what are now vim comments which invariably end up deleting the last two paragraphs I typed then doing several more operations which end up erasing the undo buffer so I can't get those paragraphs back.

Ctrl-space inserts a null character (you can verify this by putting it in a file and running od -xc on it). I've done lots of googling in the past, but it's hard to google on strings like " " or even "space" or "null", and nobody I asked had a clue what this function was called (it turns out it re-inserts whatever the last inserted characters were) so I couldn't google on the function name.

Vim's help suggests that <Nul>, <Char-0>, or <C-^V > should do it. I tried them with map, vmap, cmap, and nmap, to no avail. I also tried <C-@> since that's a historical way of referring to the null character, googling found some references to that in vim, and that's how it displays if I type it in vim.

I finally found #vim on freenode, and asked there. Last night nobody knew, but this morning, p0g found the problem: I needed to use imap, not the map/vmap/cmap/nmap I'd been using.

So here, perserved for google posterity in case other people are plagued by this problem, is the answer:

imap <Nul> <Space>

For good measure, I also mapped the character to no-op in all the other modes as well:

map  <Nul> <Nop>
vmap <Nul> <Nop>
cmap <Nul> <Nop>
nmap <Nul> <Nop>

My current .vimrc.

Tags: , ,
[ 11:24 Feb 17, 2005    More linux/editors | permalink to this entry | ]

Wed, 16 Feb 2005

"The Leak": Why Not Subpoena Robert Novak?

I am just utterly not understanding this story on "The Leak".

The news yesterday: Matthew Cooper (Time magazine) and Judith Miller (the New York Times) are to be subpoenaed in the ongoing "Leak" case. (LA Times, or via Yahoo)

You remember "The Leak". Joseph Wilson, the CIA investigator sent to Niger to trace rumours that Saddam Hussein had tried to purchase "yellowcake" uranium, wrote an opinion column in the New York Times accusing President Bush of "misrepresenting the facts on an issue that was fundamental justification for going to war." Wilson's published report had stated the rumours were false, but Bush ignored the report and quoted the rumours as fact in his 2003 State of the Union address.

Roughly a week later, Washington Post columnist Robert Novak wrote that Wilson's wife, Valerie Plame, was a CIA operative, citing information from a "senior administration official".

It being a crime to reveal the identity of an undercover CIA operative, Bush at the time vowed to "find the leak". The current update in the case means two other reporters, Cooper and Miller, who supposedly were also contacted by the same "senior administration official", will be called to testify as to the identity of the person who contacted them. If they refuse, they face imprisonment for contempt of court.

The papers are full of outraged articles arguing that reporters should never be forced to reveal sources, and waving their "First Amendment" flags. And that's fine -- I have no problem with journalists protecting sources.

What I completely don't understand is: Why are Matthew Cooper and Judith Miller, who never wrote anything about the case, being subpoenaed and threatened with improsonment, while Robert Novak, who wrote the article which started all this, is not?

Why, in all the journalistic breast-beating which has accompanied this case, does no one ever suggest concentrating on Novak to find The Leak's identity?

Novak is the reporter who published the article outing Plame. Novak is the reporter who clearly had a source. Sure, question other sources, but why isn't Novak the prime, number-one source in this investigation?

A cynical friend says it's because Novak is a Bush administration mouthpiece, who did the administration's bidding in publishing the article, while Cooper and Miller did not.

Perhaps. But if that's the case, shouldn't that itself be news?

[ 12:12 Feb 16, 2005    More headlines | permalink to this entry | ]

Tue, 15 Feb 2005

Blogedit -- edit a file without altering the date

Lots of Linux blogging software, such as the pyblosxom I'm currently using, uses the Unix file date on for each posting to determine the date at which the entry was made.

This makes it very convenient to add new entries, but it also makes it tricky to go back and update an old entry without losing all information about when the entry was originally posted.

I've been using a little sh script I hacked up for the purpose, which parsed the output of ls -l and then passed that in to touch -d. It worked, but it was ugly and had problems with postings that crossed a year boundary or were too old (because the ls -l format varies).

I finally got around to rewriting the script in python. It's more robust now, and cleaner, plus it checks EDITOR and VISUAL instead of always using vi. blogedit

[ 23:51 Feb 15, 2005    More blogging | permalink to this entry | ]

Thu, 10 Feb 2005

Back in College

I'm back in college, after [mumble] years away. What fun!

I'm taking Field Geology, something I've wanted to take for years. I've been reading geology books for years, but there's a wide abyss between reading about limestone and olivine, and being able to identify random rocks in any location we hike.

So far, two weeks in, the class is great. The instructor is enthusiastic and interesting. Most of the students are geology fans like me, taking the course out of fascination for the subject. (Not all kids, either; several are returning students, like me. Is that a euphemism? Hey, Akkana, why don't you just say "old farts"?) Yesterday's lab was "Here's a box of sedimentary rocks, here's a bottle of acid, identify the rocks." Fun! I can hardly wait for the field trips. (Dave: How was your class? Me: We dropped acid! Dave: Really? Is it too late to sign up? Me: On the rocks.)

I brought in a rock collected from our last Utah trip, from the plateau rising out of the eastern edge of the Bonneville salt flats. Dave and I both guessed it was limestone. With the HCl it fizzed like mad. Cool -- we were right!

One minor amusement about being back in college: a lot of students now eschew the traditional backpack in favor of rolling luggage. Walking around campus you hear these rummmmmblings that sound like an onrushing skateboard, and it turns out to be some kid plodding along with luggage in tow. Well, maybe they have bad backs.

That was yesterday. Good things that happened today: I won our Toastmasters club table topics competition, so I get to compete at the next level. Also I posted lesson 3 in the gimp course (a fun one, making a Valentine's day card) and finished my planet column on Iapetus. Bad things: more Iapetus diagrams to make, and when I got home I discovered I had a slight fever. I feel better now, so maybe it won't turn into anything.

[ 22:29 Feb 10, 2005    More education | permalink to this entry | ]

Wed, 09 Feb 2005

Don't Try to Stare a Rabbit Down

We went for a short hike at RSA this afternoon. A flash of blue swooped showily past us and disappeared into the grass of the field ("What was what? that didn't look like a jay"), emerging half a minute later, a western bluebird with a big fat worm in its bill.

We saw the first wild turkeys of the year, a big flock of about ten. Some hikers scared them and they decided to cross the stream, but they did it in a very orderly fashion, one by one and single file. Obviously there was a wrenching conflict in the turkey psyche between not wanting to get one's feet wet, versus flying being a lot of work. So each turkey would trot down the slope to the stream, jump just before reaching the bottom, flap two or three times, land in the water then splash/trot the last couple steps to the far bank. Then the next turkey in line would follow the same procedure.

The last two turkeys said "Aw, to heck with it!" and trotted straight down the slope, getting wet feet.

Up the hill on the farm bypass trail, we came to a place where the grass was, evidently, greener. We saw one brush rabbit, then another, then a third, then a fourth, then some kind of mouse who vanished as soon as it spotted us (the rabbits were less concerned). We watched the fourth rabbit for quite a while as it munched the grass, and Dave noticed that it never blinked. Was it blinking too fast for a human to see, or do rabbits, somehow, not blink?

So I checked with Suzi. She says she's never caught her pet rabbit, Scamper, blinking -- and Scamper sleeps with both eyes open.

Dana found the answer. Rabbits apparently only blink once every six minutes. It's in the oddly titled study, Proliferation Rate of Rabbit Corneal Epithelium during Overnight Rigid Contact Lens Wear. Though I'm fairly sure the rabbit we saw on the trail was not wearing contact lenses.

[ 22:36 Feb 09, 2005    More nature | permalink to this entry | ]

Tue, 08 Feb 2005

Nonworking Novel Ad Redux

Turns out the Novell Ad requires flash 7, and just runs partially (but with no errors explaining the problem) with flash 6. About 2/3 of the linux users I polled on #linuxchix had the same problem as I did (still on flash 6).

I installed flash 7.0r25, and now I get video and sound (albeit with the usual flash "way out of sync" problem), but mozilla 1.8a6 crashes when leaving the page (I filed a talkback report).

Still not a great face to show migrating customers. Oh, well, maybe it works better on Novell Linux ...

Tags: , ,
[ 18:33 Feb 08, 2005    More linux | permalink to this entry | ]

Novell Can't Manage a "Migrate to Linux" Page That Works In Linux?

Someone on IRC posted a link to a Novell ad trying to persuade people to migrate from Windows to Linux.

It's flash, so I saw the flash click-to-view button. I clicked it, and something downloaded and showed play controls (a percent-done slider and a pause button). The controls respond, but no video ever appears.

Thinking maybe it was a problem with click-to-view, I tried it in my debug profile, with mostly default settings. No dice: even without click-to-view, the page just plain doesn't work in Linux Mozilla. Didn't work in Firefox either (though I don't have a Firefox profile without click-to-view, admittedly). People on Windows and Mac report that it works on those platforms.

I thought to myself, Novell is trying to be pro-Linux, they'll probably want to know about this. So I went up one level to try to find a contact address (there isn't one on the migration page). I didn't find any email addresses but I did find a feedback link, so I clicked it. It popped up an empty window, which sat empty for a minute or two, then filled with "Novell Account: Mal-formed reply from origin s". Any text which might follow that is cut off, doesn't fit in the window size they specified.

What does Novell expect customers to think when they migrate one machine to Linux, start using it to surf the web, and discover that they can't even read Novell's own pro-Linux pages from Linux? What sort of impression is that going to make on someone considering migrating a whole shop?

Fortunately sites like Novell's which don't work in Linux and Mozilla are the exception, not the rule. I can surf most of the web just fine; it's only a few bad apples who can't manage to write cross-platform web pages. But someone early in the migration process doesn't know that. They're more likely to just stop right there.

Tags: , ,
[ 12:30 Feb 08, 2005    More linux | permalink to this entry | ]

Thu, 03 Feb 2005

Emacs Color Themes

A nifty emacs trick I learned about today: ColorThemes.

Instead of the old hacked-together color collection I've been using in emacs, I can load color-theme.el and choose from lots of different color schemes.

I added these lines to .emacs:

(require 'font-lock)
(if (fboundp 'global-font-lock-mode) (global-font-lock-mode 1))
(load "~/.emacs-lisp/color-theme.el")
(color-theme-ramangalahy)  ;; pick a favorite theme

The disadvantage is that color-theme.el is fifteen thousand lines long! So I'll probably make a local version that strips out all but the theme I actually use (then I can customize that).

The (global-font-lock-mode 1) tells emacs to use syntax highlighting on every file, not just certain types. So now I get at least some highlighting even in html files, though it still doesn't seem to be able to highlight like vim does (e.g. different colors for text inside <b> or <b> tags).

Tags: ,
[ 18:57 Feb 03, 2005    More linux/editors | permalink to this entry | ]

Wed, 02 Feb 2005

GimpLabels script-fu

Someone showed up on #gimp the other day asking about how to make business cards. He was on Windows, so gLabels wasn't really an option, and of course my old gimp-print patch to read gLabels label templates would have been no help to a Windows user.

I got to thinking about how easy it would be to write a little gimp script analogous to my CD label script, which created a rectangular template in which to design a label, then created a bigger image scaled to the size of a page on which the label could be repeatedly positioned, with specified start and end points.

I couldn't resist trying it. It wasn't quite as easy as I had initially thought, mainly because I don't know script-fu very well and debugging script-fu is painful. But it still only took a few hours on a couple successive days to hack up something that more or less works: GimpLabels.

I didn't try to parse the gLabels XML from script-fu; I wrote a separate python script to translate the label templates into script-fu.

It's not perfect. On a page of 30 Avery 5160 labels (10 rows), it gets a little off by the bottom of the page. I don't know yet if this is a problem in the gLabels template, in my understanding of the parameters, or in the script-fu. It's fine for shorter pages.

I integrated my existing CD label routines into the script, but haven't yet written code to parse the CD label templates and make a print page from them. I've lost motivation for working on CD labels anyway, since discovering a few months ago how drastically they hurt CD longevity.

Anyway, GimpLabels was a fun hack, and an example of how easy it is to do this sort of thing in gimp.

[ 12:20 Feb 02, 2005    More gimp | permalink to this entry | ]