Skip to content

Instantly share code, notes, and snippets.

@zAbuQasem
Last active November 14, 2024 22:01
Show Gist options
  • Save zAbuQasem/cbdc151a15277a96117b34b6c56934d9 to your computer and use it in GitHub Desktop.
Save zAbuQasem/cbdc151a15277a96117b34b6c56934d9 to your computer and use it in GitHub Desktop.
Configure new instance with fancy terminal
#!/bin/bash -xe
sudo apt update && sudo apt upgrade -y
sudo apt install -y zsh curl nano net-tools git ripgrep vim xclip fail2ban p7zip-full unzip dnsutils
git clone --depth 1 https://github.com/junegunn/fzf.git ~/.fzf
~/.fzf/install --all
curl https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh -o /tmp/install.sh &&
sed -i 's/CHSH=no/CHSH=yes/g' /tmp/install.sh &&
echo "Y" | sh /tmp/install.sh
sed -i 's/plugins=(git)/plugins=(git fzf)/g' ~/.zshrc
sed -i 's/ZSH_THEME="robbyrussell"/ZSH_THEME="pmcgee"/g' ~/.zshrc
sudo chmod -x /etc/update-motd.d/*
echo -e 'source <(kubectl completion zsh 2>/dev/null) 2>/dev/null\nsource <(helm completion zsh 2>/dev/null) 2>/dev/null' >> ~/.zshrc
sudo tee /etc/fail2ban/jail.local <<EOF
[DEFAULT]
ignoreip = 127.0.0.1/32
bantime = 3600
findtime = 300
maxretry = 3
banaction = iptables-multiport
backend = auto
[sshd]
enabled = true
EOF
sudo systemctl enable fail2ban
sudo systemctl start fail2ban
sudo systemctl status fail2ban
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment