generated from fastai/fast_template
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
2a64939
commit eae0c73
Showing
1 changed file
with
18 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
# 使用proxy | ||
|
||
假设代理服务器安装在本机127.0.0.1的地址上,在~/.profile中添加如下代码。 | ||
|
||
```shell | ||
function proxy() { | ||
hostip=$(cat /etc/resolv.conf | grep nameserver | awk '{ print $2 }') | ||
#hostip=127.0.0.1 | ||
ALL_PROXY=socks5://$hostip:10808 $@ | ||
#https_proxy=http://$hostip:10809 http_proxy=http://$hostip:10809 $@ | ||
echo $ALL_PROXY | ||
} | ||
``` | ||
|
||
如果使用代理服务器访问外网,用`proxy`开头后面跟命令,例如: | ||
``` | ||
proxy git submodule update --init --recursive | ||
``` |