惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

U
Unit 42
Vercel News
Vercel News
博客园 - 叶小钗
大猫的无限游戏
大猫的无限游戏
MyScale Blog
MyScale Blog
P
Proofpoint News Feed
量子位
Engineering at Meta
Engineering at Meta
B
Blog RSS Feed
博客园 - 【当耐特】
Recent Announcements
Recent Announcements
Google DeepMind News
Google DeepMind News
D
DataBreaches.Net
Stack Overflow Blog
Stack Overflow Blog
博客园 - 聂微东
小众软件
小众软件
Hugging Face - Blog
Hugging Face - Blog
人人都是产品经理
人人都是产品经理
IT之家
IT之家
T
The Blog of Author Tim Ferriss
Last Week in AI
Last Week in AI
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
Jina AI
Jina AI
博客园 - 三生石上(FineUI控件)

繁星点点

最新轻量级龙虾部署教程 通过netboot.xyz重装系统 giffgaff卡保号教程 Llinux系统中全新透明代理方案(可代理所有出站流量) tailscale开启子网路由常见的坑 OpenWrt固件编译 解决UFW和Docker的问题 使用PGP的非对称算法加密文件 NSSM工具把任意exe程序注册为Windows后台服务 轻量级简约端口转发rinetd 安卓IDE的安装和使用 IP信息查询网站汇总 热点共享代理教程 SSH使用密钥认证登录详细解释 Debian系统公网IP出口切换指南,适用多IP服务器 Windows系统安装Scoop包管理器 安卓Flutter开发学习笔记 使用手机搭建节点服务端 关于github提交记录泄露真实邮箱的处理办法 anytls协议部署教程 caddy给域名用上ECH加密 通过gitlab流水线自动备份仓库 通过CF-Workers代理访问网站 低配机器使用alpine系统跑docker 端口敲门教程 3x-ui面板通过api管理示例 nmap端口扫描 数据库常用命令 snap和winget包管理器 Git推送GitHub常用命令
Github加速
2024-07-02 · via 繁星点点

GitHub加速站

本地代理:

sudo vim ~/.bashrc
export all_proxy="socks5://127.0.0.1:10808"
export HTTP_PROXY="socks5://127.0.0.1:10808"
export HTTPS_PROXY="socks5://127.0.0.1:10808"
source ~/.bashrc

此时输入curl ip.sb查看本机IP判断是否配置成功

如需删除并停止,只需清空文件并重新加载即可

注意:如果脚本命令前面带sudo,则需要添加-E传递环境变量才会生效

Git加速域名

# 设置全局加速
git config --global url."https://gh-proxy.com/https://github.com/".insteadOf https://github.com/

# 移除
git config --global --unset url."https://gh-proxy.com/https://github.com/".insteadOf

# 验证
git config --global --get-regexp github

Git代理

git config --global http.proxy socks5://127.0.0.1:10808
git config --global https.proxy socks5://127.0.0.1:10808

v2rayA代理

官方文档

手动使用软件源安装

手动下载v2rayA软件源上传到服务器

手动下载xray软件源上传到服务器

安装

sudo apt install xray.deb路径 v2rayA.deb路径

替换两个deb包所在的实际路径

启动

sudo systemctl start v2raya.service
默认端口:
2017: v2rayA面板端口
20170: SOCKS协议
20171: HTTP协议
20172: 带分流规则的HTTP协议
32345: tproxy透明代理所需

卸载

sudo apt-get remove v2raya xray

快捷安装方式

v2ray内核

sudo apt install snapd
sudo snap install v2raya

需要修改配置文件

sudo vim /etc/systemd/system/snap.v2raya.v2raya.service

ExecStart参数后面增加 --address 0.0.0.0:2017,只需增加即可,注意空格需保留。

加载并重启

sudo systemctl daemon-reload
sudo systemctl restart snap.v2raya.v2raya.service

卸载

sudo snap remove v2raya

win系统安装

以管理员身份运行PowerShell

winget install --id v2rayA.v2rayA

会自动安装到桌面,启动后自动配置系统代理,端口为52345

部分应用(比如命令行程序)可能不读取或者不使用系统代理,你可能需要proxychains来强行让它们走代理,或者使用程序自身的代理配置。

如果 v2rayA 意外退出,那么 v2rayA 无法在退出的时候帮你取消系统代理,这种情况下你需要自行去Internet选项或者系统设置里面关掉代理。

更新

winget upgrade --id v2rayA.v2rayA

卸载

winget uninstall --id v2rayA.v2rayA

开机自启

将你scoop\shims目录下的start-v2raya.cmd复制到启动文件夹(一般位于 C:\Users\YourUserName\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Startup)。

命令运行示例:

Copy-Item -Path '~\scoop\shims\start-v2raya.cmd' -Destination '~\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Startup'


国内Debian / Ubuntu切换apt源

国内一键换源脚本

bash <(curl -sSL https://gitee.com/SuperManito/LinuxMirrors/raw/main/ChangeMirrors.sh)

手动换源

需要root权限

先备份sudo cp /etc/apt/sources.list /etc/apt/sources.list.bak

打开文件/etc/apt/sources.list

国内清华大学debian 11

deb https://mirrors.tuna.tsinghua.edu.cn/debian/ bullseye main contrib non-free
deb-src https://mirrors.tuna.tsinghua.edu.cn/debian/ bullseye main contrib non-free

deb https://mirrors.tuna.tsinghua.edu.cn/debian-security bullseye-security main contrib non-free
deb-src https://mirrors.tuna.tsinghua.edu.cn/debian-security bullseye-security main contrib non-free

deb https://mirrors.tuna.tsinghua.edu.cn/debian/ bullseye-updates main contrib non-free
deb-src https://mirrors.tuna.tsinghua.edu.cn/debian/ bullseye-updates main contrib non-free

国内清华大学ubuntu 20.04

deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ focal main restricted universe multiverse
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ focal-updates main restricted universe multiverse
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ focal-backports main restricted universe multiverse
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ focal-security main restricted universe multiverse

# deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ focal main restricted universe multiverse
# deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ focal-updates main restricted universe multiverse
# deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ focal-backports main restricted universe multiverse
# deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ focal-security main restricted universe multiverse

## Pre-released source, not recommended.
# deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ focal-proposed main restricted universe multiverse
# deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ focal-proposed main restricted universe multiverse

官方debian 11

deb https://deb.debian.org/debian/ bullseye main contrib non-free
deb-src https://deb.debian.org/debian/ bullseye main contrib non-free

deb https://deb.debian.org/debian/ bullseye-updates main contrib non-free
deb-src https://deb.debian.org/debian/ bullseye-updates main contrib non-free

deb https://deb.debian.org/debian/ bullseye-backports main contrib non-free
deb-src https://deb.debian.org/debian/ bullseye-backports main contrib non-free

deb https://deb.debian.org/debian-security/ bullseye-security main contrib non-free
deb-src https://deb.debian.org/debian-security/ bullseye-security main contrib non-free

官方debian 12

deb http://deb.debian.org/debian bookworm main contrib non-free non-free-firmware
deb-src http://deb.debian.org/debian bookworm main contrib non-free non-free-firmware

deb http://deb.debian.org/debian-security/ bookworm-security main contrib non-free non-free-firmware
deb-src http://deb.debian.org/debian-security/ bookworm-security main contrib non-free non-free-firmware

deb http://deb.debian.org/debian bookworm-updates main contrib non-free non-free-firmware
deb-src http://deb.debian.org/debian bookworm-updates main contrib non-free non-free-firmware

更新源

sudo apt update

切换完成


配置 APT 包管理器的代理服务器设置

编辑/etc/apt/apt.conf.d/proxy.conf

Acquire::http::Proxy "socks5h://127.0.0.1:1080";
Acquire::https::Proxy "socks5h://127.0.0.1:1080";
Acquire::socks::Proxy "socks5h://127.0.0.1:1080";
sudo apt update

修改系统hosts文件实现加速(老方法不稳定):

  • 文件路径:
windows: C:\Windows\System32\drivers\etc 
linux: /etc/hosts
  • 格式:
127.0.0.11 github.com
127.0.0.11 raw.githubusercontent.com
127.0.0.11 assets-cdn.github.com
127.0.0.11 github.global.ssl.fastly.net

127.0.0.11替换为查询到的地址

可以从这里获取最新可用的hosts地址:https://github.com/521xueweihan/GitHub520/blob/main/hosts

该内容会每天自动更新。

修改 hosts 文件

hosts 文件在每个系统的位置不一,详情如下:

  • Windows 系统:C:\Windows\System32\drivers\etc\hosts
  • Linux 系统:/etc/hosts
  • Mac(苹果电脑)系统:/etc/hosts
  • Android(安卓)系统:/system/etc/hosts
  • iPhone(iOS)系统:/etc/hosts

修改方法,把上面的内容复制到文本末尾:

  1. Windows 使用记事本
  2. Linux、Mac 使用 Root 权限:sudo nano /etc/hosts
  3. iPhone、iPad 须越狱、Android 必须要 root

激活生效

大部分情况下是直接生效,如未生效可尝试下面的办法,刷新 DNS:

  1. Windows:在CMD窗口输入:ipconfig /flushdns

  2. Linux命令:sudo systemctl restart nscd 如报错则须安装:sudo apt install nscdsudo /etc/init.d/nscd restart

  3. Mac命令:sudo killall -HUP mDNSResponder

PS: 上述方法无效可以尝试重启机器。