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 | |
| yum -y update | |
| yum -y groupinstall "development tools" | |
| yum -y install vim wget curl htop tmux bzip2 unzip net-tools zsh util-linux-user | |
| # Add ssh keys | |
| mkdir /root/.ssh && chmod 700 /root/.ssh | |
| curl https://github.com/5lx.keys >> /root/.ssh/authorized_keys | |
| chmod 600 /root/.ssh/authorized_keys | |
| # ssh enforce | |
| echo "PermitEmptyPasswords no" >> /etc/ssh/sshd_config | |
| echo "PasswordAuthentication no" >> /etc/ssh/sshd_config | |
| yum -y install fail2ban | |
| cp /etc/fail2ban/fail2ban.conf /etc/fail2ban/fail2ban.local | |
| cp /etc/fail2ban/jail.conf /etc/fail2ban/jail.local | |
| echo "[sshd]\nenabled = true" >> /etc/fail2ban/jail.local | |
| systemctl restart sshd | |
| systemctl enable fail2ban | |
| systemctl start fail2ban | |
| # docker | |
| dnf -y install dnf-plugins-core | |
| dnf config-manager --add-repo https://download.docker.com/linux/fedora/docker-ce.repo | |
| dnf config-manager --set-enabled docker-ce-edge | |
| dnf -y install docker-ce | |
| systemctl enable docker | |
| 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 | |
| reboot now |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment