Tag Archives: ssh

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.

2014-11-07-2sjx281-sshrc

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. πŸ˜‰

pssh: Still more parallelized tools

I think so far, every parallelized tool I’ve discovered in the P section has been new to me.

pssh is new to me too, even if it dates back to at least 2009, if not further.

pssh is a collection of ssh-oriented tools written in Python and mimicking a lot of the standard openssh-style fare. There is a strict pssh application, a psshscp tool for scp-ish adventures, a prsync utility and some others, along with a library to assist with creating new tools.

My escapades with the pssh tools was a little less than successful, something I am always willing to blame on myself first.

Part of my difficulty may lie in that the flag options for prsync (and I use that only as an example; some of the other tools also gave difficulty) are very different from vanilla rsync. prsync, as best I can tell, also demands that you declare a host and a user in the command or face error messages.

The odd thing being, if I tried to just sync two folders in my home directory, a la

prsync -r -h kmandla@127.0.0.1 -l kmandla source/ /home/kmandla/dest/

I met with an error exit code of 255 — which I can’t seem to track down in the man pages or on the web site.

Some other issues too; there were slight inconsistencies in the documentation. The man page for psshscp is titled “pscp.” The man page for pslurp says it’s an application to kill parallelized processes, but the extended description talks about copying and source and destinations and so forth. I admit I was confused. (All this in the Arch version, by the way.)

And beyond that — and I’m not afraid to display my ignorance here — I’m not sure if “parallelized” means “optimized for multiprocessor machines,” as was the case with pbzip2 and pigz, or “optimized for high bandwidth connections,” since most of these are aimed at networking tasks. For what I can tell.

It seems it should be the latter … or at least that’s what I’d be looking for. I’m probably splitting hairs here, but I can say that most of my bottlenecks when I use things like rsync or ssh are not at the processor. And that’s all the more I’ll say, at risk of embarrassing myself.

I’ll let you give them a try, and see if they behave any better for you, or if their focus is a little more clear. It’s good to know they’re available, and maybe they’ll brighten someone’s day. πŸ˜‰