360 Secure SkillHub
360 安全技能中心

Github Hosts Optimizer

该 Skill 提供 Python 脚本,在 Linux 服务器上检测 GitHub CDN 可达性、通过 DNS 查询选取 IP 并写入 /etc/hosts,写入前自动备份,并附带回滚脚本;需以 sudo 与 python3 运行,目标是缓解 GitHub 连接超时与速率限制。

分类:自动化
guanqi0914
guanqi0914
热度 0.00
最近更新 2026-03-24 11:02:00

安装

发给 Agent
帮我安装这个技能:npx secure-skills-cli add guanqi0914/github-hosts
兼容性
通用兼容
联网要求
需要联网
数据出网
数据不出本机
Metadata
name
GitHub Hosts Optimizer
description
Optimize server access to GitHub via /etc/hosts. Auto-detect CDN IP failures, discover new IPs via DNS, update hosts with backup. Fixes GitHub rate limits and connection timeouts.
metadata
{"openclaw":{"tags":["github","hosts","network","linux","optimization"]}}
version
1.1.1

GitHub Hosts Optimizer

Fix GitHub timeout and rate limits via /etc/hosts optimization.

One-Line Run

sudo python3 scripts/update_hosts.py

How It Works

  1. Test GitHub CDN reachability
  2. Find fastest IP via DNS lookup
  3. Append to /etc/hosts
  4. Auto-backup before each change

Commands

# Run optimization
sudo python3 scripts/update_hosts.py

# Force refresh
sudo python3 scripts/update_hosts.py --force

# Check status
grep github.com /etc/hosts