Tea-Mux

sm0ketst@dell-t3400:~$ cat /etc/issue
Debian GNU/Linux 8 \n \l
sm0ketst@dell-t3400:~$ su - # only once just in case your user is not in the staff/sudo groups
Password:
root@dell-t3400:~# usermod -a -G staff sm0ketst
root@dell-t3400:~# usermod -a -G sudo sm0ketst
root@dell-t3400:~# exit
sm0ketst@dell-t3400:~$ exit
<login back>
sm0ketst@dell-t3400:~$ sudo apt install pkg-config build-essential libevent-dev libncurses-dev automake
sm0ketst@dell-t3400:~$ cd /usr/local/src && git clone https://github.com/tmux/tmux.git
Cloning into 'tmux'...
remote: Counting objects: 31563, done.
remote: Compressing objects: 100% (146/146), done.
remote: Total 31563 (delta 76), reused 0 (delta 0), pack-reused 31417
Receiving objects: 100% (31563/31563), 7.57 MiB | 6.33 MiB/s, done.
Resolving deltas: 100% (24762/24762), done.
Checking connectivity... done.
sm0ketst@dell-t3400:/usr/local/src$ l
total 12K
drwxrwsr-x  3 root     staff 4.0K Mar 15 09:27 ./
drwxrwsr-x 10 root     staff 4.0K Feb 16 13:06 ../
drwxr-sr-x  7 sm0ketst staff 4.0K Mar 15 09:27 tmux/
sm0ketst@dell-t3400:/usr/local/src$
sm0ketst@dell-t3400:/usr/local/src$ cd tmux && sh autogen.sh
configure.ac:23: installing 'etc/compile'
configure.ac:8: installing 'etc/config.guess'
configure.ac:8: installing 'etc/config.sub'
configure.ac:6: installing 'etc/install-sh'
configure.ac:6: installing 'etc/missing'
Makefile.am: installing 'etc/depcomp'
sm0ketst@dell-t3400:/usr/local/src/tmux$
sm0ketst@dell-t3400:/usr/local/src/tmux$ ./configure
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for a thread-safe mkdir -p... /bin/mkdir -p
checking for gawk... gawk
checking whether make sets $(MAKE)... yes
[...]
checking that generated files are newer than configure... done
configure: creating ./config.status
config.status: creating Makefile
config.status: executing depfiles commands
sm0ketst@dell-t3400:/usr/local/src/tmux$
sm0ketst@dell-t3400:/usr/local/src/tmux$ make 
sm0ketst@dell-t3400:/usr/local/src/tmux$ tmux -V
tmux 1.9
sm0ketst@dell-t3400:/usr/local/src/tmux$ sudo apt-get purge tmux
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following packages will be REMOVED:
  tmux*
0 upgraded, 0 newly installed, 1 to remove and 4 not upgraded.
After this operation, 610 kB disk space will be freed.
Do you want to continue? [Y/n]
(Reading database ... 179840 files and directories currently installed.)
Removing tmux (1.9-6) ...
Purging configuration files for tmux (1.9-6) ...
Processing triggers for man-db (2.7.0.2-5) ...
sm0ketst@dell-t3400:/usr/local/src/tmux$ sudo make install
make[1]: Entering directory '/usr/local/src/tmux'
 /bin/mkdir -p '/usr/local/bin'
  /usr/bin/install -c tmux '/usr/local/bin'
make  install-exec-hook
make[2]: Entering directory '/usr/local/src/tmux'
if test xmdoc = xmdoc; then \
        sed -e "s|@SYSCONFDIR@|/etc|g" ./tmux.1 \
                >./tmux.1.mdoc; \
else \
        sed -e "s|@SYSCONFDIR@|/etc|g" ./tmux.1| \
                gawk -f./mdoc2man.awk >./tmux.1.man; \
fi
/bin/mkdir -p /usr/local/share/man/man1
/usr/bin/install -c -m 644 ./tmux.1.mdoc \
        /usr/local/share/man/man1/tmux.1
make[2]: Leaving directory '/usr/local/src/tmux'
make[1]: Nothing to be done for 'install-data-am'.
make[1]: Leaving directory '/usr/local/src/tmux'
sm0ketst@dell-t3400:/usr/local/src/tmux$

sm0ketst@dell-t3400:/usr/local/src/tmux$ man -k tmux
tmux (1)             - terminal multiplexer

