Last active
March 29, 2024 09:29
-
-
Save zhao-ji/10cda56982f52852d753679016f2e6d5 to your computer and use it in GitHub Desktop.
Initialize a new host
This file contains 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
# Copy public key into .ssh/unthorized_keys | |
# config locales to en.US-utf-8 and zh, set c.UTF-8 as default locale | |
sudo dpkg-reconfigure locales | |
# set timezone | |
sudo timedatectl set-timezone Pacific/Auckland | |
# add swap file: https://www.digitalocean.com/community/tutorials/how-to-add-swap-space-on-debian-11 | |
# add disk as db data folder: https://www.digitalocean.com/community/tutorials/how-to-partition-and-format-storage-devices-in-linux | |
# testing the disk io and throughout | |
curl -sL yabs.sh | bash -s -- -i -g | |
# testing disk latency | |
ioping -c 100 . | |
# install zsh/git | |
sudo apt update | |
sudo apt install zsh git neofetch | |
#installing oh-my-zsh | |
sh -c "$(curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)" | |
# set oh-my-zsh as default shell | |
chsh -s $(which zsh) | |
# installing go on debian x86-amd64 | |
wget https://go.dev/dl/go1.19.5.linux-amd64.tar.gz | |
rm -rf /usr/local/go && sudo tar -C /usr/local -xzf go1.19.5.linux-amd64.tar.gz | |
echo 'export PATH=$PATH:/usr/local/go/bin' >> .profile | |
# we have to set GOPATH, otherwise we can not use vim-go | |
echo 'export GOPATH=$HOME/go/bin' >> .profile | |
source .profile | |
go version | |
# installing vim-go | |
git clone https://github.com/fatih/vim-go.git ~/.vim/pack/plugins/start/vim-go | |
# install gcc for building go-vim | |
apt-get install build-essential | |
# after installed, execute in vim: :GoInstallBinaries | |
# zsh plugins | |
sudo apt-get install ripgrep | |
sudo apt-get install autojump |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment