Last active
August 29, 2019 20:49
-
-
Save nrvale0/831f91a8d556ce2d254ccd720ac503c8 to your computer and use it in GitHub Desktop.
setup RHEL debugging enviroment
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/bash | |
[ ! -n "$DEBUG" ] || set -x | |
set -ue | |
function onerr { | |
echo 'Cleaning up after error...' | |
exit -1 | |
} | |
trap onerr ERR | |
function packages() { | |
echo 'Installing packages useful for debugging...' | |
(set -x; | |
yum install -y oracle-epel-release-el7.x86_64 && \ | |
/usr/bin/ol_yum_configure.sh && \ | |
sed -i -e 's/enabled=0/enabled=1/g' /etc/yum.repos.d/oracle-epel-ol7.repo && \ | |
yum makecache && \ | |
yum group install -y 'development tools' && \ | |
yum install -y python-devel python-pip && \ | |
yum install -y dstat tmux mosh htop iperf3 && \ | |
pip install httpie && \ | |
pip install glances) | |
} | |
function tmux() { | |
echo 'Dropping a sane tmux config...' | |
cat <<EOF | tee ~/.tmux.conf | |
set -g default-terminal "screen-256color" | |
set -g status-bg colour39 | |
set -g display-panes-time 2000 | |
bind -n C-o display-pane | |
bind -n M-x command-prompt | |
bind D source-file ~/.tmux-dashboard.conf | |
EOF | |
echo 'Dropping a "dashboard" tmux config...' | |
cat <<EOF | tee ~/.tmux-dashboard.conf | |
selectp -t 0 | |
splitw -v -p 50 'dstat -lcids --fs --tcp' | |
selectp -t 0 | |
splitw -h -p 50 'glances' | |
selectp -t 2 | |
splitw -h -p 50 'htop' | |
selectp -t 0 | |
EOF | |
} | |
function main () { | |
packages | |
tmux | |
} | |
main |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment