VPS脚本合集:测速、WARP、流媒体解锁、性能测试、一键DD脚本等

更新软件包列表并升级已安装的软件包

apt update -y && apt dist-upgrade -y

自动同步校正系统时间

apt install systemd-timesyncd
timedatectl set-ntp true

输入命令,timedatectl status,如NTP service为active代表已成功开启。

Local time: Thu 2024-02-08 01:34:01 CST
Universal time: Wed 2024-02-07 17:34:01 UTC
RTC time: Wed 2024-02-07 17:34:01
Time zone: Asia/Shanghai (CST, +0800)
System clock synchronized: yes
NTP service: active
RTC in local TZ: no

设置时区为北京时间

timedatectl set-timezone Asia/Shanghai

Debian开启BBR

一键开启BBR,优化VPS速度

echo -e "\nnet.core.default_qdisc=fq\nnet.ipv4.tcp_congestion_control=bbr" >> /etc/sysctl.conf && sysctl -p

查看是否成功开启

sysctl net.ipv4.tcp_congestion_control

若返回如下,则表示启动成功:

net.ipv4.tcp_congestion_control = bbr

开启WARP

新脚本(推荐)

https://gitlab.com/fscarmen/warp

自动配置 WARP WireGuard 双栈全局网络(所有出站流量走 WARP 网络)

bash <(curl -fsSL git.io/warp.sh) d

自动配置 WARP WireGuard IPv4 网络(IPv4 出站流量走 WARP 网络)

bash <(curl -fsSL git.io/warp.sh) 4

自动配置 WARP WireGuard IPv6 网络(IPv6 出站流量走 WARP 网络)

bash <(curl -fsSL git.io/warp.sh) 6

查看菜单

bash <(curl -fsSL git.io/warp.sh) menu

回程测试

TCP回程测试

curl https://raw.githubusercontent.com/zhucaidan/mtr_trace/main/mtr_trace.sh|bash

ICMP回程

wget -qO- git.io/autobesttrace | bash

流媒体解锁测试

脚本1

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

脚本2

bash <(curl -sL unlock.moe)

性能测试YABS

默认(硬盘、网络、Geekbench6)

curl -sL yabs.sh | bash

快速模式(跳过网络测试,仅测硬盘和Geekbench5)

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

 

拓展用法

 

跳过硬盘测试,保留其他
curl -sL yabs.sh | bash -s -- -fd
跳过网速测试,保留其他
curl -sL yabs.sh | bash -s -- -i
跳过Geekbench,保留其他
curl -sL yabs.sh | bash -s -- -g
换为Geekbench 5,保留其他
curl -sL yabs.sh | bash -s -- -5
仅测硬盘
curl -sL yabs.sh | bash -s -- -ig
仅测速
curl -sL yabs.sh | bash -s -- -fdg
仅测Geekbench 5
curl -sL yabs.sh | bash -s -- -fdi5
仅测Geekbench 5 和 Geekbench 6
curl -sL yabs.sh | bash -s -- -fdi56

 

 

测速

国内测速

测试VPS到国内电信、移动、联通和教育网的速度以及到亚洲的速度(支持IPv4、Ipv6、单线程、多线程)

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

全球测速

默认全球
curl -sL network-speed.xyz | bash
区域测速
region_name = na, sa, eu, asia, africa, middle-east, india, china, iran
curl -sL network-speed.xyz | bash -s -- -r region_name
实例(仅测亚洲)
curl -sL network-speed.xyz | bash -s -- -r asia

注:一次测速约耗时10-15分钟,消耗流量几十G至上百G不等。

Globalping

curl -s https://packagecloud.io/install/repositories/jsdelivr/globalping/script.deb.sh | sudo bash
apt install globalping
globalping --help

 

用法说明

 

~$ globalping help
    
    Usage:
      globalping [command]
    
    Measurement Commands:
      dns         Use the native dig command
      http        Perform a HEAD or GET request to a host
      mtr         Use the native mtr command
      ping        Use the native ping command
      traceroute  Use the native traceroute command
    
    Additional Commands:
      completion  Generate the autocompletion script for the specified shell
      help        Help about any command
      version     Print the version number of Globalping CLI
    
    Flags:
      -C, --ci            Disable realtime terminal updates and color suitable for CI (default false)
      -F, --from string   A continent, region (e.g eastern europe), country, US state or city (default "world")
      -h, --help          help for globalping
      -J, --json          Output results in JSON format (default false)
      -L, --limit int     Limit the number of probes to use (default 1)
    
    Use "globalping [command] --help" for more information about a command.

 

 

 

禁用IPv6

不禁用IPv6,设置IPv4优先

sed -i 's/#precedence ::ffff:0:0\/96  100/precedence ::ffff:0:0\/96  100/' /etc/gai.conf

临时禁用:

sysctl -w net.ipv6.conf.all.disable_ipv6=1 net.ipv6.conf.default.disable_ipv6=1

永久禁用:

echo 'net.ipv6.conf.all.disable_ipv6=1' >> /etc/sysctl.conf && echo 
'net.ipv6.conf.default.disable_ipv6=1' >> /etc/sysctl.conf | sysctl -p

宝塔面板

7.7原版&开心版

纯原版1:

curl -sSO https://raw.githubusercontent.com/zhucaidan/btpanel-v7.7.0/main/install/install_panel.sh && bash install_panel.sh

纯原版2:

wget -O install.sh http://f.cccyun.cc/bt/install_6.0.sh && bash install.sh

升级(降级)到7.7命令:

curl http://f.cccyun.cc/bt/update6.sh|bash

宝塔7.7原版一键开心脚本

curl -sSO https://raw.githubusercontent.com/ztkink/bthappy/main/one_key_happy.sh && bash one_key_happy.sh

新版开心版

 

展开查看

Centos安装命令(默认安装是7.8.0 直接在线升级7.9.3):

yum install -y wget && wget -O install.sh http://io.bt.sy/install/install_6.0.sh && sh install.sh

试验性Centos/Ubuntu/Debian安装命令 独立运行环境(py3.7) 可能存在少量兼容性问题 不断优化中

curl -sSO http://io.bt.sy/install/install_panel.sh && bash install_panel.sh

Ubuntu Deepin安装命令:

wget -O install.sh http://io.bt.sy/install/install-ubuntu_6.0.sh && sudo bash install.sh

Debian安装命令:

wget -O install.sh http://io.bt.sy/install/install-ubuntu_6.0.sh && bash install.sh

Fedora安装命令:

wget -O install.sh http://io.bt.sy/install/install_6.0.sh && bash install.sh

Linux面板 7.9.3 升级企业版命令 1(7.9.3 官方版 / 7.7.0 开心版 可以执行这个升级到 7.9.3 开心版):

curl https://io.bt.sy/install/update_panel.sh|bash

讲解:升级企业版命令 1 与 升级企业版命令 2 二选一 都可以升级最新版!

Linux面板 7.9.3 升级企业版命令 2(7.9.3 官方版 / 7.7.0 开心版 可以执行这个升级到 7.9.3 开心版):

curl http://io.bt.sy/install/update6.sh|bash

 

卸载微步木马检测

systemctl stop oneavd
systemctl disable oneavd
rm -rf /opt/threatbook
rm -rf /var/log/oneav
rm /etc/systemd/system/oneavd.service

清空并锁定/request目录

echo "" > /www/server/panel/script/site_task.py
chattr +i /www/server/panel/script/site_task.py
rm -rf /www/server/panel/logs/request/*
chattr +i -R /www/server/panel/logs/request

AWS Lightsail启用root登录

情景1:未创建实例
创建instance时,点击Add Launch Script,复制下列代码(注意更改默认 root 密码fabulous123bigword)。

echo root:fabulous123bigword |sudo chpasswd root
sudo sed -i 's/^.*PermitRootLogin.*/PermitRootLogin yes/g' /etc/ssh/sshd_config;
sudo sed -i 's/^.*PasswordAuthentication.*/PasswordAuthentication yes/g' /etc/ssh/sshd_config;
sudo reboot

情景2:已创建实例
登录ssh,输入以上代码。

mdserver面板(宝塔替代)

curl --insecure -fsSL https://cdn.jsdelivr.net/gh/midoks/mdserver-web@latest/scripts/install.sh | bash

github项目地址

https://github.com/midoks/mdserver-web

一键DD脚本

https://github.com/leitbogioro/Tools
THE END