Skip to content

Instantly share code, notes, and snippets.

@frankamp
Last active December 27, 2015 02:59

Revisions

  1. frankamp revised this gist Nov 11, 2013. 1 changed file with 4 additions and 0 deletions.
    4 changes: 4 additions & 0 deletions sssh.bash
    Original file line number Diff line number Diff line change
    @@ -1,3 +1,7 @@
    # Usage: sssh name_of_session *ssh_args
    # ex: sssh a -i identity.pem user@server.com
    # will connect to or create session "a" on remote server with a certain identity
    # Requires: bash.
    # function needs to be exported into your shell, ex: put in .bashrc near aliases
    # keep this handy http://www.mechanicalkeys.com/files/os/notes/tm.html

  2. frankamp revised this gist Nov 11, 2013. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion sssh.bash
    Original file line number Diff line number Diff line change
    @@ -1,7 +1,7 @@
    # function needs to be exported into your shell, ex: put in .bashrc near aliases
    # keep this handy http://www.mechanicalkeys.com/files/os/notes/tm.html

    ssh() {
    sssh() {
    session="$1"
    shift
    ssh -t $@ "tmux a -t $session || tmux new -s $session || screen -S $session -dr || screen -S $session || /bin/bash"
  3. frankamp revised this gist Oct 31, 2013. 1 changed file with 1 addition and 0 deletions.
    1 change: 1 addition & 0 deletions sssh.bash
    Original file line number Diff line number Diff line change
    @@ -1,4 +1,5 @@
    # function needs to be exported into your shell, ex: put in .bashrc near aliases
    # keep this handy http://www.mechanicalkeys.com/files/os/notes/tm.html

    ssh() {
    session="$1"
  4. frankamp revised this gist Oct 31, 2013. 1 changed file with 3 additions and 3 deletions.
    6 changes: 3 additions & 3 deletions sssh.bash
    Original file line number Diff line number Diff line change
    @@ -1,7 +1,7 @@
    # function needs to be exported into your shell, ex: put in .bashrc near aliases

    sssh() {
    screen_name="$1"
    ssh() {
    session="$1"
    shift
    ssh -t $@ "screen -S $screen_name -dr || screen -S $screen_name"
    ssh -t $@ "tmux a -t $session || tmux new -s $session || screen -S $session -dr || screen -S $session || /bin/bash"
    }
  5. frankamp created this gist Oct 31, 2013.
    7 changes: 7 additions & 0 deletions sssh.bash
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,7 @@
    # function needs to be exported into your shell, ex: put in .bashrc near aliases

    sssh() {
    screen_name="$1"
    shift
    ssh -t $@ "screen -S $screen_name -dr || screen -S $screen_name"
    }