ClusterSSH for iTerm2

61 points by ilikejam 3 years ago | 10 comments
  • antoniomika 3 years ago
    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...

    • jevinskie 3 years ago
      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...

      • dig1 3 years ago
        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....

      • roughly 3 years ago
        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.
        • gourneau 3 years ago
          This looks cool for interactive things.

          Another option for less interactive things would be clush (Clustershell) https://clustershell.readthedocs.io/en/latest/tools/clush.ht...

          • isaac-ped 3 years ago
            very nice! I was looking for something like this a while ago for defining tiled window setups with commands pre-run over ssh [1].

            Not nearly as polished (or well documented) as your solution - quite nice to have something that does "one thing well". I will keep it in mind next time I'm in that situation.

            [1] https://github.com/isaac-ped/iTerm-Split-Automator

            • lowbloodsugar 3 years ago
              Appearing soon in a post-mortem blog post!
              • ilikejam 3 years ago
                Life is short. Keep it interesting.
              • jmakov 3 years ago
                Would love to see this feature for Byobu terminal.