mirror of
https://github.com/DictXiong/dotfiles.git
synced 2026-10-23 05:08:16 +08:00
Dev (#3)
* 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:
20
tools/install.sh
Executable file
20
tools/install.sh
Executable 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
41
tools/ubuntu.sh
Executable 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 $@
|
||||
Reference in New Issue
Block a user