Last active
April 27, 2021 17:15
-
-
Save muzea/169f61f8a5743240ecfcb9f18cedf98a to your computer and use it in GitHub Desktop.
init shell
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
case "$1" in | |
'install') | |
apt update | |
apt install git curl zsh vim htop -y | |
chsh -s $(which zsh) | |
sh -c "$(curl -fsSL https://raw.githubusercontent.com/robbyrussell/oh-my-zsh/master/tools/install.sh)" | |
;; | |
'docker') | |
apt-get update | |
apt-get install \ | |
apt-transport-https \ | |
ca-certificates \ | |
curl \ | |
gnupg2 \ | |
software-properties-common -y | |
curl -fsSL https://download.docker.com/linux/$(. /etc/os-release; echo "$ID")/gpg | apt-key add - | |
add-apt-repository \ | |
"deb [arch=amd64] https://download.docker.com/linux/$(. /etc/os-release; echo "$ID") \ | |
$(lsb_release -cs) \ | |
stable" -y | |
apt-get update | |
apt-get install docker-ce -y | |
;; | |
'config') | |
sed -i 's/ZSH_THEME="robbyrussell"/ZSH_THEME="bira"/g' ~/.zshrc | |
mkdir -p ~/.vim/colors | |
curl https://raw.githubusercontent.com/altercation/vim-colors-solarized/master/colors/solarized.vim > ~/.vim/colors/solarized.vim | |
touch ~/.vimrc | |
cat >> ~/.vimrc<<EOF | |
syntax enable | |
set background=dark | |
let g:solarized_termtrans = 1 | |
colorscheme solarized | |
EOF | |
;; | |
'ssh') | |
mkdir -p ~/.ssh | |
touch ~/.ssh/authorized_keys | |
curl https://gist.githubusercontent.com/muzea/dc3e5dad46741de9dfc36a9acb82ea08/raw/54626ac5a07de81d4e6968bc0684ee7cfc10b298/ali-hz >> ~/.ssh/authorized_keys | |
sed -i 's|^.*Port 22.*$|Port 12450|' /etc/ssh/sshd_config | |
;; | |
'ss') | |
mkdir -p /etc/go-shadowsocks2 | |
curl -L https://github.com/muzea-ci/go-shadowsocks2/releases/download/weakly-release-2021-04-26/go-shadowsocks2-linux-amd64-20210426.tar.gz > /etc/go-shadowsocks2/file.tar.gz | |
tar zxf /etc/go-shadowsocks2/file.tar.gz -C /etc/go-shadowsocks2 | |
mv /etc/go-shadowsocks2/go-shadowsocks2_linux_amd64 /usr/local/bin/go-shadowsocks2 | |
echo '#!'"/bin/bash\n\n/usr/local/bin/go-shadowsocks2 -s 'ss://AEAD_CHACHA20_POLY1305:your-password@:8488'" > /etc/go-shadowsocks2/start.sh | |
chmod +x /etc/go-shadowsocks2/start.sh | |
curl https://raw.githubusercontent.com/muzea-ci/go-shadowsocks2/master/init.sh > /etc/init.d/go-shadowsocks2 | |
chmod +x /etc/init.d/go-shadowsocks2 | |
;; | |
*) | |
echo ':D' | |
;; | |
esac |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment