文章说明:本篇介绍购买VPS后可能涉及用到的一些Linux脚本,便于我们日常使用。

一、流媒体测试

1.1、ChatGPT 测试

bash <(curl -Ls https://raw.githubusercontent.com/missuo/OpenAI-Checker/main/openai.sh)

1.2、奈飞测试

wget -O nf https://github.com/sjlleo/netflix-verify/releases/download/2.5/nf_2.5_linux_amd64 && chmod +x nf && clear && ./nf

1.3、流媒体平台及游戏区域限制测试

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

二、机器测试

2.1、GeekBench6 跑分测试

curl -sL yabs.sh | bash -s -- -i
curl -sL yabs.sh | bash

2.2、单线程测试

bash <(curl -Lso- https://bench.im/hyperspeed)

2.3、Superbench测试

wget -qO- git.io/superbench.sh | bash

三、速度测试

3.1、抖动、延迟测试

bash <(wget -qO- https://bench.im/hyperspeed)

3.2、回程线路测试

curl https://raw.githubusercontent.com/zhucaidan/mtr_trace/main/mtr_trace.sh|bash
wget -q route.f2k.pub -O route && bash route
wget https://raw.githubusercontent.com/nanqinlang-script/testrace/master/testrace.sh
bash testrace.sh
wget -qO- git.io/besttrace | bash

3.2、标准四网测速

wget -O jcnf.sh https://raw.githubusercontent.com/Netflixxp/jcnfbesttrace/main/jcnf.sh && chmod +x jcnf.sh && bash jcnf.sh

3.3、快速四网测速

bash <(curl -Lso- https://dl.233.mba/d/sh/speedtest.sh)
bash <(curl -Lso- https://git.io/J1SEh)

3.4、三网测速

bash <(curl -Lso- https://git.io/superspeed_uxh)

3.5、完整全网测速

curl -fsL https://ilemonra.in/LemonBenchIntl | bash -s fast

3.6、国内外带宽测速

3.6.1、下载测速包

sudo curl -O https://raw.githubusercontent.com/sivel/speedtest-cli/master/speedtest.py

3.6.2、赋权

sudo chmod +x ./speedtest.py

3.6.3、指定源地址

sudo ./speedtest.py --source 192.168.10.10

3.6.4、列出所有测速节点

sudo ./speedtest.py --list --source=192.168.10.10
38954) ProSiebenSat.1 Tech Solutions (Unterföhring, Germany) [173.51 km]
63316) MT-Media (Landshut, Germany) [195.33 km]
44483) LowHosting Services (Falkenstein, Germany) [216.59 km]
55165) ms-nw.net -flk (Falkenstein, Germany) [216.59 km]
38152) dewDrive - Cloud Backup (Falkenstein, Germany) [216.62 km]
63259) Innsbrucker Kommunalbetriebe AG (Innsbruck, Austria) [226.42 km]
29944) HALLAG Kommunal GmbH - citynet.at (Hall In Tirol, Austria) [230.34 km]
45793) AnschlussWerk GmbH (Trostberg, Germany) [242.39 km]
41545) Goingnet GmbH (Going am Wilden Kaiser, Austria) [257.03 km]
11532) Salzburg AG (Salzburg, Austria) [285.31 km]

3.6.5、指定测速节点

sudo ./speedtest.py --server=38954 --source=192.168.10.10

四、其他脚本

4.1、测试 IPv4 优先还是 IPv6 优先

curl ip.p3terx.com

4.2、脚本工具箱BOX

wget -O box.sh https://raw.githubusercontent.com/BlueSkyXN/SKY-BOX/main/box.sh && chmod +x box.sh && clear && ./box.sh

4.3、科技lion脚本

curl -sS -O https://kejilion.pro/kejilion.sh && chmod +x kejilion.sh && ./kejilion.sh
bash <(curl -sL kejilion.sh)

五、DD脚本

甲骨文DD脚本

5.1、DD 成 Debian 10

bash <(wget --no-check-certificate -qO- 'https://raw.githubusercontent.com/MoeClub/Note/master/InstallNET.sh') -d 10 -v 64 -p "自定义root密码" -port "自定义ssh端口"

5.2、DD 成 Ubuntu 20

bash <(wget --no-check-certificate -qO- 'https://raw.githubusercontent.com/MoeClub/Note/master/InstallNET.sh') -u 20.04 -v 64 -p "自定义root密码" -port "自定义ssh端口"

六、Docker脚本

6.1、非大陆服务器 Docker 安装

wget -qO- get.docker.com | bash
docker -v  #查看docker版本
systemctl enable docker  # 设置开机自动启动

6.2、非大陆服务器 Docker-compose 安装

sudo curl -SL https://github.com/docker/compose/releases/download/v2.26.1/docker-compose-linux-x86_64 -o /usr/local/bin/docker-compose
sudo chmod +x /usr/local/bin/docker-compose
docker-compose --version  #查看docker-compose版本

6.3、国内服务器安装 Docker

curl -sSL https://get.daocloud.io/docker | sh
docker -v  #查看docker版本
systemctl enable docker  # 设置开机自动启动

6.4、国内服务器安装 Docker-compose

curl -L https://get.daocloud.io/docker/compose/releases/download/v2.1.1/docker-compose-`uname -s`-`uname -m` > /usr/local/bin/docker-compose && chmod +x /usr/local/bin/docker-compose
docker-compose --version  #查看docker-compose版本

6.5、修改 Docker 配置(可选)

以下配置会增加一段自定义内网 IPv6 地址,开启容器的 IPv6 功能,以及限制日志文件大小,防止 Docker 日志塞满硬盘。

cat > /etc/docker/daemon.json <<EOF
{
    "log-driver": "json-file",
    "log-opts": {
        "max-size": "20m",
        "max-file": "3"
    },
    "ipv6": true,
    "fixed-cidr-v6": "fd00:dead:beef:c0::/80",
    "experimental":true,
    "ip6tables":true
}
EOF

重启Docker服务。

systemctl restart docker

6.6、卸载 Docker

apt-get purge docker-ce docker-ce-cli containerd.io
apt-get remove docker docker-engine
sudo rm -rf /var/lib/docker
sudo rm -rf /var/lib/containerd

6.7、Docker服务

systemctl status docker  #查看服务
systemctl start docker #开启服务
systemctl enable docker #开启自启

6.8、官方安装Docker

6.8.1、设置 Docker 的apt存储库

# Add Docker's official GPG key:
sudo apt-get update
sudo apt-get install ca-certificates curl
sudo install -m 0755 -d /etc/apt/keyrings
sudo curl -fsSL https://download.docker.com/linux/ubuntu/gpg -o /etc/apt/keyrings/docker.asc
sudo chmod a+r /etc/apt/keyrings/docker.asc

# Add the repository to Apt sources:
echo \
  "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.asc] https://download.docker.com/linux/ubuntu \
  $(. /etc/os-release && echo "$VERSION_CODENAME") stable" | \
  sudo tee /etc/apt/sources.list.d/docker.list > /dev/null

6.8.2、安装最新版Docker软件包

sudo apt-get install -y docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin

6.8.3、查看版本

docker -v  #查看docker版本

6.9、官方安装Docker-Compose

6.9.1、下载并安装独立的 Compose

点我:查看当前最新版

curl -SL https://github.com/docker/compose/releases/download/v2.26.1/docker-compose-linux-x86_64 -o /usr/local/bin/docker-compose

6.9.2、赋予执行权限

sudo chmod +x /usr/local/bin/docker-compose

6.9.3、查看版本

docker-compose --version  #查看docker-compose版本