标签 系统配置 下的文章

概要

云服务器市场的供应商激增,如今许多厂商经常将自己的服务器宣传得像天花乱坠,夸大其性能优势。这让许多新手用户在选择时感到困惑,往往难以判断选择合适的服务器,或者说如何科学地面对服务器的实际性能。这种情况,我们需要借助命然而,对于大多数新手来说,高效命令行的使用可能不太熟悉,这也使得他们在判断服务器性能时面临技术领先。为了帮助大家发现这些陷阱,博主特地整理了一些命令,帮助你快速检测服务器的真实性能,确保不再“踩坑”!

脚本1

wget -qO- bench.sh | bash

脚本2

  wget -qO- https://raw.githubusercontent.com/oooldking/script/master/superbench.sh | bash

看上下行

脚本3

(wget -qO- wget.racing/nench.sh | bash; wget -qO- wget.racing/nench.sh | bash) 2>&1 | tee nench.log

脚本4

curl -s bench.wget.racing | bash

脚本5

curl -s https://raw.githubusercontent.com/masonr/yet-another-bench-script/master/yabs.sh | bash

可比较真实的测试服务器带宽

脚本6

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

可测试是否支持Netflxi等(不一定准确)

脚本7

wget -N --no-check-certificate https://raw.githubusercontent.com/veip007/hj/master/hj.sh && chmod +x hj.sh && bash hj.sh

全能,测速、加速 DD系统等

脚本8

(curl -s wget.racing/nench.sh | bash) 2>&1 | tee nench.log

脚本9

screen -S uping
wget -N --no-check-certificate https://raw.githubusercontent.com/FunctionClub/uPing/master/uping.py
python uping.py

服务器延迟监测
脚本10

wget -qO- --no-check-certificate https://raw.githubusercontent.com/qd201211/Linux-SpeedTest/master/superbench.sh | bash

系统配置、国内速度等

脚本11

wget --no-check-certificate https://zhujiwiki.com/wp-content/uploads/2018/07/unixbench.sh

chmod +x unixbench.sh

./unixbench.sh

UnixBench跑分,测试主机性能

运行10-30分钟后(根据CPU内核数量,运算时间不等)得出分数,越高越好

脚本12
访问:https://netflix.com/title/80018499
测试是否可以观看Netflix(奈飞)

脚本13

bash <(curl -Lsk https://raw.githubusercontent.com/BigMangos/speedtest-go-script/master/install.sh)

测试本地速度speedtest go版本的一键安装脚本

脚本14

bash <(curl -Lso- http://yun.789888.xyz/speedtest.sh)
        或者
 bash <(curl -Lso- https://zhujiwiki.com/wp-content/uploads/2021/12/speedtest.sh)

一键测试三网速度

脚本15

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

一键测试TCP三网回程线路

脚本16

curl https://raw.githubusercontent.com/zhanghanyun/backtrace/main/install.sh -sSf | sh

一键测试TCP三网回程线路

脚本17

bash <(curl -Lso- https://bench.im/hyperspeed)
 bash <(curl -Lso- https://2life.top/speedtest.sh)

国内三网速度

脚本18

`curl -sL yabs.sh | bash
`
yabs,系统性能测试

脚本19

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

综合工具箱

脚本20

 wget -q https://github.com/Aniverse/A/raw/i/a && bash a

独服测试

脚本21

wget -qO- benchy.pw | sh

curl -Ls benchy.pw | sh

已开源:https://github.com/L1so/benchy

22、系统信息和测速

含国内、亚洲、国际等节点,可选节点

1、面向全球

wget -qO- network-speed.xyz | bash

2、限定区域,包括国内

curl -sL network-speed.xyz | bash -s -- -r region_name

中国

curl -sL network-speed.xyz | bash -s -- -r china

亚洲

curl -sL network-speed.xyz | bash -s -- -r asia

region_name = na, sa, eu, asia, middle-east, india, china, iran

23、TCP三网回程

bash <(curl -Ls https://raw.githubusercontent.com/sjlleo/nexttrace/main/nt_install.sh) && nexttrace -F -T

24、VPS一键脚本工具

curl -fsSL https://raw.githubusercontent.com/eooce/ssh_tool/main/ssh_tool.sh -o ssh_tool.sh && chmod +x ssh_tool.sh && ./ssh_tool.sh

wget -qO ssh_tool.sh https://raw.githubusercontent.com/eooce/ssh_tool/main/ssh_tool.sh && chmod +x ssh_tool.sh && ./ssh_tool.sh

总结

在使用性能测试脚本时,绝对不能随便运行从网上找到一个就直接在自己的服务器上。很多正常的脚本,背后可能被某些不法分子侵入了后门或病毒,这些恶意代码可能会窃取你的资源和数据,甚至利用你的服务器进行恶意攻击,导致你所在的服务区域瘫痪,影响其他用户的正常使用。因此,安全性作为首要,必须确保所用的测试脚本来源可靠、无害。博主在这里为大家收集的脚本,都是经过检验的。欢迎大家使用,之后博主还会不断的更新!

WSL 安装和配置指南
本文档介绍如何在 Windows 11 上安装和配置 WSL (Windows Subsystem for Linux),以及安装开发工具。

1. 启用 Windows 功能

1.1打开 Windows 功能设置

  1. 按 Win + R 打开运行窗口
  2. 输入 optionalfeatures 或 控制面板\程序\启用或关闭 Windows 功能
  3. 点击确定
    打开 Windows 功能设置

1.2 启用必要功能
启用必要功能
在"启用或关闭 Windows 功能"窗口中,勾选以下选项:

  • 适用于 Linux 的 Windows 子系统 (WSL)
  • 虚拟机平台 (如果可用)

[bsmessage type="common" color="red" title="注意"]Windows 11 可能只显示部分选项,这是正常的。[/bsmessage]
勾选后点击确定,系统可能需要重启。

2. 设置 WSL 版本和安装 Linux

2.1 设置 WSL 默认版本
打开 PowerShell 或命令提示符(管理员权限),执行:

# 设置默认版本为 WSL2
wsl --set-default-version 2

2.2 查看可用的 Linux 发行版

# 查看可用的 Linux 发行版
wsl --list --online

2.3 安装 Linux 发行版
选择一个发行版进行安装(推荐 Debian 或 Ubuntu):

# 安装 Debian
wsl --install -d Debian
# 或者安装 Ubuntu
wsl --install -d Ubuntu

3. 用户配置

3.1 创建普通用户
如果首次进入发行版后是 root 用户,需要创建普通用户:

# 创建新用户(替换 your_username 为你的用户名)
adduser your_username
# 将用户添加到 sudo 组
usermod -aG sudo your_username

3.2 设置默认用户
编辑 WSL 配置文件:

sudo vim /etc/wsl.conf

在 /etc/wsl.conf 中添加以下内容:

[user]
default=your_username

保存后,在 Windows 中重启 WSL:

wsl --shutdown

4. 替换镜像源(加速下载)

4.1 备份原配置文件

sudo cp /etc/apt/sources.list /etc/apt/sources.list.bak

4.2 编辑源列表

sudo nano /etc/apt/sources.list

4.3 替换为国内镜像源
对于 Debian,将内容替换为:

deb https://mirrors.aliyun.com/debian/ trixie main
deb-src https://mirrors.aliyun.com/debian/ trixie main

对于 Ubuntu,可使用:

#deb https://mirrors.aliyun.com/ubuntu/ jammy main restricted universe multiverse
#deb https://mirrors.aliyun.com/ubuntu/ jammy-updates main restricted universe multiverse

4.4 更新软件包

sudo apt update
sudo apt upgrade -y

4.5 测试网络(可选)

sudo apt install apache2 -y

5. Claude Code 安装

5.1 安装 Node.js

# 下载并安装 Node.js LTS 版本(Ubuntu/Debian)
curl -fsSL https://deb.nodesource.com/setup_lts.x | sudo bash -
sudo apt-get install -y nodejs

5.2 验证安装

node --version
npm --version

5.3 安装 Claude Code

npm install -g @anthropic-ai/claude-code

5.4 设置环境变量

# 临时设置环境变量(当前会话有效)
export ANTHROPIC_AUTH_TOKEN=sk-你的token
export ANTHROPIC_BASE_URL=https://anyrouter.top

5.5 永久保存环境变量

echo 'export ANTHROPIC_AUTH_TOKEN=sk-你的token' >> ~/.bashrc
echo 'export ANTHROPIC_BASE_URL=https://anyrouter.top' >> ~/.bashrc
source ~/.bashrc

5.6 使用 Claude Code

# 验证安装
claude --version
# 进入项目目录使用
cd your-project
claude

6. OpenAI Codex 安装

6.1 安装 Codex

npm i -g @openai/codex

6.2 创建配置目录

mkdir -p ~/.codex

6.3 创建配置文件

cat > ~/.codex/config.toml << 'EOF'
model = "gpt-5-codex"
model_provider = "anyrouter"
preferred_auth_method = "apikey"
[model_providers.anyrouter]
name = "Any Router"
base_url = "https://anyrouter.top/v1"
wire_api = "responses"
EOF

6.4 创建认证文件

cat > ~/.codex/auth.json << 'EOF'
{
"OPENAI_API_KEY": "你的KEY"
}
EOF

6.5 使用 Codex

# 验证安装
codex --version
# 进入项目目录使用
cd your-project
codex

7. 常用 WSL 命令

7.1 查看和管理发行版

# 查看已安装的发行版
wsl --list --verbose
# 停止 WSL
wsl --shutdown
# 设置默认发行版
wsl --set-default Ubuntu

7.2 导出/导入发行版(备份或迁移)

# 导出发行版
wsl --export Ubuntu ubuntu_backup.tar
# 导入发行版
wsl --import Ubuntu C:\wsl\ubuntu C:\wsl\ubuntu_backup.tar

7.3 其他常用命令

# 卸载发行版
wsl --unregister Ubuntu
# 查看 WSL 版本
wsl --version
# 进入指定发行版
wsl -d Debian

参考资料

本文档参考了以下资源:

常见问题

Q: WSL 启动失败怎么办?
A: 尝试以下步骤:

  1. 确认已启用 “适用于 Linux 的 Windows 子系统” 和 “虚拟机平台”
  2. 检查 BIOS 是否启用了虚拟化技术 (Intel VT-x 或 AMD-V)
  3. 运行 wsl --shutdown 后重新启动

Q: 如何更新 WSL?
A: 在 PowerShell 中运行:

wsl --update

Q: 如何在 Windows 和 WSL 之间访问文件?
A:

  1. 在 WSL 中访问 Windows 文件:/mnt/c/Users/YourName/
  2. 在 Windows 中访问 WSL 文件:\wsl$\Ubuntu\home\username\