Tag Archives: remote

conspy: Take command of your command line

I can think of plenty of ways to use conspy, but I can’t really think of one that shows it in action, except perhaps for this.


It might take a few seconds to see what conspy is doing there: That’s the vc2 login on my Arch system, reproduced exactly in a terminal emulator.

In other words, you get a faithful rendition of what’s in the virtual console, inside another terminal instance. This might remind you of something like screen -x, but it’s quite different.

It’s terribly clever, and I know I’ve used it in the past, even if I don’t think I made a note of it either here or on the old blog. Which is an oversight, and I should apologize.

conspy allows you to send keystrokes to a tty too, which is probably where it might come in most handy. So you could, in theory, send commands to a vc that is either inaccessible or remote. And pairing this with ssh means you probably have an extra layer of control.

There are some obvious question marks that arise. For one, you might wonder at the usefulness of conspy if either your terminal or your console is of dramatically different dimensions.

For what I’ve seen, conspy plays it safe by leaving excess space blank when you have it, and by arbitrarily cutting off the display when you don’t. I haven’t tried resetting or resizing a framebuffer with conspy, and I don’t know if you’d have much luck using conspy with a framebuffer emulator. I leave it to you to pursue those options.

I also notice some discrepancies in what a virtual console shows, and what conspy can display. Even just htop has a few oddball characters in conspy, that otherwise look fine in the tty.

And sometimes there’s a little lag between sending characters through conspy and their appearance on the screen. It could just be the side effect of working with a machine that is out-of-date by more than a decade, but it’s something I see.

None of those issues hamstrings conspy in the least though, since conspy allows you to effectively peer into a vc, or even issue commands through it, from far away. That kind of usefulness — and its apparent freedom from other tools that might let you do something similar, like screen — make it a valuable tool in its own right.

sshrc: Piggyback your rc across ssh

I just got a message about sshrc a few weeks ago, but I didn’t make a note of who sent it. ๐Ÿ˜ฆ So if it was you, I apologize; I do like to give credit to the discoverers whenever possible.

sshrc allows you to inject your own set of aliases, functions, environment variables and so forth into a remote ssh session. This might be preferable to following the conventions of the host machine, particularly if you’re used to a specific command or alias.


And as you can see, it works quite well. sshrc keeps its own configuration file, so you don’t have to make any changes to your local .bashrc or .bash_profile to use it.

According to the home page, sshrc can also piggyback special files or scripts in your ssh journeys, such as vim configurations or other specialized rc files. That might sound somewhat dangerous, as if it could potentially overwrite distant files.

But the home page promises they’ll be kept out of harm’s way and in a unique location that won’t taint any other configuration files. I leave it to you to decide if that’s the case.

sshrc is another of those programs that I wish I had more call to use. As it is, I keep mostly the same configuration across all the machines I have right now, and it’s a very rare case that I have something special on one machine that I don’t have on another.

I can see where sshrc would be useful though. I plan to keep this in the back of my mind, should the need ever arise. ๐Ÿ˜‰