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

推荐订阅源

P
Proofpoint News Feed
博客园_首页
WordPress大学
WordPress大学
大猫的无限游戏
大猫的无限游戏
有赞技术团队
有赞技术团队
阮一峰的网络日志
阮一峰的网络日志
Hugging Face - Blog
Hugging Face - Blog
博客园 - 【当耐特】
酷 壳 – CoolShell
酷 壳 – CoolShell
Y
Y Combinator Blog
Vercel News
Vercel News
The GitHub Blog
The GitHub Blog
T
The Blog of Author Tim Ferriss
云风的 BLOG
云风的 BLOG
博客园 - 司徒正美
Engineering at Meta
Engineering at Meta
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
J
Java Code Geeks
Stack Overflow Blog
Stack Overflow Blog
N
Netflix TechBlog - Medium
Martin Fowler
Martin Fowler
宝玉的分享
宝玉的分享
G
Google Developers Blog
Last Week in AI
Last Week in AI

jdhao's digital space

Conversion between base64 and OpenCV or PIL Image 腾讯云对象存储博客图床开启 CDN 加速(不需要购买额外域名) Search and Replace in Multiple Files in Vim/Neovim Change Table Column Width in LaTeX Image or Table Side by Side in LaTeX LaTeX 并排显示图像或表格 Firenvim: Neovim inside Your Browser Content inside HTML tags missing in Latest Hugo? Creating Markdown Front Matter with Ultisnips Labelme JSON 标注格式转 voc XML 格式 Nifty Nvim Techniques That Make My Life Easier -- Series 6 macOS 下如何为视频制作字幕 Running Command Asynchronously inside Neovim Resolving Merge Conflict after Git Stash Pop Pylint: command not found? A Hands-on Experience with Neovim's Built-in LSP Support How to Convert PDF to Images with Imagemagick 互联网上常用缩略语集锦 File Backup in Neovim Converting PDF Pages to Images with Poppler Nifty Nvim Techniques That Make My Life Easier -- Series 5 Neovim Configuration for System-wide Use How to sort a list of tuple or list in Python -- lambda or itemgetter? Building A Vim Statusline from Scratch 人类第一颗原子弹爆炸始末 Distributed Training in PyTorch with Horovod Learning Expect Programming Essential Knowledge about SSH Nifty LaTeX Techniques -- Series 1 更改 Adsense 邮寄地址,重新寄送 PIN
使用代理加速 Mac 终端下载速度
2019-10-10 · via jdhao's digital space

在 Mac 的终端 (terminal) 下载文件或者 clone git 仓库的时候,明显感觉速度特别慢,即使把梯子的全局模式打开也无济于事,需要在终端设置代理才能加快下载速度,本文简要总结需要的配置。

在 Unix 终端,有三个和代理相关的环境变量,分别为 http_proxy, https_proxyall_proxy。粗略来说,http_proxyhttps_proxy 分别用来设置 http 和 https连接的代理,all_proxy 设置所有连接的代理。

对于 git clone,由于连接一般是 https 连接,可以设置 https_proxy 或者all_proxy 变量,设置 http_proxy 没有作用。

一般来说代理可以是 http 代理,也可以是 socks5 代理,格式如下:

export https_proxy=127.0.0.1:1087  # http 代理
export https_proxy="socks5://127.0.0.1:1087"  # socks5 代理

我目前使用的 梯子,支持 socks5 协议,也支持 http 协议,打开 偏好设置 --> 高级 选项,可以看到socks5 协议的 ip 以及端口,在 http 选项卡,可以看到 http 代理的信息。

设置好代理以后,可以使用 curl cip.cc 查看当前自己的 ip 信息,确认代理是否设置成功。

References#