Archive for March, 2011

Create large files of random information

I wanted to test that mischevious hard drive, to avoid problems when I move stuff on to it.

The plan was to fill it with dummy files and if there was an issue at the 40Gb point, I would know up front. Which would have been better than finding out a week later.

To that end, the weak-sauce tip for the day becomes this one: Creating a series of 2Gb files made of random gibberish, just to take up space.

for i in {1..20} ; do time dd if=/dev/urandom of=test-{$i}.file bs=268435456 count=8 ; done

The results, after a considerable amount of time (/dev/zero is faster), will be twenty files all 2Gb in size, filled with gunk. Good gunk, that is.

A little tip there: The block size multiplied by the count gives you the size of the file. So what?

So simply setting the block size to one gigabyte (or gibibyte, since I seem to be drawing flak on the issue these days :) ) might cause memory errors on a machine with only 512Mb or less. It did for me.

The size of the file in my case wasn’t really important I guess, but I did get that quick primer for performing this stunt on low-memory machines. Reduce the block size, magnify the count, get the same results.

Oh, and the hard drive? It’s fine. I filled it all the way to the brim, and Arch didn’t complain. Good to know.

APM, and the value in Linux

I have to offer a public thank-you to Alex, who pointed out the APM discussion on the kernel mailing list. I’ve been through the majority of the replies and find it very interesting.

It’s certainly not a life-changing debate, but there are a couple of points that stand out for me.

To start, as mentioned early on in the string, there isn’t much activity around APM support, which suggests two possibilities: Either the code has reached pristine condition, or no one is using it.

If the latter is true, then there does seem to be a rationale for dumping it.

But there does seem to be support for a lot of hardware that is far older than the APM bracket, and it’s still in the kernel. Which makes cutting it seem a bit arbitrary.

Losing it wouldn’t make a machine unusable, it would just make it difficult to use with newer kernels. And when that happens, then we have reached the definition of obsolescence.

I have to admit up front that I rarely, if ever, rely on software-driven power management of any kind, when I build my own kernels. So whether it’s there or not is immaterial … to me.

But that doesn’t mean it wouldn’t be useful to someone else, using something similar or even older. And I think Ingo summed it up well by saying, “Our general compatibility with old hardware is an asset that we should value.”

I think that’s the real value in Linux. People watch their perfectly functional, favorite computers slowly become “unusable,” as big-name operating systems gleefully abandon them.

Where’s the first place they go? Linux, because it has the reputation of supporting outdated machines … often better than the original manufacturer intended.

Keep it, I say. Dropping it only means alienating a smaller bracket of potential users, or committing a small pocket of hardware to final unusability.

And who knows? Maybe APM really has reached code Nirvana. It’s not impossible. :mrgreen:

Debian and Arch

I’ve mentioned two or three times now that I have been spending a lot of time in Arch and Debian these days. I hold both distros in equally high regard for being fast, light and good starting points for outdated machines.

Debian gets points for reaching all the way back to the 486 generation, which means I can use it on my very very old systems. At the same time though, I find myself floating back to Arch more often than not.

On a machine that postdates the Pentium, Arch’s flat configuration is just more to my liking. I appreciate Debian 6 for picking up things like Grub2, but I strongly dislike the need to edit /etc/default/grub, then run an updater, if the configuration files are in a different place completely.

I don’t know the rationale for that, so it might be something inherited from the developers of Grub2. All the same, it’s a little inconvenient, particularly if you only want to change one digit.

If I can continue being honest, I also dislike the update-alternatives system for determining things like a default window manager, or a default terminal emulator in X.

Again, I don’t know how or why that’s in Debian, but it seems like a huge obfuscation. I have tried to learn the system over the years and sometimes it will actually work in my favor, but more often … not.

I think my underlying dislike for it is similar to my complaint about Grub2 — why is there another whole layer of configuration, just to trigger which emulator springs into view when I press Super-L-plus-Enter?

That, to me, is something that should be configured in the window manager’s files, edited directly and not relying on links, names, paths and priorities. And so I usually do just that — configure the window manager and ignore the alternatives system.

But I’m probably not being fair, since Debian has more uses and applications that I can even dream of. No doubt that system works well for someone else who needs Debian for more than just resurrecting an old Pentium I.

If I have to be honest though — and I might as well, since I’ve been dangerously honest up to know — those two things and a few others like them are what keep me from using Debian on my newer, faster machines.

For those, it’s just quicker and easier for me to set up Arch, and tinker directly with the software. To each his own, I guess. :|

A little more information

I did a bit of a disservice the other day, when I dropped that bland note about the drive size issue between different versions of Linux.

Invariably if I make a note like that and don’t give a little more information, months from now I’ll be scrounging around trying to remember why that happened and what I did to get around it.

So as a service to myself, and to anyone else who might run into the same problem, here’s a little more information.

First, yes, the Debian 5 installation routine (specifically off the business card installer) can properly report and partition the drive to its correct dimensions.

And yes, both Debian 6 and Arch Linux can’t, at least not in their current renditions. I don’t think this is a bug, I think it’s a combination of lesser issues, and the fact that the drive was probably supposed to be 40Gb. :)

However, both ‘Six and Arch can manage the drive after it has been partitioned, and access areas beyond that imaginary 40Gb limit.

Their internal partitioning routines still try to cut it off at 40Gb, but so long as those stay out of the way, there doesn’t seem to be a problem.

Which means the obvious shortcut is to prepartition the drive using the Debian 5 installer, break away and go back to one of the other miscreants. ;)

The only problem I’ve had with this, after two or three attempts apiece, is a single Grub 18 error in Arch. If you don’t know, that’s when the Grub configuration files are located beyond what the BIOS can access normally.

And that’s an error I’m used to, after working with very old machines for years. It’s easy enough to get around, with a small 64-96Mb partition at the front of the drive, just for /boot.

So that’s as much information as I have now, and unless I stumble over something that’s related or relevant, as much as I’m likely to ever have.

If there’s a fix or a bug report out there that seems to match it, let me know. But I probably won’t be filing a bug anywhere entitled, “Drive size misreported on a magical hard drive that was mispackaged as three times the advertised size but only in some distros and not in others.” :mrgreen:

Oddly enough, ‘Five gets it right

I just realized something odd: I have a drive that is occasionally reported at the wrong size — it’s a 120Gb drive, one that fell out of the sky on me, years ago.

Sometimes operating systems, to include Linux, report it at only 40Gb. Arch does that, and so does Debian 6.

But not Debian 5. El cinco reports it at its full dimensions, and will partition it normally.

I wonder why that is. :|

Changes in the air

Now that the lurch of console programs are out of the way, I have two minor changes to report.

First, I am considering options for reducing the number of computers in the house by one, perhaps two. It’s hard to believe, but it’s true.

Spring is the season for relocating, and as a result a number of expatriates in my area are pulling up stakes and shifting to new locations.

So I am expecting to be the beneficiary of at least one computer, and maybe more. And so I need to think about thinning the herd. And to be honest, it would be nice to have a change or two.

I am a little attached to some of these computers though, so it’s going to be hard to decide. I have three sub-150Mhz Pentiums though, which is probably about two too many.

So some might go. And really, having a 120Mhz, a 133Mhz and a 150Mhz system in the house is only a curiosity to me. To anyone else, it’s a little bizarre.

The other news of note is a random string of misbehavior coming out of the laptop-turned-wall-clock. I had seen it acting strangely even during teardown and buildup, but the problems haven’t magically gone away.

For the record, it freezes during almost any attempt to use aptitude. I am not sure why that alone is the trouble, but it’s the only common thread.

A long time ago I thought it was an issue of faulty memory, but I’ve tried three different sticks now, and it happens all the same. I’m leaning toward a problematic hard drive now.

Not that it means a whole lot anyway. The clock runs, the map updates, the system is fine … it just itches a little bit, to not be able to properly update the system.

Oh, if only all my systems were so lucky. :roll:

And then there was one

I’m going to close out this little three-day foray into the maelstrom of console-based software with one I really like, and have been using quite a bit since I installed it: sc.

Now it’s true that I am a teapot fan — I like teapot for being unconventional and at the same time easy to figure out. sc, however, is like a comfortable old jacket … it just feels nice as soon as you put it on.

It’s about the size of a pin, as easy to run as a pencil and paper and has a history way, way back in days of *nix past. It does exactly what you expect, when you expect it, how you expect it.

And yes, vi fans, it has some similar keystrokes. :roll:

That shallow learning curve, coupled with the onboard help, will probably have you up and calculating in no time. Which is good. If that’s not enough, check out this recent rundown from Linux Journal.

Downsides are that it’s not Excel or Gnumeric or whatever spreadsheet Apple users get, which means about 99 percent of the planet is going to be hesitant.

And it is a little naive when it comes to file formats, although you can export to asc or something like tab-delimited too. I am sure a savvy computer user like you can get your data converted somehow.

And that’s really all I’m going to say about it. I know there is a successor, slsc, but I don’t see it in the Debian repos and so I might need to build it myself. I am not afraid. :twisted:

But for now, sc does almost everything I need in a spreadsheet. Life is good. :)

A mix of six

WordPress.com was suffering from some technical glitches over the past few days, so some of the posts I had planned out over three days got glommed together.

That’s a good thing really; I realize there is more than enough material out there to do a “cli-app-a-day” blog for at least a year or two without having to duplicate posts.

So if you’re in the mood to take on such a project, let the world know. People seem to dig it. In the mean time, here’s another mixed half-dozen that might give you reason to pause.

First, here’s yapet.

Password “wallets,” as I am tempted to call them, are not something I usually pursue. I rely on traditional cellulose-based methods … which is to say, a pencil and a piece of paper.

But this might enthuse you as something that can encrypt and retrieve passwords, as well as generate them and protect them from casual view.

I have to mention though, that at very low speeds — like 120Mhz — the screen refresh for yapet was horrific. I am afraid I can’t use this one because just jumping between text boxes caused the screen to flash three or four times over the course of two or three seconds, with each key press.

I don’t know why that is, if it’s a side effect of the way the program was written or if it’s something oddball about Debian’s version, but I’ve never seen that in other text-based applications. :|

Next is pdmenu, which also falls in the useful cyan gadget category:

This I like very much, because in conjunction with Debian’s menu utility, you have arrow-key access to the bulk of the software that’s installed on your machine.

Not that I need help with that; I don’t have many more than about seven or eight discrete programs that I use on a daily basis. I’m not likely to be surprised by anything pdmenu happens to find.

But for anyone else who might be, say, chained to my desk chair and forced to use a Pentium with only text-based software on it … well pdmenu might be what saves them from a short screaming fit. :D

Next up are two file managers, lfm on the left, and vfu on the right.

 

lfm is strikingly similar to mc and the traditional two-pane file manager genre, being distinct in its relative freshness (last update was May 2010 for the Debian Squeeze version, I believe) and its python underpinnings.

lfm also includes a little something called pyview, which stands as a text or hex file viewer, independent of lfm or cued by it. Two for one, in a manner of speaking.

vfu is strikingly different from lfm or its mc heritage, by being almost completely text, without any sort of graphic adornment save color bands.

In a way I like this one, and you might too. It shows almost all the pertinent information for a file, up front and immediate, and you don’t have to manage panes or trigger info displays.

If you ever wish you could pan through the results of an ls -lha --color=auto command, this might be the application you’re looking for.

And now, sports fans, it’s time for a little action. First is asciijump.

I giggled as I tried it, and while I haven’t figured out all the commands, I can tell you it runs relatively quick on a 120Mhz machine that’s simultaneously accessing and controlling a second computer, and running about eight different applications at the same time.

Which isn’t too shabby. Invariably I crash as I land, but the judges don’t seem to mind, so I’ll stick with this one for a little while.

Last is a aajm, which is half sports, half science.

I didn’t know juggling was such a detailed and mathematical event, but I have now been schooled. I’ll give you a hint — start with aajm -s 453 to get the results you see there, but after that you’ll have to research siteswaps.

That’s good for today. I shall finish this “series” off tomorrow and get back to proper blog materiel. ;)

Seven in a row

I am going to succumb for a few days to the overwhelming list of terminal applications I want to note. Ordinarily I try to space these out by a week or so at a time, but the list is growing faster than I can manage.

So here is day one of what will probably be two or three posts on console applications. Today: Hex editors and text editors.

I can think of exactly one occasion when I actually needed a proper hex editor, and unfortunately it was so long ago that I wasn’t even using Linux at the time.

Just the same, there is always the chance that something like this might come in handy, so here’s tweak, on the left, and beav.

 

Both work well and do the job as you would expect. beav gets a point for being easy to decipher, with on-screen help prompts and more interaction, but I couldn’t find an option to widen the screen display.

tweak is more or less the opposite, with a few options (like stretching the display over the width of the terminal :roll: ), but fewer on-screen tips and commands are a little more cryptic.

Both tweak and beav are more aligned to the emacs style of doing things — I believe both use CTRL+X CTRL+C to quit, as an example. Here’s one for the vi camp: hexer.

Probably simpler and less functional than the other two, but if you know vi you’ll be quicker at the starting line with this one. hexer, I should mention, feels a little less complete; perhaps it’s still a work in progress.

Enough with hex editors though; let’s move on.

Of course, mentioning a text editor for Linux is like pointing out one particular grain of sand on entire beach. There are just too many, with each of them doing something special in its own right.

All the same, I think I should point out the lighter, more unusual ones I find — that, after all, is my gimmick. I’ve mentioned e3 in the past; here it is again along with mg, joe and jed.


e3

mg

jed

joe

e3 is amazing for fitting a fully functional editor into a 10kb sliver, along with the option to use different command sets that are closer to what you’re familiar with. So that whole emacs-vi thing can go away for once.

mg is likewise a teeny little thing, but this one, as I understand it, is much like zile in its attempt to be a (much) lighter emacs.

I suppose, in that sense, both e3 and mg are useful to people who are accustomed to the way one particular editor works, but want something much, much smaller.

I have a hard time separating jed and joe in my mind (no joke intended there), but you might know joe as one of the editor options in the Arch Linux installation sequence.

joe works well for being obvious and easy to manage. Help commands are listed in a drop-down box, which makes them quick to find while you’re learning it. And it feels like an editor, if that makes sense.

jed, on the other hand, might be the most replete and easy to manage of the editors listed here. jed feels like a graphical application, with drop-down menus, windowed documents, and so forth.

But like I said, these are just four grains of sand on a huge beach of text editors for Linux. I’d be mad to ever mention another text editor again, and probably will be, just for mentioning these four.

There we are though, seven more I can cross off my list. Seven steps forward, ten steps back. … :|

Skimming subfolders for files to copy

Basic tip today, this time for sifting through a directory tree and plucking out files that match a certain filter.

I needed to move some of the office photo collection off CD and USB into a different location to sort them manually. A lot of international characters and intermingled, unwanted files were complicating things.

I’m sure there are lots of ways to do this, but this is what I did.

find /media/ -iname "*jpg" -exec cp '{}' /home/kmandla/hold/ \;

Obviously you can change that to move the files, or anything else you like.

The regular cp command — or as I was trying to use it, cp -Rv /media/*jpg /home/kmandla/hold — wasn’t working with me, and my variations on that line were likewise failures.

find did the job right the first time. And was quicker than pointing and clicking, that’s for sure.

Next 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