Skip to content

Instantly share code, notes, and snippets.

@IoTeacher
Last active February 16, 2026 05:01
Show Gist options
  • Select an option

  • Save IoTeacher/33fe0e0248088ce2e340bda13854cc00 to your computer and use it in GitHub Desktop.

Select an option

Save IoTeacher/33fe0e0248088ce2e340bda13854cc00 to your computer and use it in GitHub Desktop.
TMUX config para AWS Academy – Ubuntu Server
image

Vamos a crear una configuración tmux profesional para un entorno AWS Academy – Ubuntu Server, optimizada para:

  • 🖥️ Servidor remoto (SSH)
  • ⚡ Bajo consumo de recursos
  • 🧠 Flujo de desarrollo backend / cloud
  • 🔐 Trabajo frecuente con múltiples sesiones
  • 🚫 Sin dependencias pesadas de macOS
  • ✅ Compatible con Ubuntu 20.04 / 22.04
  • ✅ Funciona incluso sin entorno gráfico

🚀 TMUX PRO – AWS Academy (Ubuntu Server)

Reemplaza tu ~/.tmux.conf completo con esto:

##### ════════════════════════════════════════════════
#####  TMUX PRO - AWS Academy Ubuntu Server
#####  Optimizado para desarrollo remoto por SSH
##### ════════════════════════════════════════════════


##### ─── RENDIMIENTO ──────────────────────────────

# Respuesta inmediata
set -sg escape-time 0

# Historial amplio (logs largos)
set -g history-limit 100000

# Mejor compatibilidad en SSH
set -g default-terminal "screen-256color"

# Evita errores si el cliente no soporta RGB
set -as terminal-overrides ",*:Tc"

# Clipboard solo si está disponible
set -g set-clipboard off


##### ─── PREFIJO ──────────────────────────────────

unbind C-b
set -g prefix C-a
bind C-a send-prefix

# Recargar configuración
bind r source-file ~/.tmux.conf \; display-message "Configuración recargada ✔"


##### ─── ÍNDICES MÁS NATURALES ────────────────────

set -g base-index 1
setw -g pane-base-index 1
set -g renumber-windows on


##### ─── NAVEGACIÓN TIPO VIM ──────────────────────

setw -g mode-keys vi

# Divisiones conservando ruta actual
bind | split-window -h -c "#{pane_current_path}"
bind - split-window -v -c "#{pane_current_path}"

# Movimiento entre paneles
bind h select-pane -L
bind j select-pane -D
bind k select-pane -U
bind l select-pane -R

# Redimensionar
bind -r H resize-pane -L 5
bind -r J resize-pane -D 5
bind -r K resize-pane -U 5
bind -r L resize-pane -R 5


##### ─── SESIONES INTELIGENTES ────────────────────

# Cambiar sesión rápidamente
bind s choose-session

# Crear nueva sesión
bind n command-prompt -p "Nombre sesión:" "new-session -s '%%'"

# Matar sesión actual
bind X kill-session


##### ─── MODO COPIA MEJORADO ──────────────────────

bind -T copy-mode-vi v send -X begin-selection
bind -T copy-mode-vi y send -X copy-selection-and-cancel


##### ─── ESTILO SERVIDOR (Minimalista Profesional) ─

set -g status-position top
set -g status-interval 5

# Colores sobrios (bajo consumo visual)
set -g status-style bg=black,fg=green
set -g window-status-style fg=white,bg=black
set -g window-status-current-style fg=black,bg=green,bold

# Panel activo resaltado
set -g pane-border-style fg=colour238
set -g pane-active-border-style fg=green

# Lado izquierdo: sesión
set -g status-left-length 40
set -g status-left "#[bold] #S "

# Lado derecho: carga CPU + hora + usuario@host
set -g status-right-length 100
set -g status-right "#(uptime | awk -F'load average:' '{print $2}') %H:%M %u@#H"


##### ─── SEGURIDAD & SSH ──────────────────────────

# Evita cerrar tmux si se cae SSH
set -g detach-on-destroy off

# Mantiene sesión activa
set -g remain-on-exit on


##### ════════════════════════════════════════════════
##### FIN
##### ════════════════════════════════════════════════

📦 Instalación en Ubuntu (si no tienes tmux)

sudo apt update
sudo apt install tmux -y

Verifica versión:

tmux -V

🧠 Flujo recomendado en AWS Academy

Cuando entres por SSH:

ssh usuario@ip-servidor
tmux new -s dev

O adjuntarte si ya existe:

tmux attach -t dev

🔥 Layout recomendado para desarrollo cloud

Divide en 3 paneles:

|  Código (vim/nvim) | Logs |
|--------------------|------|
| Terminal backend   |

Comandos:

Ctrl-a |
Ctrl-a -

🛠 Si trabajas con:

  • Node → un panel para npm run dev
  • Python → uno para uvicorn / django
  • Docker → uno para docker logs -f
  • AWS CLI → uno exclusivo para comandos cloud

@IoTeacher

IoTeacher commented Feb 16, 2026

Copy link
Copy Markdown
Author

🚀 TMUX AWS PRO – Cloud Engineer Edition

Vamos a subir el nivel a AWS PRO real, pensado para:

  • 🧠 DevOps / Cloud Engineer
  • 🐳 Docker / Containers
  • ☸️ Kubernetes
  • 🚀 CI/CD
  • 📊 Monitoreo en vivo
  • 🔐 Servidores productivos
  • ⚡ Instancias pequeñas (t3.micro incluidas)
  • 🌍 Trabajo intensivo por SSH

Esta config está optimizada para Ubuntu Server en AWS, con enfoque profesional.


🚀 TMUX AWS PRO – Cloud Engineer Edition

Reemplaza tu ~/.tmux.conf completo:

##### ════════════════════════════════════════════════
#####   TMUX AWS PRO – Cloud / DevOps Edition
#####   Ubuntu Server | SSH | Docker | K8s | CI/CD
##### ════════════════════════════════════════════════


##### ─── PERFORMANCE (Optimizado para EC2) ───────

set -sg escape-time 0
set -g history-limit 150000
set -g focus-events off
set -g assume-paste-time 1
set -g set-clipboard off
set -g default-terminal "screen-256color"

# Mantener sesión viva si SSH cae
set -g detach-on-destroy off
set -g remain-on-exit on


##### ─── PREFIX PROFESIONAL ───────────────────────

unbind C-b
set -g prefix C-a
bind C-a send-prefix

bind r source-file ~/.tmux.conf \; display-message "AWS PRO Config Recargada ✔"


##### ─── INDEXACIÓN LIMPIA ────────────────────────

set -g base-index 1
setw -g pane-base-index 1
set -g renumber-windows on


##### ─── NAVEGACIÓN VIM ───────────────────────────

setw -g mode-keys vi

bind | split-window -h -c "#{pane_current_path}"
bind - split-window -v -c "#{pane_current_path}"

bind h select-pane -L
bind j select-pane -D
bind k select-pane -U
bind l select-pane -R

bind -r H resize-pane -L 5
bind -r J resize-pane -D 5
bind -r K resize-pane -U 5
bind -r L resize-pane -R 5


##### ─── WORKSPACES CLOUD ─────────────────────────

# Sesión rápida tipo "dev"
bind d new-session -s dev

# Sesión rápida tipo "prod"
bind p new-session -s prod

# Selector interactivo
bind s choose-session


##### ─── LAYOUTS AUTOMÁTICOS ──────────────────────

# Layout backend típico (editor + logs + shell)
bind b \
new-window -n backend \; \
split-window -h \; \
split-window -v -t 1 \; \
select-pane -t 1

# Layout Docker monitoring
bind D \
new-window -n docker \; \
split-window -v \; \
send-keys "docker ps" C-m \; \
select-pane -t 2 \; \
send-keys "docker stats" C-m


##### ─── STATUS BAR CLOUD INTELIGENTE ─────────────

set -g status-position top
set -g status-interval 3

set -g status-style bg=black,fg=green
set -g window-status-current-style fg=black,bg=green,bold

set -g pane-border-style fg=colour238
set -g pane-active-border-style fg=green

set -g status-left-length 40
set -g status-left "#[bold] #S "

# CPU + RAM + Load + Hora + Host
set -g status-right-length 120
set -g status-right "\
CPU:#(top -bn1 | grep 'Cpu(s)' | awk '{print $2}')% \
RAM:#(free -m | awk '/Mem:/ {print int($3/$2*100)}')% \
Load:#(uptime | awk -F'load average:' '{print $2}') \
%H:%M #H"


##### ─── MODO COPIA AVANZADO ──────────────────────

bind -T copy-mode-vi v send -X begin-selection
bind -T copy-mode-vi y send -X copy-selection-and-cancel
bind -T copy-mode-vi r send -X rectangle-toggle


##### ─── SEGURIDAD SERVIDOR ───────────────────────

# No cerrar ventana si proceso termina (útil para debugging)
set -g remain-on-exit on

# Evita errores visuales por conexiones lentas
set -g visual-activity off
set -g visual-bell off


##### ════════════════════════════════════════════════
##### FIN AWS PRO
##### ════════════════════════════════════════════════

🧠 Qué hace esta versión PRO

✔ Mantiene sesiones aunque se caiga SSH
✔ Monitoreo CPU/RAM en barra superior
✔ Layout automático para backend
✔ Layout automático para Docker
✔ Optimizado para EC2 pequeñas
✔ Navegación ultra rápida
✔ Ideal para labs AWS Academy


🏗 Flujo Profesional Recomendado

Cuando entras por SSH:

tmux attach -t dev || tmux new -s dev

Crear entorno backend automático:

Ctrl-a b

Crear entorno Docker monitor:

Ctrl-a D

🔥 Nivel AWS PRO+

Si quieres lo llevamos aún más arriba:

  • ☸️ Layout automático para Kubernetes (kubectl get pods -w)
  • 📦 Integración con Git (branch actual en status bar)
  • 🚀 Sessionizer automático por proyecto
  • 🧠 Config tipo SRE con monitoreo avanzado
  • 🔐 Config hardened para producción real
  • 📊 Monitor estilo htop embebido

@IoTeacher

Copy link
Copy Markdown
Author

🔥 TMUX AWS PRO+ – SRE / DevOps Elite

Ahora entramos en AWS PRO+ – Nivel SRE / Cloud Engineer real.

Esto ya no es solo tmux bonito.
Es orquestación de entorno cloud desde SSH, optimizado para:

  • ☸️ Kubernetes
  • 🐳 Docker
  • 🚀 CI/CD
  • 📊 Monitoreo continuo
  • 🔐 Producción real
  • 🧠 Trabajo multi-proyecto
  • ⚡ EC2 pequeñas (t3.micro incluidas)
  • 🌍 Operación remota 100%

🔥 TMUX AWS PRO+ – SRE / DevOps Elite

Reemplaza COMPLETO tu ~/.tmux.conf con esto:

##### ════════════════════════════════════════════════
#####   TMUX AWS PRO+ – SRE / DevOps Elite Edition
#####   Ubuntu Server | Kubernetes | Docker | CI/CD
##### ════════════════════════════════════════════════


##### ─── RENDIMIENTO OPTIMIZADO EC2 ───────────────

set -sg escape-time 0
set -g history-limit 200000
set -g focus-events off
set -g assume-paste-time 1
set -g set-clipboard off
set -g default-terminal "screen-256color"

set -g detach-on-destroy off
set -g remain-on-exit on
set -g visual-activity off
set -g visual-bell off


##### ─── PREFIJO PROFESIONAL ───────────────────────

unbind C-b
set -g prefix C-a
bind C-a send-prefix
bind r source-file ~/.tmux.conf \; display-message "AWS PRO+ Recargado ✔"


##### ─── INDEXACIÓN LIMPIA ─────────────────────────

set -g base-index 1
setw -g pane-base-index 1
set -g renumber-windows on


##### ─── NAVEGACIÓN TIPO VIM ───────────────────────

setw -g mode-keys vi

bind | split-window -h -c "#{pane_current_path}"
bind - split-window -v -c "#{pane_current_path}"

bind h select-pane -L
bind j select-pane -D
bind k select-pane -U
bind l select-pane -R

bind -r H resize-pane -L 5
bind -r J resize-pane -D 5
bind -r K resize-pane -U 5
bind -r L resize-pane -R 5


##### ─── SESSIONIZER AUTOMÁTICO POR PROYECTO ──────

# Lanzar selector de carpetas tipo "ThePrimeagen"
bind f run-shell "find ~/ -maxdepth 2 -type d | fzf | xargs -I {} tmux new-session -ds $(basename {}) -c {} \; switch-client -t $(basename {})"


##### ─── LAYOUT BACKEND PRO ────────────────────────

bind b \
new-window -n backend \; \
split-window -h -c "#{pane_current_path}" \; \
split-window -v -c "#{pane_current_path}" \; \
select-pane -t 1


##### ─── DOCKER MONITORING WINDOW ─────────────────

bind D \
new-window -n docker \; \
split-window -v \; \
send-keys "docker ps" C-m \; \
select-pane -t 2 \; \
send-keys "docker stats" C-m


##### ─── KUBERNETES CONTROL CENTER ────────────────

bind K \
new-window -n k8s \; \
split-window -h \; \
split-window -v -t 1 \; \
send-keys "kubectl get pods -A" C-m \; \
select-pane -t 2 \; \
send-keys "kubectl get svc -A" C-m \; \
select-pane -t 3 \; \
send-keys "kubectl get nodes" C-m


##### ─── CI/CD WATCH MODE ─────────────────────────

bind C \
new-window -n cicd \; \
split-window -v \; \
send-keys "tail -f /var/log/syslog" C-m


##### ─── STATUS BAR SRE INTELIGENTE ───────────────

set -g status-position top
set -g status-interval 3

set -g status-style bg=black,fg=green
set -g window-status-current-style fg=black,bg=green,bold

set -g pane-border-style fg=colour238
set -g pane-active-border-style fg=green

set -g status-left "#[bold] #S "

set -g status-right-length 200
set -g status-right "\
CPU:#(top -bn1 | grep 'Cpu(s)' | awk '{print $2}')% \
RAM:#(free -m | awk '/Mem:/ {print int($3/$2*100)}')% \
Load:#(uptime | awk -F'load average:' '{print $2}') \
Git:#(git rev-parse --abbrev-ref HEAD 2>/dev/null) \
%H:%M #H"


##### ─── MODO COPIA PRO ───────────────────────────

bind -T copy-mode-vi v send -X begin-selection
bind -T copy-mode-vi y send -X copy-selection-and-cancel
bind -T copy-mode-vi r send -X rectangle-toggle


##### ════════════════════════════════════════════════
##### FIN AWS PRO+
##### ════════════════════════════════════════════════

🧠 Qué hace esta versión PRO+

🚀 Sessionizer automático (Ctrl-a f)

Seleccionas proyecto → crea sesión con ese nombre.


🐳 Docker Center (Ctrl-a D)

Panel superior: docker ps
Panel inferior: docker stats


☸️ Kubernetes Control (Ctrl-a K)

Panel 1: Pods
Panel 2: Services
Panel 3: Nodes

Perfecto para labs EKS o clusters reales.


🔥 Backend Layout (Ctrl-a b)

Editor + logs + shell.


📊 Status Bar inteligente

Muestra:

  • CPU %
  • RAM %
  • Load average
  • Branch Git actual
  • Hora
  • Host

Todo sin plugins pesados.


📦 Requisitos recomendados

sudo apt install fzf git -y

Opcional para K8s:

sudo snap install kubectl --classic

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment