一些常用linux脚本
一,详细配置
superbench
一键测试脚本 开源:https://github.com/oooldking/script/
使用
官方
wget -qO- --no-check-certificate https://raw.githubusercontent.com/oooldking/script/master/superbench.sh | bash
备份
bash <(curl -sL api.zzz.me/shell/script/vps-test/superbench.sh)
扩展
./superbench.sh info #info 系统信息
./superbench.sh io #io 简单 io 测试
./superbench.sh speed #speed 速度测试
./superbench.sh ip #ip GEOIP 信息
./superbench.sh fast #fast 快速模式
./superbench.sh share #share 分享
测试结果
LemonBench
LemonBench工具(别名LBench、柠檬Bench),是一款针对Linux服务器设计的服务器性能测试工具。通过综合测试,可以快速评估服务器的综合性能,为使用者提供服务器硬件配置信息。 详细介绍LemonBench目前涵盖了如下测试:
系统名称 (包括版本号、系统位数)
CPU信息 (型号、缓存大小)
CPU数量检测 (自适应识别区分虚拟机(即VPS)与独立服务器)
内存使用率
Swap使用率
引导设备 (开机磁盘)
系统负载 (1分钟/5分钟/15分钟,测试结果取启动测试时的实时结果)
网络信息收集
本机IPV4地址及相关信息(ASN/归属地/运营商)
本机IPV6地址及相关信息(ASN/归属地/运营商)
流媒体解锁测试 (Beta)
HBO Now 解锁测试
巴哈姆特动画疯解锁测试
哔哩哔哩 港澳台 及 台湾限定 解锁测试
系统性能测试
CPU性能测试
内存性能测试
磁盘性能测试 (4K测试结果适用于SSD介质磁盘,1M测试结果适用于SSD介质与HDD介质磁盘)
Speedtest网速测试
最近测速点
中国东北地区 (联通/移动)
中国华北地区 (联通/移动)
中国华中地区 (联通/电信)
中国华东地区 (联通/移动)
中国华南地区 (电信/移动)
中国西南地区 (联通/移动)
中国西北地区 (联通/电信/移动)
路由追踪测试 (回程测试)
国内部分:联通/电信/移动/联通精品网/电信CN2/鹏博士/教育网/科技网/广电网
香港部分:CU/CT/CN2/HGC/HKBN/PCCW/TGT/WTT
新加坡部分:CT/CN2/Singtel/StarHub/M1/AWS
日本部分:NTT/IIJ/SoftBank/KDDI/CT/CN2/AWS
韩国部分:KT/SK/LG/CN2/AWS
台湾部分:Chief/APTG/CHT/TFN/FET/KBT/TAIFO
美国部分:CT/CN2/PCCW/HE/GTT/ATT/TATA/NTT/Level3/ZAYO/Cogentco
欧洲部分:Telekom/O2/Vodafont/CT/CN2/GTT/Cogentco/BT/TATA/RT/TTK/MTS
IPV6部分:联通/电信/移动/教育网 (CERNET2)
来源:https://blog.ilemonrain.com/linux/LemonBench.html
使用
官方
快速测试
wget -qO- http://ilemonra.in/LemonBenchIntl | bash -s fast
完整测试
wget -qO- http://ilemonra.in/LemonBenchIntl | bash -s full
备份
快速测试
wget -qO- https://api.zzz.me/shell/tools/LemonBenchIntl | bash -s fast
完整测试
wget -qO- https://api.zzz.me/shell/tools/LemonBenchIntl | bash -s full
测试结果
LemonBench Server Test Tookit 20201005 Intl BetaVersion (C)iLemonrain. All Rights Reserved.
==========================================================================================
[Info] Bench Start Time: 2021-05-01 15:58:13
[Info] Test Mode: Full Mode
-> System Information
OS Release: CentOS Linux 7.9.2009 (x86_64)
CPU Model: Intel Core Processor (Broadwell) 2.20 GHz
CPU Cache Size: 16384 KB
CPU Number: 1 vCPU
Virt Type: KVM
Memory Usage: 301.61 MB / 462.90 MB
Swap Usage: 333.54 MB / 1.00 GB
Boot Device: /dev/vda2
Disk Usage: 5.93 GB / 7.85 GB
CPU Usage: 6.2% used, 0.0% iowait, 0.0% steal
Load (1/5/15min): 0.28 0.24 0.23
Uptime: 18 Days, 3 Hours, 32 Minutes, 35 Seconds
Kernel Version: 3.10.0-1160.24.1.el7.x86_64
Network CC Method: cubic + pfifo_fast
-> Network Infomation
IPV4 - IP Address: [RU] 92.38.131.116
IPV4 - ASN Info: AS199524 (GCORE - G-Core Labs S.A., LU)
IPV4 - Region: Russian Federation Khabarovsk Krai Khabarovsk
IPV6 - IP Address: [RU] 2a03:90c0:a5::4b1
IPV6 - ASN Info: AS199524 (GCORE - G-Core Labs S.A., LU)
IPV6 - Region: Russian Federation Russian Federation
-> Media Unlock Test
HBO Now: No
Bahamut Anime: No
Abema.TV: No
Princess Connect Re:Dive Japan: No
BBC: No
BiliBili China Mainland Only: No
BiliBili Hongkong/Macau/Taiwan: No
Bilibili Taiwan Only: No
-> CPU Performance Test (Standard Mode, 3-Pass @ 30sec)
1 Thread Test: 686 Scores
-> Memory Performance Test (Standard Mode, 3-Pass @ 30sec)
1 Thread - Read Test : 14711.21 MB/s
1 Thread - Write Test: 9612.57 MB/s
-> Disk Speed Test (4K Block/1M Block, Direct-Write)
Test Name Write Speed Read Speed
10MB-4K Block 7.5 MB/s (1834 IOPS, 1.40s) 7.7 MB/s (1888 IOPS, 1.36s)
10MB-1M Block 710 MB/s (677 IOPS, 0.01s) 1.8 GB/s (1691 IOPS, 0.01s)
100MB-4K Block 8.1 MB/s (1989 IOPS, 12.87s) 7.7 MB/s (1880 IOPS, 13.61s)
100MB-1M Block 261 MB/s (248 IOPS, 0.40s) 260 MB/s (247 IOPS, 0.40s)
1GB-4K Block 7.8 MB/s (1894 IOPS, 135.10s) 8.1 MB/s (1977 IOPS, 129.49s)
1GB-1M Block 214 MB/s (203 IOPS, 4.90s) 203 MB/s (194 IOPS, 5.15s)
-> Speedtest.net Network Speed Test
Node Name Upload Speed Download Speed Ping Latency Server Name
Speedtest Default 22.33 MB/s 20.76 MB/s 0.48 ms Pautina-LLC (Russia Khabarovsk)
China, Nanjing CU 1.15 MB/s 19.62 MB/s 115.65 ms China Unicom (China Nanjing)
China, Shanghai CU 0.81 MB/s 21.22 MB/s 72.68 ms China Unicom 5G (China ShangHai)
China, Hangzhou CT 0.08 MB/s 21.46 MB/s 88.01 ms China Telecom ZheJiang Branch (China Hangzhou)
China, Nanjing CT 1.88 MB/s 21.58 MB/s 74.13 ms China Telecom JiangSu 5G (China Nanjing)
China, Guangzhou CT 0.04 MB/s 13.83 MB/s 120.62 ms ChinaTelecom 5G (China Guangzhou)
China, Wuhan CT Fail: Host resolve failed: Timeout occurred in connect.
China, Shenyang CM Fail: Timeout Exceeded after 60 seconds
China, Hangzhou CM Fail: Timeout Exceeded after 60 seconds
China, Nanning CM 16.53 MB/s 18.21 MB/s 390.04 ms GX ChinaMobile (China Nanning)
China, Lanzhou CM 16.50 MB/s 6.69 MB/s 355.71 ms Lanzhou,China Mobile,Gansu (China Lanzhou)
Hong Kong, CSL 7.41 MB/s 2.68 MB/s 68.84 ms CSL (Hong Kong Kwai Chung)
Hong Kong, PCCW 22.92 MB/s 22.11 MB/s 182.38 ms STC (China Hong Kong)
Korea, South Korea 13.96 MB/s 14.14 MB/s 376.00 ms kdatacenter.com (South Korea Seoul)
Japan, GLBB 13.36 MB/s 0.78 MB/s 361.06 ms Allied Telesis Capital Corporation (Japan Fussa-shi)
Taiwan, FET Fail: Timeout Exceeded after 60 seconds
Taiwan, Chief 22.97 MB/s 22.21 MB/s 90.33 ms Chief Telecom (Taiwan Taoyuan)
Taiwan, TWM 23.48 MB/s 22.64 MB/s 255.99 ms Taiwan Mobile (Taiwan Taoyuan)
Singapore, Singtel 16.55 MB/s 21.67 MB/s 112.80 ms Singtel (Singapore Singapore)
Singapore, M1 22.23 MB/s 20.79 MB/s 301.72 ms M1 Limited (Singapore Singapore)
Singapore, NME 23.65 MB/s 21.56 MB/s 103.76 ms NewMedia Express (Republic of Singapore Singapore)
USA, Century Link 16.74 MB/s 19.71 MB/s 288.92 ms CenturyLink (United States Seattle, WA)
-> Traceroute Test (IPV4)
(太长 省略了 可在后面paste查看完整信息)
-> Traceroute Test (IPV6)
(太长 省略了 可在后面paste查看完整信息)
==========================================================================================
[Info] Bench Finish Time: 2021-05-01 16:30:26
[Info] Time Elapsed: 1933 seconds
[Info] Please wait, collecting results ...
[Info] Generating Report ...
[Info] Saving local Report ...
[Info] Generating Report URL ...
[Success] Report Generate Success!Please save the follwing link:
[Info] Report URL: https://paste.ubuntu.com/p/gQBmyN222y/
Yet-Another-Bench-Script
一键测试脚本
开源:https://github.com/masonr/yet-another-bench-script
使用
官方
curl -sL yabs.sh | bash
备份
bash <(curl -sL api.zzz.me/shell/script/vps-test/yabs.sh)
扩展
-f/-d此选项禁用 fio(磁盘性能)测试
-i此选项禁用 iperf(网络性能)测试
-g此选项禁用极客台(系统性能)测试
-h此选项打印帮助消息,并具有使用情况、检测到的标记和本地包(fio/iperf)状态
-r此选项可减少 iperf 位置(Online.net/Clouvider LON+NYC)的数量,以减少带宽使用
-4此选项取代了极客台5性能测试,并运行了极客台4测试,而不是
-9除了极客台5测试之外,此选项还运行极客台4测试
测试结果
# ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## #
# Yet-Another-Bench-Script #
# v2021-06-05 #
# https://github.com/masonr/yet-another-bench-script #
# ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## #
Sat Jul 10 12:57:52 CST 2021
Basic System Information:
---------------------------------
Processor : DO-Regular
CPU cores : 1 @ 2494.102 MHz
AES-NI : ✔ Enabled
VM-x/AMD-V : ✔ Enabled
RAM : 991.0 MiB
Swap : 0.0 KiB
Disk : 25.0 GiB
fio Disk Speed Tests (Mixed R/W 50/50):
---------------------------------
Block Size | 4k (IOPS) | 64k (IOPS)
------ | --- ---- | ---- ----
Read | 148.32 MB/s (37.0k) | 355.72 MB/s (5.5k)
Write | 148.71 MB/s (37.1k) | 357.59 MB/s (5.5k)
Total | 297.04 MB/s (74.2k) | 713.31 MB/s (11.1k)
| |
Block Size | 512k (IOPS) | 1m (IOPS)
------ | --- ---- | ---- ----
Read | 883.98 MB/s (1.7k) | 956.44 MB/s (934)
Write | 930.94 MB/s (1.8k) | 1.02 GB/s (996)
Total | 1.81 GB/s (3.5k) | 1.97 GB/s (1.9k)
iperf3 Network Speed Tests (IPv4):
---------------------------------
Provider | Location (Link) | Send Speed | Recv Speed
| | |
Clouvider | London, UK (10G) | 988 Mbits/sec | 1.19 Gbits/sec
Online.net | Paris, FR (10G) | 1.22 Gbits/sec | 1.20 Gbits/sec
WorldStream | The Netherlands (10G) | 1.04 Gbits/sec | 1.11 Gbits/sec
Biznet | Jakarta, Indonesia (1G) | 767 Mbits/sec | 38.0 Mbits/sec
Clouvider | NYC, NY, US (10G) | 1.74 Gbits/sec | 2.41 Gbits/sec
Velocity Online | Tallahassee, FL, US (10G) | 1.83 Gbits/sec | 2.13 Gbits/sec
Clouvider | Los Angeles, CA, US (10G![测试结果图](https://cdn.my-api.cn/static/images/img-main/2021/04/24/e65d5ec8551b11d4e7fcf053d2757019.png)) | 1.98 Gbits/sec | 5.47 Gbits/sec
Iveloz Telecom | Sao Paulo, BR (2G) | 72.7 Mbits/sec | 887 Mbits/sec
iperf3 Network Speed Tests (IPv6):
---------------------------------
Provider | Location (Link) | Send Speed | Recv Speed
| | |
Clouvider | London, UK (10G) | 985 Mbits/sec | 1.19 Gbits/sec
Online.net | Paris, FR (10G) | 1.39 Gbits/sec | 1.15 Gbits/sec
WorldStream | The Netherlands (10G) | 1.10 Gbits/sec | 1.21 Gbits/sec
Clouvider | NYC, NY, US (10G) | 1.56 Gbits/sec | 2.51 Gbits/sec
Clouvider | Los Angeles, CA, US (10G) | 2.00 Gbits/sec | 8.44 Gbits/sec
Geekbench 5 Benchmark Test:
---------------------------------
Test | Value
|
Single Core | 555
Multi Core | 529
Full Test | https://browser.geekbench.com/v5/cpu/8756956
二,网络相关
superspeed
国内三网上传下载测试
开源:https://github.com/ernisn/superspeed
使用
官方
bash <(curl -Lso- https://git.io/superspeed)
备份
bash <(curl -sL api.zzz.me/shell/script/vps-test/net/superspeed.sh)
测试结果
speedtest-cli
面向开发人员的互联网连接测量
开源:https://github.com/masonr/yet-another-bench-script
官方
wget https://raw.github.com/sivel/speedtest-cli/master/speedtest.py
chmod a+rx speedtest.py
python speedtest.py
扩展
如果你想生成一张图片,并分享给其他人,那么应该这样:
python speedtest.py --share
在默认情况下,SpeedTest是选择离测试机最近的一个节点进行测试的,如果你想要自定义测试到某个地区的上传/下载速率,那首先列出目前可用的SpeedTest服务器:
python speedtest.py --list
此时会列出所有的服务器(按照距离远近进行排列)
如果想一点一点的列出服务器,请输入:
python speedtest.py --list|more
我们可以看到,列出的服务器前面有一串数字
root@debian:~# python speedtest.py --list|more
Retrieving speedtest.net configuration...
14939) Mimosa Networks (San Jose, CA, United States) [0.45 km]
10384) Speedtest.net (San Jose, CA, United States) [4.19 km]
11899) Janus Networks (San Jose, CA, United States) [4.19 km]
15786) Sprint (San Jose, CA, United States) [4.19 km]
9383) Sneaker Server (San Jose, CA, United States) [4.19 km]
9540) DNASOLES (San Jose, CA, United States) [4.19 km]
11599) Mimosa Networks (Santa Clara, CA, United States) [7.10 km]
18007) T-Mobile (Santa Clara, CA, United States) [7.10 km]
12818) Ridge Wireless (Cupertino, CA, United States) [12.57 km]
10455) Cytranet (Fremont, CA, United States) [24.84 km]
6468) Tekify Broadband Internet Services (Fremont, CA, United States) [24.84 km]
如果你想列出指定地区的测试节点,可以使用
python speedtest.py --list | grep China
如果我们想测试主机到Mimosa Networks这个节点的速率,那么是这样输入:
python speedtest.py --server 11599
如果是要生成分享的图片,那就加上share
python speedtest.py --server 11599 --share
产考:https://www.mrkevin.net/code/1380.html
测试结果
Hosted by eero (San Jose, CA) [9.32 km]: 2.76 ms
Testing download speed................................................................................
Download: 3484.38 Mbit/s
Testing upload speed................................................................................................
Upload: 1897.13 Mbit/s
三,流媒体测试
RegionRestrictionCheck
流媒体NetFlix解锁检测脚本
本脚本基于CoiaPrant/MediaUnlock_Test代码进行修改 优化了Disneyplus的判断准确性 新增MyTVSuper解锁判断 新增Dazn解锁判断 新增Hulu Japan解锁判断 新增赛马娘解锁判断 新增舰娘解锁判断 新增Now E解锁判断 新增Viu TV解锁判断 新增U-NEXT VIDEO解锁判断 新增Paravi解锁判断 优化了Abema TV的判断准确性 新增WOWOW解锁判断 新增TVer解锁判断 新增Hami Video解锁判断 新增4GTV解锁判断 新增Sling TV解锁判断 新增Pluto TV解锁判断 新增HBO Max解锁判断 新增Channel 4解锁判断 新增ITV Hub解锁判断 新增爱奇艺国际版区域判断 新增Hulu US解锁判断 新增encoreTVB解锁判断 新增LineTV TW解锁判断 新增Viu.com解锁判断 新增Niconico解锁判断 新增Paramount+解锁判断 新增KKTV解锁判断 新增Peakcock TV解锁判断 新增FOD解锁判断 新增TikTok区域判断 优化YouTube判断增加Premium是否可用判断 新增BritBox解锁判断 新增Amazon Prime Video区域判断 新增Molotov解锁判断 新增DMM解锁判断 新增Radiko解锁及区域判断 新增CatchPlay+解锁判断 新增Hotstar解锁判断 新增Litv解锁判断
开源:https://github.com/lmc999/RegionRestrictionCheck
使用
官方
bash <(curl -L -s https://raw.githubusercontent.com/lmc999/RegionRestrictionCheck/main/check.sh)
备份
bash <(curl -L -s https://api.zzz.me/shell/script/vps-test/net/RegionRestrictionCheck.sh)
测试结果
请选择检测项目,直接按回车将进行全区域检测
输入数字【1】:【跨国平台+美国平台】检测
输入数字【2】:【跨国平台+日本平台】检测
输入数字【3】:【跨国平台+香港平台】检测
输入数字【4】:【跨国平台+台湾平台】检测
输入数字【5】:【跨国平台+欧洲平台】检测
输入数字【6】:【 只进行跨国平台 】检测
请输入正确数字或直接按回车:
--------------------------------
** 您的网络为: Digital Ocean
=============跨国平台解锁==============
Dazn: No
Netflix: [N] Mark Only
DisneyPlus: No
HotStar: No
YouTube Premium: Yes (Region: US)
Amazon Prime Video: Yes (Region: US)
Tiktok Region: US
iQyi Oversea Region: US
Viu.com: No
Steam Currency: USD
=======================================
=============美国地区解锁==============
Hulu: No
HBO Now: Yes
HBO Max: Yes
Paramount+: Yes
Peacock TV: Yes
Sling TV: Yes
Pluto TV: Yes
encoreTVB: Yes
=======================================
==============日本地区解锁=============
DMM: No
Abema.TV: No
Niconico: No
Paravi: No
U-NEXT: No
Hulu Japan: No
TVer: No
WOWOW: No
FOD(Fuji TV): No
Radiko: No
Kancolle Japan: No
Pretty Derby Japan: Failed (Network Connection)
Princess Connect Re:Dive Japan: Failed (Network Connection)
=======================================
=============香港地区解锁==============
MyTVSuper: No
Now E: No
Viu.TV: No
BiliBili Hongkong/Macau/Taiwan: No
=======================================
=============台湾地区解锁==============
KKTV: No
LiTV: No
4GTV.TV: No
LineTV.TW: Yes
Hami Video: No
CatchPlay+: No
Bahamut Anime: No
Bilibili Taiwan Only: No
=======================================
=============欧洲地区解锁==============
BritBox: Yes
ITV Hub: No
Channel 4: No
BBC iPLAYER: No
Molotov: No
=======================================
** 正在测试IPv6解锁情况
--------------------------------
** 您的网络为: Digital Ocean
=============跨国平台解锁==============
Dazn: Unsupport
Netflix: [N] Mark Only
DisneyPlus: Failed (Network Connection)
HotStar: Yes (Region: US)
YouTube Premium: Yes (Region: US)
Amazon Prime Video: Unsupported
Tiktok Region: Failed
iQyi Oversea Region: Failed
Viu.com: Failed
Steam Currency: Failed (Network Connection)
=======================================
=============美国地区解锁==============
Hulu: Failed
HBO Now: Failed (Network Connection)
HBO Max: Yes
Paramount+: Yes
Peacock TV: Yes
Sling TV: Yes
Pluto TV: Yes
encoreTVB: Failed
=======================================
==============日本地区解锁=============
DMM: Unsupported
Abema.TV: Failed (Network Connection)
Niconico: Yes
Paravi: No
U-NEXT: Failed (Network Connection)
Hulu Japan: No
TVer: Failed
WOWOW: Yes
FOD(Fuji TV): No
Radiko: Unsupported
Kancolle Japan: No
Pretty Derby Japan: Failed (Network Connection)
Princess Connect Re:Dive Japan: Failed (Network Connection)
=======================================
=============香港地区解锁==============
MyTVSuper: No
Now E: Failed (Unexpected Result: )
Viu.TV: Failed (Unexpected Result: )
BiliBili Hongkong/Macau/Taiwan: Failed (Network Connection)
=======================================
=============台湾地区解锁==============
KKTV: No
LiTV: Failed
4GTV.TV: Failed
LineTV.TW: No
Hami Video: Failed
CatchPlay+: Failed
Bahamut Anime: Failed (Network Connection)
Bilibili Taiwan Only: Failed (Network Connection)
=======================================
=============欧洲地区解锁==============
BritBox: Yes
ITV Hub: Failed (Network Connection)
Channel 4: Failed (Network Connection)
BBC iPLAYER: Failed
Molotov: Failed
=======================================
本次测试已结束,感谢使用此脚本
NETFLIX-VERIFY
流媒体NetFlix解锁检测脚本
开源:https://github.com//sjlleo/netflix-verify/
使用
官方
Github主站下载链接(适用于IPv4网络的机器):
wget -O nf https://github.com/sjlleo/netflix-verify/releases/download/2.6/nf_2.6_linux_amd64 && chmod +x nf && clear && ./nf
CDN下载链接(通用选项,既适用于有IPv4网络的机器也适用于仅有IPv6网络的机器):
wget -O nf https://cdn.jsdelivr.net/gh/sjlleo/netflix-verify/CDNRelease/nf_2.60_linux_amd64 && chmod +x nf && clear && ./nf
备份
wget -O nf https://api.zzz.me/shell/script/vps-test/net/nf_2.60_linux_amd64 && chmod +x nf && clear && ./nf
扩展
./nf 或者是 ./nf -method lite 简洁测试 图一
./nf -method full 详细测试 图二
在v2.6版本中提供了自定义解锁功能,运行./nf -custom 想测试的电影ID号即可查看特定影片是否在该网络上解锁
测试结果
VerifyDisneyPlus
一个检测出口IP是否解锁DisneyPlus的脚本
开源:https://github.com/sjlleo/VerifyDisneyPlus
使用
官方
wget -O dp https://github.com/sjlleo/VerifyDisneyPlus/releases/download/1.01/dp_1.01_linux_amd64 && chmod +x dp && clear && ./dp
备份
wget -O dp https://api.zzz.me/shell/script/vps-test/net/dp_1.01_linux_amd64 && chmod +x dp && clear && ./dp
测试结果
MediaUnlock_Test
支持双栈测试 支持大部分流媒体测试 支持Steam货币测试 部分测试支持输出解锁的国家
开源:https://hub.fastgit.org/CoiaPrant/MediaUnlock_Test/
使用
官方
bash <(curl -sSL "https://hub.fastgit.org/CoiaPrant/MediaUnlock_Test/raw/main/check.sh")
备份
bash <(curl -sL api.zzz.me/shell/script/vps-test/net/check.sh)
测试结果