Giter VIP home page Giter VIP logo

blog-back's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

sf-breeze

blog-back's Issues

【效率】让你mac的终端飞起来

本文首发:https://github.com/wsdo/blog/issues/5
stark.wang 作为开发者经常使用 npm 安装某些包的时候, wget 或curl 下载某些东西的时候、git、brew ,使用docker下载镜像的时候,等场景,经常出现超慢 timeout 卡死。 对于开发者来说,这是一个很棘手的事情,也是每天常见的一个问题。

如何让我们的终端 never timeout

依赖:对于程序员来说耳听能详的shadowsocks 通常简称ss

privoxy 安装

使用下面命令:

brew install privoxy

privoxy 配置

因为是 Homebrew 方式安装的 privoxy,所以跟官方网站的使用方式不一样,请以此文为准。

打开配置文件 /usr/local/etc/privoxy/config

vim /usr/local/etc/privoxy/config

在 config 配置文件的最底部,手动加入以下代码:

listen-address 0.0.0.0:8118
forward-socks5 / localhost:1080 .

或者用echo命令直接写入,执行以下命令:

cd /usr/local/etc/privoxy/
echo 'listen-address 0.0.0.0:8118\nforward-socks5 / localhost:1080 .' >> config

启动 privoxy

sudo /usr/local/sbin/privoxy /usr/local/etc/privoxy/config

查看是否启动成功

netstat -na | grep 8118

出现下面结果表示启动成功

tcp4 0 0 *.8118 . LISTEN

在终端使用代理

终端里 privoxy 的使用

输入一下命令,即可。

export http_proxy='http://localhost:8118'
export https_proxy='http://localhost:8118'

测试

stark.wang 使用以下命令测试

wget  https://www.google.com

connected. 表示成功通信 ok!

此文讲伴随你的职业生涯,请收藏!收藏!收藏!

嘿,你也可以点赞哦!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.