npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

sshp

v0.4.5

Published

simple, intuitive, no bullshit approach to parallel ssh

Downloads

42

Readme

sshp

simple, intuitive, no bullshit approach to parallel ssh

Installation

npm install -g sshp

Why?

there are thousands of programs that do this, but none of them do it well. I wanted something simple, clear, non-assumptive, and cross-platform compatible.

sshp takes a command to run (pass directly to ssh), and a list of hosts with -f file or passed in over stdin. For every line of output from the remote hosts, the hostname will be prepended and printed out to the user. All stderr appears red and is written to stderr on the local machine, and stdout green to stdout. The exit code will be printed as soon as it is avaliable if -e is supplied, green for 0, red for != 0, as well as the ms deltas for all operations so you know how long things took.

Most importantly, you can specify the maximum number of concurrent ssh connections to use with -m or --max-jobs.

Send a SIGUSR1 to the process to get the current progress (like dd(1))

Examples

Parallel ssh into hosts supplied by a file, running uname -v

sshp1

see how simple it is? you can get fancy and check the exit codes of the commands run remotely.

sshp2

You can see the exit status of every command run remotely.

I'm also illustrating the point that sshp takes the input file over stdin, I'm not trying to win a uuoc award.

Run with -d to get full debug information, making it clear what sshp will do.

sshp3

Just like ssh, sshp takes arguments like -l user, -p port and -q. If these arguments are not present, it will be as if you ran ssh without those arguments. This means ssh will run using your .ssh config if it is present, and not assume you ssh out on port 22, or as your username for instance.

Join hosts together by unique output to clearly identify differences or discrepancies in the output generated by each host.

sshp4

Usage

Usage: sshp [-m maxjobs] [-f file] command ...

parallel ssh with streaming output

examples
  ssh into a list of hosts passed via stdin and get the output of `uname -v`

    sshp uname -v < hosts

  ssh into a list of hosts passed on the command line, limit max parallel
  connections to 3, and grab the output of ps piped to grep on the remote end

    sshp -m 3 -f my_hosts.txt "ps -ef | grep process"

options
  -a, --anonymous   hide hostname prefix, defaults to false
  -b, --boring      disable color output
  -d, --debug       turn on debugging information, defaults to false
  -e, --exit-codes  print the exit code of the remote processes, defaults to false
  -f, --file        a file of hosts separated by newlines, defaults to stdin
  -g, --group       group the output together as it comes in by hostname, not line-by-line
  -h, --help        print this message and exit
  -j, --join        join hosts together by unique output (aggregation mode)
  -m, --max-jobs    the maximum number of jobs to run concurrently, defaults to 300
  -n, --dry-run     print debug information without actually running any commands
  -N, --no-strict   disable strict host key checking for ssh, defaults to false
  -s, --silent      silence all stdout and stderr from remote hosts, defaults to false
  -t, --trim        trim hostnames from fqdn to short name (remove domain), defaults to false
  -u, --updates     check for available updates
  -v, --version     print the version number and exit

ssh options (options passed directly to ssh)
  -i, --identity    ssh identity file to use
  -l, --login       the username to login as
  -q, --quiet       run ssh in quiet mode
  -p, --port        the ssh port
  -y, --tty         allocate a pseudo-tty for the ssh session

License

MIT License

Extra

If you're looking for cross-platform compatible see Installation above ;)