Skip to content

Instantly share code, notes, and snippets.

@tanpengsccd
Last active September 2, 2023 02:11
Show Gist options
  • Save tanpengsccd/24050bfa94bcbb03c84ef464788aa178 to your computer and use it in GitHub Desktop.
Save tanpengsccd/24050bfa94bcbb03c84ef464788aa178 to your computer and use it in GitHub Desktop.
科学上网备忘录

前言:

为什么要科学上网

  1. google 查资料
  2. stackOverFlow(google api被墙)
  3. 想体验Google的全家桶套餐(chrome云服务,gmail,youtube,play,hangout,google voice等)
  4. 一些依赖源下载慢甚至无法下载

为什么不建议用第三方如蓝灯或者飞机场等免费/收费软件

  1. 稳定 (用的人多,随时被墙)
  2. 安全 (一般不可能开源)
  3. 速度 (看VPS宽带位置)

软件 V2ray支持SS和Vmess协议

Mac: https://github.com/Cenmrev/V2RayX
win: https://github.com/2dust/v2rayN
iOS: shadowrocket(不开源,非国区可购买)(逆向) https://github.com/we11cheng/WCShadowrocket
安卓: https://github.com/2dust/v2rayNG

v2rayN(windows) 含节点 链接: https://pan.baidu.com/s/1bV_I7Cw3qCRQFayRuNH6zg 提取码: 1wus ss/V2ray使用有限制。只能代理基于http协议的请求,ssh,curl,git 无法代理

常用解决方案

SS/V2ray + 全局/pac = 直接使用
SS/V2ray + Chrome (swichyOmega) = 网页浏览
SS/V2ray + 配置 = wget/curl 下载
SS/V2ray + proxtChains-ng = 下载/运行程序

其他方案

git

http://blog.fazero.me/2015/07/11/%E7%94%A8shadowsocks%E5%8A%A0%E9%80%9Fgit-clone/ 1)用 proxychains 这类透明代理,间接走系统中运行的代理工具中转; 2)用 git 内置代理,直接走系统中运行的代理工具中转,比如,你的 SS 本地端口是 1081,那么可以如下方式走代理

//git协议下 特定地址走代理
git config --global http.https://github.com.proxy socks5://127.0.0.1:1081

//git协议下 全走代理

git config --global http.proxy http://[proxyuser]:[proxypwd]@[proxy.server.com]:8080
git config --global http.proxy socks5://127.0.0.1:1081
git config --global https.proxy socks5://127.0.0.1:1081
git config core.gitproxy '"ssh" for kernel.org' 'for kernel.org$'

取消代理设置

git config --global --unset http.proxy

检查是否设置成功

git config --global --get http.proxy

大部分基于Unix的系统可直接编辑 ~/.gitconfig 文件

设置git缓存池

git config --global http.postBuffer 524288000

可能需要设置v2ray的TCP连接,KCP常出现 error: RPC failed; curl 18 transfer closed with outstanding read data remaining

curl 代理

需要设置环境

export https_proxy=http://127.0.0.1:8001;
export http_proxy=http://127.0.0.1:8001;
export all_proxy=socks5://127.0.0.1:1081

取消代理环境

unset https_proxy               
unset http_proxy    
unset all_proxy

wget

cocoapods

换源 淘宝 https://ruby.taobao.com

proxychains-ng Hood软件 代理

brew install proxychains-ng
修改 /usr/local/etc/proxychains.conf

# 修改原 
socks4 	127.0.0.1 9050
# 为 本地代理地址
socks5  127.0.0.1 1081

使用

proxychains4 [原来命令行]
如 安装Logitech 速度非常慢,就可以Hook 代理 下载,飞快
╭─tanpengsccd@tanpengsccds-Mac-Pro ~
╰─$ proxychains4 open /Users/tanpengsccd/Downloads/lghub_installer.app
[proxychains] config file found: /usr/local/etc/proxychains.conf
[proxychains] preloading /usr/local/Cellar/proxychains-ng/4.13/lib/libproxychains4.dylib
[proxychains] DLL init: proxychains-ng 4.13

安利内容

Google全家桶

  1. chrome 有 extensions/app 商店有很多有意思的插件/app,可自动同步插件,win,mac,Linux。还支持 chrome os
  2. youtube 有很多有意思的东西
  3. gmail 15亿用户的选择
  4. google play,自家商店自动同步,安全简洁(比如爱奇艺 没什么广告)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment