首页
Search
1
解决visual studio code (vscode)安装时没有选择安装路径问题
138 阅读
2
Linux 下 Bash 脚本 bad interpreter 报错的解决方法
131 阅读
3
Arch Linux 下解决 KDE Plasma Discover 的 Unable to load applications 错误
107 阅读
4
如何在 Clash for Windows 上配置服务
76 阅读
5
Uniapp如何引入自定义样式文件
75 阅读
clash
服务器
javascript
全部
游戏资讯
登录
Search
加速器之家
累计撰写
1,061
篇文章
累计收到
0
条评论
首页
栏目
clash
服务器
javascript
全部
游戏资讯
页面
搜索到
47
篇与
的结果
2024-08-12
Debian 使用 Speedtest CLI 进行测速
本文将指导如何在 Debian 12 和 Ubuntu 22.04 下安装并使用 Speedtest CLI 进行测速。安装 Speedtest CLISpeedtest CLI 是 Ookla 官方推出的 Linux / BSD 下的 CLI 工具,方便我们在服务器里直接测试公网带宽速度。首先,导入 GPG Key 并添加源:apt install -y lsb-release ca-certificates apt-transport-https curl gnupg dpkg curl -sSL https://packagecloud.io/ookla/speedtest-cli/gpgkey | gpg --dearmor > /usr/share/keyrings/speedtest.gpg echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/speedtest.gpg] https://packagecloud.io/ookla/speedtest-cli/debian/ $(lsb_release -sc) main" > /etc/apt/sources.list.d/speedtest.list apt install -y lsb-release ca-certificates apt-transport-https curl gnupg dpkg curl -sSL https://packagecloud.io/ookla/speedtest-cli/gpgkey | gpg --dearmor > /usr/share/keyrings/speedtest.gpg echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/speedtest.gpg] https://packagecloud.io/ookla/speedtest-cli/ubuntu/ $(lsb_release -sc) main" > /etc/apt/sources.list.d/speedtest.list 然后更新系统并安装 speedtest:apt update apt install speedtest -y 使用 Speedtest CLI安装完毕后我们即可使用默认的 speedtest 命令选择最近的节点并使用默认的网络测速,提示 Do you accept the license? [type YES to accept] 时,输入 YES 并回车即可:高级用法输入 speedtest -h 即可查看 speedtest 的命令参数:root@debian ~ # speedtest -h Speedtest by Ookla is the official command line client for testing the speed and performance of your internet connection. Version: speedtest 1.1.1.28 Usage: speedtest [<options>] -h, --help Print usage information -V, --version Print version number -L, --servers List nearest servers -s, --server-id=# Specify a server from the server list using its id -I, --interface=ARG Attempt to bind to the specified interface when connecting to servers -i, --ip=ARG Attempt to bind to the specified IP address when connecting to servers -o, --host=ARG Specify a server, from the server list, using its host's fully qualified domain name -p, --progress=yes|no Enable or disable progress bar (Note: only available for 'human-readable' or 'json' and defaults to yes when interactive) -P, --precision=# Number of decimals to use (0-8, default=2) -f, --format=ARG Output format (see below for valid formats) --progress-update-interval=# Progress update interval (100-1000 milliseconds) -u, --unit[=ARG] Output unit for displaying speeds (Note: this is only applicable for ‘human-readable’ output format and the default unit is Mbps) -a Shortcut for [-u auto-decimal-bits] -A Shortcut for [-u auto-decimal-bytes] -b Shortcut for [-u auto-binary-bits] -B Shortcut for [-u auto-binary-bytes] --selection-details Show server selection details --ca-certificate=ARG CA Certificate bundle path -v Logging verbosity. Specify multiple times for higher verbosity --output-header Show output header for CSV and TSV formats Valid output formats: human-readable (default), csv, tsv, json, jsonl, json-pretty Machine readable formats (csv, tsv, json, jsonl, json-pretty) use bytes as the unit of measure with max precision Valid units for [-u] flag: Decimal prefix, bits per second: bps, kbps, Mbps, Gbps Decimal prefix, bytes per second: B/s, kB/s, MB/s, GB/s Binary prefix, bits per second: kibps, Mibps, Gibps Binary prefix, bytes per second: kiB/s, MiB/s, GiB/s Auto-scaled prefix: auto-binary-bits, auto-binary-bytes, auto-decimal-bits, auto-decimal-bytes比较实用的有:指定出口网卡:speedtest -I 指定网卡名称 指定出口 IP:speedtest -i IP 地址 注意指定网卡或 IP 后可能会出现 [error] Error: [0] Cannot open socket 的错误提示,忽略即可。查看附近的测速节点列表:speedtest -L 指定某个测速节点:speedtest -s 测速节点 ID 最后秀一下我们的 40Gbps 公网带宽服务器:
2024年08月12日
53 阅读
0 评论
0 点赞
2024-08-12
Debian / Ubuntu 手工添加 Swap 分区
本文将指导如何在 Debian 11 和 Ubuntu 22.04 下手工添加 Swap 分区。准备工作首先,检查你的系统是否已经有 Swap 分区:swapon -s 或free -m 如果没有返回结果或者 free -m 中 Swap 一列数值是 0,则表示你的系统没有 Swap 分区。创建 SWAP 分区我们可以使用 fallocate 命令创建一个 1GB 大小的 Swap 分区:fallocate -l 1G /swapfile 如果这个命令无法使用,请安装 util-linux 包:apt install util-linux 然后设置这个文件的权限:chmod 600 /swapfile 然后激活 SWAP 分区mkswap /swapfile swapon /swapfile 此时,你可以使用 swapon -s 或 free -m 命令查看 Swap 分区是否已经激活。设置开机自启我们需要编辑 /etc/fstab 这个文件,加入下面的内容即可:echo "/swapfile swap swap defaults 0 0" >> /etc/fstab 大功告成,使用 free -m 命令查看 Swap 分区是否正确:调整系统内核 Swappiness 值Swapiness 是 Linux 内核的一个属性,定义了系统使用交换空间的频率,Swapiness 的值在 0 到 100 之间 (默认是 60),一个低的值会使内核尽可能地避免交换,而一个高的值会使内核更积极地使用交换空间。这个值默认是 60,我们可以使用 cat /proc/sys/vm/swappiness 命令查看当前值。一般我们可以给他改成 10:echo "vm.swappiness=10" >> /etc/sysctl.conf 然后使用 sysctl -p 命令使其生效。关闭 Swap有时候我们需要关闭 Swap 分区,可以使用下面的命令:首先,停用 Swap 分区:swapoff -v /swapfile 然后检查 /etc/fstab,删除 /swapfile swap swap defaults 0 0 这一行。最后删除 /swapfile 这个文件:rm /swapfile
2024年08月12日
11 阅读
0 评论
0 点赞
1
...
9
10