一键回程测试脚本:backtrace 三网回程路由测试使用教程

首先简单介绍一下 backtrace 这个脚本,这个脚本是在 GitHub 上看到的,目前仅有的介绍其实就是一个 GitHub 项目主页。

GitHub 主页:https://github.com/zhanghanyun/backtrace

目前作者没有添加更多介绍,只有简单的一句“三网回程路由测试”。

二、backtrace 一键测试脚本使用教程

backtrace 一键测试脚本使用也很简单,登录 VPS 之后输入下面的命令即可:

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

输入之后回车即可开始测试。

如何限制rockyLinux8网卡速度

在 Rocky Linux 8 中,我们可以使用 tc (traffic control) 命令来实现端口限速。以下是具体步骤:

  1. 首先安装必要的工具:
bash
dnf install -y iproute-tc
  1. 基本的限速命令格式(以限制下载速度为例):
bash
tc qdisc add dev eth0 root tbf rate 1mbit burst 32kbit latency 400ms
  1. 对特定端口限速的完整示例(使用 iptables 配合 tc):
bash
# 创建新的 tc 规则
tc qdisc add dev eth0 root handle 1: htb default 10

# 创建限速类
tc class add dev eth0 parent 1: classid 1:1 htb rate 1mbit ceil 1mbit

# 使用 iptables 标记特定端口的流量
iptables -A OUTPUT -p tcp --sport 80 -j MARK --set-mark 1
iptables -A INPUT -p tcp --dport 80 -j MARK --set-mark 1

# 将标记的流量匹配到限速类
tc filter add dev eth0 protocol ip parent 1: prio 1 handle 1 fw flowid 1:1

参数说明:

  • rate: 平均速率
  • burst: 突发流量大小
  • latency: 数据包延迟
  • mbit: 兆比特/秒
  • kbit: 千比特/秒

删除限速规则:

bash
tc qdisc del dev eth0 root

查看当前限速规则:

bash
tc -s qdisc ls dev eth0

需要注意:

  1. 将 eth0 替换为您实际的网络接口名称
  2. 根据实际需求调整速率值
  3. 建议先测试小流量,再逐步调整参数

    如果要限速 1G,需要修改 rate 和 burst 的值,这里给出命令:

    bash
    tc qdisc add dev eth0 root tbf rate 1gbit burst 1mbit latency 400ms

    解释一下参数:

    • rate 1gbit:限制速率为 1 Gigabit/秒
    • burst 1mbit:突发缓冲区设为 1 Megabit
    • latency 400ms:延迟保持 400 毫秒

    如果要查看是否生效:

    bash
    tc -s qdisc ls dev eth0

    如果要删除限速:

    bash
    tc qdisc del dev eth0 root

    如果要限速 500M,将 rate 值设为 500mbit:

    bash
    tc qdisc add dev eth0 root tbf rate 500mbit burst 500kbit latency 400ms

    参数说明:

    • rate 500mbit:限制速率为 500 Megabit/秒
    • burst 500kbit:突发缓冲区设为 500 Kilobit(一般设置为与 rate 对应的较小值)
    • latency 400ms:延迟保持 400 毫秒

    验证和管理命令:

    bash
    # 查看限速规则
    tc -s qdisc ls dev eth0

    # 如果要删除限速
    tc qdisc del dev eth0 root

    记得将 eth0 替换为您实际的网络接口名称。

VPS 限制网速带宽 Linux网卡限速

Wondershaper介绍: WonderShaper 是一个限制网络带宽的脚本, 可用于对特定网卡进行带宽限速, 它封装了linux的tc命令, 但是使用起来更加简单和方便.

安装 wondershaper

curl -Lo /usr/sbin/wondershaper https://raw.githubusercontent.com/magnific0/wondershaper/master/wondershaper;
chmod +x /usr/sbin/wondershaper;

查询网卡

ifconfig # 大多数为 eth0

对网卡设置限速

wondershaper -a eth0 -d 5000  -u 2000 # 限制 下载 5Mbps, 上传 2Mbps
wondershaper -a eth0 -d 90000 -u 90000 # 限制 下载  90Mbps, 上传 90Mbps
wondershaper -a eth0 -d 900000 -u 900000 # 限制 下载 900Mbps, 上传 900Mbps
wondershaper -a eth0 -d 900000 -u 900000

-a 网卡名(这里设了 eth0)
-d 下载速度 (单位为 Kbps)
-u 上传速度 (单位为 Kbps)
速度单位为 Kbps(Kbit/s) (100000 Kbps = 100Mbps = 12.5 MB/s)

取消网卡限速

wondershaper -a eth0 -c # eth0 为网卡名

查看状态

wondershaper -a eth0 -s # eth0 为网卡名

speedtest 测试网速

安装speedtest 的教程

speedtest # 根据就近节点, 测试限速效果

防止重启机器, 限速失效

  • 安装服务:
    curl -Lo /etc/systemd/system/wondershaper.service https://raw.githubusercontent.com/magnific0/wondershaper/master/wondershaper.service;
    systemctl daemon-reload;
  • 创建配置文件
    curl -Lo /etc/systemd/wondershaper.conf https://raw.githubusercontent.com/magnific0/wondershaper/master/wondershaper.conf;
    # 编辑 配置文件
    vim /etc/systemd/wondershaper.conf
    # 根据需要, 修改 IFACE, DSPEED, USPEED 的值即可
  • 启动服务
    systemctl enable --now wondershaper.service

限速的用途

某些VPS商家的带宽限速规则较严格, 比如多少分钟内, 占用过高(比如超过多少Mbps) 就限速.
自己手动限速, 可以避免 触发限速规则.

How to Use Free VPN to use TikTok in the US

VPN Free Download:http://jsq.my

Understanding the Need for a VPN

Due to various geo-restrictions, TikTok content might not be accessible in all regions. A VPN (Virtual Private Network) masks your IP address, making it appear as if you’re connecting from a different location. This allows you to bypass these restrictions and access TikTok content that might be blocked in your region.

Why Kuaiya VPN?

Kuaiya VPN is a popular choice for many users due to its:

  • Speed: Provides fast and reliable connections for smooth video streaming.
  • Security: Offers strong encryption to protect your online privacy.
  • Server locations: Has servers in various countries, allowing you to connect to TikTok from different regions.
  • Ease of use: User-friendly interface and apps for multiple devices.

Steps to Access TikTok Using Kuaiya VPN

  1. Download and Install Kuaiya VPN:

    • Visit the Kuaiya VPN website and download the app for your device (iOS, Android, Windows, macOS).
    • Follow the on-screen instructions to install the app.
  2. Create an Account and Subscribe:

    • Sign up for a Kuaiya VPN account.
    • Choose a subscription plan that suits your needs.
  3. Connect to a Server:

    • Open the Kuaiya VPN app and connect to a server located in a country where TikTok is accessible without restrictions. For example, you might choose a server in Japan or the United Kingdom.
  4. Open TikTok:

    • Once connected to the VPN, open the TikTok app or website. You should now be able to access TikTok content without any restrictions.

Additional Tips

  • Choose a Fast Server: Opt for a server located closer to you for faster speeds.
  • Test Different Servers: If you encounter any issues, try connecting to a different server.
  • Check for Updates: Regularly update the Kuaiya VPN app to benefit from the latest features and bug fixes.
  • Consider a Dedicated IP: For more consistent results, you might consider purchasing a dedicated IP address.

Important Note:

  • Legal Considerations: Always ensure that your use of a VPN complies with the laws and regulations in your jurisdiction.
  • Privacy Concerns: While VPNs can enhance your privacy, it’s important to choose a reputable VPN provider that has a strong privacy policy.
  • Performance: VPN usage might slightly decrease your internet speed.  

By following these steps, you should be able to access and enjoy TikTok content using Kuaiya VPN. Remember to check the specific instructions provided by Kuaiya VPN for any updates or changes to their service.

网站反代服务器出现报错 500 Internal Server Error

让我们逐步排查 Nginx 500 内部错误的可能原因:

  1. 查看错误日志
bash
# 默认错误日志位置
tail -f /var/log/nginx/error.log

# 或自定义错误日志位置
tail -f /usr/local/nginx/logs/error.log

  1. 常见原因和解决方案:
  • PHP-FPM 配置问题
nginx
# 检查 php-fpm 是否运行
systemctl status php-fpm

# 检查 nginx 配置中的 fastcgi_pass 是否正确
location ~ \.php$ {
fastcgi_pass unix:/run/php/php7.4-fpm.sock; # 确认socket路径正确
# 或
fastcgi_pass 127.0.0.1:9000; # 确认端口正确
}
  • 权限问题
bash
# 检查目录权限
chmod 755 /var/www/html
chown -R www-data:www-data /var/www/html

# 检查日志文件权限
chmod 755 /var/log/nginx

  • 反代配置问题
nginx
# 检查上游服务器配置
upstream backend {
server backend.example.com:8080;
}

location / {
proxy_pass http://backend;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
}

  • SELinux 问题
bash
# 临时关闭 SELinux 测试
setenforce 0

# 查看 SELinux 状态
getenforce

能否提供错误日志内容?这样可以更准确地定位问题。

socket() failed (24: Too many open files) while connecting to upstream

这个错误表示打开的文件句柄数达到了系统限制。需要从两个方面增加限制:

  1. 增加系统文件句柄限制:
bash
# 编辑 /etc/security/limits.conf,添加
* soft nofile 65535
* hard nofile 65535
root soft nofile 65535
root hard nofile 65535

# 编辑 /etc/sysctl.conf,添加
fs.file-max = 65535

# 应用 sysctl 设置
sysctl -p

  1. 修改 Nginx 配置:
nginx
# nginx.conf 主配置文件
worker_rlimit_nofile 65535; # 增加 worker 进程的文件句柄限制

events {
worker_connections 65535; # 增加每个 worker 的最大连接数
}

  1. 验证修改:
bash
# 检查当前系统限制
ulimit -n

# 重启 Nginx
systemctl restart nginx

# 检查 Nginx 进程的文件句柄限制
cat /proc/nginx进程id/limits

修改完成后需要重启系统使所有修改生效。如果问题持续,建议检查:

  • 实际并发连接数
  • 是否存在连接未正常释放的情况
  • 后端服务器的响应时间

DMIT圣诞节促销,香港CTG/日本CTG/美国CN2 VPS年付$100起,中国方向优质宽带

DMIT圣诞节促销,活动1:香港CTG/日本CTG/美国CN2优质线路特惠服务器年付$100起,且买二送一;活动2:TYO & HKG Tier 1 STARTER 或更高年付7折;活动3:TYO EB 系列最高可获得1.3倍流量。

DMIT 官网

https://www.dmit.io

DMIT限量套餐

中国大陆的优化路由、强大的 AMD EPYC 高性能硬体设施、面向个人和微型企业的高性价比服务。

日本 TYO.Pro.Shinagawa(买二送一)

  • CPU:1 vCPU
  • 内存:2G
  • 硬盘:60G SSD
  • 流量:500G/月
  • 速率:500Mbps
  • IP:1 * IPv4 + /64 IPv6
  • 价格:$199.99/年
  • 链接

香港 HKG.Pro.VICTORIA(买二送一)

  • CPU:1 vCPU
  • 内存:2G
  • 硬盘:60G SSD
  • 流量:500G/月
  • 速率:500Mbps
  • IP:1 * IPv4 + /64 IPv6
  • 价格:$298.88/年
  • 链接

美国洛杉矶 PVM.LAX.Pro.PalmSpring

  • CPU:2 vCPU
  • 内存:2G
  • 硬盘:40G SSD
  • 流量:2000G/月
  • 带宽:2Gbps
  • IP:1*IPv4+ IPv6 /64
  • 价格:$100/年
  • 链接

美国洛杉矶 LAX.EB.FONTANA

  • CPU:2 vCPU
  • 内存:2G
  • 硬盘:40G SSD
  • 流量:4000G/月
  • 带宽:4Gbps
  • IP:1*IPv4+ IPv6 /64
  • 价格:$100/年
  • 链接

香港 HKG.EB.WEEv2

  • CPU:1 vCPU
  • 内存:1G
  • 硬盘:20G SSD
  • 流量:450G/月
  • 带宽:500Mbps
  • IP:1*IPv4+ IPv6 /64
  • 价格:$179.9/年
  • 链接

日本 TYO.EB.WEE

  • CPU:1 vCPU
  • 内存:1G
  • 硬盘:20G SSD
  • 流量:450G/月
  • 带宽:500Mbps
  • IP:1*IPv4+ IPv6 /64
  • 价格:$154.9/年
  • 链接

*特别产品限量供应,售完即止。部分特殊产品标有“买二送一”的标签,代表参与买二送一活动,活动详情见下方。

一加一等于二

但现在您可以,免费获得第三个

在活动期间内,
购买任意两件 Pro 或 EB 系列产品,即可免费获得一件额外的 Pro 或 EB 产品。

套餐 CPU 内存 硬盘 流量 带宽 价格 链接
HKG.Pro.STARTER 1 vCPU 2G 40G 800G/月 1Gbps $79.9/月 链接
TYO.Pro.STARTER 1 vCPU 2G 40G 500G/月 1Gbps $39.9/月 链接
LAX.Pro.STARTER 2 vCPU 2G 80G 3000G/月 10Gbps $29.9/月 链接

*如果购买的两种产品不同,赠送的产品将是其中价值较低的产品,赠送的产品仅在第一个帐单周期免费,续订时将收取费用。

*此处仅列出推荐产品,任何 Pro 或 EB 系列的常规产品均可参与此促销活动。部分特别产品(限量供应)标有“买二送一”的标签,代表参与该活动,否则不参与。请求免费赠送的产品(您可以要求将免费产品添加到一个指定的账户)后,购买的两个产品将无法退款。

折扣,最高 30%

活动期间购买 TYO & HKG Tier 1 STARTER 或更高的系列产品

HKG Tier 1

测试IP:103.135.248.120

年付7折优惠码:T1-CHRISTMAS-2024-ANNUALLY-30OFF

半年付8折优惠码:T1-CHRISTMAS-2024-SEMI-ANNUALLY-20OFF

套餐 CPU 内存 硬盘 流量 带宽 价格 链接
STARTER 1核 2G 40G 4T/月 10Gbps $108.36/年 链接
MINI 2核 2G 60G 8T/月 10Gbps $183.96/年 链接
MICRO 2核 4G 80G 16T/月 10Gbps $276.36/年 链接
MEDIUM 4核 8G 160G 32T/月 10Gbps $419.16/年 链接
LARGE 8核 16G 320G 64T/月 10Gbps $839.16/年 链接
GIANT 8核 24G 640G 128T/月 10Gbps $1679.16/年 链接

TYO Tier 1

年付7折优惠码:T1-CHRISTMAS-2024-ANNUALLY-30OFF

半年付8折优惠码:T1-CHRISTMAS-2024-SEMI-ANNUALLY-20OFF

套餐 CPU 内存 硬盘 流量 带宽 价格 链接
STARTER 1核 2G 40G 4T/月 10Gbps $108.36/年 链接
MINI 2核 2G 60G 8T/月 10Gbps $183.96/年 链接
MICRO 2核 4G 80G 16T/月 10Gbps $276.36/年 链接
MEDIUM 4核 8G 160G 32T/月 10Gbps $419.16/年 链接
LARGE 8核 16G 320G 64T/月 10Gbps $839.16/年 链接
GIANT 8核 24G 640G 128T/月 10Gbps $1679.16/年 链接

*Tier 1 (T1) 系列产品不包含任何中国内地网路优化,从中国内地访问可能伴有较高的延时和丢包。

额外流量,最高 30%

活动期间购买 TYO EB 系列产品,即可获得高达 30% 的额外流量

年付1.3倍流量优惠码:EB-CHRISTMAS-2024-ANNUALLY-1.3X-TRANSFER

半年付1.2倍流量优惠码:EB-CHRISTMAS-2024-SEMI-ANNUALLY-1.2X-TRANSFER

季付1.1倍流量优惠码:EB-CHRISTMAS-2024-QUARTERLY-1.1X-TRANSFER

套餐 CPU 内存 硬盘 流量 带宽 价格 链接
TINY 1核 1G 20G 1T/月 1Gbps $25.9/月 链接
STARTER 1核 2G 40G 2T/月 2Gbps $55.9/月 链接
MINI 2核 2G 60G 3T/月 2Gbps $85.9/月 链接
MICRO 4核 4G 80G 4T/月 4Gbps $119.9/月 链接
MEDIUM 4核 8G 160G 6T/月 4Gbps $179.9/月 链接
LARGE 8核 16G 320G 12T/月 4Gbps $369.9/月 链接
GIANT 8核 24G 640G 24T/月 4Gbps $749.9/月 链接

wget 递归下载整个网站(网站扒皮必备)

有时间看到别人网站的页面比较漂亮,就想给扒皮下来,学习学习。分享一个我常用网站扒皮命令wget

这个命令可以以递归的方式下载整站,并可以将下载的页面中的链接转换为本地链接。

wget加上参数之后,即可成为相当强大的下载工具。

wget命令详解

wget -r -p -np -k http://xxx.com/xxx

-r, –recursive(递归) specify recursive download.(指定递归下载)

-k, –convert-links(转换链接) make links in downloaded HTML point to local files.(将下载的HTML页面中的链接转换为相对链接即本地链接)

-p, –page-requisites(页面必需元素) get all images, etc. needed to display HTML page.(下载所有的图片等页面显示所需的内容)

-np, –no-parent(不追溯至父级) don’t ascend to the parent directory.

另外断点续传用-nc参数 日志 用-o参数

拿我自己的网站扒皮试一下吧

执行 wget -r -p -np -k http://www.phpernote.com/ 命令

wget 递归下载整个网站(网站扒皮必备)一

等网站递归下载完毕,你会发现你当前目录会有一个 www.phpernote.com/ 的目录

进入这个目录看一下

wget 递归下载整个网站(网站扒皮必备)二

熟练掌握wget命令,可以帮助你扒皮网站。

iptables封禁BT/PT/SPAM(垃圾邮件)和自定义端口/关键词一键脚本

说明:通常我们买的VPS如果乱发垃圾邮件(SPAM)和下载BTPT等都会导致VPSIDC封杀。按照博主的经验来看发垃圾邮件被封杀几率是非常大的,不过对于BTPT来说,有的商家虽然有规定不许下载,但都是睁一只眼闭一只眼,只要不被投诉就没事。但还是要注意点,特别是喜欢分享55R等梯子的人,最好都给封上,以防万一。

安装

注意:本脚本邮件端口是完全可以封住的,但是BTPT就不是100%的了,封不干净,这个没办法。
系统要求:CentOS 6+/Debian 6+/Ubuntu 14.04 +

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

运行脚本后会出现脚本操作菜单,选择并输入对应的数字来操作。

提示:既然是iptables防火墙规则,那VPS肯定是要安装iptables的,不过一般都安装的有,除了坑爹的CentOS 7需要关闭自带的防火墙安装iptables

使用说明

进入下载脚本的目录并运行脚本:

./ban_iptables.sh

然后选择你要执行的选项即可。

 iptables防火墙 封禁管理脚本 [vX.X.X]
 -- Toyo | doub.io/shell-jc2 --
 
 0. 查看 当前封禁列表
————————————
 1. 封禁 BT、PT
 2. 封禁 SPAM(垃圾邮件)
 3. 封禁 BT、PT+SPAM
 4. 封禁 自定义 端口
 5. 封禁 自定义关键词
————————————
 6. 解封 BT、PT
 7. 解封 SPAM(垃圾邮件)
 8. 解封 BT、PT+SPAM
 9. 解封 自定义 端口
10. 解封 自定义关键词
11. 解封 所有  关键词
————————————
12. 升级脚本
 
请输入数字 [0-11]:

其他操作

为了方便,我也做了几个快捷的命令,不需要进入菜单去选择对应的选项,直接就能封禁/解封。

./ban_iptables.sh banbt
# 封禁 BT、PT
 
./ban_iptables.sh banspam
# 封禁 SPAM(垃圾邮件)
 
./ban_iptables.sh banall
# 封禁 BT、PT+SPAM
 
./ban_iptables.sh unbanbt
# 解封 BT、PT
 
./ban_iptables.sh unbanspam
# 解封 SPAM(垃圾邮件)
 
./ban_iptables.sh unbanall
# 解封 BT、PT+SPAM

脚本地址:https://doub.io/shell-jc2/