sm0ketst@dell-t3400:/usr/local/src/tmux$ type tmux
tmux is hashed (/usr/bin/tmux)
sm0ketst@dell-t3400:/usr/local/src/tmux$ hash -d tmux
sm0ketst@dell-t3400:/usr/local/src/tmux$ type tmux
tmux is /usr/local/bin/tmux
sm0ketst@dell-t3400:/usr/local/src/tmux$ tmux -V
tmux master

sm0ketst@dell-t3400:/usr/local/src/tmux$ git checkout 2.3
HEAD is now at 52869ed... Release tmux 2.3
sm0ketst@dell-t3400:/usr/local/src/tmux$ ./configure && make && sudo make install && hash -d tmux ; tmux -V
tmux 2.3
sm0ketst@dell-t3400:/usr/local/src/tmux$
sm0ketst@dell-t3400:~$ cat .tmux.conf
# Refs.:
#  - https://github.com/gpakosz/.tmux
#  - https://pragprog.com/titles/bhtmux2/source_code
#  - http://www.hamvocke.com/blog/a-guide-to-customizing-your-tmux-conf/
#  - https://awhan.wordpress.com/2012/04/18/tmux-copy-paste-with-mouse/
# ========================================================================

# Remap prefix from 'C-b' to 'C-a' (leave defualt prefix unchanged)
# unbind C-b
set-option -g prefix C-a
bind-key C-a send-prefix

#setting the delay between prefix and command
set -s escape-time 1

# Set the base index for windows to 1 instead of 0
set -g base-index 1

# Set the base index for panes to 1 instead of 0
setw -g pane-base-index 1

# Reload the file with Prefix r
bind r source-file ~/.tmux.conf \; display "Tmux configuration reloaded."

# Split panes using | and -
bind | split-window -h
bind - split-window -v
unbind '"'
unbind %

# Switch panes: Alt-arrow (without prefix)
bind -n M-Left select-pane -L
bind -n M-Right select-pane -R
bind -n M-Up select-pane -U
bind -n M-Down select-pane -D

# Enable mouse mode (tmux 2.1 and above)
# : Select -> SHIFT + Mouse, Copy -> ENTER, Paste -> SHIFT + INS
set -g mouse on

# don't rename windows automatically
set-option -g allow-rename off

# Set the default terminal mode to 256color mode
set -g default-terminal "screen-256color"

# Plugins
#set -g @plugin 'tmux-plugins/tpm'
#set -g @plugin 'tmux-plugins/tmux-resurrect'
#run '~/.tmux/plugins/tpm/tpm'


# Messaging
set -g message-fg black
set -g message-bg yellow
set -g message-command-fg blue
set -g message-command-bg black

# Window mode
setw -g mode-bg colour6
setw -g mode-fg colour0

# Window status
setw -g window-status-format " #F#I:#W#F "
setw -g window-status-current-format " #F#I:#W#F "
setw -g window-status-format "#[fg=magenta]#[bg=black] #I #[bg=cyan]#[fg=colour8] #W "
setw -g window-status-current-format "#[bg=brightmagenta]#[fg=colour8] #I #[fg=colour8]#[bg=colour14] #W "
setw -g window-status-current-bg colour0
setw -g window-status-current-fg colour11
setw -g window-status-current-attr dim
setw -g window-status-bg green
setw -g window-status-fg black
setw -g window-status-attr reverse

# Info
set -g status-left ''

# Quiet
set-option -g visual-activity off
set-option -g visual-bell off
set-option -g visual-silence off
set-window-option -g monitor-activity off
set-option -g bell-action none

set -g default-terminal "screen-256color"

# The modes {
setw -g clock-mode-colour colour135
setw -g mode-attr bold
setw -g mode-fg colour196
setw -g mode-bg colour238


# Panes 
set -g pane-border-fg black
set -g pane-active-border-fg brightred

set -g pane-border-bg colour235
set -g pane-border-fg colour238
set -g pane-active-border-bg colour236
set -g pane-active-border-fg colour51


# Statusbar 
set -g status-justify left
set -g status-bg default
set -g status-fg colour12
set -g status-interval 2
set -g status-position bottom
set -g status-bg colour234
set -g status-fg colour137
set -g status-attr dim
set -g status-left ''
set -g status-right '#[fg=colour233,bg=colour241,bold] %d/%m #[fg=colour233,bg=colour245,bold] %H:%M:%S '
set -g status-right-length 50
set -g status-left-length 20

