Ref: https://blog.laoda.de/archives/useful-script/
测试相关
机器测试
基本测试
请出秋水的 bench.sh 脚本,这个脚本可以查看 Linux 系统信息,还可以测试网络带宽及硬盘读写速率。
1
| wget -qO- bench.sh | bash
|
GeekBench
来源:https://github.com/masonr/yet-another-bench-script
单线程测试
1
| bash <(curl -Lso- https://bench.im/hyperspeed)
|
最全测速脚本
1
| curl -fsL https://ilemonra.in/LemonBenchIntl | bash -s fast
|
superbench
1
| wget -qO- git.io/superbench.sh | bash
|
Bench.sh
1
| wget -qO- bench.sh | bash
|
速度测试
显示延迟、抖动
1
| bash <(wget -qO- https://bench.im/hyperspeed)
|
直接显示回程线路
1 2 3 4 5 6 7 8 9 10
| curl https://raw.githubusercontent.com/zhucaidan/mtr_trace/main/mtr_trace.sh|bash BASH wget -q route.f2k.pub -O route && bash route PLAINTEXT
wget https://raw.githubusercontent.com/nanqinlang-script/testrace/master/testrace.sh bash testrace.sh
wget -qO- git.io/besttrace | bash
|
四网测速
1 2 3
| wget -O jcnf.sh https://raw.githubusercontent.com/Netflixxp/jcnfbesttrace/main/jcnf.sh
bash jcnf.sh
|
三网测速
1
| bash <(curl -Lso- https://git.io/superspeed_uxh)
|
带快速四网测试版本:
1
| bash <(curl -Lso- https://dl.233.mba/d/sh/speedtest.sh)
|
1
| bash <(curl -Lso- https://git.io/J1SEh)
|
流媒体检测
1
| bash <(curl -L -s media.ispvps.com)
|
测试 25 端口是否开放
测试 IPv4 优先还是 IPv6 优先
BBR
CentOS 7 BBR
1
| wget -N --no-check-certificate "https://raw.githubusercontent.com/chiakge/Linux-NetSpeed/master/tcp.sh" && chmod +x tcp.sh && ./tcp.sh
|
一键开启 BBR
注意:需要 Linux Kernel 内核升级到 4.9 及以上版本可以实现 BBR 加速
输出结果:
1 2 3 4 5 6
| PLAINTEXT Linux 3.10.0-957.12.2.el7.x86_64 x86_64 3 - 内核版本. 10 - 主修订版本. 0-957 - 次要修订版本. 12 - 补丁版本.
|
一般来说,Ubuntu18.04 以上就可以 (默认的内核 4.15
)
1 2 3 4 5 6 7 8
| 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
|
升级 packages
CentOS
Debian / Ubuntu
1 2
| sudo apt update && sudo apt upgrade sudo apt install wget curl sudo vim git -y
|
防火墙
CentOS 关闭防火墙
甲骨文
1 2 3 4 5 6
| systemctl stop oracle-cloud-agent systemctl disable oracle-cloud-agent systemctl stop oracle-cloud-agent-updater systemctl disable oracle-cloud-agent-updater systemctl stop firewalld.service systemctl disable firewalld.service
|
其他
1 2 3
| systemctl start supervisord systemctl disable firewalld systemctl stop firewalld
|
Ubuntu 关闭防火墙
1 2 3 4 5
| iptables -P INPUT ACCEPT iptables -P FORWARD ACCEPT iptables -P OUTPUT ACCEPT iptables -F apt-get purge netfilter-persistent && reboot
|
甲骨文修改 root 登录
方法 1
1 2 3 4 5 6 7 8 9 10 11
| sudo -i
passwd
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 service sshd restart
reboot
|
方法 2
1 2 3 4 5 6 7 8 9 10 11
| sudo -i
passwd
vi /etc/ssh/sshd_config
PermitRootLogin yes
PasswordAuthentication yes
reboot
|
Docker 相关
安装 Docker
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
| wget -qO- get.docker.com | bash
docker -v
systemctl enable 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
|
安装 Docker Compose
1 2 3 4 5 6 7 8
| curl -L "https://github.com/docker/compose/releases/download/v2.24.2/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose
chmod +x /usr/local/bin/docker-compose
docker-compose -v
|
呆梨相关
x-ui
1
| bash <(curl -Ls https://raw.githubusercontent.com/FranzKafkaYu/x-ui/master/install.sh)
|
脚本来源:https://github.com/FranzKafkaYu/x-ui
mack-a
1
| wget -P /root -N --no-check-certificate "https://raw.githubusercontent.com/mack-a/v2ray-agent/master/install.sh" && chmod 700 /root/install.sh && /root/install.sh
|