Category Archives: Crux Linux

screen’s competition: tmux

I love screen, and I love it even more when it’s patched to split vertically too. But screen isn’t the only game in town, if you like life at the command line. You might remember a long time ago, my rather brief infatuation with dvtm, which dissipated quickly when I realized that screen ran much lighter and faster on ancient hardware.

On the other hand, there is also tmux, which does a lot of things that screen should, but doesn’t really.

Not a particularly stellar screenshot there, but it illustrates the point. Just a quick look at the man page will show you a few things tmux does that screen might not. Preset pane arrangements, a highlight for the active frame, and a few other things all stand out at the start. The command sequence will take a little getting used to, and of course the default keybindings are a little different, but the same ideas are there and I doubt it would take long to adjust.

The real benefit to tmux, if it can be called a “benefit,” is that it is actively developed, with the most recent update in March. It’s certainly no requirement for admission to my system, but I do like to think that the folks who build a program are still interested in their project and pursue its future. Not required, but I get a warm, fuzzy feeling from that.

As far as software “weight,” I don’t see much that differs between tmux and screen when I look at them side-by-side in htop. I’ll do a little more profiling though, and see if there is a winner. One of the nice things about an extremely slow machine like this one, is that I can better see small increments in processor demand, while faster machines would be harder to read. Probably. :roll:

I will probably try to spend more time in tmux over the next few days, and see if it will usurp screen. It’ll give me a twinge of disloyalty, but that always happens when I find a new toy. …

P.S.: And yes, there is still dtach to consider. Sigh, so many programs, so little time. …

Some Crux ports for console clocks

My real-life commitments are more intense in summer, and so I have to apologize for the blank spot over the past couple of days. It’s not that I didn’t have anything to say, but that I didn’t have much time to myself in the first place, and couldn’t spend it typing or tweaking.

For today, I have wanted to tack up a couple more Crux ports, mostly for the console clocks that I have mentioned in recent history. If you’re not a Crux user you probably won’t find these interesting; if you’re an Arch user you might find them useful as starting points for PKGBUILDS, if they don’t already exist in AUR.

(If Pkgfiles look like primitive PKGBUILDs, that would be because in a way, they are. It’s one of the nice things about Crux: As Arch has matured PKGBUILDs have become a teeny bit more complex, whereas Crux ports are still quite simple.)

Without further delay, binclock

# Description: Displays system time in binary format.
# URL:
# Depends on: 

build () 
    cd $name-$version
    install -d m644 $PKG/usr/man/man1/
    install -d m644 $PKG/usr/share/binclock/
    install -d m644 $PKG/etc/
    install -d m644 $PKG/usr/bin
    make PREFIX=/usr 
    make PREFIX=$PKG/usr DESTDIR=$PKG MANPATH=$PKG/usr/man/man1 CONF=$PKG/etc/ INSPATH=$PKG/usr/bin HOME=$PKG/usr/share/binclock install

And vtclock

# Description: 	A text-mode full-screen digital clock
# URL:
# Depends on:	ncurses


build() {
	cd $name
	sed -i s:/usr/local:/usr:g Makefile
	mkdir $PKG/usr/bin/ -p
	make PREFIX=/usr
	make DESTDIR=$PKG install

And finally ticker, which scott kindly mentioned in the wake of my note on vtclock.

# Description:	Generates vertical stock ticker style output on the console.
# URL:
# Depends on:	

build () 
    cd $SRC/$name-$version
    make DESTDIR=$PKG install

Ticker is fun because it does things a little differently than the run-of-the-mill console clock. With this you can stream the date and time — via the date command, or others — down the side of the screen, as opposed to planted in the center as most others do.

And ticker will allow you almost any input, so you can feed it the results of just about any command. It would be nice to be able to customize it a little more — pick a specific block character for readability, or maybe add some color — but as it is it’s unusual and fun to mess with. :)

Configuring an ultralight 2.6.34 kernel

My last post was a bit tongue-in-cheek, but this one is as serious as a heart attack. In the past couple of summers I have offered suggestions on how to strip down a current kernel and run it extremely light, and this summer I see no reason to break with tradition.

This year I’m going to even further back in time though. Instead of configuring it for a mid-grade Celeron, I’m going to show you the bottom-of-the-barrel, no-frills-no-thrills Pentium setup I use daily for everything except image viewing. This kernel boots in under 20 seconds from Grub to the login prompt, discounting the five or six seconds it takes the framebuffer to snap to the proper resolution.

As always, there are some disclaimers.

  • I am not an expert.
  • This is not for beginners.
  • I should mention that I use Crux, but that doesn’t mean these configurations won’t work in other distros. If you are interested in using Crux — which I recommend heartily for any machine, really — I will point you at the Crux Handbook to get you started.
  • I can guarantee with 99.9 percent certainty that if you copy and paste this, your machine won’t even boot.

This year I’m going to catch hell for making one very large change in the way I do things: Completely disabling power management structures altogether. Yes, I know, your eyeballs just popped out of their sockets. Ready your keyboards for e-mailing me to tell me how foolish I am; I am ready in return to tell you that for this machine, it makes almost no difference whatsoever. But let’s talk about that later.

First up, under General Setup, I enable only these things:

  • Support for paging of anonymous memory (swap)
  • System V IPC
  • BSD Process Accounting
  • Kernel->user space relay support (formerly relayfs)
  • Namespaces support
    • UTS namespace
    • IPC namespace

That’s all. I used to optimize for size when I was working with a machine with only 16Mb of memory, but I’ve moved up in the world, and now I have a spacious 80Mb. :roll:

Next is Enable loadable module support, under which I only enable Module unloading.

For Enable the block layer, I disable Support for large (2TB+) block devices and files and use only one IO Scheduler: CFQ.

Under Processor type and features, only these things are enabled:

  • Single-depth WCHAN output
  • Disable Bootmem code
  • Machine Check / overheating reporting
  • MTRR (Memory Type Range Register) support
  • Enable seccomp to safely compute untrusted bytecode

Timer frequency is set to 1000Hz, and High Memory Support is off. I set the Processor family to Pentium Classic.

Now comes the part that’s going to horrify you: Power management and ACPI options. Call me crazy, but for months now I have been running kernels on two different Pentium machines that have everything — and I mean everything disabled under this category. Frequency scaling, idle PM support, everything.

And no, my house has not burned down, and yes, the hardware battery management in the Mebius still works. I have seen no signs of the apocalypse, the sky has not blackened and there is no smell of sulphur (or an electrical fire) in the air. Life goes on.

My rationale? None, I have none. I turned it off once, nothing terrible happened, and now it’s off all the time. C’est la vie.

Next, for Bus options (PCI etc.), PCI Support, ISA support and PCCard (PCMCIA/CardBus) support are enabled. Under PCMCIA cards, I have CardBus yenta-compatible bridge support turned on, and both 16- and 32-bit support enabled. I have several network cards that reach way back to the last part of the 1990s, and I want to be able to use them. ;)

For Executable file formats / Emulations, I just leave it however it is at default. I don’t think I’ve ever tinkered with those settings, and something tells me it wouldn’t matter if I did.

Under Networking support > Networking options, I enable:

  • Packet socket
  • Unix domain sockets
  • TCP/IP networking

But everything under TCP/IP networking is disabled. And yes, I can still reach the Internet and my home network.

Under Networking support > Wireless I enable:

  • cfg80211 – wireless configuration API

    • enable powersave by default
    • cfg80211 wireless extensions compatibility
  • Wireless extensions sysfs files
  • Generic IEEE 802.11 Networking Stack (mac80211)
  • Enable LED triggers

All that gives me working wireless cards for the few that I have, when I use them. Note that I turned off anything related to debugging; debugging is Linus’s job, not mine. :roll:

This is the hairy part: Device drivers. First, Connector – unified userspace <-> kernelspace linker and its children are enabled.

Next, under Plug and Play support, I enable ISA Plug and Play support.

For Block devices, I build Normal floppy disk support as a module. Loopback device support is enabled. I don’t bother with RAM block device support.

I know this is defeating the purpose in running a newer kernel, but I use the deprecated ATA/ATAPI/MFM/RLL support. The few kernels I have built with the newer Serial ATA and Parallel ATA drivers have not behaved well, and I usually end up rebooting into my old kernel rather than the newer one. It’s possible there is some sort of code change in that section that my hardware doesn’t like, but in any case I use what works (and no more than that, if I can help it :twisted: ).

These things are enabled under ATA/ATAPI/MFM/RLL …

  • generic ATA/ATAPI disk support

    • ATA disk support
    • ATAPI floppy support
  • legacy /proc/ide/ support
  • generic/default IDE chipset support
  • CMD640 chipset bugfix/support
  • Probe IDE PCI devices in the PCI bus order
  • CMD64{3|6|8|9} chipset support

Some of those are hardware-specific, but others are just for peace of mind. The one thing I dislike more than anything is to go through the whole rigamarole of transplanting the drive, building the kernel, installing it, moving the drive back, and then finding out that the thing won’t boot. So it’s possible that even more of those could be safely omitted, but I just leave them on because I’m satisified with the way they are now.

Network device support is also fun. I usually have enough various and sundry network cards to warrant keeping this category flexible and open. All the same, only Wireless LAN and PCMCIA network device support are enabled. Under wireless, these are modules where possible:

  • Hermes chipset 802.11b support (Orinoco/Prism2/Symbol)

    • Cache Hermes firmware on driver initialisation
    • Hermes PCMCIA card support

And PCMCIA both of these are modules:

  • NE2000 compatible PCMCIA support
  • Xircom 16-bit PCMCIA support

That might look a little sparse, but remember two things: First, this machine has no USB ports, which means no USB support is needed.Second, the PCMCIA hardware predates CardBus technology, so a lot of “newer” PCMCIA cards don’t work in it. Other machines get support at those levels of course, just be aware of what your machine can do, as well as what you want it to do.

Moving on, here’s Input device support, where only Event interface is enabled, aside from what is fixed in place. That includes Hardware I/O ports and everything underneath it. Remember that a lot of these items are locked “on,” until you disable USB and/or HID support, later on.

Under Character devices:

  • /dev/kmem virtual device support
  • Unix98 PTY support
  • /dev/nvram support

Everything under Serial devices is off.

I2C support is also off, but that might require you to disable some parts lower in the list before it will be released.

Graphics support can also be a real hairball. For my own part, I enable only

  • VGA Arbitration
  • Support for frame buffer devices
    • Enable firmware EDID
    • Enable Video Mode Handling Helpers
    • Enable Tile Blitting Support
  • VGA 16-color graphics support
  • Userspace VESA VGA graphics support
  • VESA VGA graphics support
    • Backlight & LCD device support
    • Lowlevel Backlight controls
      • Generic (aka Sharp Corgi) Backlight Driver
    • Bootup logo
      • Standard 224-color Linux logo

That gives me a snap-to 800×600 framebuffer with a super-cool Tux logo on an ancient C&T graphics card. I would love to figure out how to turn off the backlight properly, but for now it’s just on my to-do list.

Sound card support is another tricky one. For myself, I need ISA support and I build everything as a module, because I need to pass parameters to the module in order to get it to work. So …

  • Advanced Linux Sound Architecture

    • Support old ALSA API
    • Verbose procfs contents
    • ISA sound devices
      • Sound Blaster 1.0/2.0/Pro (8-bit)

Again, less complicated than it sounded. I am not sure about Old ALSA API or Verbose procfs, I suppose it’s possible to turn off those things and still work. I’ll try that sometime soon. Of course, sound on this thing is not so fantastic to start with, so I don’t stress myself with it.

And that’s all for device drivers. Everything else is turned off — USB, HID, real time clock, and so forth. And yes, everything runs fine.

We’re on the home stretch now. Here’s File systems:

  • Second extended fs support
  • Dnotify support
  • Inotify file change notification support
  • Inotify support for userspace
  • Native Language Support
    • Japanese charsets (Shift-JIS, EUC-JP)

I used to disable both dnotify and inotify, but these days udev wants one, and something else wants the other (I forget what it is). Also I sometimes set up the kernel to use NFS (under Network File Systems), but since 2.6.32 or something, NFS hasn’t worked quite right for me. Again, that’s something else I’ll have to test. In the mean time I turn it off, because I think the issue is related to changes since 2.6.31 or so. And I don’t need it that bad.

For Kernel hacking:

  • Show timing information on printks
  • Enable __must_check logic
  • Magic SysRq key
  • Sysctl checks
  • Enable verbose x86 bootup info messages
  • Early printk

That’s all. I turn off anything related to debugging, and anything that involves hardware I don’t have.

Under Security options, everything is off. Yeah, and you thought turning off power management was daring. …

I leave Cryptographic API pretty much as it is by default, except for disabling Hardware crypto devices.

And Virtualization is disabled, while Library routines is left as-is.

And we’re done. Remember to adjust this as you like, for the hardware you want and the purpose of the machine. After the break, the .config file you might want. :)

Continue reading

vtclock: One more console clock can’t hurt

Just a short note today, about another possible clock and/or screensaver for your terminal-only system. This is vtclock, running in screen-vs.

The home page insists the only thing needed to make this work is ncurses, and so I am fairly confident that it will build on your system. The source code dates back to 2005 and might show a warning or two when you compile it, but I had no difficulties on my Pentium. Expect it to finish in under a minute, no matter what you run.

This one doesn’t scale itself to a window size, like clockywock, and doesn’t occupy a small enough space to be “portable,” like tty-clock, and doesn’t seem to do color like binclock … but it’s very visible and has four different “fonts” outside from the one you see there. (Commodore junkie alert: No. 4 appears to be very close to the old C64 font pattern. … :shock: )

The real nifty tricks are the -p and -f flags, which allow you to add arbitrary text, either from a file or a command, to the display a line at a time. So you can tack on something like date, as you see in the photo, or even something else like a wifi status or the tail of dmesg. It’s very convenient.

But that’s all there is to say about it really — it’s simple and clean and does what it says. Add it to your array of screensaver gizmos in this fashion, and bask in the phosphorescent glow. …

Steve Jobs, quit stealing my ideas

I got a link the other day from Sean Whitton to an article about Safari 5’s Reader feature, which supposedly tears away the gunk that encrusts most web sites and presents it as straight, mostly-unadorned black text on white background, superimposed on the browser body.

This is what that article looks like, from within elinks.

And yes, they’re right. Stripping away the cluttered layouts, the pointless gizmos and the sloppy page design means better visibility, easier reading and a cleaner, more pleasant browsing experience. Those Apple demigods are so freaking smart, it must hurt. And whatever made them suspect that less is more? that carving away all the crap leaves only the best parts, and is easier to manage and enjoy? that Flash, Java, rollover CSS effects, popup logins, lightbox effects … all of those things are distractions really?

Hey. …

Hey, waitaminute!

That’s my line! I’ve been saying that for years! I’ve been trying to convince people to drop Firefox and pick up a text-based browser for years now. Because that’s what it does: It removes visual clutter and leaves you with the information you were after in the first place! That’s been my mantra since at least 2007, if not before!

Do you know what this means? Do you realize the implications here?

It means Steve Jobs is reading my blog and stealing my ideas!

Curse you, Steve Jobs! :evil:

binclock and a screensaver script

I have two clocks for the console that I really like — tty-clock and clockywock. A third, binclock, is a curiosity and lacks a few of the “features” that the others have, but it’s worth looking into, for fun.

As you can see, it’s a binary clock with color-coded numbers, ticking off one second at a time, helped along by a conventional, human-readable display on the right. binclock loops with the -l flag, has some primitive color customizations in a binclockrc file, and generally doesn’t tax your system any more than it takes to spit out a few colored numbers.

Personally I’d like to see binclock do a few more things, like center its output on the screen, offer a few more color options or character adjustments while it’s running … things that clockywock or tty-clock do already. But that’s for the programmers to solve, and since I can’t fix it myself, I certainly won’t complain.

And that’s where this could end, except I do enjoy jamming things through figlet now and again. :twisted:

binclock has a “traditional” string of output — a series of binary numbers listed in sequence, rather than in a grid. These mesh nicely with figlet, which means this

binclock -t | figlet -f big -t -c

Shows up in nice big fat letters, centered to your terminal screen. binclock’s built-in looping mechanism doesn’t really work with figlet, since it’s waiting for binclock to “end” before converting the results to large-print edition. In that case, this works fine.

while true ; do clear ; binclock -t | figlet -f big -t -c  ; sleep 1 ; done

Clear the screen, show the time, sleep a second and then go back and do it again, until a real person tells you otherwise. That’s nice too, although there’s no human-readable display, which makes it rather cumbersome as an actual clock.

I’m going to “solve” this the same way I “solved” part of the display for the mocp status screensaver script. This is date, the omnipresent tool for telling time, and sed, which can center things for us.

while true ; do 
	binclock -t | figlet -f big -t -c 
	date +"%T %P" > $HOME/.scripts/header.txt 
	sed  -e :a -e 's/^.\{1,133\}$/ &/;ta' -e 's/\( *\)\1/\1/' $HOME/.scripts/header.txt 
	sleep 10

It’s a little fatter now, but will sit neatly in a script file, waiting to be cued by something like screen’s blanker option.

I notice on my Pentium that there’s a slight lag while sed calculates the line length and pads the time before printing it; for that reason and because I don’t have a need for an every-second update, I changed the sleep length to 10 seconds. Do as you will though. It’s all about freedom. ;)

Arch Crux grub boot image wallpaper

I’ll add this today, just as a quick afterthought. The wallpaper in that final picture from the ill-fated Celeron was a quick touch-up job to the grub boot splash image that comes with Crux Linux.


I like that it’s fairly simple and put the focus in the lower right corner, which was good for those fbterm-screen hybrids: I have no proof, but it seems like most of my “desktops” were empty in the lower right corner. But having an Arch desktop scream “Crux!” is a little silly, so I just painted over it with the Gimp, put the same size text and font in at the same angle, and saved it to a different file format.

Hardly any work involved. But because most Crux 2.6 installations come with two possible grub menu backgrounds, here is the other, also cut to fit 1024×768 and in a different file format.

Not the same, and not much my favorite for being a little different. But it might appeal to you. If you want the words “Arch” in there, you have to do it yourself though. :twisted:

P.S.: Yes, I deliberately gave this post a strange title. :mrgreen:

A quick swing past autofs

If I were to cross off an imaginary list of things that most modern desktops “do,” automounting would be about the only thing left that I haven’t really conquered. Other things like international keyboards, switching languages and even mimicking a decade-old desktop layout are all old hat. But automounting I just don’t bother with.

Part of that is personal; I am not the kind of person who wants to stick a USB drive into a machine and see an icon pop up on the desktop. Just in principle that seems to cross over the line between my sense of control and allowing the computer to decide what is best for itself. Never send a machine to do a human’s work.

Out of rabid curiosity though I took a look at the Arch Wiki page on autofs the other day, and came away satisfied … for the most part.

Setting it up was very easy, with only a couple of configuration files to manage, and no real challenge when using something like Arch. (I left out kernel support for autofs when I built the kernels on my Crux systems, so I didn’t bother with those. :roll: ) In fact, I am afraid I don’t have anything to add to what you see on the Arch wiki, in terms of how to configure it. Start to finish, the information there worked perfectly for me.

For the most part. USB flash drives, SD cards and CDROMs all worked without a hitch, being accessible within seconds of insertion. On the other hand, hard drives in USB enclosures — which make up the majority of what I use for external storage — seemed to be ignored. I am not sure what the difference is that would make a 2Gb flash drive “detectable,” and a 4Gb hard drive in a USB casing “undetectable,” but for my own purposes that was a bit of a deal-breaker.

And I didn’t add my nfs servers to autofs, preferring to keep them as manual mount points. So in that direction, I don’t have any guidance. But if you want a method of automounting that doesn’t require an entire desktop environment to prop it up, it might serve as a solution.

As far as making an icon pop up on your desktop though … you’re on your own for that. :)

P.S.: Score one more point for the Arch Wiki, which is still simply the best place to go when you need information. …

Compiling effortlessly … sort of

It took me a while, but I finally ironed out my upgrade from kernel to 2.6.34 this morning, on my Pentium machine. Ordinarily I don’t wait so long to make a jump, but things were going very well with, and since there is rarely any good reason to shift up, I let it stagnate for a while.

But fear of obsolescence is a powerful thing, and realizing I had a kernel that dated back the better part of a year made me a little queasy. I know in the back of my mind that a 14-year-old machine has little to benefit between a kernel written in September 2009 and one written a few weeks ago, but it seemed worth the effort.

Not that it was a huge effort though. Usually I roll configuration between kernels with make oldconfig, but this time I started from a clean page, and pruned out all the unnecessary parts. It took me a little while to fine-tune the framebuffer and a network parts, and the sound was the last thing I needed to fix. And now it’s done.

The odd part of the entire experience, and the reason why I mention it here, is that while the machine is slowly and faithfully correcting the modules I set, there’s no slowdown or lag or performance hit. That’s strange to me because on other hardware, for example my long-running Inspiron, compiling or building a kernel more or less precluded using the machine outside of very trivial tasks.

But this Pentium barely notices. Memory use peaks around 22-29Mb (alongside all the other software I normally run) and the CPU is pegged at 100 percent of course, but I can still type at normal speed, switch windows in screen or ttys at the console, manage remote systems with ssh, etc., etc., and not notice any stutter or lapse.

I wonder why that is?

Of course, this is all moot point because it still takes 20 minutes to compile a single sound module, and most of a day and night to build an entire kernel. Praising it for not lagging while it meanders through the chore of building new software is like praising a snail for traveling in a straight line for a day. You’re still frighteningly slow, and hardly covered any distance.

But it does mean that troubleshooting is a little easier, even if it takes longer. I can wait 20 minutes for a module to build, see if it works, and then go back to what I was doing without waiting or needing to switch machines.

And all that being said, if there are a large number of packages to update or if there is a particularly large program to build (such as gcc), I yank the drive and connect it over USB to the fast computer. That’s why I bought the fast one, and I’m not such a glutton for punishment that I have to build software for days and days at 120Mhz. There are limits to my fanaticism. :twisted:

The Code Monkey script project

Tom Swartz is heading up a small project called Code Monkey, which collects useful scripts into a package. As it stands there are about 10 small scripts in Code Monkey, ranging from bash one-liners, to python scripts that inject Google Reader subscriptions into conky, to a world sunlight map wallpaper fetcher.

The scripts aren’t necessarily intended for command-line only use, although one or two, like the rsync backup script, could run either in a terminal emulator or completely free of a graphical environment.

Tom is looking for suggestions or ideas, and if you have one you’d like to submit (or if you just want to see what he has collected already), you could contact him through the Launchpad page for Code Monkey, or probably catch his eye with a post to this thread in the Ubuntu Forums.