常用VPS命令

常用的 VPS 命令

常用脚本

DD 命令

Alpine

1
bash <(wget -qO- 'https://raw.githubusercontent.com/bin456789/reinstall/main/reinstall.sh') alpine 3.21 --password

Debian

1
bash <(wget -qO- 'https://raw.githubusercontent.com/bin456789/reinstall/main/reinstall.sh') debian 12 --password

初始化命令

Alpine

1
2
3
4
apk update &&
apk add python3 &&
wget -q -O init.py https://raw.githubusercontent.com/flyflas/CommonScripts/refs/heads/main/Linux/install_alpine.py &&
python3 init.py base singbox

Debian

1
2
3
4
apt update &&
apt install -y python3 &&
wget -q -O init.py https://raw.githubusercontent.com/flyflas/CommonScripts/refs/heads/main/Linux/install_debian.py &&
python3 init.py base

Warp

Warp 安装脚本

VPS 测试脚本

NodeQuality

1
bash <(curl -sL https://run.NodeQuality.com)

YABS.sh

全面的性能测试脚本,包含网络,IO,CPU 性能测试。

命令

1
curl -sL yabs.sh | bash

常用命令

1
2
3
4
# 使用 GB5 测试
curl -sL yabs.sh | bash -s -- -5
# 只进行 GB5 测试
curl -sL yabs.sh | bash -s -- -di5

回程测试

1
curl https://raw.githubusercontent.com/zhanghanyun/backtrace/main/install.sh -sSf | sh

流媒体测试

1
bash <(curl -L -s https://raw.githubusercontent.com/lmc999/RegionRestrictionCheck/main/check.sh)

常用命令

linux 命令

1
2
# 查看systemd日志
journalctl -u sing-box -n 20

BBR 开启命令

请注意,该功能需要 Linux 5.10 以上版本

1
2
3
4
5
echo "net.core.default_qdisc=fq" >> /etc/sysctl.conf
echo "net.ipv4.tcp_congestion_control=bbr" >> /etc/sysctl.conf
sysctl -p
sysctl net.ipv4.tcp_available_congestion_control
lsmod | grep bbr

UUID

1
cat /proc/sys/kernel/random/uuid

ACME.SH

1
2
3
4
5
6
7
8
curl https://get.acme.sh | sh -s email=my@example.com &&
export CF_Account_ID="763eac4f1bcebd8b5c95e9fc50d010b4" &&
export CF_Token="763eac4f1bcebd8b5c95e9fc50d010b4" &&
acme.sh --issue --dns dns_cf -d '*.example.com' &&
acme.sh --install-cert -d '*.example.com' \
--key-file /opt/ssl/key.pem \
--fullchain-file /opt/ssl/cert.pem

Docker 相关

docker 安装

1
2
3
curl -fsSL https://get.docker.com -o get-docker.sh && \
sh ./get-docker.sh --dry-run && \
sh ./get-docker.sh

docker-compose 安装

1
2
3
curl -SL https://github.com/docker/compose/releases/download/v2.16.0/docker-compose-linux-x86_64 -o /usr/local/bin/docker-compose && \
ln -s /usr/local/bin/docker-compose /usr/bin/docker-compose && \
chmod +x /usr/bin/docker-compose

常用配置文件

sing-box

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
{
log: {
disabled: true,
level: "debug",
output: "/tmp/box.log",
timestamp: true,
},
dns: {
servers: [
{
type: "local",
tag: "local",
},
],
},
inbounds: [
{
type: "shadowsocks",
tag: "ss-in",
method: "aes-128-gcm",
password: "XXXXX", // 修改密码
listen: "::",
listen_port: 61254,
},
],
outbounds: [
{
type: "direct",
tag: "direct-out",
domain_resolver: {
server: "local",
strategy: "prefer_ipv6", // dns解析优先级
},
},
],
route: {
final: "direct-out",
},
}