Category Archives: Crux Linux

One small Crux bug

I ran into a bug the yesterday, while I was building the Crux machine with Openbox on it.

Since I have been compiling everything off that machine and then syncing the ports tree over USB, I discovered a little quirk with prt-get and/or pkgadd regarding prebuilt packages. The easiest way to explain it is to show it.

bash-4.1# prt-get depinst alpine
prt-get: installing /usr/ports/local/alpine
=======> Package '/usr/ports/local/alpine/alpine#2.00-1.pkg.tar.gz' is up to date.
prt-get: installing alpine 2.00-1
pkgadd: could not install usr/bin/rpload: Write failed
pkgadd: could not install usr/man/man1/pilot.1.gz: Write failed
pkgadd: could not install usr/man/man1/rpdump.1.gz: Write failed
pkgadd: could not install usr/man/man1/rpload.1.gz: Write failed
pkgadd: could not install usr/man/man1/alpine.1.gz: Write failed
pkgadd: could not install usr/man/man1/pico.1.gz: Write failed
/sbin/ldconfig: Writing of cache data failed: No space left on device

-- Packages installed

Obviously alpine isn’t installed. pkgadd ran out of space on the drive, and in spite of displaying errors, it’s either returning a “success” code or prt-get is displaying the “success” message. If memory serves, this really only happens with precompiled packages.

I posted a bug here, and then Johannes Winkelmann suggested mentioning it in connection with pkgadd, since prt-get really just reports what pkgadd tells it. ;)

X and Openbox in 12Mb

I have not been lax in testing distros with the Mebius, but it is becoming rare to find a system that will start up effectively on 32Mb of memory, let alone install to the disk.

But I do have another miracle of modern science to show: an i586-flavor Crux system running Openbox and Xorg 7.4’s server 1.8.2 on a measly 12Mb of memory, no swap, after a cold boot.

The python memory script I mentioned a year ago confirms that, although it does put usage closer to 14Mb. I never know if I should be mentally subtracting for the space taken up to run it under python.

No matter. That’s not what is important; what’s important is that I thought only Debian could pull off this stunt, but now there are two contenders.

Memory usage is definitely lower in this rendition than in Debian, and start times from Grub to the desktop are under 16 seconds for a 150Mhz machine … with a somewhat quicker hard drive in it, so don’t tout that. Not bad at all, considering some of the speediest Arch machines I have are doing the same.

But it’s also important to note that I build Crux systems with kernels so sparse you can drive a car through them, and without an initramfs, etc., to wait on, things are considerably faster on the startup.

The standard Xorg trident driver was a loss, as was the kernel’s tridentfb module in the kernel. With both the Xorg xvesa and fbdev drivers installed I get an acceptable 16-bit 800×600 graphical desktop.

And it’s not as much of a memory hog as I usually make it out to be. In both screenshots you can see X squished into less than 6Mb of space, which isn’t as good as this was, but it’s still considerable.

Perhaps that is another bonus to using older computers — considerably smaller demands on X. :twisted:

Openbox is running the desktop in those screenshots too, and while that’s no miracle, it is amazing to me that GTK2 applications like Leafpad or gcolor2 or even obconf run without undue hassle. Yes, everything is still ugly slow, just because 150Mhz is ugly slow. But at least it’s not as bad as GTK2 was at 16Mb.

And because someone is going to ask, here it is:

Yeah, it took me almost half an hour to get that screenshot, so enjoy it. And the screen artifacts are there because it takes 20-25 seconds for a redraw for Firefox, with continuous swapping to the disk. I’d have to time-delay scrot by about two minutes to get rid of that.

For practical use though, I think the standard array of console programs inside rxvt-unicode’s daemon would be an improvement. And maybe dmenu and Musca.

Regardless, this is quite remarkable in its current form. I will continue to sift through some of the other “lightweight” distros and see what I can find, but sometimes it’s just a better idea to build it yourself. :mrgreen:

