Last active
December 25, 2021 16:05
-
-
Save 5lx/3c25315cf02f7a8919d3129d57a45dc9 to your computer and use it in GitHub Desktop.
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
| # Install Software | |
| sudo yum -y update | |
| sudo yum -y groupinstall "development tools" | |
| sudo yum -y install vim wget curl htop tmux bzip2 unzip net-tools zsh util-linux-user | |
| # Add ssh keys | |
| mkdir ~/.ssh && chmod 700 ~/.ssh | |
| curl https://github.com/5lx.keys >> ~/.ssh/authorized_keys | |
| chmod 600 ~/.ssh/authorized_keys | |
| # ssh enforce | |
| echo "PermitEmptyPasswords no" | sudo tee -a /etc/ssh/sshd_config > /dev/null | |
| echo "PasswordAuthentication no" | sudo tee -a /etc/ssh/sshd_config > /dev/null | |
| echo "PermitRootLogin no" | sudo tee -a /etc/ssh/sshd_config > /dev/null | |
| sudo yum -y install fail2ban | |
| sudo cp /etc/fail2ban/fail2ban.conf /etc/fail2ban/fail2ban.local | |
| sudo cp /etc/fail2ban/jail.conf /etc/fail2ban/jail.local | |
| echo "[sshd]\nenabled = true" | sudo tee -a /etc/fail2ban/jail.local > /dev/null | |
| sudo systemctl restart sshd | |
| sudo systemctl enable fail2ban | |
| sudo systemctl start fail2ban | |
| # Hostname | |
| sudo hostnamectl set-hostname blabla | |
| # docker | |
| sudo dnf -y install dnf-plugins-core | |
| sudo dnf config-manager --add-repo https://download.docker.com/linux/fedora/docker-ce.repo | |
| sudo dnf config-manager --set-enabled docker-ce-edge | |
| sudo dnf -y install docker-ce | |
| sudo systemctl enable docker | |
| sudo systemctl start docker | |
| # tmux | |
| cd | |
| git clone https://github.com/gpakosz/.tmux.git | |
| ln -s -f .tmux/.tmux.conf | |
| cp .tmux/.tmux.conf.local . | |
| echo "set -g history-limit 100000" >> .tmux.conf.local | |
| echo "set -g mouse on" >> .tmux.conf.local | |
| # vim | |
| echo "set ttymouse=xterm2" >> .vimrc | |
| echo "set mouse=a" >> .vimrc | |
| # zsh | |
| cd | |
| sh -c "$(curl -fsSL https://raw.githubusercontent.com/robbyrussell/oh-my-zsh/master/tools/install.sh)" | |
| git clone https://github.com/zsh-users/zsh-syntax-highlighting.git \ | |
| ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-syntax-highlighting | |
| # sed -i "s/^\(ZSH_THEME\s*=\s*\).*\$/\1\"agnoster\"/" .zshrc | |
| sed -i "s/^\(plugins\s*=\s*\).*\$/\1\(\n\ \ zsh-syntax-highlighting/" .zshrc | |
| sed -i "s/^\(plugins\s*=\s*\).*\$/\1\(\n\ \ colored-man-pages/" .zshrc | |
| # conda | |
| wget https://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh | |
| bash Miniconda3-latest-Linux-x86_64.sh | |
| echo "export PATH=\"/root/.miniconda3/bin:\$PATH\"" >> .zshrc | |
| sudo reboot now |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment