* init tools tools/ubuntu.sh

* init tools/install.sh and adding ssh to tools/ubuntu.sh

* more in tools/install.sh; .tmux.conf

* ping alias

* tmux customization; tpm auto install; zsh key binding for HOME and END; .gitignore .zwc

* ubuntu.sh: gcc g++ cmake
This commit is contained in:
2022-05-20 17:34:21 +08:00
committed by GitHub
parent 80057e06e9
commit ada575bb9b
6 changed files with 135 additions and 1 deletions

20
tools/install.sh Executable file
View File

@@ -0,0 +1,20 @@
#!/bin/bash
declare -A install_commands
install_commands=(\
[git]="apt update && apt install git" \
[fzf]="git clone --depth 1 https://github.com/junegunn/fzf.git ~/.fzf && ~/.fzf/install" \
[acme.sh]="curl https://get.acme.sh | sh -s email=${EMAIL:-me@beardic.cn}" \
[oh-my-zsh]='sh -c "$(curl -fsSL https://raw.github.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"' \
[oh-my-tuna]='wget https://tuna.moe/oh-my-tuna/oh-my-tuna.py && sudo python oh-my-tuna.py --global' \
[v2ray]="bash <(curl -L https://raw.githubusercontent.com/v2fly/fhs-install-v2ray/master/install-release.sh) #--remove" \
[zerotier-one]='curl -s https://install.zerotier.com | sudo bash' \
[docker-ce]='curl -fsSL https://get.docker.com -o get-docker.sh && sudo sh get-docker.sh #--mirror Aliyun #--dry-run' \
)
install()
{
echo -e ${install_commands[$1]}
}
install $1

41
tools/ubuntu.sh Executable file
View File

@@ -0,0 +1,41 @@
#!/bin/bash
if [[ $USER != "root" ]]; then
echo "must run as root!"
exit 1
fi
init()
{
# basic packages
apt update
for i in {man-db,vim,ca-certificates}; do apt install $i -y; done
# apt source
${MIRROR:="mirrors.tuna.tsinghua.edu.cn"}
MIRROR=${MIRROR//\//\\\/}
sed -i 's/(archive|security).ubuntu.com/${MIRROR}/g' /etc/apt/sources.list
# mass installation
apt update
apt install git tmux zsh curl wget dialog net-tools dnsutils netcat traceroute sudo python3 python3-pip cron inetutils-ping openssh-client openssh-server htop gcc g++ cmake
for i in {fzf,ripgrep}; do apt install $i -y; done
# custom dotfiles (usually not needed)
mkdir -p ~/.ssh
# cd ~ && git clone https://gitee.com/dictxiong/dotfiles && ./dotfiles/install.sh
# who am i
git config --global user.email "me@beardic.cn"
git config --global user.name "Dict Xiong"
}
router()
{
case $1 in
init ) init ;;
* ) echo unknown command "$1". available: init ;;
esac
}
router $@