Giter Site home page Giter Site logo

i2cssh's People

Contributors

dabrady avatar dancannon avatar davidxia avatar dependabot[bot] avatar mrdziuban avatar sepich avatar tatzyr avatar ttapjinda avatar wouterdebie avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

i2cssh's Issues

-C flag error

I'm wanting to layout my sessions on top of each other rather than next to each other. I assume this can be accomplished with the -C or the -R options. However, they aren't working as I'd expect. Am I missing something? Can I accomplish this differently?

Machines list with newlines drops first argument

When I try, for example,

i2cssh -m `printf "foo\nbar\nbaz"`

the first argument foo gets ignored and a window opens with connections to bar and baz. Not sure if this is supported – if not, I guess that makes this a feature request. :)

rb-appscript error when trying to run

I get the following:

/Users/mike/.rvm/gems/ruby-1.9.2-p180/gems/rb-appscript-0.6.1/lib/_aem/aemreference.rb:34:in new': wrong argument type String (expected Module) (TypeError) from /Users/mike/.rvm/gems/ruby-1.9.2-p180/gems/rb-appscript-0.6.1/lib/_aem/aemreference.rb:34:inpack_enum'
from /Users/mike/.rvm/gems/ruby-1.9.2-p180/gems/rb-appscript-0.6.1/lib/_aem/aemreference.rb:212
from /Library/Ruby/Site/1.8/rubygems/custom_require.rb:36:in gem_original_require' from /Library/Ruby/Site/1.8/rubygems/custom_require.rb:36:inrequire'
from /Users/mike/.rvm/gems/ruby-1.9.2-p180/gems/rb-appscript-0.6.1/lib/_aem/codecs.rb:12
from /Library/Ruby/Site/1.8/rubygems/custom_require.rb:36:in gem_original_require' from /Library/Ruby/Site/1.8/rubygems/custom_require.rb:36:inrequire'
from /Users/mike/.rvm/gems/ruby-1.9.2-p180/gems/rb-appscript-0.6.1/lib/aem.rb:17
from /Library/Ruby/Site/1.8/rubygems/custom_require.rb:36:in gem_original_require' from /Library/Ruby/Site/1.8/rubygems/custom_require.rb:36:inrequire'
from /Users/mike/.rvm/gems/ruby-1.9.2-p180/gems/rb-appscript-0.6.1/lib/appscript.rb:19
from /Library/Ruby/Site/1.8/rubygems/custom_require.rb:58:in gem_original_require' from /Library/Ruby/Site/1.8/rubygems/custom_require.rb:58:inrequire'
from /Users/mike/.rvm/gems/ruby-1.9.2-p180/bin/i2cssh:3

When trying to run i2cssh.

i2cssh (0.0.10)
ruby -v - ruby 1.9.2p180 (2011-02-18 revision 30909) [x86_64-darwin10.7.0]
gem -v - 1.8.5
rb-appscript (0.6.1)

how to use -A option

Hi, I have this command working via ssh-agent so that the private-host is accessed via a bastion host.

ssh -A -t bastion  'ssh user@private-host'

How do the equivalent using i2cssh -A option? Also I think i2cssh uses -t for something else.

This is on the latest macOS.

Can't get reference. Invalid index.

I try to use i2cssh (1.12.0), but when I open three sessions on remote hosts, the windows will open, but the login fails with the following error message:

➜  ~  i2cssh hman@cookie3 hman@cookie4 hman@cookie5
/Users/hman/.rvm/gems/ruby-2.1.1/extensions/x86_64-darwin-13/2.1.0/rb-appscript-0.6.1/appscript.rb:542:in `_send_command': CommandError (Appscript::CommandError)
        OSERROR: -1719
        MESSAGE: Can't get reference. Invalid index.
        OFFENDING OBJECT: app("/Users/hman/Downloads/iTerm.app").terminals[6].sessions[2]
        COMMAND: app("/Users/hman/Downloads/iTerm.app").terminals[6].sessions[2].write({:text=>"/bin/bash -l"})
    from /Users/hman/.rvm/gems/ruby-2.1.1/extensions/x86_64-darwin-13/2.1.0/rb-appscript-0.6.1/appscript.rb:642:in `method_missing'
    from /Users/hman/.rvm/gems/ruby-2.1.1/gems/i2cssh-1.12.0/lib/i2cssh.rb:113:in `block in start_ssh'
    from /Users/hman/.rvm/gems/ruby-2.1.1/gems/i2cssh-1.12.0/lib/i2cssh.rb:112:in `upto'
    from /Users/hman/.rvm/gems/ruby-2.1.1/gems/i2cssh-1.12.0/lib/i2cssh.rb:112:in `start_ssh'
    from /Users/hman/.rvm/gems/ruby-2.1.1/gems/i2cssh-1.12.0/lib/i2cssh.rb:30:in `initialize'
    from /Users/hman/.rvm/gems/ruby-2.1.1/gems/i2cssh-1.12.0/bin/i2cssh:192:in `new'
    from /Users/hman/.rvm/gems/ruby-2.1.1/gems/i2cssh-1.12.0/bin/i2cssh:192:in `<top (required)>'
    from /Users/hman/.rvm/gems/ruby-2.1.1/bin/i2cssh:23:in `load'
    from /Users/hman/.rvm/gems/ruby-2.1.1/bin/i2cssh:23:in `<main>'
    from /Users/hman/.rvm/gems/ruby-2.1.1/bin/ruby_executable_hooks:15:in `eval'
    from /Users/hman/.rvm/gems/ruby-2.1.1/bin/ruby_executable_hooks:15:in `<main>'

I am using ruby: ruby 2.1.1p76 (2014-02-24 revision 45161) [x86_64-darwin13.0]

Thank you.
Björn

Yosemite issue. Please help!

Just converted to OSX Yosemite and this is what is get. I've tried uninstalling and reinstalling with gem, brew update, nothing works. Thanks!

i2cssh -l root server1 server2
/usr/local/lib/ruby/gems/2.1.0/extensions/x86_64-darwin-13/2.1.0/rb-appscript-0.6.1/_aem/connect.rb:89:in rescue in launch_application': OS error (-600) (Connect::CantLaunchApplicationError) from /usr/local/lib/ruby/gems/2.1.0/extensions/x86_64-darwin-13/2.1.0/rb-appscript-0.6.1/_aem/connect.rb:85:inlaunch_application'
from /usr/local/lib/ruby/gems/2.1.0/extensions/x86_64-darwin-13/2.1.0/rb-appscript-0.6.1/_aem/connect.rb:182:in rescue in local_app' from /usr/local/lib/ruby/gems/2.1.0/extensions/x86_64-darwin-13/2.1.0/rb-appscript-0.6.1/_aem/connect.rb:177:inlocal_app'
from /usr/local/lib/ruby/gems/2.1.0/extensions/x86_64-darwin-13/2.1.0/rb-appscript-0.6.1/aem.rb:146:in by_path' from /usr/local/lib/ruby/gems/2.1.0/extensions/x86_64-darwin-13/2.1.0/rb-appscript-0.6.1/appscript.rb:57:inconnect'
from /usr/local/lib/ruby/gems/2.1.0/extensions/x86_64-darwin-13/2.1.0/rb-appscript-0.6.1/appscript.rb:159:in reference_by_name' from /usr/local/lib/ruby/gems/2.1.0/extensions/x86_64-darwin-13/2.1.0/rb-appscript-0.6.1/appscript.rb:633:inmethod_missing'
from /usr/local/lib/ruby/gems/2.1.0/gems/i2cssh-1.12.0/lib/i2cssh.rb:18:in initialize' from /usr/local/lib/ruby/gems/2.1.0/gems/i2cssh-1.12.0/bin/i2cssh:192:innew'
from /usr/local/lib/ruby/gems/2.1.0/gems/i2cssh-1.12.0/bin/i2cssh:192:in <top (required)>' from /usr/local/bin/i2cssh:23:inload'
from /usr/local/bin/i2cssh:23:in `

'

Installed RVM, i2cssh won't run anymore.

I see the error below.

/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/universal-darwin15/rbconfig.rb:213: warning: Insecure world writable dir /Applications/vault-cli-3.1.6 in PATH, mode 040777 /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/rubygems/dependency.rb:296:in to_specs': Could not find 'i2cssh' (>= 0) among 49 total gem(s) (Gem::LoadError)
from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/rubygems/dependency.rb:307:in to_spec' from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/rubygems/core_ext/kernel_gem.rb:47:in gem'
from /usr/local/bin/i2cssh:22:in <main>'

rvm list gives me the list below

rvm list

rvm rubies

=* ruby-2.3.0 [ x86_64 ]

# => - current
# =* - current && default
#  * - default

I am not sure what other information I can provide. Pretty new to Ruby and have no idea how to debug this.

Problem with iTerm2 2.9.20160206

I just installed it on Mac with iterm2 2.9.20160206 but got the following exception

i2cssh -m server1, server2
/Library/Ruby/Gems/2.0.0/gems/rb-scpt-1.0.1/lib/rb-scpt.rb:676:in `rescue in method_missing': Unknown property, element or command: 'create_window_with_profile' (RuntimeError)
    from /Library/Ruby/Gems/2.0.0/gems/rb-scpt-1.0.1/lib/rb-scpt.rb:646:in `method_missing'
    from /Library/Ruby/Gems/2.0.0/gems/i2cssh-2.0.0/lib/i2cssh.rb:20:in `initialize'
    from /Library/Ruby/Gems/2.0.0/gems/i2cssh-2.0.0/bin/i2cssh:298:in `new'
    from /Library/Ruby/Gems/2.0.0/gems/i2cssh-2.0.0/bin/i2cssh:298:in `<top (required)>'
    from /usr/local/bin/i2cssh:23:in `load'
    from /usr/local/bin/i2cssh:23:in `<main>'

Remote Execution of Commands?

Is it possible to pass commands that will be executed on remote hosts? I have a few scripts that one of my coworkers wrote that will execute remote commands on a single host and I'd like to pair it with i2cssh so that I can it have it run the same set of commands on all hosts in the cluster.

iTerm2 3.0.0 IndexError

Updated to iTerm 2 version 3.0.0 last night

image

Since then i2cssh is throwing the error below when I run the command

i2cssh -m username@server1,username@server2 -Xi=/path/to/private/key

/Library/Ruby/Gems/2.0.0/gems/rb-scpt-1.0.1/lib/rb-scpt.rb:177:in `block in pack': Unknown Keyword: :terminal (IndexError)
    from /Library/Ruby/Gems/2.0.0/gems/rb-scpt-1.0.1/lib/rb-scpt.rb:177:in `fetch'
    from /Library/Ruby/Gems/2.0.0/gems/rb-scpt-1.0.1/lib/rb-scpt.rb:177:in `pack'
    from /Library/Ruby/Gems/2.0.0/gems/rb-scpt-1.0.1/lib/_aem/send.rb:37:in `block in initialize'
    from /Library/Ruby/Gems/2.0.0/gems/rb-scpt-1.0.1/lib/_aem/send.rb:37:in `each'
    from /Library/Ruby/Gems/2.0.0/gems/rb-scpt-1.0.1/lib/_aem/send.rb:37:in `initialize'
    from /Library/Ruby/Gems/2.0.0/gems/rb-scpt-1.0.1/lib/aem.rb:218:in `new'
    from /Library/Ruby/Gems/2.0.0/gems/rb-scpt-1.0.1/lib/aem.rb:218:in `event'
    from /Library/Ruby/Gems/2.0.0/gems/rb-scpt-1.0.1/lib/rb-scpt.rb:506:in `_send_command'
    from /Library/Ruby/Gems/2.0.0/gems/rb-scpt-1.0.1/lib/rb-scpt.rb:642:in `method_missing'
    from /Library/Ruby/Gems/2.0.0/gems/i2cssh-1.16.0/lib/i2cssh.rb:19:in `initialize'
    from /Library/Ruby/Gems/2.0.0/gems/i2cssh-1.16.0/bin/i2cssh:298:in `new'
    from /Library/Ruby/Gems/2.0.0/gems/i2cssh-1.16.0/bin/i2cssh:298:in `<top (required)>'
    from /usr/local/bin/i2cssh:23:in `load'
    from /usr/local/bin/i2cssh:23:in `<main>

how to change profile

Here is a simple way to change the profile of spawned windows:

65c65
<                 @term.sessions[i].write :text => "unset HISTFILE && #{@ssh_prefix} #{server}"

---
>                 @term.sessions[i].write :text => "unset HISTFILE && echo -e \"\\033]50;SetProfile=Support\\a\" && #{@ssh_prefix} #{server}"

where the profile used is called 'Support'.

I'll try to submit a true patch if I get a chance but I don't know Ruby.

Setting rows or columns causes repeated pane splits

I am using i2cssh 2.2.0 with iTerm2 Build 3.0.15 on a Mac running macOS 10.12.5

I have a .i2csshrc that defines a cluster of 2 machines. I can use i2cssh to connect to this cluster just fine: it creates a new iTerm2 window, splits the window into two panes, with each pane connected to a host in the cluster.

However if I try to set either the number of columns by adding "--columns 60" to the command line, or by adding "columns: 60" to the cluster in my .i2csshrc it goes haywire:

  1. the new iTerm2 window is created
  2. it splits into two panes as before
  3. but the panes then continue to split repeatedly into smaller and smaller panes!

As far as I can tell each pane is still showing the local Mac command prompt: it hasn't got as far as connecting to the remote host.

The same problem occurs when attempting to set the number of rows instead using either "--rows 40", or with "rows: 40" in the .i2csshrc

Changing focus from the newly created window back to the original (in which the i2cssh command was typed) causes that to start repeatedly splitting into smaller and smaller panes instead.

Typing a Ctrl/C into the window with the running i2cssh command causes it to abort and ends the repeated splitting, and giving this output:

^C/usr/local/lib/ruby/gems/2.4.0/gems/rb-scpt-1.0.1/lib/_aem/send.rb:47:in `_send_apple_event': Interrupt
	from /usr/local/lib/ruby/gems/2.4.0/gems/rb-scpt-1.0.1/lib/_aem/send.rb:71:in `send'
	from /usr/local/lib/ruby/gems/2.4.0/gems/rb-scpt-1.0.1/lib/rb-scpt.rb:507:in `_send_command'
	from /usr/local/lib/ruby/gems/2.4.0/gems/rb-scpt-1.0.1/lib/rb-scpt.rb:642:in `method_missing'
	from /usr/local/lib/ruby/gems/2.4.0/gems/i2cssh-2.2.0/lib/i2cssh.rb:103:in `block (2 levels) in split_session'
	from /usr/local/lib/ruby/gems/2.4.0/gems/i2cssh-2.2.0/lib/i2cssh.rb:102:in `upto'
	from /usr/local/lib/ruby/gems/2.4.0/gems/i2cssh-2.2.0/lib/i2cssh.rb:102:in `block in split_session'
	from /usr/local/lib/ruby/gems/2.4.0/gems/i2cssh-2.2.0/lib/i2cssh.rb:101:in `upto'
	from /usr/local/lib/ruby/gems/2.4.0/gems/i2cssh-2.2.0/lib/i2cssh.rb:101:in `split_session'
	from /usr/local/lib/ruby/gems/2.4.0/gems/i2cssh-2.2.0/lib/i2cssh.rb:26:in `initialize'
	from /usr/local/lib/ruby/gems/2.4.0/gems/i2cssh-2.2.0/bin/i2cssh:298:in `new'
	from /usr/local/lib/ruby/gems/2.4.0/gems/i2cssh-2.2.0/bin/i2cssh:298:in `<top (required)>'
	from /usr/local/bin/i2cssh:22:in `load'
	from /usr/local/bin/i2cssh:22:in `<main>'

If you need any further information do please let me know.
Cheers,
Mike B-)

[Req] Ability to open in new tab

Hello,

What would be great is to open i2ssh shells in a new tab.
(I never remember how to switch window ^^)
Really not a high priority request, just a suggestion.

XL.

Fullscreen doesn't work in Mountain Lion

The --fullscreen option doesn't work in Mountain Lion (10.8.4) with i2cssh 1.9.0

$ i2cssh --fullscreen host1 host2
/Library/Ruby/Gems/1.8/gems/rb-appscript-0.6.1/lib/appscript.rb:676:in `method_missing': Unknown property, element or command: 'desktop' (RuntimeError)
    from /Library/Ruby/Gems/1.8/gems/i2cssh-1.9.0/lib/i2cssh.rb:37:in `maximize'
    from /Library/Ruby/Gems/1.8/gems/i2cssh-1.9.0/lib/i2cssh.rb:29:in `initialize'
    from /Library/Ruby/Gems/1.8/gems/i2cssh-1.9.0/bin/i2cssh:192:in `new'
    from /Library/Ruby/Gems/1.8/gems/i2cssh-1.9.0/bin/i2cssh:192
    from /usr/bin/i2cssh:19:in `load'
    from /usr/bin/i2cssh:19

For me, full-screen is quite important since otherwise any mouse movement during cssh init activates different panes from what the script expects and borks the whole thing :)

Host list with hierarchy

I would be nice to have a configuration file with a list of hosts that you connect to often. The list should be hierarchical:

  • myservice:
    • mymachine_1
    • mymachine_2
  • Another_service:
    • Master:
      • another_machine_1
      • another_machine_2
    • Slave:
      • yet_another_machine_1
      • yet_another_machine_2

Then i2cssh should accept the tags myservice, Another_service and even Another_service:Master. The interesting part is that Another_service should include Master and Slave machines in the previous example.

SSH'ng to a cluster, Stack trace

I just installed i2cssh with Ruby 2.4.0 and I'm configuring my cluster in ~/.i2csshrc as follows:

version: 2
clusters:
  c13:
   hosts:
     - dse01-use1-c13
     - dse02-use1-c13
     - dse03-use1-c13
     - dse04-use1-c13
     - dse05-use1-c13
     - dse06-use1-c13
     - dse07-use1-c13
     - dse08-use1-c13

When I try to do i2cssh -c deploy@c13 I get the following stack trace:

dioxin:~ nynhex$ i2cssh -c deploy@c13
/Users/nynhex/.rbenv/versions/2.4.0/lib/ruby/gems/2.4.0/gems/rb-scpt-1.0.1/lib/_aem/codecs.rb:236: warning: constant ::Fixnum is deprecated
/Users/nynhex/.rbenv/versions/2.4.0/lib/ruby/gems/2.4.0/gems/rb-scpt-1.0.1/lib/_aem/codecs.rb:236: warning: constant ::Bignum is deprecated
/Users/nynhex/.rbenv/versions/2.4.0/lib/ruby/gems/2.4.0/gems/rb-scpt-1.0.1/lib/_aem/codecs.rb:236: warning: constant ::Fixnum is deprecated
/Users/nynhex/.rbenv/versions/2.4.0/lib/ruby/gems/2.4.0/gems/rb-scpt-1.0.1/lib/_aem/codecs.rb:236: warning: constant ::Bignum is deprecated
/Users/nynhex/.rbenv/versions/2.4.0/lib/ruby/gems/2.4.0/gems/rb-scpt-1.0.1/lib/rb-scpt.rb:177:in `block in pack': Unknown Keyword: :terminal (IndexError)
	from /Users/nynhex/.rbenv/versions/2.4.0/lib/ruby/gems/2.4.0/gems/rb-scpt-1.0.1/lib/rb-scpt.rb:177:in `fetch'
	from /Users/nynhex/.rbenv/versions/2.4.0/lib/ruby/gems/2.4.0/gems/rb-scpt-1.0.1/lib/rb-scpt.rb:177:in `pack'
	from /Users/nynhex/.rbenv/versions/2.4.0/lib/ruby/gems/2.4.0/gems/rb-scpt-1.0.1/lib/_aem/send.rb:37:in `block in initialize'
	from /Users/nynhex/.rbenv/versions/2.4.0/lib/ruby/gems/2.4.0/gems/rb-scpt-1.0.1/lib/_aem/send.rb:37:in `each'
	from /Users/nynhex/.rbenv/versions/2.4.0/lib/ruby/gems/2.4.0/gems/rb-scpt-1.0.1/lib/_aem/send.rb:37:in `initialize'
	from /Users/nynhex/.rbenv/versions/2.4.0/lib/ruby/gems/2.4.0/gems/rb-scpt-1.0.1/lib/aem.rb:218:in `new'
	from /Users/nynhex/.rbenv/versions/2.4.0/lib/ruby/gems/2.4.0/gems/rb-scpt-1.0.1/lib/aem.rb:218:in `event'
	from /Users/nynhex/.rbenv/versions/2.4.0/lib/ruby/gems/2.4.0/gems/rb-scpt-1.0.1/lib/rb-scpt.rb:506:in `_send_command'
	from /Users/nynhex/.rbenv/versions/2.4.0/lib/ruby/gems/2.4.0/gems/rb-scpt-1.0.1/lib/rb-scpt.rb:642:in `method_missing'
	from /Users/nynhex/.rbenv/versions/2.4.0/lib/ruby/gems/2.4.0/gems/i2cssh-1.16.0/lib/i2cssh.rb:19:in `initialize'
	from /Users/nynhex/.rbenv/versions/2.4.0/lib/ruby/gems/2.4.0/gems/i2cssh-1.16.0/bin/i2cssh:298:in `new'
	from /Users/nynhex/.rbenv/versions/2.4.0/lib/ruby/gems/2.4.0/gems/i2cssh-1.16.0/bin/i2cssh:298:in `<top (required)>'
	from /Users/nynhex/.rbenv/versions/2.4.0/bin/i2cssh:22:in `load'
	from /Users/nynhex/.rbenv/versions/2.4.0/bin/i2cssh:22:in `<main>'

I'm sorry if this is not configured correctly or I'm doing something wrong, but would really like to be able to login to a cluster at once and am unsure as to what's going wrong.

Do not show "UNUSED" window

Hi,
Is it possible to not show the unused window when the cluster has an 'odd' number? I don't care if it creates a non symmetrical set.

Thanks.

Cluster File not being parsed correctly?

I am having an issue with i2cssh interpretting the cluster file (.i2csshrc). Here is my .i2csshrc file:


---
clusters:
  servers-a:
    - server01
    - server02
  servers-b:
    - server03
    - server04

Here's the error I get:

/usr/local/Cellar/ruby/1.9.2-p290/lib/ruby/1.9.1/syck.rb:135:in `load': syntax error on line 3, col 3: `    - server01' (ArgumentError)
    from /usr/local/Cellar/ruby/1.9.2-p290/lib/ruby/1.9.1/syck.rb:135:in `load'
    from /usr/local/Cellar/ruby/1.9.2-p290/lib/ruby/gems/1.9.1/gems/i2cssh-1.2.3/bin/i2cssh:49:in `block (2 levels) in <top (required)>'
    from /usr/local/Cellar/ruby/1.9.2-p290/lib/ruby/1.9.1/optparse.rb:1308:in `call'
    from /usr/local/Cellar/ruby/1.9.2-p290/lib/ruby/1.9.1/optparse.rb:1308:in `block in parse_in_order'
    from /usr/local/Cellar/ruby/1.9.2-p290/lib/ruby/1.9.1/optparse.rb:1264:in `catch'
    from /usr/local/Cellar/ruby/1.9.2-p290/lib/ruby/1.9.1/optparse.rb:1264:in `parse_in_order'
    from /usr/local/Cellar/ruby/1.9.2-p290/lib/ruby/1.9.1/optparse.rb:1258:in `order!'
    from /usr/local/Cellar/ruby/1.9.2-p290/lib/ruby/1.9.1/optparse.rb:1349:in `permute!'
    from /usr/local/Cellar/ruby/1.9.2-p290/lib/ruby/1.9.1/optparse.rb:1370:in `parse!'
    from /usr/local/Cellar/ruby/1.9.2-p290/lib/ruby/gems/1.9.1/gems/i2cssh-1.2.3/bin/i2cssh:64:in `<top (required)>'
    from /usr/local/Cellar/ruby/1.9.2-p290/bin/i2cssh:19:in `load'
    from /usr/local/Cellar/ruby/1.9.2-p290/bin/i2cssh:19:in `<main>'

Was wondering if there is a fix, or if I'm just got the syntax wrong for the cluster file.

Broken Pane Split - i2ccsh 2.2.0 and Iterm2 3.0.15

Hi, with newer version of i2cssh, if i launch a cluster of 6 machines, the pane split is broken, if for example i set to use 3 columns, i creates them, uses the 3 columns, but the rest of the other 3 servers are spaunes in row mode on column # 1.

If i use 3 rows, the same, it creates 3 rows, but the other 3 servers are spawned on row # 1.

using different server amounts, is always broken.
could this be fixed ?

i2cssh + iterm2 not working on macos Sierra

Using -2, --iterm2 or -i iTerm2 gives the same error:

Alejandros-MBP:~ alejandrito$ i2cssh -2 -m user1@host1,user2@host2 -m user3@host3 user4@host4 user5@host5
**/Library/Ruby/Gems/2.0.0/gems/rb-scpt-1.0.1/lib/_aem/findapp.rb:30:in rescue in _find_app': Application "[\"iTerm.app\"]" not found. (FindApp::ApplicationNotFoundError)** from /Library/Ruby/Gems/2.0.0/gems/rb-scpt-1.0.1/lib/_aem/findapp.rb:25:in _find_app'
from /Library/Ruby/Gems/2.0.0/gems/rb-scpt-1.0.1/lib/_aem/findapp.rb:55:inrescue in by_name' from /Library/Ruby/Gems/2.0.0/gems/rb-scpt-1.0.1/lib/_aem/findapp.rb:49:in by_name'
from /Library/Ruby/Gems/2.0.0/gems/rb-scpt-1.0.1/lib/rb-scpt.rb:855:inby_name' from /Library/Ruby/Gems/2.0.0/gems/rb-scpt-1.0.1/lib/rb-scpt.rb:932:in by_name'
from /Library/Ruby/Gems/2.0.0/gems/i2cssh-2.2.0/lib/i2cssh.rb:13:ininitialize' from /Library/Ruby/Gems/2.0.0/gems/i2cssh-2.2.0/bin/i2cssh:298:in new'
from /Library/Ruby/Gems/2.0.0/gems/i2cssh-2.2.0/bin/i2cssh:298:in<top (required)>' from /usr/local/bin/i2cssh:23:in load'
from /usr/local/bin/i2cssh:23:in`

'

Problems with -d (--direction)

i2cssh v.2.2.0
iterm2 v.3.0.10

I would like my sessions to stack vertically instead of next to each other. I assume this can be accomplished with the -d (--direction) option or the -R (--rows) option. I'm getting the following error in both cases.

i2cssh --direction=row rprqa-app1 rprqa-app2
/Library/Ruby/Gems/2.0.0/gems/rb-scpt-1.0.1/lib/rb-scpt.rb:542:in `_send_command': CommandError (Appscript::CommandError)
        OSERROR: -1719
        MESSAGE: Access for assistive devices is disabled.
        OFFENDING OBJECT: app("/System/Library/CoreServices/System Events.app").processes["iTerm2"].menu_bars[1]
        COMMAND: app("/System/Library/CoreServices/System Events.app").processes["iTerm2"].menu_bars[1].menu_bar_items["Window"].menus["Window"].menu_items["Select Split Pane"].menus["Select Split Pane"].menu_items["Select Pane Above"].click()
    from /Library/Ruby/Gems/2.0.0/gems/rb-scpt-1.0.1/lib/rb-scpt.rb:642:in `method_missing'
    from /Library/Ruby/Gems/2.0.0/gems/i2cssh-2.2.0/lib/i2cssh.rb:103:in `block (2 levels) in split_session'
    from /Library/Ruby/Gems/2.0.0/gems/i2cssh-2.2.0/lib/i2cssh.rb:102:in `upto'
    from /Library/Ruby/Gems/2.0.0/gems/i2cssh-2.2.0/lib/i2cssh.rb:102:in `block in split_session'
    from /Library/Ruby/Gems/2.0.0/gems/i2cssh-2.2.0/lib/i2cssh.rb:101:in `upto'
    from /Library/Ruby/Gems/2.0.0/gems/i2cssh-2.2.0/lib/i2cssh.rb:101:in `split_session'
    from /Library/Ruby/Gems/2.0.0/gems/i2cssh-2.2.0/lib/i2cssh.rb:26:in `initialize'
    from /Library/Ruby/Gems/2.0.0/gems/i2cssh-2.2.0/bin/i2cssh:298:in `new'
    from /Library/Ruby/Gems/2.0.0/gems/i2cssh-2.2.0/bin/i2cssh:298:in `<top (required)>'
    from /usr/bin/i2cssh:23:in `load'
    from /usr/bin/i2cssh:23:in `<main>'

Tab's naming

Hello,

when I run

i2cssh feux
I get my 4 tabs with 4 different names "lacoste@agni", "lacoste@loki", "lacoste@hephaistos" and "lacoste@vulcain"

But when I run

i2cssh root@feux
I get 1 tab name "Shell (bash) and 3 tabs with the same name : "lacoste@cronos" where wronos is my localhost. It's not a big issue but if it is easy to do it would be great if the names where "root@machine_name[1-4]".

Thanks,

XL.

Option to open windows inside current window for Tmux support

so iTerm2 has fantastic tmux support and I am trying to combine i2cssh and tmux but it is not happening. I can open my tmux session and try to execute: i2cssh -p tmux -c someservers but no matter what I cannot get it to open the windows in my existing session and thus actually open tmux windows rather than normal windows. Any suggestions?

Use alternate SSH client

Is it possible to use another SSH client or wrapper other than the native SSH client? I found a script that allows me to carry all of my local aliases to whatever hosts I shell into, I would like to use this along with i2cssh but don't see a way other than symlinking /usr/local/bin/ssh to the script, which I can't do since this is a shared workstation.

To many exits

When completed with a run, I have to type exit once on the host, and twice in the opened sessions themselves due to the profile set commands. I would propose a simple change appended to line 172 on lib/i2cssh.rb

Original:

@term.sessions[@session_index + i].write :text => "unset HISTFILE && echo -e \"\\033]50;SetProfile=#{@profile}\\a\" && #{@ssh_prefix} #{send_env} #{server}"

Proposed:

@term.sessions[@session_index + i].write :text => "unset HISTFILE && echo -e \"\\033]50;SetProfile=#{@profile}\\a\" && #{@ssh_prefix} #{send_env} #{server} && exit"

Specify cluster hosts via external command

It would be awesome to be able to get a list of hosts from an external command instead of specify specific hosts in the rc or using the -m

Something like

clusters:
    cluster_a: 
        hosts_by_command: /bin/find_hosts ...

Unknown property, element or command: 'desktop' ERROR

I get the following error when trying to spawn i2cssh:

Unknown property, element or command: 'desktop'

The full trace is:

ddecker$ i2cssh -l ddecker -m "es-tw01.emcent.scn.securustech.net es-tw02.emcent.scn.securustech.net" -F
/Library/Ruby/Gems/1.8/gems/rb-appscript-0.6.1/lib/appscript.rb:676:in `method_missing': Unknown property, element or command: 'desktop' (RuntimeError)
    from /Library/Ruby/Gems/1.8/gems/i2cssh-1.9.0/lib/i2cssh.rb:37:in `maximize'
    from /Library/Ruby/Gems/1.8/gems/i2cssh-1.9.0/lib/i2cssh.rb:29:in `initialize'
    from /Library/Ruby/Gems/1.8/gems/i2cssh-1.9.0/bin/i2cssh:192:in `new'
    from /Library/Ruby/Gems/1.8/gems/i2cssh-1.9.0/bin/i2cssh:192
    from /usr/bin/i2cssh:19:in `load'
    from /usr/bin/i2cssh:19

My Ruby Version:

ddecker$ ruby -v
ruby 1.8.7 (2012-02-08 patchlevel 358) [universal-darwin12.0]

i2cssh is broken without a config file

If there is no ~/.i2csshrc, then i2cssh just doesn't work, with a stacktrace instead of an error message:

$ i2cssh root@HOSTNAME1 root@HOSTNAME2
/Library/Ruby/Gems/1.8/gems/i2cssh-1.8.0/lib/i2cssh.rb:62:in split_session': undefined method[]' for nil:NilClass (NoMethodError)
from /Library/Ruby/Gems/1.8/gems/i2cssh-1.8.0/lib/i2cssh.rb:25:in initialize' from /Library/Ruby/Gems/1.8/gems/i2cssh-1.8.0/bin/i2cssh:191:innew'
from /Library/Ruby/Gems/1.8/gems/i2cssh-1.8.0/bin/i2cssh:191
from /usr/bin/i2cssh:23:in `load'
from /usr/bin/i2cssh:23

appscript gem causing errors

$ i2cssh -m host1.com,host2.com

/Library/Ruby/Gems/1.8/gems/rb-appscript-0.6.1/lib/appscript.rb:542:in `_send_command': CommandError (Appscript::CommandError)
    OSERROR: -1719
    MESSAGE: Access for assistive devices is disabled.
    OFFENDING OBJECT: app("/System/Library/CoreServices/System Events.app").processes["iTerm"].menu_bars[1]
    COMMAND: app("/System/Library/CoreServices/System Events.app").processes["iTerm"].menu_bars[1].menu_bar_items["Shell"].menus["Shell"].menu_items["Split Vertically with Current Profile"].click()
  from /Library/Ruby/Gems/1.8/gems/rb-appscript-0.6.1/lib/appscript.rb:642:in `method_missing'
  from /Library/Ruby/Gems/1.8/gems/i2cssh-1.9.0/lib/i2cssh.rb:74:in `split_session'
  from /Library/Ruby/Gems/1.8/gems/i2cssh-1.9.0/lib/i2cssh.rb:73:in `upto'
  from /Library/Ruby/Gems/1.8/gems/i2cssh-1.9.0/lib/i2cssh.rb:73:in `split_session'
  from /Library/Ruby/Gems/1.8/gems/i2cssh-1.9.0/lib/i2cssh.rb:28:in `initialize'
  from /Library/Ruby/Gems/1.8/gems/i2cssh-1.9.0/bin/i2cssh:192:in `new'
  from /Library/Ruby/Gems/1.8/gems/i2cssh-1.9.0/bin/i2cssh:192
  from /usr/bin/i2cssh:19:in `load'
  from /usr/bin/i2cssh:19

$ ruby -v
ruby 1.8.7 (2012-02-08 patchlevel 358) [universal-darwin11.0]

Rearrange Panes To Initial Grid (csshx' Ctrl-A + r)

After longer multipane sessions, resizing panes all the time, is there the possibility to have them nicely arranged again, like with csshx Ctrl-A + r ?

PS: Good job, love the yaml style config setup, like in tmuxinator ;-)

Access for assistive devices is required but not checked

Eventually aborting the application and throwing the following error :

lib/rb-scpt.rb:542:in _send_command': CommandError (Appscript::CommandError) OSERROR: -1719 MESSAGE: Access for assistive devices is disabled. OFFENDING OBJECT: app("/System/Library/CoreServices/System Events.app").processes["iTerm2"].menu_bars[1] COMMAND: app("/System/Library/CoreServices/System Events.app").processes["iTerm2"].menu_bars[1].menu_bar_items["Window"].menus["Window"].menu_items["Select Split Pane"].menus["Select Split Pane"].menu_items["Select Pane Left"].click() from /Users/carlo/.gem/ruby/2.0.0/gems/rb-scpt-1.0.1/lib/rb-scpt.rb:642:in method_missing'
from /Users/carlo/src/i2cssh/lib/i2cssh.rb:103:in block (2 levels) in split_session' from /Users/carlo/src/i2cssh/lib/i2cssh.rb:102:in upto'
from /Users/carlo/src/i2cssh/lib/i2cssh.rb:102:in block in split_session' from /Users/carlo/src/i2cssh/lib/i2cssh.rb:101:in upto'
from /Users/carlo/src/i2cssh/lib/i2cssh.rb:101:in split_session' from /Users/carlo/src/i2cssh/lib/i2cssh.rb:26:in initialize'
from ./i2cssh:302:in new' from ./i2cssh:302:in

'

At least on Sierra, a system pop up will spawn asking for authorization to enable UI and showing iTerm in the list of applications that requested "UI" access.

Once that is enabled the following Applescript would return true :

tell application "System Events"
set GUIScriptingEnabled to (UI elements enabled)
return GUIScriptingEnabled
end tell

As an alternative, using instead Keys (as done in csshX) should allow for this to run without the need for "UI special access", which is restricted for Security reasons

Allow to specify window size

Currently the default window size allows to open only 11 panes, thus 11 machines. The script breaks if you want to open more machines.

$ for i in 1 2 3 4 5 6 7 8 9 10 11 12 ; do echo localhost ; done | xargs i2cssh -C 1
/Library/Ruby/Gems/2.0.0/gems/rb-appscript-0.6.1/lib/appscript.rb:542:in `_send_command': CommandError (Appscript::CommandError)
        OSERROR: -1719
        MESSAGE: Can't get reference. Invalid index.
        OFFENDING OBJECT: app("/Applications/iTerm.app").terminals[6].sessions[12]
        COMMAND: app("/Applications/iTerm.app").terminals[6].sessions[12].write({:text=>"unset HISTFILE && echo -e \"\\033]50;SetProfile=Default\\a\" && ssh   localhost"})
    from /Library/Ruby/Gems/2.0.0/gems/rb-appscript-0.6.1/lib/appscript.rb:642:in `method_missing'
    from /Library/Ruby/Gems/2.0.0/gems/i2cssh-1.9.0/lib/i2cssh.rb:111:in `block in start_ssh'
    from /Library/Ruby/Gems/2.0.0/gems/i2cssh-1.9.0/lib/i2cssh.rb:95:in `upto'
    from /Library/Ruby/Gems/2.0.0/gems/i2cssh-1.9.0/lib/i2cssh.rb:95:in `start_ssh'
    from /Library/Ruby/Gems/2.0.0/gems/i2cssh-1.9.0/lib/i2cssh.rb:31:in `initialize'
    from /Library/Ruby/Gems/2.0.0/gems/i2cssh-1.9.0/bin/i2cssh:192:in `new'
    from /Library/Ruby/Gems/2.0.0/gems/i2cssh-1.9.0/bin/i2cssh:192:in `<top (required)>'
    from /usr/bin/i2cssh:23:in `load'
    from /usr/bin/i2cssh:23:in `<main>'

One solution would be to allow to resize the window on open, or dynamically resize the window, or always start in Fullscreen mode (which currently doesn't work in mountain lion it seems) and then go back. (Another option is to create a iterm profile that has a larger window size on start up, but that's less intuitive).

Doesn't work with fish shell

My default shell is fish. i2cssh opens the first terminal with bash but the other ones seem to be fish in which && isn't valid syntax. Is there a way to force all the terminals to use bash?

unset HISTFILE && echo -e "\033]50;SetProfile=Default\a" && ssh HOSTNAME

default layouts

this is really more of a question than an issue:

When I run i2cssh -c clustername, with 3 servers in my cluster, I'd like iTerm2 to show them vertically side by side, but it always shows the first one vertically (column 1), and then an additional 3 windows stacked in column 2. Here's a screenshot.

http://cl.ly/0e1e3C1M2W1q1h310I0p

I always just drag the windows into place and then close the fourth (empty) window. I imagine this is probably a setting in iTerm2, but I've never been able to track it down. Anyone have a guess if there is a way to tweak this?

How to broadcast command?

Sorry for asking what's probably the most trivial question.

How can I broadcast command? This is the i2cssh command I do:

i2cssh -l myself hostA hostB hostC

No Zero Padding When Using Glob Expansion

When trying to use shell expansion in the FQDN, i2cssh ignores the zero padding when counting through the digits, even if it's specified.

server0{1..9).domain.com will result in connections to server01 to server09 respectively.

server{01..09}.domain.com will result in connections to server1 to server9 respectively, same follows for server{1..9}.domain.com

When I'm trying to shell into 10+ servers this creates an issue where I have to specify server0{1..9}.domain.com server{10..20}.domain.com otherwise the first 9 connections will fail if I did server{1..20}.domain.com.

This isn't an issue with bash because a quick test of echo {01..05} prints 01 02 03 04 05

I can't even tell what version I'm using since there is no form of the version flag apparently, but I cloned the repo only about 2 months ago.

Passing of SSH arguments

Is there a way to pass SSH arguments similar to how they are passed in csshX? For example I'd like to be able to pass a pem file, e.g.

ssh -i mypem.pem user@host

Several issues

My config setting is following:

 $ cat .i2csshrc 
 ---
 version: 2
 login: root
 rows: 3
 clusters:
   my:
     login: root
     hosts:
       - host1
       - host2
       ...
       - host7

Screenshot: http://cl.ly/image/3i193r3t2s3N

  1. If I call just i2cssh my, it ignores the login parameter - I am required to call i2cssh root@my
  2. The layout for those 7 hosts is really strange
  3. The field "UNUSED" in last two terminal splits?
  4. There is not any split for writing to all the terminals?

'create_window_with_profile' (RuntimeError)

After a fresh install of i2cssh I get the following error:

$ i2cssh -c picocluster
/Users/govindaf/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/rb-scpt-1.0.1/lib/rb-scpt.rb:676:in `rescue in method_missing': Unknown property, element or command: 'create_window_with_profile' (RuntimeError)
    from /Users/govindaf/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/rb-scpt-1.0.1/lib/rb-scpt.rb:646:in `method_missing'
    from /Users/govindaf/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/i2cssh-2.0.0/lib/i2cssh.rb:20:in `initialize'
    from /Users/govindaf/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/i2cssh-2.0.0/bin/i2cssh:298:in `new'
    from /Users/govindaf/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/i2cssh-2.0.0/bin/i2cssh:298:in `<top (required)>'
    from /Users/govindaf/.rbenv/versions/2.3.0/bin/i2cssh:22:in `load'
    from /Users/govindaf/.rbenv/versions/2.3.0/bin/i2cssh:22:in `<main>'

I have the following version of i2cssh:

$ gem list i2cssh

*** LOCAL GEMS ***

i2cssh (2.0.0)

Ruby version: 2.3.0 (2015-12-25 patchlevel 0) [x86_64-darwin15]
iTerm: 2.1.4

Any hints how to fix this?

RFE: Ability To Handle Ports

Hi,

I've been using csshX for terminal.app, but recently found i2cssh for iTerm2. One thing that I'm missing from i2cssh is the ability to set a port. e.g ssh -p or csshX :port.

I thought about attempting this myself, may have a go at it, but I thought I would submit an RFE as well. :)

Thanks for your hard work and effort.

/Bobby

Problems with fullscreen (-f / -fullscreen)

Hello,

After upgrading to Iterm2 3.0 and I2cssh 2.0 the fullscreen options seems to be broken.

I have tried both options
i2cssh --fullscreen -nb -Xp=9090 Servers
or
i2cssh -F -nb -Xp=9090 Servers

We did a workaround on this just by creating a new Iterm2 profile and set the "Window" -> "Style" mode to Fullscreen and added the profile information to .i2csshrc

screen shot 2016-06-08 at 10 48 51 am

BTW Create product using it everyday ;)

Add functionality to group clusters in .i2csshrc

Please add the functionality to group clusters in the .i2csshrc config.

Example:

---
version: 2
clusters:
  clusterA:
    hosts:
      - server1
      - server2
      - server3
  clusterB:
    hosts:
      - server4
      - server5
      - server6
  clusterC:
    hosts:
      - clusterA
      - clusterB

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.