setw -g window-status-current-fg colour81
setw -g window-status-current-bg colour238
setw -g window-status-current-attr bold
setw -g window-status-current-format ' #I#[fg=colour250]:#[fg=colour255]#W#[fg=colour50]#F '

setw -g window-status-fg colour138
setw -g window-status-bg colour235
setw -g window-status-attr none
setw -g window-status-format ' #I#[fg=colour237]:#[fg=colour250]#W#[fg=colour244]#F '

setw -g window-status-bell-attr bold
setw -g window-status-bell-fg colour255
setw -g window-status-bell-bg colour1


# Messages 
set -g message-attr bold
set -g message-fg colour232
set -g message-bg colour166
sm0ketst@dell-t3400:~$ sudo apt-get install rubygems

sm0ketst@dell-t3400:~$ sudo gem install tmuxinator
Fetching: thor-0.19.4.gem (100%)
Successfully installed thor-0.19.4
Fetching: erubis-2.7.0.gem (100%)
Successfully installed erubis-2.7.0
Fetching: tmuxinator-0.9.0.gem (100%)

    __________________________________________________________
    ..........................................................

    Thank you for installing tmuxinator.

    Make sure that you've set these variables in your ENV:

      $EDITOR, $SHELL

    You can run `tmuxinator doctor` to make sure everything is set.
    Happy tmuxing with tmuxinator!

    ..........................................................
    __________________________________________________________

Successfully installed tmuxinator-0.9.0
Parsing documentation for erubis-2.7.0
Installing ri documentation for erubis-2.7.0
Parsing documentation for thor-0.19.4
Installing ri documentation for thor-0.19.4
Parsing documentation for tmuxinator-0.9.0
Installing ri documentation for tmuxinator-0.9.0
Done installing documentation for erubis, thor, tmuxinator after 3 seconds
3 gems installed
sm0ketst@dell-t3400:~$
sm0ketst@dell-t3400:~$ echo "export EDITOR='vim'" >> .bash_aliases
sm0ketst@dell-t3400:~$ cat .bash_aliases
alias l='ls -laFh --color=auto'
export EDITOR='vim'
sm0ketst@dell-t3400:~$ . .bash_aliases
sm0ketst@dell-t3400:~$ echo $EDITOR
vim
sm0ketst@dell-t3400:~$
sm0ketst@dell-t3400:~$ cat .tmuxinator/dell-t3400.yml
# ~/.tmuxinator/dell-t3400.yml

name: dell-t3400
root: ~/

# Example from -> https://github.com/tmuxinator/tmuxinator
#
# Optional. tmux socket
# socket_name: foo

# Runs before everything. Use it to start daemons etc.
# pre: sudo /etc/rc.d/mysqld start

# Runs in each window and pane before window/pane specific commands. Useful for setting up interpreter versions.
# pre_window: rbenv shell 2.0.0-p247

# Pass command line options to tmux. Useful for specifying a different tmux.conf.
# tmux_options: -f ~/.tmux.mac.conf

# Change the command to call tmux.  This can be used by derivatives/wrappers like byobu.
# tmux_command: byobu

# Specifies (by name or index) which window will be selected on project startup. If not set, the first window is used.
# startup_window: logs

windows:
  - system:
#      layout: main-vertical
      layout: 42d9,317x85,0,0{177x85,0,0,0,139x85,178,0,4}
      panes:
        - glances
        - sudo su -
  - auth: multitail -i /var/log/auth.log -i /var/log/fail2ban.log
  - logs: multitail -i /var/log/messages -i /var/log/syslog
  - www:
      layout: main-vertical
      panes:
        - ssh sparkbox
        - ssh sparkbox

# sm0ketst@dell-t3400:~$ tmux list-windows
# 1: system* (3 panes) [237x65] [layout 1aae,237x65,0,0{138x65,0,0,0,98x65,139,0[98x32,139,0,4,98x32,139,33,6]}] @0 (active)
# 2: auth (1 panes) [237x65] [layout c6de,237x65,0,0,1] @1
# 3: logs (1 panes) [237x65] [layout c6df,237x65,0,0,2] @2
# 4: www- (2 panes) [237x65] [layout df01,237x65,0,0{147x65,0,0,3,89x65,148,0,5}] @3
sm0ketst@dell-t3400:~$ tmuxinator start dell-t3400
sm0ketst@latitude-6430u:~$ ssh sm0ketst@dell-t3400 -t tmux attach-session