Skip to content

Instantly share code, notes, and snippets.

@MutoMagic
Last active June 21, 2024 08:42
Show Gist options
  • Save MutoMagic/26780f74d87829f260ef7d823e05c982 to your computer and use it in GitHub Desktop.
Save MutoMagic/26780f74d87829f260ef7d823e05c982 to your computer and use it in GitHub Desktop.
云初始化脚本
#!/bin/bash -e
# bash <(curl -L https://gist.githubusercontent.com/MutoMagic/26780f74d87829f260ef7d823e05c982/raw/debian.sh)
sudo -E apt-get -qq update
sudo -E apt-get -qq install git vim
sudo -E apt-get -qq dist-upgrade
sudo -E apt-get -qq autoremove --purge
sudo -E apt-get -qq clean
# 禁用22开放1024能有效预防小穴生对着默认端口暴力输出
echo "Port 1024
Port 22" | sudo tee /etc/ssh/sshd_config.d/_.conf
sudo systemctl restart sshd
# 最常用的别名和预设环境变量
echo "#!/bin/sh
alias lm='ls --color=auto'
alias ll='lm -l'
alias la='lm -a'
alias l='lm -la'
alias py3='python3'
export PATH=/opt:\\
\$PATH" | sudo tee /etc/profile.d/_.sh
# 这位的vimrc对瞎眼客户端很有疗效,建议长期服用。
bash <(curl -L https://gist.githubusercontent.com/MutoMagic/771a947dd50d0029dcc7c83cafab19ba/raw/install_basic_vimrc.sh)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment