Skip to content

Instantly share code, notes, and snippets.

@jackiect
Last active March 15, 2020 02:07
Show Gist options
  • Select an option

  • Save jackiect/1a18cad0929a2bec1b4eb13c2dc00323 to your computer and use it in GitHub Desktop.

Select an option

Save jackiect/1a18cad0929a2bec1b4eb13c2dc00323 to your computer and use it in GitHub Desktop.

Revisions

  1. jackiect revised this gist Mar 14, 2020. 2 changed files with 16 additions and 16 deletions.
    16 changes: 8 additions & 8 deletions boot-tmux.sh
    Original file line number Diff line number Diff line change
    @@ -1,20 +1,20 @@
    #!/bin/sh
    # ensure tmux window and pane index begin at 1
    w=1
    tmux new-session -s 'tmux-container' -d 'sh command.sh "w='$w'&p=1" & sh'
    tmux split-window -h 'sh command.sh "w='$w'&p=2" & sh'
    tmux split-window -v 'sh command.sh "w='$w'&p=3" & sh'
    tmux new-session -s 'tmux-container' -d 'sh command.sh "w='$w'&p=1" ; sh'
    tmux split-window -h 'sh command.sh "w='$w'&p=2" ; sh'
    tmux split-window -v 'sh command.sh "w='$w'&p=3" ; sh'
    tmux select-pane -t 1
    tmux split-window -v 'sh command.sh "w='$w'&p=4" & sh'
    tmux split-window -v 'sh command.sh "w='$w'&p=4" ; sh'

    for i in {2..5}
    do
    tmux new-window -n w-$i -e 'W='$i -d 'sh command.sh "w='$i'&p=1" & sh'
    tmux new-window -n w-$i -e 'W='$i -d 'sh command.sh "w='$i'&p=1" ; sh'
    tmux select-window -t $i
    tmux split-window -h 'sh command.sh "w='$i'&p=2" & sh'
    tmux split-window -v 'sh command.sh "w='$i'&p=3" & sh'
    tmux split-window -h 'sh command.sh "w='$i'&p=2" ; sh'
    tmux split-window -v 'sh command.sh "w='$i'&p=3" ; sh'
    tmux select-pane -t 1
    tmux split-window -v 'sh command.sh "w='$i'&p=4" & sh'
    tmux split-window -v 'sh command.sh "w='$i'&p=4" ; sh'
    done

    tmux -2 attach-session -d
    16 changes: 8 additions & 8 deletions boot-tmux2.sh
    Original file line number Diff line number Diff line change
    @@ -1,24 +1,24 @@
    #!/bin/sh
    # ensure tmux window and pane index begin at 1
    h=0
    tmux new-session -s 'tmux-container' -d 'sh command.sh "-h'$h' -p0" & sh'
    tmux split-window -h 'sh command.sh "-h'$h' -p1" & sh'
    tmux new-session -s 'tmux-container' -d 'sh command.sh "-h'$h' -p0" ; sh'
    tmux split-window -h 'sh command.sh "-h'$h' -p1" ; sh'
    h=1
    tmux split-window -v 'sh command.sh "-h'$h' -p0" & sh'
    tmux split-window -v 'sh command.sh "-h'$h' -p0" ; sh'
    tmux select-pane -t 1
    tmux split-window -v 'sh command.sh "-h'$h' -p1" & sh'
    tmux split-window -v 'sh command.sh "-h'$h' -p1" ; sh'

    for i in {2..11}
    do
    ha=$((i*2-2))
    hb=$((ha+1))
    w="$ha-$hb"
    tmux new-window -n w-$w -e 'W='$w -d 'sh command.sh "-h'$ha' -p0" & sh'
    tmux new-window -n w-$w -e 'W='$w -d 'sh command.sh "-h'$ha' -p0" ; sh'
    tmux select-window -t $i
    tmux split-window -h 'sh command.sh "-h'$ha' -p1" & sh'
    tmux split-window -v 'sh command.sh "-h'$hb' -p0" & sh'
    tmux split-window -h 'sh command.sh "-h'$ha' -p1" ; sh'
    tmux split-window -v 'sh command.sh "-h'$hb' -p0" ; sh'
    tmux select-pane -t 1
    tmux split-window -v 'sh command.sh "-h'$hb' -p1" & sh'
    tmux split-window -v 'sh command.sh "-h'$hb' -p1" ; sh'
    done

    tmux -2 attach-session -d
  2. jackiect revised this gist Mar 14, 2020. 2 changed files with 16 additions and 16 deletions.
    16 changes: 8 additions & 8 deletions boot-tmux.sh
    Original file line number Diff line number Diff line change
    @@ -1,20 +1,20 @@
    #!/bin/sh
    # ensure tmux window and pane index begin at 1
    w=1
    tmux new-session -s 'tmux-container' -d 'sh command.sh "w='$w'&p=1" && sh'
    tmux split-window -h 'sh command.sh "w='$w'&p=2" && sh'
    tmux split-window -v 'sh command.sh "w='$w'&p=3" && sh'
    tmux new-session -s 'tmux-container' -d 'sh command.sh "w='$w'&p=1" & sh'
    tmux split-window -h 'sh command.sh "w='$w'&p=2" & sh'
    tmux split-window -v 'sh command.sh "w='$w'&p=3" & sh'
    tmux select-pane -t 1
    tmux split-window -v 'sh command.sh "w='$w'&p=4" && sh'
    tmux split-window -v 'sh command.sh "w='$w'&p=4" & sh'

    for i in {2..5}
    do
    tmux new-window -n w-$i -e 'W='$i -d 'sh command.sh "w='$i'&p=1" && sh'
    tmux new-window -n w-$i -e 'W='$i -d 'sh command.sh "w='$i'&p=1" & sh'
    tmux select-window -t $i
    tmux split-window -h 'sh command.sh "w='$i'&p=2" && sh'
    tmux split-window -v 'sh command.sh "w='$i'&p=3" && sh'
    tmux split-window -h 'sh command.sh "w='$i'&p=2" & sh'
    tmux split-window -v 'sh command.sh "w='$i'&p=3" & sh'
    tmux select-pane -t 1
    tmux split-window -v 'sh command.sh "w='$i'&p=4" && sh'
    tmux split-window -v 'sh command.sh "w='$i'&p=4" & sh'
    done

    tmux -2 attach-session -d
    16 changes: 8 additions & 8 deletions boot-tmux2.sh
    Original file line number Diff line number Diff line change
    @@ -1,24 +1,24 @@
    #!/bin/sh
    # ensure tmux window and pane index begin at 1
    h=0
    tmux new-session -s 'tmux-container' -d 'sh command.sh "-h'$h' -p0" && sh'
    tmux split-window -h 'sh command.sh "-h'$h' -p1" && sh'
    tmux new-session -s 'tmux-container' -d 'sh command.sh "-h'$h' -p0" & sh'
    tmux split-window -h 'sh command.sh "-h'$h' -p1" & sh'
    h=1
    tmux split-window -v 'sh command.sh "-h'$h' -p0" && sh'
    tmux split-window -v 'sh command.sh "-h'$h' -p0" & sh'
    tmux select-pane -t 1
    tmux split-window -v 'sh command.sh "-h'$h' -p1" && sh'
    tmux split-window -v 'sh command.sh "-h'$h' -p1" & sh'

    for i in {2..11}
    do
    ha=$((i*2-2))
    hb=$((ha+1))
    w="$ha-$hb"
    tmux new-window -n w-$w -e 'W='$w -d 'sh command.sh "-h'$ha' -p0" && sh'
    tmux new-window -n w-$w -e 'W='$w -d 'sh command.sh "-h'$ha' -p0" & sh'
    tmux select-window -t $i
    tmux split-window -h 'sh command.sh "-h'$ha' -p1" && sh'
    tmux split-window -v 'sh command.sh "-h'$hb' -p0" && sh'
    tmux split-window -h 'sh command.sh "-h'$ha' -p1" & sh'
    tmux split-window -v 'sh command.sh "-h'$hb' -p0" & sh'
    tmux select-pane -t 1
    tmux split-window -v 'sh command.sh "-h'$hb' -p1" && sh'
    tmux split-window -v 'sh command.sh "-h'$hb' -p1" & sh'
    done

    tmux -2 attach-session -d
  3. jackiect revised this gist Mar 14, 2020. 2 changed files with 2 additions and 1 deletion.
    1 change: 1 addition & 0 deletions boot-tmux.sh
    Original file line number Diff line number Diff line change
    @@ -1,4 +1,5 @@
    #!/bin/sh
    # ensure tmux window and pane index begin at 1
    w=1
    tmux new-session -s 'tmux-container' -d 'sh command.sh "w='$w'&p=1" && sh'
    tmux split-window -h 'sh command.sh "w='$w'&p=2" && sh'
    2 changes: 1 addition & 1 deletion boot-tmux2.sh
    Original file line number Diff line number Diff line change
    @@ -1,5 +1,5 @@
    #!/bin/sh
    # ensure tmux window index begin at 1
    # ensure tmux window and pane index begin at 1
    h=0
    tmux new-session -s 'tmux-container' -d 'sh command.sh "-h'$h' -p0" && sh'
    tmux split-window -h 'sh command.sh "-h'$h' -p1" && sh'
  4. jackiect revised this gist Mar 14, 2020. 2 changed files with 2 additions and 2 deletions.
    2 changes: 1 addition & 1 deletion command-url.sh
    Original file line number Diff line number Diff line change
    @@ -5,4 +5,4 @@ url="http://httpbin.org/get?p=$p"
    curl -i $url

    cmd="cd ~/tmp/tmp && pwd && echo $p && curl -sL '$url'"
    ssh tanchen01@localhost "$cmd"
    ssh chen@localhost "$cmd"
    2 changes: 1 addition & 1 deletion command.sh
    Original file line number Diff line number Diff line change
    @@ -5,4 +5,4 @@ url="http://httpbin.org/get?$q"
    curl $url

    cmd="cd /tmp && ls && echo $p && curl -sL '$url'"
    ssh tanchen01@localhost "$cmd"
    ssh chen@localhost "$cmd"
  5. jackiect revised this gist Mar 14, 2020. 1 changed file with 24 additions and 0 deletions.
    24 changes: 24 additions & 0 deletions boot-tmux2.sh
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,24 @@
    #!/bin/sh
    # ensure tmux window index begin at 1
    h=0
    tmux new-session -s 'tmux-container' -d 'sh command.sh "-h'$h' -p0" && sh'
    tmux split-window -h 'sh command.sh "-h'$h' -p1" && sh'
    h=1
    tmux split-window -v 'sh command.sh "-h'$h' -p0" && sh'
    tmux select-pane -t 1
    tmux split-window -v 'sh command.sh "-h'$h' -p1" && sh'

    for i in {2..11}
    do
    ha=$((i*2-2))
    hb=$((ha+1))
    w="$ha-$hb"
    tmux new-window -n w-$w -e 'W='$w -d 'sh command.sh "-h'$ha' -p0" && sh'
    tmux select-window -t $i
    tmux split-window -h 'sh command.sh "-h'$ha' -p1" && sh'
    tmux split-window -v 'sh command.sh "-h'$hb' -p0" && sh'
    tmux select-pane -t 1
    tmux split-window -v 'sh command.sh "-h'$hb' -p1" && sh'
    done

    tmux -2 attach-session -d
  6. jackiect revised this gist Mar 14, 2020. 1 changed file with 6 additions and 1 deletion.
    7 changes: 6 additions & 1 deletion command.sh
    Original file line number Diff line number Diff line change
    @@ -1,3 +1,8 @@
    #!/bin/sh
    set -x
    curl -i http://httpbin.org/get?$@
    q=$@
    url="http://httpbin.org/get?$q"
    curl $url

    cmd="cd /tmp && ls && echo $p && curl -sL '$url'"
    ssh tanchen01@localhost "$cmd"
  7. jackiect revised this gist Mar 14, 2020. 1 changed file with 8 additions and 0 deletions.
    8 changes: 8 additions & 0 deletions command-url.sh
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,8 @@
    #!/bin/sh
    set -x
    p=$@
    url="http://httpbin.org/get?p=$p"
    curl -i $url

    cmd="cd ~/tmp/tmp && pwd && echo $p && curl -sL '$url'"
    ssh tanchen01@localhost "$cmd"
  8. jackiect revised this gist Mar 14, 2020. 1 changed file with 6 additions and 4 deletions.
    10 changes: 6 additions & 4 deletions boot-tmux.sh
    Original file line number Diff line number Diff line change
    @@ -1,8 +1,10 @@
    tmux new-session -s 'tmux-container' -d 'sh command.sh "w=1&p=1" && sh'
    tmux split-window -h 'sh command.sh "w=1&p=2" && sh'
    tmux split-window -v 'sh command.sh "w=1&p=3" && sh'
    #!/bin/sh
    w=1
    tmux new-session -s 'tmux-container' -d 'sh command.sh "w='$w'&p=1" && sh'
    tmux split-window -h 'sh command.sh "w='$w'&p=2" && sh'
    tmux split-window -v 'sh command.sh "w='$w'&p=3" && sh'
    tmux select-pane -t 1
    tmux split-window -v 'sh command.sh "w=1&p=4" && sh'
    tmux split-window -v 'sh command.sh "w='$w'&p=4" && sh'

    for i in {2..5}
    do
  9. jackiect revised this gist Mar 14, 2020. 1 changed file with 14 additions and 7 deletions.
    21 changes: 14 additions & 7 deletions boot-tmux.sh
    Original file line number Diff line number Diff line change
    @@ -1,10 +1,17 @@
    #!/bin/sh
    tmux new-session -s 'tmux-container' -d 'sh command.sh q=1 && sh'
    tmux split-window -h 'sh command.sh q=2 && sh'
    tmux split-window -v 'sh command.sh q=3 && sh'
    tmux new-session -s 'tmux-container' -d 'sh command.sh "w=1&p=1" && sh'
    tmux split-window -h 'sh command.sh "w=1&p=2" && sh'
    tmux split-window -v 'sh command.sh "w=1&p=3" && sh'
    tmux select-pane -t 1
    tmux split-window -v 'sh command.sh q=4 && sh'
    tmux split-window -v 'sh command.sh "w=1&p=4" && sh'

    for i in {2..5}; do tmux new-window -n w-$i -d; done
    for i in {2..5}
    do
    tmux new-window -n w-$i -e 'W='$i -d 'sh command.sh "w='$i'&p=1" && sh'
    tmux select-window -t $i
    tmux split-window -h 'sh command.sh "w='$i'&p=2" && sh'
    tmux split-window -v 'sh command.sh "w='$i'&p=3" && sh'
    tmux select-pane -t 1
    tmux split-window -v 'sh command.sh "w='$i'&p=4" && sh'
    done

    tmux -2 attach-session -d
    tmux -2 attach-session -d
  10. jackiect revised this gist Mar 14, 2020. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion boot-tmux.sh
    Original file line number Diff line number Diff line change
    @@ -5,6 +5,6 @@ tmux split-window -v 'sh command.sh q=3 && sh'
    tmux select-pane -t 1
    tmux split-window -v 'sh command.sh q=4 && sh'

    for i in {1..5}; do tmux new-window -d; done
    for i in {2..5}; do tmux new-window -n w-$i -d; done

    tmux -2 attach-session -d
  11. jackiect revised this gist Mar 14, 2020. 2 changed files with 2 additions and 5 deletions.
    2 changes: 1 addition & 1 deletion boot-tmux.sh
    Original file line number Diff line number Diff line change
    @@ -5,6 +5,6 @@ tmux split-window -v 'sh command.sh q=3 && sh'
    tmux select-pane -t 1
    tmux split-window -v 'sh command.sh q=4 && sh'

    tmux new-window -d
    for i in {1..5}; do tmux new-window -d; done

    tmux -2 attach-session -d
    5 changes: 1 addition & 4 deletions command.sh
    Original file line number Diff line number Diff line change
    @@ -1,6 +1,3 @@
    #!/bin/sh
    set -x
    curl -i http://httpbin.org/get?q=3

    #set -x
    #curl -i http://httpbin.org/get?$@
    curl -i http://httpbin.org/get?$@
  12. jackiect revised this gist Mar 14, 2020. 1 changed file with 7 additions and 10 deletions.
    17 changes: 7 additions & 10 deletions boot-tmux.sh
    Original file line number Diff line number Diff line change
    @@ -1,13 +1,10 @@
    #!/bin/sh
    tmux new-session -d 'vim && sh'
    tmux split-window -v 'ipython && sh'
    tmux split-window -h 'sh command.sh && sh'
    tmux new-window 'mutt'
    tmux -2 attach-session -d
    tmux new-session -s 'tmux-container' -d 'sh command.sh q=1 && sh'
    tmux split-window -h 'sh command.sh q=2 && sh'
    tmux split-window -v 'sh command.sh q=3 && sh'
    tmux select-pane -t 1
    tmux split-window -v 'sh command.sh q=4 && sh'

    tmux new-window -d

    #tmux new-session -d 'sh command.sh q=1 && sh'
    #tmux split-window -v 'sh command.sh q=2 && sh'
    #tmux split-window -h 'sh command.sh q=3 && sh'
    #tmux new-window 'mutt'
    #tmux -2 attach-session -d
    tmux -2 attach-session -d
  13. jackiect revised this gist Mar 14, 2020. 2 changed files with 12 additions and 2 deletions.
    9 changes: 8 additions & 1 deletion boot-tmux.sh
    Original file line number Diff line number Diff line change
    @@ -3,4 +3,11 @@ tmux new-session -d 'vim && sh'
    tmux split-window -v 'ipython && sh'
    tmux split-window -h 'sh command.sh && sh'
    tmux new-window 'mutt'
    tmux -2 attach-session -d
    tmux -2 attach-session -d


    #tmux new-session -d 'sh command.sh q=1 && sh'
    #tmux split-window -v 'sh command.sh q=2 && sh'
    #tmux split-window -h 'sh command.sh q=3 && sh'
    #tmux new-window 'mutt'
    #tmux -2 attach-session -d
    5 changes: 4 additions & 1 deletion command.sh
    Original file line number Diff line number Diff line change
    @@ -1,3 +1,6 @@
    #!/bin/sh
    set -x
    curl -i http://httpbin.org/get?q=3
    curl -i http://httpbin.org/get?q=3

    #set -x
    #curl -i http://httpbin.org/get?$@
  14. jackiect created this gist Mar 14, 2020.
    1 change: 1 addition & 0 deletions README.md
    Original file line number Diff line number Diff line change
    @@ -0,0 +1 @@
    https://stackoverflow.com/questions/5609192/answer/5752901
    6 changes: 6 additions & 0 deletions boot-tmux.sh
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,6 @@
    #!/bin/sh
    tmux new-session -d 'vim && sh'
    tmux split-window -v 'ipython && sh'
    tmux split-window -h 'sh command.sh && sh'
    tmux new-window 'mutt'
    tmux -2 attach-session -d
    3 changes: 3 additions & 0 deletions command.sh
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,3 @@
    #!/bin/sh
    set -x
    curl -i http://httpbin.org/get?q=3