Collection of shell and bash snippets.
# Disable exit on non 0. Continue if script fails
set +e
#Enable exit on non 0. Stop if script fails
set -e
# Helps debug code as it executes
set -xv
# open a .bz2 file
bzip2 -dc my_file.tar.bz2 | tar xvf -
mkdir helm
tar -zxvf helm-v3.8.1-linux-amd64.tar.gz -C helm --strip-components=1
echo -e "linuxpassword\nlinuxpassword" | passwd linuxuser
for ((i=1;i<=100;i++)); do \
ssh 192.168.1.10$i 'echo -e "linuxpassword\nlinuxpassword" | passwd linuxuser'; \
done;
useradd newuser; echo -e "passwdofuser\npasswdofuser" | passwd newuser