Archive for January, 2010



A big thumbs up: Stone Soup

I took lyyx’s advice this morning and cobbled together Dungeon Crawl Stone Soup, which looks and plays a lot like NetHack.

 

It’s painful to say it, but I think I might like this better. This seems to have a lot more depth to it — little things like large-scale mapping, religion systems, a huge array of magic disciplines, waypoint systems, you name it. Actually, none of those are little things.

And it’s tough, too. I keep getting killed — usually because of poison or a cursed item — but any game that keeps killing me off is giving me a proper challenge. I spent most of the afternoon and all of this evening trying to get past level four or so, and with very few exceptions, I consistently … fail.

Installing this for the console wasn’t that difficult; the only real obstacle was trying to figure out why pkgmk wouldn’t decompress the tarball (answer: pkgmk doesn’t recognize .tbz2 extensions) and what to do when the game gives itself a group (in this case, games:games) that doesn’t already exist on the system (I don’t usually include a “games” group, because few games actually seem to use it).

I probably could have avoided those issues by just using one of the telnet versions (that lyyx also mentioned), although it might be nice to have this offline, so I can enjoy it at my leisure. And if you want a “demo” before you actually go through all the work of installing it :roll: , you can watch a game at crawl.akrasiac.org and get an idea of what’s going on.

This one is a definite keeper, friends. I recommend it wholeheartedly.

P.S.: A gold smilie for lyyx. :D

An assortment of Crux ports

This is another one of those posts that will only be of use to Crux users, or to me in a few months, if I find myself looking for a port for one of these programs. Most of these, as usual, were stolen rather shamelessly from AUR or from the Arch repositories, and converted in part through Colin Zheng’s fantastic PKGBUILD2Pkgfile script, and with a little nudging from me. No fair laughing at the results.

Here’s a port for bs, which I mentioned the other day among a group of console games.

# Description:  The classic game of Battleships against the computer. Ncurses.
# URL:          http://www.catb.org/~esr/bs/
# Maintainer:
# Depends on:   ncurses

name=bs
version=2.7
release=1
source=(http://www.catb.org/~esr/$name/$name-$version.tar.gz)
build ()
{
        cd $name-$version
        make

        mkdir -p $PKG/usr/bin $PKG/usr/share/man/man6

        cp bs $PKG/usr/bin
        cp bs.6 $PKG/usr/share/man/man6/bs.6
}

And gnuchess, since it too was mentioned.
# Description:  Lets most modern computers play a full game of chess
# URL:          http://www.gnu.org/software/chess/chess.html
# Maintainer:
# Depends on:   glibc ncurses readline

name=gnuchess
version=5.07
release=1
source=(ftp://ftp.gnu.org/pub/gnu/chess/$name-$version.tar.gz
        http://repos.archlinux.org/wsvn/packages/$name/repos/extra-i686/$name-gcc4.patch
        http://repos.archlinux.org/wsvn/packages/$name/repos/extra-i686/$name-glibc210.patch)
build ()
{
    cd $name-$version
    patch -Np1 -i $SRC/gnuchess-gcc4.patch
    patch -Np0 -i $SRC/gnuchess-glibc210.patch
    ./configure --prefix=/usr --enable-ncurses
    make
    make DESTDIR=$PKG install
}

Come to think of it, I don’t know if including those patches in the source lines will work or not; I had downloaded them manually before I included them in the Pkgfile. I’m still ironing out a way to wget patches and other stuff from the Arch repos. Accessing them via the Web site is actually showing an HTML page, so if your patches don’t quite work right, download them manually and move them into the gnuchess port folder. Sorry. :(

I also mentioned alsaequal a long time ago, but I don’t think I ever made a “backup” of the ports I used to build it. Alsaequal wants ladspa and caps; ladspa is in the contrib repo I believe, but this is for caps.

# Description: C* Audio Plugin Suite
# URL:         http://www.quitte.de/dsp/caps.html
# Maintainer:
# Depends on:  ladspa

name=caps
version=0.4.4
release=1
source=(http://www.quitte.de/dsp/${name}_${version}.tar.gz)

build() {
    cd $name-$version
    make
    make DEST=$PKG/usr/lib/ladspa install
    chmod 755 $PKG/usr/lib/ladspa/*.so
    make RDFDEST=$PKG/usr/share/ladspa/rdf rdf-install
}

I think that one came from the vico ports originally, but I updated it to the current-at-the-time-of-writing version. ;) And here is Alsaequal proper.
# Description: A real-time adjustable equalizer plugin for ALSA sound server.
# URL: http://www.thedigitalmachine.net/alsaequal.html
# Maintainer:
# Depends on: glibc ladspa caps

name=alsaequal
version=0.4
release=1
source=(http://www.thedigitalmachine.net/tools/$name-$version.tar.bz2
	http://aur.archlinux.org/packages/$name/$name/$name.patch)
build ()
{
    cd $name
    mkdir -p $PKG/usr/lib/alsa-lib/
    patch < ../alsaequal.patch
    make
    make DESTDIR=$PKG install
}

That time the patch download should work; it’s only from the Arch repos that I have trouble directly downloading the plain, unadulterated patch. AUR works fine.

As a final group, I mentioned abcde a long time ago as a console CD ripper. Other people have since mentioned crip, but to be honest, I find myself gravitating toward the former. No real reason; I just happen to like it. This one needs a lot of help though, and I’ll post the port for abcde first so you can see what you’re getting into.

# Description: A frontend command-line utility that grabs tracks off a CD, encodes them to ogg or mp3 format, and tags them
# URL: 		http://code.google.com/p/abcde
# Maintainer:
# Depends on: 	bash cd-discid wget cdparanoia cdrkit lame vorbis-tools vorbisgain flac id3 id3v2

name=abcde
version=2.4.0
release=2
source=(ftp://ftp.archlinux.org/other/$name/$name-$version.tar.bz2
        ftp://ftp.archlinux.org/other/$name/fix-mp3-tagging.patch)
build ()
{
    cd $name-$version
    patch -Np0 -i $SRC/fix-mp3-tagging.patch
    sed -e "s:normalize-audio:normalize:g" -i $name
    sed -e "s:/usr/bin/less:/bin/less:g" -i $name
    install -Dm 0755 $name $PKG/usr/bin/$name
    install -Dm 0755 cddb-tool $PKG/usr/bin/cddb-tool
    install -Dm 0644 cddb-tool.1 $PKG/usr/share/man/man1/cddb-tool.1
    install -Dm 0644 $name.1 $PKG/usr/share/man/man1/$name.1
    install -Dm 0644 $name.conf $PKG/etc/$name.conf
}

Many of those dependencies are available from within the Crux repos; the ones that are “orphans” are here. First, cd-discid.
# Description: cd-discid is a backend utility to get CDDB discid information from a CD-ROM disc.
# URL: http://lly.org/~rcw/cd-discid/
# Maintainer:
# Depends on: glibc

name=cd-discid
version=0.9
release=1
source=(http://lly.org/~rcw/$name/${name}_${version}.orig.tar.gz)
build ()
{
    cd $name-$version
    make
    make DESTDIR=$PKG install
}

As well as id3 and id3v2.
# Description:  Utility to edit id3v1 and id3v2 tags
# URL:          http://home.wanadoo.nl/squell/id3.html
# Maintainer:
# Depends on:   gcc

name=id3
version=0.78
release=1
source=(http://home.wanadoo.nl/squell/files/$name-$version.tar.gz
        id3-0.78-gcc44.patch)
build ()
{
    cd $name-$version
    patch -Np1 -i $SRC/id3-0.78-gcc44.patch
    make
    make prefix=$PKG/usr mandir=$PKG/usr/share/man install
    install -Dm644 COPYING $PKG/usr/share/licenses/$name/LICENSE
}

# Description:  Utility to edit id3v2 tags
# URL:          http://id3v2.sourceforge.net/
# Maintainer:
# Depends on:   gcc glibc id3lib zlib

name=id3v2
version=0.1.11
release=1
source=(http://downloads.sourceforge.net/sourceforge/$name/$name-$version.tar.gz)
build ()
{
    cd $name-$version
    make clean
    make
    install -Dm 0755 $name $PKG/usr/bin/$name
    install -D -m644 id3v2.1 $PKG/usr/share/man/man1/id3v2.1
}

Unless I am mistaken, the remainder should be filled out by the Crux repos, whether it’s contrib or opt. If I omitted something, let me know. And for those who mentioned crip or perhaps prefer it, there is a port here but I don’t vouch for it. Enjoy.

Issues of perspective

In my mind, in my little world, I acknowledge that I live behind the leading edge of technology. I type this post on a machine that is 9 years old, and even when it was born, it was an underachiever. I know that and I respect it, but at the same time I am pleased that it does what it does, at the pace it does it, with a little coaching from me.

I got a look at the other side of the fence today, visiting a friend who owns a machine that so far outstrips this one that it might as well have traveled back through time. An Alienware Area-51 ALX X-58, an Intel Core i7 rated at 3.2Ghz over eight CPUs, and a whopping 12Gb of RAM. It’s a machine that looks and sounds like a V8 engine, and probably demands as much in resources. I was, to put it mildly, flabbergasted.

I didn’t even know machines were sold with those kind of specifications, although I admit to hearing about similar hardware while lurking in #crux. The last time I was in close proximity to a machine with anything near 12Gb of RAM, it was a rack-mounted server responsible for managing industrial-grade printing processes.

I don’t mean to critique the machine because that’s hardly any affair of mine. I wasn’t there to playtest it or check the hardware or even to touch it — and to be honest, I didn’t want to because I feared it might snap off a finger or two. I’m pretty sure it growled at me when I wasn’t looking.

But I take that experience along with the fact that I’ve bundled up the fastest machine I’ve had in my house for the past four or five months — a measly 1.4Ghz Celeron M packed into a failing Dell Inspiron 600m — and shipped it off to an address in America. I was weary of the sketchy motherboard and off-again, on-again keyboard performance, and given the fact that the machine never had any real sentimental value, I am almost as glad to get it off my desk as I was to originally try it out. “Lukewarm” is probably the best word for the entire experience.

But in my book, until this evening, a 1.4Ghz Celeron was fast, in much the same way a 2Ghz AMD64 was fast, or even a 1Ghz Pentium III was fast. I considered it a twin miracle of hardware superiority and my miserly tendencies to come up with a 2.6.31.5 kernel configuration that the Celeron could compile, from start to finish, in under 10 minutes.

That kind of myopia probably isn’t good for me, on the whole. I already said I’d like to get my hands on a faster-than-2Ghz machine, if only to have reliable access to USB2.0 ports and a machine that can compile without undue stress. I am realizing more and more that what I consider to be usable, or what I consider to be fast, is only because my mental yardstick puts a Pentium 4 in the “high end” bracket.

And therein lies the problem: That’s not the case any longer. Three years ago when people were ho-humming 800Mhz machines, or a year and a half ago when Pentium 4s suddenly became “antiques,” I felt I had the moral high ground. But to make the same case for those machines now, after seeing my friend’s computer … well, it suddenly seems a bit weak.

After tonight I worry that maybe I sound like the hermit out in the woods, shouting about how to get the best performance out of a donkey cart, when the rest of the world is cruising around in Cadillacs. Perhaps my perspective is so distant from contemporary that there’s no point in ranting at all.

Oh well. I suppose there’s no harm in it. I’ll still keep an eye open for a proper 2Ghz-plus machine, and maybe one day find one I can plop down on my desk (in the space left over from the 600m), and be amazed and surprised at the incredible speed. And knowing me, I’ll probably blab about here. My only hope is that I can keep a balanced perspective on the issue, if I can look back and remember this note.

A few more games for the console

In my large list of console applications to mention, I have two or three games, plus a pack of classic games that are worth revisiting. I’m guessing these are nothing new to most people, or at least to people who have been around Linux for a while. But so long as I am looking over console goodies, it would be a shame to leave them out.

Starting at the top left is bs or Battleship, which plays much the same way as the classic pen-and-paper game, or for that matter the plastic pin-and-grid set that was reportedly popular in America before computers and stuff came along. It’s a faithful reproduction with a few variations that will probably keep you busy for a little while.

It’s not a terrifically exciting game, the premise is simple and the learning curve is very shallow, but it’s a clean program with a very comfortable interface, on-screen instructions and a few colors to keep your eyes engaged. If I had written it, I would be quite satisfied with my work.

The opposite of that is gnuchess, which is a devilish console game — not only for its rather impressive chess ability, but also for being an exceptionally obtuse application. Moves are done by coordinates, and you have to tell the game to show you the board. What you see in the screenshot there is probably enough to get you going; the commands you see are a few samples.

I’m not much of a chess player anyway, but to have to count over rows on the screen, then count up to figure out where a piece will end up … that’s not just difficult, it’s an obstacle. If I had any love for chess and if I were forced to rely on this program, I would quit the hobby.

But as always, I didn’t put forth the effort to create these things, so it’s not really fair for me to complain about them. I am a mere end-user, and for that reason, I would do better to keep most of my criticism to myself.

The other three you see there are out of the venerable BSD games package, which just about every distro includes (with the odd exception of Crux :| ). You get about 200 console games (I exaggerate) with that, not least of those being Hangman, on the left, and Trek, on the bottom right.

There are too many games in there to synopsize each one; whether you prefer text-based games along the vein of Zork, or if you just want something clean and plain for your children to enjoy (like a Go clone), there are enough options to keep you busy for a while. I’ve seen these games as part of Ubuntu and Arch; and no doubt they’re in your distro too. Unless you’re using Crux, like me.

One other note, also in that package is the “rain” game, which is hardly a game — it’s more an animation that mimics raindrops on a puddle. You can get an idea from it in the lower left corner; I show it there mostly because of its potential as a console screensaver, not so much as a game.

As a final note, I did find another active telnet game which is worth exploring … literally. Discworld is something you can play through a Java-enabled browser, through a MUD client or just from the command line. The home page for the game recommends other options, but for me just telnet discworld.atuin.net worked fine.

Of course, if you’re expecting wild glowing graphics and unique spell effects, you’ll have to rely on your imagination. And to think, 20 years ago, this was more or less the way the best games were written. …

If you come up with any other console games, aside from the ones I have already skimmed over, please feel free to drop a note. I need something to keep myself occupied. ;)

Forcing dpkg through configuration errors

I have been struggling with disk errors for the past few days in Ubuntu, on the 560e that I brought home exactly a week ago. This is unusual for me, unusual for the drive and (generally speaking, in my experience) unusual for Ubuntu … but opinions will vary on that last point, of course.

These were particularly disappointing though, because they damaged some of dpkg’s configuration files. Attempting to install anything spat out an error like this one. …

E: Internal Error, Could not perform immediate configuration (1) on libattr1

Google told me the package could be different between cases, but the source of the error was usually the same — some part of dpkg’s support files had been damaged. In my case it was probably /var/lib/dpkg/status or one of its brethren. Replacing it with status-old was one option, but that didn’t seem to fix anything.

What did work was forcing the obstinate packages to install in spite of dependency issues, and then recovering the faulted packages with apt-get. In other words:

dpkg -i --force-depends libattr1_1%3a2.4.43-3_i386.deb
apt-get -f -y install

A bit brutish, but it got the job done. Eventually I was able to install enough packages and cover enough dependencies to continue installing … whatever it was I was installing. I had forgotten by this point. ;)

I’m hypothesizing here, but I suspect that the errors come about in part because of the hardware arrangement of the 560e. No OS I have put on it yet has been able to shut it down completely. The power button is a sliding switch that presses against a spring, which either activates or kills the machine. My only guess is that for some reason, when the shutdown message appears, the drive still hasn’t properly synced, which is triggering errors. Of course I’m not an expert, so it’s only a guess.

One other small point of editorializing — aptitude has fallen in my favor, in the year or so since I drifted away from it. I used to be rather enamored with the Debian-slash-Ubuntu packaging system and how well it handles the tens of thousands of dependencies and interrelationships so well. But coming back to it after a year or so and having spent most of that time with tools like pacman and yaourt, ports and prt-get, or even tazpkg, aptitude is a sluggish toad. I will curb my sharpest criticism and just say it’s not nearly as wieldy and fast as the others I mentioned, and venerable as it is, it needs a tune-up.

And that’s enough for now. :|

P.S.: Ordinarily you should put sudo in front of those commands. Unless you’re like me, and you assign a root password and su to do system maintenance. Ooh, I’m going to get in trouble for that one. … :mrgreen:

Downshifting in the face of kernel problems

Crux requires you to build your own kernels, and manage your own kernel updates. As I have mentioned in the past, one of the joys of working with older hardware is that I rarely need to keep up with kernel releases: Changes seldom apply to my hardware. And so I usually bounce upward once every month or so, moving from one release series to the next, but ignoring dot-releases.

And generally speaking, updates snap into place without a hitch. Moving from 2.6.31.5 to 2.6.32.2 was an exception, considering I lost nfs access between machines and the LEDs on my ath5k-based Corega CG-WLCB54AG2 wireless card began to blink interminably. I moved from .31.5 to .32.2 with make oldconfig, so I didn’t expect those problems.

But after three reconfigurations and the hour-long toll it takes to compile each one, I simply found no love in 2.6.32.2. It might be something has shifted, or something was misconfigured between the two, but regardless I wasn’t having any luck. So I did what any able-bodied Linux hobbyist in the same circumstances would probably do: I went back to the earlier version.

Like I said, it’s rare that one kernel or another has any real improvement in performance for me (and I say that knowing full well that over time, some hardware actually has worked better for me). But believe it or not, nfs is kind of important in my household. I have two or three machines with sub-par floppies or USB (or no floppies or no USB at all), and moving things around the network is the only way to get files where they are needed. So having one machine — the critical one — incommunicado was an obstruction … to say the least.

But more than that, I’m not so desperate for the newest, coolest kernel in my 9-year-old Celeron that I have to pull out all my hair to find an answer to those issues. Like I said, I’m a hobbyist, so it’s not my responsibility to chase bizarre kernel behavior. I don’t have the talent or the time — which is sometimes a luxury, and sometimes not. This time I am just ambivalent: One kernel or another, I am content either way.

So I’ll probably stick with the 31-series until I get curious and-or bored, and try again. Which might be in a week or two. Or three. Or four. … ;)

Buying a name

I dropped a hint the other day, when I mentioned that “none of my Pentium machines” would boot from a 120Gb hard drive. I wasn’t just speaking metaphorically; I did actually pick up another Pentium machine at the recycling store: This time, a Thinkpad 560e, again for the price of roughly US$10.

I know, I need another Pentium laptop like I need a hole in my head. But I promised myself a long time ago, if I ever saw another workable Thinkpad for cheap, that I would make a point of buying it. Based on my experiences over the past few years with Thinkpads, I could only expect a positive experience by buying the name.

Buying the name is what I did, and a positive experience is what I’ve gotten so far. This is an Intel 430MX-based system with a 166Mhz Pentium MMX in it. Video is a Trident 9660-series VGA card and audio is an old ES1688 ISA sound card. PCMCIA bridge is a Cirrus Logic 6729, which is important, since beyond that, there’s almost nothing to report. No ethernet. No USB. No CDROM.

It does have an AC adapter, which is critical, and a battery, which has a life of around three minutes. It also has a floppy drive which connects via proprietary cable, but I’m a little worried that it might not be working at 100 percent. I put a couple of floppies in it that I thought had something on them, and got nothing.

But best of all, it has a massive, enormous, gargantuan, more-space-than-I-will-ever-need 64Mb stick of PC66 in it. Okay, I admit it, that was why I bought it. Quite obviously I was searching for a 64Mb stick of memory, and got one with a free computer wrapped around it. I am not ashamed.

Beyond that, everything is else is functional, and that’s a bonus. I swapped out the noisy 2Gb drive for a spare 40Gb one, and used the 600m to install a couple of different things, including command-line Ubuntu systems (which is what you see in the picture), Slitaz CLI and X-based systems, and a couple of Crux installations which proved unbootable. (It takes me a little while to get things working just right.)

Unfortunately the drive has to be swapped out each time, and that’s about the only thing I don’t like about this machine: The hard drive is cased under the left palmrest, and you have to take out no less than 14 screws from the underside before you can get to it. Apparently, the Thinkpad reputation for being technician-friendly took hold after this model was designed.

But my 40Gb drive works fine and boots plenty quick. This is not a night-and-day difference from the 100 and 120Mhz machines I’ve used in recent history, but it does feel a little more “perky.” Ubuntu booted fast at 1.4Ghz, and is relatively fast at a tenth of that speed. Start time from the Grub menu to the login prompt is around 40 seconds, which is a considerable improvement over the old days of three-minute boots with Dapper Drake.

Slitaz is likewise speedy, but hasn’t proven to be the golden child on this particular machine as it was with the Fujitsu Pentium. For whatever reason, I couldn’t find some of the framebuffer support in the Slitaz kernel (or its supporting packages), so the magical 800×600 display that I saw with the Fujitsu is not happening here.

And occasionally, because I don’t have as much experience with Slitaz as I do with Ubuntu or Crux, I find it a little obscure or difficult to pin down. For example, I needed the usermod command (I’ve forgotten why), but apparently it’s in an outside package, maybe a coreutils derivative.

Ubuntu is not without its eccentricities, when it comes to this particular model. I assume the tridentfb module is for Trident video cards, but that one just spews forth scrambled screen garbage. uvesafb says it won’t bother itself with pre-VESA 2.0 hardware, and both vesafb and vga16fb can only force a 640×480 area. So once again, I’m trapped in a porthole effect screen.

But that’s not a terrible thing. I use the Fixed font at 13 points (as configured in /etc/defaults/console-setup and triggered by setupcon) and I have enough space to do some work at least. All the same software I like (with the exceptions of the stuff I have added personally to my Crux systems) is available in the Karmic repos, so I’m not lacking for my fave-rave programs.

On the other hand, the Linksys WPC11 wireless card — which is only the most valuable network connection I have, because it’s so flexible and easy to configure — spits out bizarre errors and drops signals if I don’t install wireless-tools (which I can sometimes run without. That’s how great that card is — I don’t even need wireless-tools to connect to an open network. Run out there and buy yourself one or two because they’re great ;) ).

I haven’t tried a graphical system in Ubuntu and I probably won’t. I did it in Slitaz and got it working nicely with both Awesome and dvm, but ran into issues with fonts — namely, it was taking so much processor heft to draw the text on screen that it could do very little else.

And while the audio worked fine in Slitaz (or as fine as could be expected for a 166Mhz machine churning through ogg files encoded at an upper level of quality), Ubuntu is still spitting weird errors at me about ALSA. This may require research.

Ultimately my goal with this machine is to bring it into line with the old X-driven terminal-based system I used on my Fujitsu during late summer last year. Physically this 560e is not in nearly as good a condition as the Fujitsu, and so I plan on taking it to work to use as a note-taking and scheduling machine, but not much else beyond that. It’s very lightweight and sufficiently portable to warrant traveling with, even if it lacks the connections to make it usable alongside the office computers.

But there’s one small thing about this computer that makes it a keeper, even if “keeper” isn’t practical over the long run. There’s something this computer doesn’t have that makes it special. Look closer … closer … closer. … What’s missing?

Aha! No Windows key! Excellent! A machine that is physically free from Microsoft’s stain. Now you’re jealous, aren’t you? :mrgreen:

Custom keyboard commands for the console

Cueing a particular key to trigger an event in the console is easier than it sounds. Or at least, it’s easy after the Arch Linux wiki explains it to you, and you take the four or five minutes required to learn how it’s done. In my case I wanted to be able to trigger a particular program from within screen, along with a window title, but I don’t want to mess with screen’s keybindings. Ordinarily, that looks like this:

screen -t charm charm

From a bash prompt or from within screen itself, after pressing CTRL+a and a colon (:), that will trigger a new “window,” with charm inside it, already given the title. Rather than type that in, I’d like to hit the F4 key, so that particular string is fed to the machine.

The first trick is to create a custom keymap, and those are part of the kbd package. Some distros (like Slitaz base flavor, for example) require you to install that, but ordinarily that’s a core package and part of any Linux system. Keymaps are usually deep in the /usr directory, at

cd /usr/share/kbd/keymaps/i386/qwerty/

Remember that if you’re using a different architecture or a different keyboard, that location will vary just a little. I strongly suggest copying out the keymap you use and editing your copy; tampering with the defaults could have disastrous effects. I use the 106-key Japanese keyboard, so mine is the jp106.map.gz keymap file.

cp jp106.map.gz ~

Now un-gunzip it, so we can easily edit the contents, and rename it so it doesn’t get confused with other stuff.

cd ~
gunzip jp106.map.gz
mv jp106.map mykeys.map

Now take a short break, and change directions. What happens when you press a key at the console? A small message is reported to the system, and it responds as is appropriate. To find out what’s being sent to the system, we need the showkey utility.

showkey

Pressing a key now will spit out a code to the screen, and that’s the number we want for later. In this example, the F4 key results in

keycode 62

Wait 10 seconds, and showkey will end. Now let’s edit that map file.

vim mykeys.map

Add a line to intercept that key, and assign it to a consequence. Here, I use the F70 consequence, for no real reason other than the Arch wiki used it, and it’s not otherwise engaged. (Unless you know what you’re doing, you probably don’t want to pick a “claimed” F-number.)

keycode 62 F70

So now the system knows when I press F4, it should jump to the F70 instruction, and do it. So what is it? Add this on the next line.

string F70 "screen -t charm charm\n"

That’s the command from earlier — followed by a backslash, and an “n”, which is a code for a carriage return. In other words, you’re telling the system, “When I press F4, send all these characters to the console in this order, followed by an Enter key.”

Save the file, and you’re done. … Almost. The next step is to load that keymap, because as it is now, all you’ve done is tinker with a pretty text file. On my system, only root can change the keymap, so after changing to the superuser (or by prefixing this with sudo), type:

loadkeys mykeys.map

Exit superuser, press F4, and see what happens. :D Edit your startup configuration (/etc/rc.conf or even put that same command in /etc/rc.local), and your keyset will change on boot. If it’s all wrong and you hate it, switch back to the old keymap you started with, down in the /usr directory.

Again, check the Arch Linux wiki — by far the best wiki there is for Linux, of any flavor — if you want more details or a better explanation. Be aware that keys are handled slightly differently under X; I don’t use X and so I don’t have many tips for you there.

But you can use this for just about any console command, although dense commands with loops and pipes might get tricky. So far I’ve used this to cue volume controls (with amixer sset PCM 1+ and amixer sset PCM 1-) and a few other little things I get tired of typing. Depending on your machine and your software, you might be able to use this to program special keyboard function keys or dedicated hardware keys. No guarantees, but leave a note if something in particular works for you. ;)

Eagerly awaiting 2010

I don’t have many bookmarks, but I do have a few threads that I keep an eye on, for ideas about new software. This gargantuan thread in the Ubuntu forums was interesting for a while, but it has devolved into a list of Gnome-based software suites, which don’t interest me.

On the other hand, Archers are incorrigible speed freaks, and so the “light and fast awards” threads are great sources of ideas. Best of all, there has been one every year for the past four years — 2006, 2007, 2008 and 2009 — which means you’ll probably need a whole weekend to pick through all the suggestions there.

Add to that a small bonus — a thread that somehow involves Ubuntu, on the Arch forums. It seems a little oddball at first, but the ideas that are tacked on there are quite good.

In the meantime, I am eagerly awaiting the 2010 “light and fast awards,” so I can add still more ideas to my already-huge list of software to try. If you see it, send me a link. :mrgreen:

The mysteries of life

Few things in life truly vex me — where socks go when you put them in the dryer, why my Pentium machines won’t boot with 120Gb hard drives in them, and why everyone just naturally assumes I either use a Mac or a Windows PC. But as of late I’ve been rather confounded by another situation that I can’t explain.

Remember this machine? The otherwise functional VAIO machine, that only needed a small, US$40 part to become a productive member of society again? Don’t feel bad if you don’t remember it; I had pretty much forgotten about it too. But I met the owner of that machine again the other day, and asked how the repair went. (Because in some circles, that is an acceptable topic of conversation: “How is your old computer doing?” :roll: )

And to my surprise, it was still in the same, semi-functional state. It’s been almost two years without a repair — without use even, apparently — stacked in a corner behind a door, gathering dust.

I’m mystified.

I’m not mystified that the repair hadn’t been done; that will happen. People get busy, things like that are a low priority, life gets in the way. But still, why not put a working, powerful, otherwise-in-good-shape Pentium 4 to work doing something rather than stack it in a corner and hold up some dust?

I made a brief offer to buy it from the owner (after all, I am sort of on the lookout for a high(er)-end Pentium machine to do some compiling with), but apparently there is some sentimental value attached, and the owner wouldn’t consider parting with it for much, much more than it’s worth in resale.

Which is too bad. For all the thousands of things that machine could be doing, even in it’s somewhat inconvenient state, it does absolutely nothing, and all in the name of “sentimental value.” It’s true, I do claim sentimental value as a reason for keeping a machine instead of buying a new one, but I can’t imagine what sentimental value it has if it’s propped up behind a door somewhere.

Anyway, it’s not my machine, and not my place to judge. It makes me feel a little better about keeping a 120Mhz Pentium in the closet while I figure out why it won’t boot with a 120Gb hard drive in it, since it’s still getting more use than that VAIO. And it may be that someday, someone asks me which Linux distro I use before they assume I use one of the lesser operating systems. But for now, I can probably only wonder why someone keeps an old computer, but doesn’t use it. :|

« Previous PageNext Page »


Welcome!



Visit the Wiki!

Some recent desktops


May 6, 2011
Musca 0.9.24 on Crux Linux
150Mhz Pentium 96Mb 8Gb CF
 


May 14, 2011
IceWM 1.2.37 and Arch Linux
L2300 core duo 3Gb 320Gb

Some recent games


Apr. 21, 2011
Oolite on Xubuntu 11.04
L2300 core duo 3Gb 320Gb

Enter your email address to subscribe to this blog and receive notifications of new posts.

Join 144 other followers

License

This work is licensed under the GNU Free Documentation License. Please see the About page for details.

Blog Stats

  • 3,164,314 hits

Archives


Follow

Get every new post delivered to your Inbox.

Join 144 other followers