recap: Everything about everything from everything, prepacked

I’ve cruised through enough system information tools over the past couple of years to recognize a few good ones and more than a few bad ones.

recap takes some of the better ones, mixes them together, and generates customizable reports.

2014-08-30-6m47421-recap

That’s an example, where recap can pull in things like free, vmstat (think: procps), sar and a few other tools you might recognize off hand. Output goes to /var/log/recap/.

If I understand correctly, the author intended for recap to work at interval, along with something like cron. This makes sense, as a polling and logging tool that you can trace backward in time.

As a roundup of system data, recap makes good sense and has enough small customizable points to tweak that you can probably adjust it to your needs or wants.

I do feel obligated to mention though, that recap itself, for what I can see, is really only marshaling the efforts of outside tools, and consolidating their output. So it’s true, recap doesn’t seem to be doing any of the heavy lifting, but it does put together a nice summary.

And you might have a script already that does that for you. If not, chances are you could whip one up in a short amount of time.

On the other hand, recap seems to have done for you already. ;)

darkstat: Making an exception again

Last time I saw darkstat, I had some misgivings about including it among console-based software. I am having those same thoughts again, now.

2014-08-30-6m47421-darkstat-01 2014-08-30-6m47421-darkstat-02

The problem is, I have entertained a lot of programs in the past that lean more toward the graphical, even if they do a lot of their core work at the command line. Looking back, I probably shouldn’t have fudged with things like lilypond or even mplayer or inkscape, because in retrospect, they just aren’t intended to run at the console alone.

darkstat falls into the same bracket. It’s a fantastic network traffic monitor, has a great array of graphs and charts, but is really intended as a browser-based interface to your network.

True, it can dump your traffic in hex, to the console.

2014-08-30-6m47421-darkstat-03

But that’s a rather humdrum task for a program that’s doing lovely things within X. If there is another mode or another way to see darkstat in action, other than pointing Firefox at 127.0.0.1:667, I haven’t found it.

Please don’t get me wrong: darkstat does a fantastic job and if I had a proper server running (god forbid) and needed to connect remotely and see what’s happening to it — within the last few minutes, few hours, days or even this month — darkstat would be at the top of the list.

But if I ever repeat this little adventure and cruise through console software again, darkstat won’t be included. No more exceptions. :|

asciiplanes: Akin to Battleship, but with a few issues

I have a game to show next, if I can call it that. asciiplanes is arguably a variation on the venerable Battleship game family, with a few small changes.

2014-08-28-6m47421-asciiplanes

As you can probably see, the game works by “firing” into the grid, which reports back either a hit or a miss. Fire out the patterns of all the planes in the grid, and the game ends.

If I don’t sound too enthused about asciiplanes, it’s probably because I feel the game needs a little work.

For one thing, you might guess from the general layout and arrangement that asciiplanes is intended for … well, a strict ASCII environment. The name alone might suggest that, as well as the hyphen-and-pipe line drawing arrangement. And by default, asciiplanes fits neatly into an 80×25 terminal, scrolling just enough to vaguely hint at an “animated” game screen.

The problem is that asciiplanes uses special characters for successful guesses, which look like small ornate asterisks in a terminal emulator, but show up as nondescript blocks in a default virtual console. Rather defeats the purpose.

I have other complaints. The game options allow for a grid so small that asciiplanes can’t calculate where to place the targets. This means asciiplanes will hang if you give it a grid less than six squares on a side, but more than one plane.

In a larger sense, success is only determined by the number of shots and the time it takes to play through. There’s no consequence for a missed shot, as there is in the traditional Battleship rule set. Missing a shot in bs, for example, exposes you to your opponent’s volley.

This means asciiplanes just becomes a race to type through the grid as quickly as possible — a1, a2, a3 … — with the worst score being the square of the size of the grid and your worst typing speed. Short of playing asciiplanes while wearing a pair of gardening gloves, it just doesn’t hold that much challenge.

Oh, and there’s no color. Which always makes me sad. :(

I give asciiplanes mediocre marks for being functional, but without much depth. I can see where it might have its roots in a programming experiment or a classroom assignment, but it will need quite a bit more work — and perhaps a little more thought — to really stand as a “game.”

procinfo and friends: Become one with your hardware

Sorry about the delay, some real-life issues demanded attention, and couldn’t be avoided. As a way of making up for the lost time, here’s a three-in-one hardware information tool: procinfo.

2014-08-29-6m47421-procinfo 2014-08-29-6m47421-lsdev 2014-08-29-6m47421-sockinfo

procinfo appears as procinfo-ng on the home page and in Arch Linux, but just procinfo in Debian. Both packages install three tools: procinfo itself, lsdev and sockinfo.

sockinfo is probably the leanest of the three; you can see its output above, and the Arch version doesn’t even have a man page. sockinfo isn’t a bad program, but there are probably some more helpful socket analysis gizmos out there, so I doubt sockinfo sees much action.

lsdev is a step up, but only by a tiny bit. This will really get you closer to your hardware, right down to the IRQ and DMA. According to the man page, lsdev has no options, so what you see is what you’ll get. Depending on your system, of course. :)

That’s probably where my only complaint about lsdev arises: The output is a bit spattered. That might be a consequence of the hardware or the way the information is reported, but it’s difficult to see what is appearing in what column. Hopefully if I should ever need lsdev, I’ll have enough information at the start to intuitively pick apart lsdev‘s report.

procinfo is the real star of the show, and has enough options and visual style to make up for the shortcomings of either lsdev or sockinfo. Check out its man page, and then take it for a spin with procinfo -H -n2 or procinfo -H -n2 -d if you’re feeling crazy. You’ll get a nice, steady system-wide update that reflects the inner workings of your mysterious electronic doodad.

procinfo has a lot to tell and it’s worth trying for its meager footprint and clean encapsulation of everything from hard drives to memory usage. It doesn’t have color, but hey, you can’t have everything. If you did, where would you put it? ;)

minime: The 9.8K text editor

I have a huge list of text editors that could be added to my own dwindling list of programs, but I keep them separate because this site would just turn into The Text Editor of the Day Blog. And yours truly would suffer a nervous breakdown.

I do have one that I really like though: minime.

2014-08-26-6m47421-minime

This one comes by way of an e-mail suggestion, and if I called it a minimalist editor, that would be an understatement. It’s not every day I see a new text editor, but it’s even more rare to see one in so little space.

The download page measures minime at only 9.7Kb, and it shows up at 9.8Kb in the version I cloned from the git address. Either way, that’s really small.

It might take a second to get used to minime, but I’ll give you a few hints. Use ALT+l to list the files in your directory. Start typing and you’re in insert mode. Highlight text with SHIFT+arrows, and if you have xsel installed, this is where your copy and paste functions appear. Copy in with ALT+W and paste out with CTRL+y.

Edit the minimerc file if those commands are a little awkward for you. They were for me.

As you might guess from the screenshot, most of minime’s functions are console commands interpreted on the run. So xsel is responsible for the copying and pasting. Pressing CTRL+n gives you a new file, courtesy of true. And you can see fmt at work there, for reformatting the text on screen.

I like that. I know that some of its functions are rudimentary, particularly when compared with behemoths like vim or emacs. But I think this has the potential to work as a sort of hybrid editor for the console. Imagine stacking up your favorite commands as CTRL key sequences. …

My only fear is that its reliance on xsel might hamstring it at the virtual console. Let me think about that one for a while. :|

Anyway, nice work for an under-10Kb program. And of course, note that you’ll need python to run minime, and xsel if you want those functions. Happy editing! :)

seq: Count up, count down

A quick note before we get into seq today: If you left a comment in the past 18 hours or so but don’t see it by now, it might have gotten lost in a spam avalanche.

Someone out there in the world must have turned up the dial on the spam machine, because I had more than 120 spam comments between noon today and early yesterday evening. For reference, I usually see 10 or 12 in a day.

Usually WordPress.com — in spite of all my complaints — does a decent job of filtering out the winners from the losers, but sometimes people get lost in the fracas. If for some reason your comment got mixed in with the spam, I’m sorry, but it’s likely gone forever.

And just FYI: If you include a URL in your comment, it’s more likely to be flagged as dubious by the automated system. Sometimes I can pluck a comment out while it’s circling the drain, but this time there were too many to scan through. My apologies.

Anyways. … seq is up to bat today, and this won’t take long. seq doesn’t do much other than count, by increment, between a stop and a start number. Sounds simple enough.

2014-08-26-6m47421-seq

The fun in seq is getting it to pad its output with leading zeros, which pleases people like me who want their numbered files to line up vertically down the screen. :roll: And as you can see, you can set a delimiter for seq, which comes in handy at times.

It does pad things a little oddly at times — for example, that 00.0 in the screenshot above. And if you pad your numbers while counting in reverse (yes, you can do that), you’ll find that seq pads 0 as 00, and so forth. I should also mention that seq‘s last output doesn’t carry a separator. That means if you do something funky like this:

kmandla@6m47421: ~$ seq -w -s' '$(shuf -n1 /usr/share/dict/cracklib-small)$'\n' 1 1 10

You’ll see that every line but the last carries a random word. Just so you’re aware. ;) Things like that are a little unusual but not deal-breakers. Not like join was. :|

That’s about all I need to say about seq. It comes in very handy at times, which is probably why it’s part of coreutils. ;)

mnemonicode: At long last we meet

I’ve been waiting quite a while to see mnemonicode pop up in the rotation. I remember adding it to the list a long while back and thinking, “That is really cool.”

mnemonicode is not a new tool; in fact, the GitHub repo I linked to is just a six-year-old (?) mirror of the original, which is apparently no longer online (but is archived, thank goodness). But I’m really glad I found it, and that Stephen Paul Weber uploaded it there.

What’s so great about it? Well, if you’re like me, and your passwords are just 12-digit strings of random letters and numbers, they can get a little clunky to remember. (But they are fairly time-consuming to force.) Unless the password actually has some intrinsic meaning to it, which mine don’t, it can be a challenge. Of course, that’s the purpose of having such an obtuse password.

But here’s what mnemonicode can do, with its mnencode and mndecode tools:

kmandla@6m47421: ~$ echo TxFX0rxNFkVN | mnencode 
 nova-figure-peru--george-side-ninja
 jargon-contact-ninja--airline

See where this is going yet?

kmandla@6m47421: ~$ echo "nova-figure-peru--george-side-ninja
> jargon-contact-ninja--airline" | mndecode
TxFX0rxNFkVN

No longer do I need to remember a string of 12 characters or letters. If I can recall the normal English words, hyphens and line breaks that mnencode gave me, I can translate it back as a matter of course.

To the best of my knowledge, this is not an additional layer of encryption. I’m not actually making the password any more secure than if I had converted with something like rot13. But it does make it easier to remember.

I’d also be a little more comfortable relaying words or sequences of numbers to someone, perhaps written down or face-to-face, if I knew they were going to pipe it back through mndecode later. Which may be part of its history, actually.

mnemonicode could use a little attention these days; aside from the archived explanation of the original program, the GitHub version doesn’t seem to have any documentation. What little I know is through experimentation.

mnemonicode is in AUR and in Sid; I’m glad to see that since I have a feeling this could be something useful in my encrypted live system. It would at least help me remember some of the more eccentric passwords I use. :|

P.S.: No, those are not my real passwords. You should know better than that.