文章说明:本篇介绍购买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脚本
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(国内镜像源加速版)
-
卸载旧版Docker(如有)
sudo apt-get remove docker docker-engine docker.io containerd runc
-
安装基础依赖工具
sudo apt-get update && sudo apt-get install -y \ apt-transport-https \ ca-certificates \ curl \ gnupg-agent \ software-properties-common
-
添加阿里云Docker镜像源
# 添加GPG密钥 curl -fsSL https://mirrors.aliyun.com/docker-ce/linux/ubuntu/gpg | sudo apt-key add - # 设置阿里云仓库 sudo add-apt-repository \ "deb [arch=amd64] https://mirrors.aliyun.com/docker-ce/linux/ubuntu \ $(lsb_release -cs) \ stable"
-
安装Docker引擎
sudo apt-get update sudo apt-get install -y docker-ce docker-ce-cli containerd.io
-
配置Docker镜像加速器
# 创建配置文件(若已存在则追加镜像源) sudo tee /etc/docker/daemon.json <<-'EOF' { "registry-mirrors": [ "https://d.yydy.link:2023" ] } EOF # 重启Docker生效 sudo systemctl daemon-reload sudo systemctl restart docker
-
验证安装
sudo docker run hello-world # 若显示"Hello from Docker!"则成功
6.2、修改 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
systemctl restart docker
6.3、卸载 Docker
sudo apt-get remove docker docker-engine docker.io containerd runc
apt-get remove docker docker-engine
sudo rm -rf /var/lib/docker
sudo rm -rf /var/lib/containerd
6.4、Docker服务
systemctl status docker #查看服务
systemctl start docker #开启服务
systemctl enable docker #开启自启
6.5、官方安装Docker
6.5.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
sudo apt-get update
6.5.2、安装最新版Docker软件包
sudo apt-get install -y docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin
6.5.3、查看版本
docker -v #查看docker版本
6.6、官方安装Docker-Compose
sudo wget https://pan.yydy.link:2023/d/share/docker/docker-compose-latest-install.sh && sudo chmod +x docker-compose-latest-install.sh && sudo bash docker-compose-latest-install.sh