* .gitconfig; tools/alpine.sh; mkdir -p when install; restruct ubuntu.sh

* spelling

* tpm requires make; set-tz; lemonbench

* ANTIGEN_EXCLUDE

* dfs force-update
This commit is contained in:
2022-05-22 00:53:55 +08:00
committed by GitHub
parent d5bf057e65
commit c8cf824e62
6 changed files with 100 additions and 29 deletions

47
tools/alpine.sh Executable file
View File

@@ -0,0 +1,47 @@
#!/bin/bash
if [[ $USER != "root" ]]; then
echo "must run as root!"
exit 1
fi
set_mirror()
{
#MIRROR=${1:="mirrors.tuna.tsinghua.edu.cn"}
#MIRROR=${MIRROR//\//\\\/}
#sed -i 's/(archive|security).ubuntu.com/${MIRROR}/g' /etc/apt/sources.list
echo "to-do ..."
}
apk_add()
{
apk update
# mass installation
apk add zsh git tmux vim curl wget bash python3 htop gcc g++ cmake make fzf perl linux-headers bind-tools iputils man-db
#for i in {fzf,ripgrep}; do apk add $i -y; done
# who am i
git config --global user.email "me@beardic.cn"
git config --global user.name "Dict Xiong"
}
set_timezone()
{
apk update
apk add tzdata
cp /usr/share/zoneinfo/Asia/Shanghai /etc/localtime
echo "Asia/Shanghai" > /etc/timezone
}
router()
{
case $1 in
apk-add ) apk_add ;;
set-timezone | set-tz ) set_timezone ;;
#set-mirror ) set_mirror $2 ;;
* ) echo unknown command "$1". available: apk-add, set-timezone;;
esac
}
router $@

View File

@@ -10,6 +10,7 @@ install_commands=(\
[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' \
[lemonbench]='curl -fsSL https://ilemonra.in/LemonBenchIntl | bash -s fast # or full' \
)
install()

View File

@@ -5,36 +5,43 @@ if [[ $USER != "root" ]]; then
exit 1
fi
init()
set_mirror()
{
MIRROR=${1:-"mirrors.tuna.tsinghua.edu.cn"}
MIRROR=${MIRROR//\//\\\/}
sed -i 's/(archive|security).ubuntu.com/${MIRROR}/g' /etc/apt/sources.list
}
apt_install()
{
# 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
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 make
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"
}
set_timezone()
{
TIMEZONE=${1:-"Asia/Shanghai"}
timedatectl set-timezone "$TIMEZONE"
}
router()
{
case $1 in
init ) init ;;
* ) echo unknown command "$1". available: init ;;
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
}