P.S.: Sound is still screwy though. … :(

How to use teapot like a pro

I like to make a big deal out of console applications that really are applications — that actually have a workable “GUI” beyond just a command and a few switches. It’s part of my quest in life: To dispel the irrational repulsion many people brag (yes, brag) about when they discuss using the console with Linux. :roll:

It’s been a while since I really walked neatly through a program though, and I feel I should do that with teapot. teapot is a very useful, very lightweight spreadsheet that I like a lot. I don’t need it very often though, and so each time I pick it up I have to relearn it again.

But on top of that, I have mentioned Oleo in the past, which is a very good console spreadsheet. But it’s not the only one out there, isn’t really to my liking, and there are things about teapot that are worth looking at.

The first trick might be getting it installed, since it isn’t in every distro — Ubuntu, for example, draws a blank if you ask the package search pages about it. AUR has it, with the caveat that it’s for “mathy” people, which I don’t dispute. It’s a spreadsheet, so you can expect to see some numbers. I know some people for whom that would be enough to be called “mathy.” ;)

If you decide to build it from scratch, you can take comfort in the thought that teapot only needs ncurses to get going. So I’m guessing with 99 percent certainty that (a), you can build it without too much hassle, and (b), it’s as light as a feather when in action. And that last part is a fact confirmed by htop.

Getting started is easy enough. Enter teapot at the prompt, and you should get something that looks like this.

Fair enough, it looks like a spreadsheet. We were expecting that much.

Except … hold on: The columns aren’t labeled with letters. We have numbers across and numbers down. That’s a little unusual.

Yes, that alone is probably enough to either intrigue you or dismay you — teapot breaks convention by using numbers in both directions. Now the un-“mathy” people in the crowd are probably already considering panicking, but the “mathy” ones might suddenly be interested.

Because it means that there is an x-y coordinate for each cell — and in fact, most of teapot’s instructions and formulas rely on that to work. And best of all for the “mathy” types, there is an unseen z dimension at work here, so the layers beneath this page are also addressable.

You know, maybe that “mathy” label was right.

No matter. Let’s get started. I’m going to make a spreadsheet for this example that shows how much of my lowly paycheck went into my X60s, in the form of memory and a new hard drive. First, I’m going to put the make and model of my hard drive in the upper left block. Type “SATA3G hard drive”, starting and finishing with quotes.


My god, it’s full of stars. … Well, we’ve already run into our first problem. It seems that the title is too long for the width of the cell. teapot tells us that by showing those stars, and signaling to us that we should probably widen that column a little.

No problem. Press F10.

teapot has a menu system — I wasn’t kidding when I mentioned GUIs in console programs. Select W)idth, and set the column width to 24.

That’s better. You can see in the bottom line there that the coordinates for the cell — 0,0,0 — contain the quote-enclosed text we entered. Now a little navigation: Use the cursor keys to skip through the spreadsheet, and move down a row. Then enter the next item, “PC2-5300 memory”.

If you make a mistake after you enter data, just press return on that cell again to edit it. If you make a mistake and need to back out of the menu, press CTRL+c.

I bought two sticks of memory in different sizes, so it would be nice to just copy that text into the row below. teapot uses block marking, a lot like old-style pre-graphical word processors. You mark a block and then tell teapot what you want done with it.

In this case, press the period (“dot” or .) key twice. This marks the cell as the first corner of the block and the last corner of the block. If you move the selection highlight after that, you can see that the block (or cell, in this case) remains lit.

Now that we have a selection, we can tell teapot to copy it to a new location. Put the selector on the row beneath the memory text, and press F10. Choose B)lock, then C)opy, and confirm it.

That did the trick. One small problem though: We still have the original cell marked. How do we un-mark it? Press period (“dot” or .) again, and it will disappear.

Next, add the text for the last thing on the list, the “SATA enclosure”. At this point, the spreadsheet should look like this.

The problem at this point is that I forgot a header row. It’s not really necessary, but as long as I am going to make this, I might as well make it clear what I am talking about. Let’s insert a row above the whole business.

Navigate back to the top of the page, or just press the less-than key (<). Press F10, then B)lock, I)nsert, R)ow, and then W)hole line.

We used the block menu even though we didn’t have a block defined, and it worked fine this time. And notice that after you’ve inserted the row, you’re still in the menu dialog; press CTRL+c to leave that. I’ll add some headers to this table.

I like a quantity, cost each and total cost for each line. Nothing fancy, just the kind of things you’d expect on an invoice or an order form.

For the quantity column, I can enter 1 for each, since I only bought one each. For the currency I can use the cost in yen for each one, so the table ends up looking something like this.

And I see I made one mistake again: I bought memory of two different sizes but didn’t leave a column for the size. I can insert a column for “Gb” quickly, and add the information where it’s appropriate.

Of course, those headers are skewed off to the left while their information is on the right. Let’s align the headers to the right so they look nice. Mark a block with only the numeric headers highlighted: Press period at the “Gb” column, then skip to the right with the cursor keys until the “Total cost” column is highlighted as well, and then press period again.

If you move away from the marked block, you can see that the entire area is now inverted. Press F10, then A)ttributes, R)epresentation, and R)ight.

So long as you have a block marked, the attributes and representations will be applied to the block. Press CTRL+c to leave the menu dialog, then press period again to unselect the marked block.

Let’s get some totals in here. Obviously, the quantity times the cost will give me the total cost for each line. teapot is flexible enough that there are several different ways to do that, but to avoid being too “mathy,” I’ll take the easiest way.

Go to the first item in the list, to the total cost cell, and we’ll give it a formula to calculate. Enter @(2,1,0)*@(3,1,0) in that box, and the total is shown for that line.

One small problem though, created mostly because human beings are innately lazy: I’d rather not retype that three times over. I can fill the contents of that cell through the cells below it, but then the formula always points back to that first row of numbers.

So instead of specifying the exact x-y-z location for the formula, I’m just going to give it the x location. If teapot doesn’t find a y or z in the location of the cell, it takes the one where it is at the moment. So instead of the multiplication operation above, edit the cell to show @(3)*@(2) — the x locations only of the data I want to multiply.

Then mark the block for that one cell, move down one cell and use F10, B)lock, F)ill. For the number of column-wise repetitions say 1 — the column we’re in. For row-wise, say 3 — the current cell plus the two below it. For depth-wise say 1 — the layer we’re in.

And voila.

Adjusting the quantity or the price will change the values across the sheet, like all good spreadsheets should.

Just for fun, let’s sort a few columns. Select all of the data rows (but not the grand total), and then hit F10, B)lock, S)ort, R)ow. For the “X position of key vector,” and “Z position of key vector,” enter 0. The A)scending and S)ort region.

We sorted the list alphabetically, by the name of the item (X key vector 0) over one level of “sheets” (Z key vector 0). This could be useful if you need to keep day-to-day spreadsheets of the same information, since it means you can sort vertically over a “date” cell.

Changing it back is simply reversing the same process, but using the X key vector for the “Cost each” column — 3. And don’t forget to use “descending.” :)

There’s one more thing that teapot will do that is worth looking at, because it changes how you can use the entire spreadsheet — or the entire idea behind a spreadsheet, really. Try this: Go to the top of the total cost column, press F10 then A)ttributes then L)abel. Now call this “first”.

The status line near the bottom changed, with the label included. Now go to the last in that column, and give that the label “last”.

Now skip down one more line and enter this for the grand total of that column: sum(first,last).

“Okay, great,” you say. “It knows how to sum things, and it can use those labels to do it. So what?”

Well the “so what” part is principle, not action this time. It essentially means you can label, refer to and connect from any cell over the three dimensions of the spreadsheet, and not need coordinates to do it.

You can skew a column of numbers, sum them over a series of cells, insert wide gaping holes in pages, but the labels are what determines how numbers are calculated. teapot takes its labels seriously and allows you to do some cool things with them, and the results are about what you need.

It also means that those text labels we put on the left, or the column headers on the right are completely superfluous now. They’re only there for uninitiated humans to find there way around the page. We could just as easily label cells as “quantity1″, “quantity2″ and so forth. Then call the cost cells “cost1″, “cost2″ and so on, and just sum the opposite corners of a range.

It’s not a mind-blowing or life-altering idea, but it does mean that formulas and number-crunching become easier to think about, and don’t require you to second-guess because a cell shifted to allow for more data. So long as the labels stay the same, the calculations work the same.

The next obvious question is, “Where can I go with my spreadsheet?” To which, I can say that teapot saves in XDR natively for mathematical precision, and exports to at least four or maybe five others. I see that two of those — CSV and HTML — are something Google documents can open, albeit as word processor pages.

Beyond that, I am not up-to-snuff on what is the file format du jour for spreadsheet programs. I am guessing a modern one can probably handle something teapot exports to.

teapot does a lot of other things; the list of formulas available to you, and the way you can access cells or run counts is very impressive. The source package includes a teapot-driven variation on Conway’s game of life too, so it’s not all serious stuff.

Of course there are quite a lot of things teapot doesn’t do, like export in Excel format or draw exploding pie charts in three dimensions and 64,000 colors. For things like that you will probably want to investigate, bigger, bulkier and slower spreadsheets, built by other people.

But if you want something that will run in a slice of memory thinner than a piece of paper, this is a good choice. It’s fast, light, sensible and flexible and comes with a very good documentation file (check the source package for the doc folder). And while there’s a degree of “mathy-ness” that you can’t get away from, it’s certainly nothing to be afraid of. ;)

Still crawling. …

Just a quick note today, and really only to mention that I’ve been absorbed again by Crawl, in its 0.7.1 rendition.

I know it’s not a game for everyone, even if it is a game for everything (meaning, just about anything with a console should be able to run it). Thieves are gone now, along with Death Knights, and there are a lot of other changes afoot as well. (As I understand it, the rationale for both of those subtractions was that there wasn’t any strong delineation between those classes and other, similar professions.)

Save yourself the trouble of installing it by using telnet to play; your games are saved automatically and you don’t have to worry about software updates. This might be as close as I get to the cloud. … :twisted:

Your lightbox effect still sucks

Why? I’m glad you asked.

Silly me. What was I thinking? That I might be able to read the labels on the diagram? :roll:

It isn’t bad enough that I have to put up with that crap just to upload a picture to this site. Add to that the fact that it’s overdone, cliché and a waste of bandwidth.

It was passé four years ago, and it’s definitely not new or innovative. It slows things down, gets in the way, makes it difficult to maneuver and as you can see, defeats its own purpose if the screen dimensions don’t accomodate it.

Oh, and if you trap a login in that lightbox effect, I will officially never use your site, your service or your product, ever ever again, for as long as I live. :evil:

Poor man’s SSD

I hope your fingers are limber and ready for some exercise, because this next post is either going to infuriate you and trigger all kinds of keyboard action, or get you so wired to reply that you’ll fall into spasms from trying to punch at the “Leave a comment” button.

First, a question: What’s this?

If you said, “An 8Gb CF memory card,” you’re right. Now here’s another one for you:

If you said, “A CF-to-2.5-inch-IDE adapter,” you’re right again. Give yourself a cookie.

Now if you can imagine where this is going, then you’re probably already seconds away from those spasms I just mentioned. But a little history first.

Way back in October, when I went on a short vacation and gallivanted all around the world with a Pentium laptop, I suffered a rather noisy and very unfortunate hard drive crash. In the time that I had remaining away from home, I thought about investing in a solid state drive, but there are two big shortcomings for me: size and price.

Price, because I don’t like dumping US$200 into a 14-year-old computer. I would be spending almost 20 times the value of the machine on a fairly-new technology that hasn’t really settled into a stable price bracket to start with. Pecuniary prudence prevented it. ;)

And size, because to be honest, I don’t need anything in the 200Gb range in a console-based laptop that I only use for writing, scheduling, surfing, e-mail, note-taking, chatting, gaming, troubleshooting, experimenting, blogging, organizing, planning, making presentations, calculating, reviewing and more experimenting, and a few other small things. :twisted: In fact, there’s nothing that I do that would require 20Gb, let alone 200.

So paying a lot of money for a giant sized drive that probably wouldn’t even boot in a BIOS this old would be throwing bad money after good. I’d do just as well with a teensy 10Gb drive, provided it was reasonably fast. And cheap. And light. And didn’t eat a lot of power. And wasn’t hot. And wasn’t noisy.

Well hey, SSDs aren’t much different from giant memory cards. And CF cards are two or three generations removed from state-of-the-art, so they’re pretty cheap. Heck, I can get an 8Gb card off for around US$20, and the connector is only US$14. …

“And that is how I got to where I find myself today.”

I’m US$34 poorer now, and just about everyone who heard about my plan pooh-poohed it as a ridiculous idea, that CF cards would degrade over time, that the IO drag would be a nightmare, that bad luck would follow me like the plague … pretty much everything short of biblical catastrophe would ensue.

But even Wikipedia mentions this combination as an alternative to SSDs. And the XO-1 shipped with NAND flash as standard, although what you see there is just your common ordinary garden-variety CF card, intended for cameras and whatnot.

And really, I think the pros far outweigh the cons. Weight is negligible. Noise level is absolute zero. Speed is on par with the 40Gb 5400rpm drive I usually use in the Pentium. Heat is nil. Power draw is next to nil. And mechanical issues, which drove me to this end in the first place, are next to nil.

Moreover, I consider this an experiment: If it falls to pieces after a few hours, so be it. I lost roughly US$30 and learned something about the way these things work. I would much rather that, than lose US$200 to a drive that didn’t like my BIOS and collected dust in the closet. I’m willing to take a chance.

In the mean time, I’m going to sit back, relax, count and recount the US$175 or so I saved on a full size SSD plus shipping, and imagine how I shall waste that money. :twisted:

An interlude: Colossus

A long, long time ago, quite possibly before you were born, there were no computers. Which is to say there were computers, but they were large, lunking things that took up entire rooms, made a lot of noise and demanded specific temperature ranges. It wasn’t something you could go out to your local thrift store and buy. It was something your company or your university or your nation’s military bought and used for serious things, like processing payrolls.

In those days, people didn’t play Mario Kart or World of Warcraft for entertainment. Instead they relied on games made out of paper and cardboard, that came packaged in cardboard boxes, with rules printed — with ink on a press, not a laser printer — in long and boring sheets. You might hear your grandparents talking about those days, and not just in reference to the first edition of Dungeons and Dragons. I mean games like Air War. And Dune. And Steve Jackson’s Illuminati. And of course, Star Fleet Battles.

And Titan, an Avalon Hill game which was amazingly simple and at the same time delightfully complex, with no clear thematic element aside from oversimplified combat between fantastical creatures. Roll a die, plot a move, stack an army, collect points, and repeat. The artwork was clean-cut but evocative, the game play was simple but efficient, and for the most part, it was a good way to spend a few hours with friends.

Fast forward a few decades, and while it’s still possible to get the paper game, you might find that rather quaint or even silly — or not have enough friends to fill a table. :( All of those things are possible and it’s nothing to be ashamed of, but as a possible alternative, you could always check out Colossus.


I’ve been playing this game for quite some time, and I don’t mean in terms of hours, but years: I think I remember using Java for this on Windows machines as far back as 2001 (yes, you’ll need JRE to play). I suppose it’s probably one of the earliest open-source games I ever played, and probably one of my first run-ins with Sourceforge.

So it’s not new, but neither is the original. If you remember this game, you’ll probably be pleased to see that much of the style and feel of the original has been duplicated in this version. Colors, markers and some monsters even keep their appearance, which is important to those of us who remember the game, because the artwork was an important part of it.

If you don’t remember the game it might take a little getting used to, mostly because the movement and recruitment rules are not exactly intuitive just by looking at the screen. And notice that I use a 1024×768 LCD, which means that in its full size, the board gets cut off slightly. There are options to zoom it in the Preferences menu, as well as to dump that awful glossy Java interface.

But the game itself works in much the same way. Split your stacks, start recruiting and pound on your opponent at any and every opportunity. The game is point-driven too, in that increasing your score opens other options later in the game. That’s important.

The fun part of an electronic version in the open like this, is that there are a number of modifications and variants that are available. There never was an “undead” version of Titan (to the best of my knowledge), but you can recruit skeletons, nagas, and even more unusual creatures, depending on the variant.

Even better, there is now a public server client, which means you could conceivably find all your old friends that you used to play Titan with, wherever they are, and challenge them again. See, you don’t even need a table. ;)

I realize this might be a bit of an esoteric game to you, and if you require animated blood splatters, force-feedback controllers, space zombies or 3D glow effects, this is probably about as interesting as a cold bowl of mashed potatoes. If you’d rather exercise the part of your brain that handles strategic thinking instead of just exercising the nerve sequence that controls your index finger, it’s worth learning.

And if you do remember it, it’s worth playing again. :mrgreen: