Live data from Hacker News

ClusterSSH for iTerm2

github.com

1–10 of 11 posts

Re: ClusterSSH for iTerm2

#3
post #2

Also there is ansible-console [1] REPL, from which you can run ansible or shell commands, which are executed on multiple hosts. [1] https://docs.ansible.com/ansible/latest/cli/ansible-console....

I wasn't aware of that, pretty cool.

Now if only there was some way to have that ansible repl create roles or tasks based on the commands I run through that repl. Kinda how script[1] works.

[1] https://www-users.cse.umn.edu/~gini/1901-07s/files/script.ht...

Re: ClusterSSH for iTerm2

#4
You can use tmux to achieve the same using `set synchronize-panes on`. I've been using a little script that allows using this trick to open up multiple ssh sessions for years [1]. Can do cool things like:

HOSTS="$(echo runner{0..30}.example.com)" syncssh

To get into a bunch of machines. Also have an adaptation of this that allows you to do the same for any commands (i.e. if you need different ssh flags). Also found the original source from back in 2011 [2].

[1] https://gist.github.com/antoniomika/81b81b908f057cd7aafc0df4...

[2] http://linuxpixies.blogspot.com/2011/06/tmux-copy-mode-and-h...

Re: ClusterSSH for iTerm2

#5
iTerm2 is by far my favorite terminal! It’s API is really cool but a bit buried under needing AppleScript, websockets, and protocol buffers. There are a couple Go clients but I wanted something to call from C so I wrote this library:

https://github.com/jevinskie/jeviterm

The QEMU patch in the root dir spawns a window for all the TTY outputs and monitor for your session. Very handy!

There are brew tap instructions and a demo video here:

https://mobile.twitter.com/jevinskie/status/1482443633777209...

Re: ClusterSSH for iTerm2

#10
I’ve used this technique fixing incidents - pulling this one out of the toolkit is a sign that you have well and truly fucked up somewhere up the line. This is the “emergency car window punch” of tools - when you need it, you really need it, but my god you shouldn’t be using it unless you’re really, really sure you need it.
Post reply on HN