Last active
March 15, 2020 02:07
-
-
Save jackiect/1a18cad0929a2bec1b4eb13c2dc00323 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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 select-pane -t 1 | |
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 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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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' | |
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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 chen@localhost "$cmd" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
set -x | |
q=$@ | |
url="http://httpbin.org/get?$q" | |
curl $url | |
cmd="cd /tmp && ls && echo $p && curl -sL '$url'" | |
ssh chen@localhost "$cmd" |
create or attach session
SESSION="`tmux-s`"
tmux attach -d -t $SESSION || tmux new -s $SESSION
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
warn: