Want more features on Pastebin? Sign Up, it's FREE!
Guest

bin/setup_dashboard.sh

By: mikelieman on Aug 29th, 2013  |  syntax: Bash  |  size: 0.92 KB  |  views: 603  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. #!/bin/bash
  2.  
  3. # Create tmux session with 3 panes showing various status information for mosh-client to connect to
  4. # Invoke this on the remote machine with:
  5. #
  6. # $ mosh root@server.example.com -- /root/bin/setup_dashboard.sh
  7. #
  8. # and if you get disconnected, the mosh command:
  9. #
  10. # $ mosh root@server.example.com -- tmux attach
  11.  
  12. # tmux list-windows gives you this layout string, which is used to reset the panes
  13. LAYOUT="1cc2,157x66,0,0[157x26,0,0,0,157x39,0,27{79x39,0,27,1,77x39,80,27,2}]"
  14.  
  15. # quoting shell commands with tmux can be an issue, so we don't use shell variables
  16. /usr/local/bin/tmux new-session -d -s sysop -n dash '/usr/bin/less -WX +F /storage/www/server.example.com/application/log/development.log'
  17. /usr/local/bin/tmux split-window -t dash /usr/bin/dstat
  18. /usr/local/bin/tmux split-window -t dash -h /usr/bin/top
  19. /usr/local/bin/tmux select-layout -t dash $LAYOUT  
  20. /usr/local/bin/tmux attach-session -t sysop
clone this paste RAW Paste Data