Skip to content

Instantly share code, notes, and snippets.

@ksingh7
Last active August 6, 2020 11:37
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ksingh7/ce66a27d6ea8f0c6cf128c6b82d3eb3e to your computer and use it in GitHub Desktop.
Save ksingh7/ce66a27d6ea8f0c6cf128c6b82d3eb3e to your computer and use it in GitHub Desktop.
Minimalistic Screenrc File
startup_message off
vbell off
escape /
defscrollback 5000
# Enable mouse scrolling and scroll bar history scrolling
termcapinfo xterm* ti@:te@
#backtick 1 60 60 $HOME/.screenrc.acpi # .screenrc.acpi contains 1 line: acpi | awk -F ', ' '{print $2}'
# 256 colors
attrcolor b ".I"
termcapinfo xterm 'Co#256:AB=\E[48;5;%dm:AF=\E[38;5;%dm'
defbce on
hardstatus alwayslastline
hardstatus string '%{= kG}%-Lw%{= kW}%50> %n*%f %t%{= kG}%+Lw%< %{= kG}%-=%D %m/%d/%y | %C:%s %A | %1`%{-}'
screen -t shell 1 bash
screen -t shell 2 bash
screen -t shell 3 bash
screen -t shell 4 bash
screen -t shell 5 bash
screen -t shell 6 bash
select 1
@ksingh7
Copy link
Author

ksingh7 commented Mar 13, 2018

How to use

yum install -y wget screen

wget -O ~/.screenrc  https://gist.githubusercontent.com/ksingh7/ce66a27d6ea8f0c6cf128c6b82d3eb3e/raw/55a7ee5599a0d8c9bb58fbd62e01325ed93c711d/.screenrc

screen -S screen-1

Press Ctrl+a  then d  ## To Detach
screen -x screen-1   ## To Attach 

@ksingh7
Copy link
Author

ksingh7 commented Jul 24, 2018

Pdsh Setup on all nodes

sudo apt-get install pdsh ; sudo yum install -y pdsh
vim hosts
alias mypdsh="PDSH_SSH_ARGS_APPEND='-o StrictHostKeyChecking=no' PDSH_RCMD_TYPE=ssh pdsh -S -w ^hosts"
mypdsh 'hostname'

@ksingh7
Copy link
Author

ksingh7 commented Oct 17, 2019

sudo pip install pssh

vim remotehosts.txt
ceph-node1
ceph-node2
ceph-node3
ceph-node4

pssh -h remotehosts.txt  -i "uptime"
pssh -h remotehosts.txt  -i "sudo mv /etc/yum.repos.d/akopytov_sysbench.repo /etc/yum.repos.d/akopytov_sysbench.repo.old"

@ksingh7
Copy link
Author

ksingh7 commented Mar 16, 2020

  • To run in containers
- install screen in container
- exec into container
- script /dev/null
- screen -t karan

@ksingh7
Copy link
Author

ksingh7 commented Aug 6, 2020

PDSH for RHEL8 / CentOS 8

Here is steps to build and install pdsh from source:

Download latest pdsh source (say from https://code.google.com/archive/p/pdsh/downloads)
Extract pdsh-2.29.tar.bz2 file
sudo ./configure --without-rsh --with-ssh (For configure ssh)
sudo make
sudo make install
ln -s /usr/local/bin/pdsh /bin/pdsh

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