Tag Archives: change

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:


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. šŸ˜ˆ

peat: Pete and Repeat are sitting on a fence. …

Here’s a simple python tool that jumps into action when a file changes: peat.


peat is built to execute a command of your choosing, and requires only a list of files to watch as input. As you can see above, probably its most basic use is just to send a message to the screen to announce a change.

But it seems capable of executing almost anything as its target, so you could set it to clean up files, compile a code snippet and run it, or … something completely different.

The syntax to get peat running can be a small challenge; by default peat wants a list separated by whitespace. Check the flags if you want to feed it a list separated by newlines or blank spaces.

I should also mention that in Arch, peat wouldn’t run without calling specifically for python2. On the other hand, it seemed to run without any oddball dependencies or bizarre python libraries, so it may be that it will run well on a vanilla system with no added weight.

I feel like I should mention the long list of file event watchers that are available, so it may be that using python as the basis for a file watcher is still too cumbersome.

And given that their list of features is as wide and long as the list itself, the choice becomes a little more academic. peat is worth investigating if you are comfortable with python and if its advanced handling doesn’t intimidate you. But remember there are many others in the running.

commacd: Just so long as you know where you’re going

The home page for commacd insists that it is not a fast directory switcher, and so I’ll refrain from calling it that. It does make switching directories a lot faster though.

But I can see where the difference lies. Things like z or j or j2 or autojump or fasd all tried to apply their own algorithms to switching patterns. commacd, on the other hand, trusts you to know where you are and where you want to go, and then takes you there.

commacd, as you have inferred, ties the cd command to the comma sign. In that sense it works exactly the same.

kmandla@6m47421: ~$ , downloads/

kmandla@6m47421: ~/downloads$

But if I have a nested directory and I know where I want to go, commacd suddenly makes it much easier.

kmandla@6m47421: ~$ , /u/s/j

kmandla@6m47421: /usr/share/jack-audio-connection-kit$

On my system, the only path that has the initials u then s then j is /usr/share/jack-audio-connection-kit, and commacd wisely expands my request to match it, and moves me there.

If there’s any doubt, commacd asks for permission.

kmandla@6m47421: ~$ , /u/s/e
0	/usr/share/emacs/
1	/usr/share/enchant/
2	/usr/share/et/
: 2

kmandla@6m47421: /usr/share/et$

A double comma works in reverse, but in the same way as well.

kmandla@6m47421: /usr/share/et$ ,, s

kmandla@6m47421: /usr/share$

Since “share” is in my path and it starts with an s, commacd moved me there. If there is more than one part of my path that starts with that letter, I get moved to the uppermost folder.

kmandla@6m47421: /lib/kernel$ cd /usr/lib/modules/3.16.4-1-ARCH/kernel/net/llc/

kmandla@6m47421: .../3.16.4-1-ARCH/kernel/net/llc$ ,, l

kmandla@6m47421: /usr/lib$ 

Triple commas are wilder, allowing you to jump anywhere within your tree, not just your path. For example. …

kmandla@6m47421: .../3.16.4-1-ARCH/kernel/net/llc$ ,,, sound

kmandla@6m47421: .../modules/3.16.4-1-ARCH/kernel/sound$ 

And that might be the best feature of commacd: jumping well beyond your $PWD to a folder that’s only tangential to where you are at a particular moment.

No more backtracking to a common branch and then tab-completing down to the folder you want. With a little guidance and the reassurance that you know where you are and where you want to go, commacd will just take you there.

There’s no real downside to commacd, except perhaps that you need to have an idea of where you’re going. If you’re just exploring the bowels of /usr/src or looking for an errant file, it won’t help you much to have that kind of flexibility in changing directories. You might be better with the traditional cd command.

commacd “installs” by sourcing with your .bashrc or .bash_profile, so there’s no compiling and no need for a second program. It keeps no logs, has no daemons and doesn’t care if you like sysvinit or systemd. šŸ˜‰ It’s wonderfully transparent and so light you won’t even know it’s there.

I like this one a lot, and it’s definitely worth trying out … just don’t call it a fast directory switcher. šŸ˜‰

html2ps: You thought it wasn’t possible

I made a big deal the other day about converting csv files to Excel files, and from there possibly even generating HTML files as a result. Here’s one that will reverse directions on you again, converting an HTML page into PostScript. And of course, it’s called html2ps.


Nothing much to show, of course, but the end result is undeniable. And of course it’s only one step from there to …


Acrobat Reader?! šŸ˜Æ Yuck! šŸ˜”

Sorry, I do that just because I know I’ll get an e-mail from a certain reader, reminding me that ‘Reader is evil, and there are dozens of free alternatives. It amuses me.

The point of this little soliloquy is to mention that you can dump HTML pages into PostScript files, and maintain most of the information, if not all the style. html2ps does it fairly effortlessly, and fairly quietly. Meaning your csv files can now be converted to Excel, then to HTML, and from there to PostScript.

And of course, from PostScript it’s just a quick hop to PDF format, or whatever your heart desires. Why do that? Well … because you can! :mrgreen:

As a console application, html2ps doesn’t rank very high, since it has little offer in a way of interaction except through option flags and error messages. I don’t hold any ill-will for that, but I will repeat my preference for applications that use space and color and some sort of interface.

I guess programs are like people. Some don’t care to say too much, while others will take up as much as you’ll give them. šŸ˜‰

csv2xls: Back to the harmless and mundane

After yesterday’s foray into the dark and sinister worlds of password cracking and torrent searching šŸ™„ , today we’ll play the innocent and take a glance at csv2xls.

2014-08-09-6m47421-csv2xls-01 2014-08-09-l3-b7175-csv2xls-02

What could be more upright and resepectable than converting a plain old csv-formatted address list into an Excel spreadsheet? And I mean that with all seriousness. šŸ˜

As you can see above, csv2xls did a precise job of converting my database into a spreadsheet, accessible by LibreOffice and likely Excel too … but I don’t own a copy of that, so I can’t be 100 percent sure. šŸ˜‰

I’m tempted to stop there and say, “Yup, it works. Let’s move on.” But I see a couple of options in the man page that might be worth pursuing.

For one thing, my spreadsheet was only 100 names long. That’s no monster, and I doubt that csv2xls worked very hard to convert it. By default csv2xls will dump one csv file into one xls file, but the -l option will break it off after a certain number of lines. Successive entries are put into numbered files, ad infinitum, ad astra.

I can see the usefulness in that, but I can’t actually see a case where I personally would need it. Unless I churn out a 1000-line csv file and break it apart by hundreds, just to amuse you. O_o

One other curious and related note: If your csv file has a header line, csv2xls will keep that header across line-split files if you use the -H flag. So you needn’t worry that your grade sheet or customer invoice will lose its header row across files.

And I suppose I should mention that the default delimiter for csv2xls is … a semicolon. šŸ˜• Remember to use the -d flag if your comma-separated values are actually (gasp!) separated with commas. šŸ™„

I’ll leave it at that. csv2xls does a good job, I encountered no errors, and it has enough options to make it useful beyond the obvious. If only it didn’t talk so much. … šŸ˜‰

P.S.: If you’re looking to go the opposite direction, check here or here. Hey, now you can convert your csv files to HTML. … šŸ˜Æ šŸ˜Ž

z and z: A tale of two z’s

Remember my little rant from a few weeks ago, the one about single-character application names? If you don’t it’s just as well. I usually regret my rants. That one was no exception.

The point comes through though, since I have two z’s to report — this one and this one.

2014-07-05-6m47421-z-01 2014-07-05-6m47421-z-02

The z on the left is an intuitive compression-decompression tool. By all rights it should sense whether a file should be compressed or decompressed, and come up with the right results. If you remember atool or dtrx or unp, think of it as one of those, with enough smarts to do the opposite, if need be.

I did run into a few problems with z — the z on the left, that is. Compression seemed to sputter in the Arch version, while it looked for something called compress at /usr/bin/. It wasn’t finding it, and so half of what it could do, it couldn’t.

The z on the right is another fast directory switching tool. It’s by the same author as j and j2, and seems to follow the same pattern.

If you place the z.sh script somewhere in your $PATH, and change the $_Z_CMD variable to just “z”, then you should start building a database of recently visited directories. From there you can jump straight to a particular one by prefixing it — or part of it — with just “z”.

In theory, of course, and there is more to it than just that. It works acceptably well, although personally I’m not much of a fan of fast-directory-switcher-gizmos, and so a lot of it is probably lost on me.

So there are the two z’s, and I’d like to just take one last second to remind everyone out there who is working on building The Next Great Killer App, The Program That Will Change Life As We Know It, The Application That Consumed The Entire Universe In One Slobbery Gulp, to please — please — think rationally for just the briefest moment, and give your program a name that’s longer than just one stupid letter. šŸ˜”

wendy: Under wendy’s watchful eye

I know we just saw watchfile.sh the other day, but I can’t account for the whims of alphabetical order.


tsar11 sent a link three or four months ago to a reddit post about wendy, which monitors files (or directories, for that matter) for changes, and then executes a command as a response.

As you see there, it could be something as simple as a message on screen, or it could be as complex as an order to recompile a program.

wendy can discriminate between file modification, file creation and file deletion, which is handy. If I had told it to spawn a warning only when a file was created, that gif probably would have been shorter. šŸ™„

wendy also knows enough to keep quiet when told, or to poll at distinct intervals. All nice touches.

I don’t have any complaints about wendy. It seems to handle more complex cases than watchfile.sh, works better than fsniper did (for me), and seems to work at least as well as entr.

wendy’s home page shows edits within the past few months, so if you find there’s a feature it lacks (for one, I’d like to see the option to discriminate actions based on either modification, deletion or creation), the author is probably listening.

In the mean time, your homework will be to daisy-chain all four of these together and see what kind of ruckus erupts as a result. šŸ˜ˆ