Last active
November 14, 2024 22:01
-
-
Save zAbuQasem/cbdc151a15277a96117b34b6c56934d9 to your computer and use it in GitHub Desktop.
Configure new instance with fancy terminal
This file contains hidden or 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 -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