mirror of
https://github.com/DictXiong/dotfiles.git
synced 2025-07-03 06:00:30 +08:00
* common.sh: arg parse init * bug fix * bug fix * bug fix. now common.sh won't parse arg autoly * improve git-branches * improve git-branches; util-linux * accelerate ci * improve gbes; PARSE_ARG_RET * ci: fix gbes * ssh: add key ltp1.bd * Revert "ssh: add key ltp1.bd" This reverts commit c2433a05499203b0da530a902e51a44e4ae1b4ca. * install column; apt -> apt-get Co-authored-by: xiongdian.me <xiongdian.me@bytedance.com>
42 lines
1.1 KiB
Bash
Executable File
42 lines
1.1 KiB
Bash
Executable File
#!/bin/bash
|
|
|
|
set -e
|
|
|
|
set_mirror()
|
|
{
|
|
MIRROR=${1:-"mirrors.tuna.tsinghua.edu.cn"}
|
|
MIRROR=${MIRROR//\//\\\/}
|
|
sed -i "s@http://.*archive.ubuntu.com@https://${MIRROR}@g" /etc/apt/sources.list
|
|
sed -i "s@http://.*security.ubuntu.com@https://${MIRROR}@g" /etc/apt/sources.list
|
|
}
|
|
|
|
apt_install()
|
|
{
|
|
# basic packages
|
|
apt-get update
|
|
for i in {man-db,vim,ca-certificates}; do apt-get install $i -y; done
|
|
|
|
# mass installation
|
|
apt-get 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 make zip less bsdmainutils
|
|
for i in {fzf,ripgrep}; do apt-get install $i -y; done
|
|
}
|
|
|
|
set_timezone()
|
|
{
|
|
TIMEZONE=${1:-"Asia/Shanghai"}
|
|
timedatectl set-timezone "$TIMEZONE"
|
|
}
|
|
|
|
router()
|
|
{
|
|
case $1 in
|
|
apt-install ) apt_install ;;
|
|
set-mirror ) set_mirror $2 ;;
|
|
set-timezone\
|
|
| set-tz ) set_timezone $2 ;;
|
|
* ) echo unknown command "$1". available: apt-install, set-mirror, set-timezone;;
|
|
esac
|
|
}
|
|
|
|
router $@
|