Tag Archives: ascii

x_x: The Dead Guy CLI

With barely a week left for this site, I’m beginning to trim away programs that I just probably won’t get to, by virtue of time or technical dilemmas. I’m also making a conscious effort to pick out titles that amuse me in one form or another, so I finish with happy memories. ๐Ÿ˜›

x_x, which I mentally refer to as “the Dead Guy CLI,” because the home page uses that as a subtitle, is a rather nifty tool that I’m surprised I haven’t seen covered elsewhere. Using a bland, dull, boring Excel spreadsheet borrowed from a corner of the Interweb, Dead Guy CLI transmogrifies it into this:

2015-04-21-6m47421-x_x

Well isn’t that clever.

Dead Guy CLI gives you a small measure of control over your output, by allowing you to specify a header row or allow for special encoding. It also works with CSV files, so you’re not strapped trying to convert back and forth to Excel, just to fiddle with x_x.

Aside from that though, Dead Guy CLI seems very simple. Of course, your spreadsheet may need some management if you expect it to fit into a certain dimension, but I am confident that as a skilled and capable member of the information age, you won’t throw a wobbly over a pear-shaped spreadsheet.

Keep x_x in mind when you’re thinking about things like csv2xls or xlhtml, since it may save you a step or prevent you from relying on graphical tools just to extract data from a spreadsheet. And of course, if you’re working with csv files, x_x could supplement what tabview or other tools can do.

For my own recordkeeping, Dead Guy CLI gets points for doing something obvious that I don’t recall seeing elsewhere. And also for the snarky name. I’m a fan of snarky names. ๐Ÿ˜ˆ

Advertisements

ascii: Quick and dirty info

This next title is a quick and obvious tool, and I had been holding it back because it seemed a little too simple. This is ascii.

2015-02-14-6m47421-ascii

Which, as you can see, either displays a chart of ASCII conversion data, or takes a string of digits and returns their conversion, as would be useful in a script. Escaped characters and control characters are possible too, as well as octal or hex values.

ascii does a few other things that serve in the same kind of situation; check the help flag or the man page for ascii’s second-string tricks.

But … that’s all I can think to do with it. The value in ascii is its quick-fire accessibility to character codes. And beyond that … ? :\

jp2a: Jack be nimble, Jack be quick

Quick, nimble, short and fast programs are always to my liking. We’ve been through plenty of image-to-text converters for the console, but here’s one that just plain works, on the first try: jp2a.

2014-12-15-6m47421-jp2a-01 2014-12-15-6m47421-jp2a-02

I’m showing two screenshots there because I wanted to point out one small thing about jp2a that I really like: It’s smart enough by default to keep the original aspect ratio, and confine it to the available terminal space.

I know that seems like a small issue, but the original smiley face image that I used was 1024×1024, and some utilities try to convert that as pixel-to-character, on a one-to-one basis. Which complicates things.

jp2a can certainly do that, and if you dig through its flags you’ll see that it can do quite a bit more too. I used only the --colors flag to generate the images above, but you can set output dimensions, redirect to a file, flip an image on conversion, put borders on output and a mess of other options.

If you’re looking for a quick, fire-and-forget conversion tool this might be the one. And given that it has only libjpeg (and curl) as its dependencies, it definitely won’t burden your system with random and impractical features that draw in obtuse libraries.

And once you’ve got your conversion tucked away, you’re only a hop, skip and a jump away from completing your text-only masterpiece. Don’t forget to invite us to the unveiling. ๐Ÿ˜‰

groff: Typesetting, in any direction

It seems to me, groff is another one of those programs — like lilypond from so long ago, or even like mencoder or some other conversion tools — that are sitting on the fence in terms of console programs.

groff doesn’t really display anything, that I can find. It converts between specific markups, changing, for example, text-formatted pages to man format. If all goes right, groff doesn’t show you a darned thing. But the output files are quite lovely.

Here’s an example. First, a raw man page converted to ASCII, then formatted to be readable.

2014-08-06-6m47421-groff-01 2014-08-06-6m47421-groff-02

Whenever possible, I try to avoid the Wall of Text effect. O_o

groff can do some other fun things too. Here’s a man page converted to a PDF document.

2014-08-06-6m47421-groff-03

I know: Acrobat Reader. Ick. ๐Ÿ˜›

You can convert straight to PDF with groff and its included tools, without the need for ghostscript. groff translates between other formats too — including some I had never heard of. Here’s a memorandum macro letter, which was completely new to me until this morning.

2014-08-06-6m47421-groff-04

Nice and clean output, even if it is in Acrobat Reader. Blech.

There is plenty of help online that will get you started with groff. My favorite discussion, as you will be able to tell as soon as you start into it, was here.

Like I said at the start, as a conversion tool, groff doesn’t seem to show much. In fact, in all those examples, groff never said a word unless there were errors.

So the question remains: Is a taciturn and laconic conversion tool still a console application? Should I have omitted this and all those others? Have I been wasting my time all these years? ๐Ÿ˜ฎ :\

aview: Let me draw you a picture

Thinking back, I haven’t seen a whole lot of ASCII art viewers for the console, with the exception of the ones that come bundled with the aa or caca libraries.

aview can do this though, and has enough side options to keep you pressing keys at random, hoping for a suprise mode.

2014-07-16-6m47421-aview

I will tell you up front that aview wants its target file to be converted to PNM format, so you might want to dredge up imagemagick before you start in with aview.

Once it’s running though, you have quite a few nifty tricks at your disposal. aview is prepared to handle image inversions, several different types of dithering, zoom and un-zoom modes, frame-by-frame panning across images, and a lot more.

And I wasn’t joking about hitting keys at random: aview’s home page suggests there are some hidden features. If you find any, let me know. ๐Ÿ˜‰

One nice touch about aview: You can save the resulting image into an HTML file, or your choice of about eight or nine other formats, replete with display, character and other options. How’s it look? Well, you be the judge.

2014-07-16-6m47421-aview

Not gorgeous, but at least Tux isn’t embedded with evil hidden messages this time. ๐Ÿ™„ And that’s just the simplest of the available styles that I saw. Go crazy with that.

As a final note, I’ll mention that aview kicks into a graphical-ish mode if you trigger it from within a terminal emulator, which is why I demanded the curses driver in the gif above. It is smart enough to stick to text-only if you’re calling it from a virtual console though. (The caca suite was smart enough to do that too, if you remember that far back. cacaclock -f /usr/share/figlet/fonts/big.flf -d '%H:%M:%S' anyone? :mrgreen: )

And no, there’s no color, which I’m sure disappoints you as much as it does me. I will survive though, and I take some solace in noting that the last update to aview was more than a dozen years ago, if the home page is correct. I like software that can survive the times. ๐Ÿ˜‰

ps2ascii and ps2pdf: In two directions

I don’t run across pure Postscript files too often any more. All the same, things like ps2ascii and ps2pdf are useful.

Both are part of the ghostscript package, which you might already have installed as a dependency to something else. It seems to get around.

2014-03-15-lv-r1fz6-ps2ascii 2014-03-15-lv-r1fz6-ps2pdf

I don’t know if there’s much I can add that isn’t better shown in the images. On the one hand you can convert to straight text, and the other, make the leap to PDFs … and from there, there’s lots of places to go.

I will say ps2ascii‘s product seems to be a bit cluttered, so it might need a little touching up here and there. I hold no grudge over that though.

And I should also note that ps2pdf has a few variations, and on my Arch system they show up as ps2pdf12, ps2pdf13, ps2pdf14 and ps2pdfwr. If you need a certain degree of compatibility — or lack thereof, if you use ps2pfdwr alone — you have the options.

Conversion tools, conversion tools, so many more conversion tools. … ๐Ÿ˜