2023-07-26 21:18:24 +08:00
|
|
|
#!/usr/bin/env bash
|
2022-08-26 20:43:00 +08:00
|
|
|
set -e
|
2022-12-03 20:37:20 +08:00
|
|
|
THIS_DIR=$( cd "$( dirname "${BASH_SOURCE[0]:-${(%):-%x}}" )" && pwd )
|
|
|
|
source "$THIS_DIR/common.sh"
|
2022-05-20 17:34:21 +08:00
|
|
|
|
2022-05-22 00:53:55 +08:00
|
|
|
set_mirror()
|
|
|
|
{
|
|
|
|
MIRROR=${1:-"mirrors.tuna.tsinghua.edu.cn"}
|
2022-11-05 19:45:21 +08:00
|
|
|
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
|
2022-05-22 00:53:55 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
apt_install()
|
2022-05-20 17:34:21 +08:00
|
|
|
{
|
2022-12-03 20:37:20 +08:00
|
|
|
apt-get update -y
|
|
|
|
# lite
|
[dev] refactor riot; improve tmux and vim; more plugins; more aliases (#43)
* riot: remove unknown domain warn
* install.sh: --no-ssh -> --no-auth-info
* doll: --restart=unless-stopped
* zshrc: alias cps and mvs
* riot: proxy -> ssh
* zshrc: not alias rm to trash
* (trial) riot devel: separate preset to config dir riot.d
* riot: support extra options and extra -o options
* (experimental) riot config in a single file
* riot config: add nasp remote and null domain
* gitconf: pull.ff = only
* fix ci
* riot: dynamic port forwarding
* riot: only one domain func will be exec
* to-install: update lemonbench
* to-install: alist
* [exp] riot inferred ssh: ping ping6
* sagt: fix nixos
* riot config: domain 42
* ubuntu.sh: DEBIAN_FRONTEND=noninteractive
* zshrc: ping -n
* zshrc: alias ping -n
* riot-config: jumpserver from sir0 to ssh.beardic.cn
* zshrc: alias ping before checking os type
* frigg: support api4.beardic.cn
* fix(install.sh): crontab fails on a new server
* fix(riot-conf): nasp.ob.ac.cn -> nasp.fit
* fix(install.sh): install crontab (exp)
* feat(test.zsh): test crontab
* fix(riot): secure control master
* fix(ci): riot control master
* fix(riot): not mkdir if dry-run
* feat(vimrc): set shiftwidth=4
* feat(ci): sync tmux-yank
* feat(tmux): set-clipboard on and mouse on (experimental)
* feat(zshrc): alias ping6
* build(ci): hub mirror 1.3->1.4
* fix(zshrc): tmux on msys; feat(common): better perf getting os type and linux dist
* fix(common.sh): get_os_type and get_linux_dist
* feat(zshrc): add plugin {magic-enter,per-directory-history,pip,podman,python,rsync,systemd,timer}
* feat(zshrc): journalctl alias
* feat(vimrc): tab=2 for c,cpp,nix,yaml
* build(ci): checkout v3 -> v4
---------
Co-authored-by: xiongdian.me <xiongdian.me@bytedance.com>
2024-05-05 12:02:55 +08:00
|
|
|
DEBIAN_FRONTEND=noninteractive apt-get install -y git zsh bash tmux vim curl iputils-ping less bsdmainutils
|
2022-12-03 20:37:20 +08:00
|
|
|
# full
|
2023-01-06 16:14:41 +08:00
|
|
|
if [[ -z "$DFS_LITE" || "$DFS_LITE" == "0" ]]; then
|
[dev] refactor riot; improve tmux and vim; more plugins; more aliases (#43)
* riot: remove unknown domain warn
* install.sh: --no-ssh -> --no-auth-info
* doll: --restart=unless-stopped
* zshrc: alias cps and mvs
* riot: proxy -> ssh
* zshrc: not alias rm to trash
* (trial) riot devel: separate preset to config dir riot.d
* riot: support extra options and extra -o options
* (experimental) riot config in a single file
* riot config: add nasp remote and null domain
* gitconf: pull.ff = only
* fix ci
* riot: dynamic port forwarding
* riot: only one domain func will be exec
* to-install: update lemonbench
* to-install: alist
* [exp] riot inferred ssh: ping ping6
* sagt: fix nixos
* riot config: domain 42
* ubuntu.sh: DEBIAN_FRONTEND=noninteractive
* zshrc: ping -n
* zshrc: alias ping -n
* riot-config: jumpserver from sir0 to ssh.beardic.cn
* zshrc: alias ping before checking os type
* frigg: support api4.beardic.cn
* fix(install.sh): crontab fails on a new server
* fix(riot-conf): nasp.ob.ac.cn -> nasp.fit
* fix(install.sh): install crontab (exp)
* feat(test.zsh): test crontab
* fix(riot): secure control master
* fix(ci): riot control master
* fix(riot): not mkdir if dry-run
* feat(vimrc): set shiftwidth=4
* feat(ci): sync tmux-yank
* feat(tmux): set-clipboard on and mouse on (experimental)
* feat(zshrc): alias ping6
* build(ci): hub mirror 1.3->1.4
* fix(zshrc): tmux on msys; feat(common): better perf getting os type and linux dist
* fix(common.sh): get_os_type and get_linux_dist
* feat(zshrc): add plugin {magic-enter,per-directory-history,pip,podman,python,rsync,systemd,timer}
* feat(zshrc): journalctl alias
* feat(vimrc): tab=2 for c,cpp,nix,yaml
* build(ci): checkout v3 -> v4
---------
Co-authored-by: xiongdian.me <xiongdian.me@bytedance.com>
2024-05-05 12:02:55 +08:00
|
|
|
DEBIAN_FRONTEND=noninteractive apt-get install -y wget dialog net-tools dnsutils netcat traceroute sudo python3 python3-pip cron openssh-client openssh-server htop gcc g++ cmake make zip
|
|
|
|
for i in {fzf,ripgrep,man-db}; do DEBIAN_FRONTEND=noninteractive apt-get install -y $i; done
|
2022-12-03 20:37:20 +08:00
|
|
|
fi
|
2022-05-20 17:34:21 +08:00
|
|
|
}
|
|
|
|
|
2022-05-22 00:53:55 +08:00
|
|
|
set_timezone()
|
|
|
|
{
|
|
|
|
TIMEZONE=${1:-"Asia/Shanghai"}
|
|
|
|
timedatectl set-timezone "$TIMEZONE"
|
|
|
|
}
|
|
|
|
|
2022-05-20 17:34:21 +08:00
|
|
|
router()
|
|
|
|
{
|
|
|
|
case $1 in
|
2022-05-22 00:53:55 +08:00
|
|
|
apt-install ) apt_install ;;
|
|
|
|
set-mirror ) set_mirror $2 ;;
|
|
|
|
set-timezone\
|
|
|
|
| set-tz ) set_timezone $2 ;;
|
2023-01-06 16:14:41 +08:00
|
|
|
* ) echo unknown command \"$1\". available: apt-install, set-mirror, set-timezone;;
|
2022-05-20 17:34:21 +08:00
|
|
|
esac
|
|
|
|
}
|
|
|
|
|
2023-01-06 16:14:41 +08:00
|
|
|
router "${GOT_OPTS[@]}"
|