注册 登录  
 加关注
   显示下一条  |  关闭
温馨提示!由于新浪微博认证机制调整,您的新浪微博帐号绑定已过期,请重新绑定!立即重新绑定新浪微博》  |  关闭

笑遍世界@网易博客

明天还会在路上……

 
 
 

日志

 
 
关于我

Stay hungry, stay foolish. 工作用脑,生活用心! 走过山重水复,必然迎来柳暗花明! 受苦的人没有悲观的权利,远征的人没有流泪的资格。 Live each day as if we should die tomorrow.

网易考拉推荐
 
 

tsocks配置代理来使用git的repository  

2012-02-22 22:57:21|  分类: Linux技术 |  标签: |举报 |字号 订阅

  下载LOFTER 我的照片书  |

以前写过一篇关于tsocks的博客,讲解了一下tsocks的使用,这次在工作中呢,其他需要,所以又用英文写了一下。
我在网易博客中关于tsocks的博文在:http://renyongjie668.blog.163.com/blog/static/16005312011824112410588/
用英文写了一点tsocks用于git clone的方法如下:

How to clone external git repository using tsocks

What’s the background?
To git clone something like git://external_network/temp.git in $my_company network will be blocked by our IT policy. This BKM will help you to resolve this issue using tsocks.
Note: The following steps on using tsocks is based on a RHEL6.x system and tocks-1.8-x. There should be some similar configuration with OSes or tsocks in different versions.

How to use tsocks to help your git-clone?

1. ”’install tsocks: ”’
? download this RPM for RHEL6.x attachment:tsocks-1.8-7.beta5.2.el6.rf.x86_64.rpm
? (or download source code from: http://sourceforge.net/projects/tsocks/files/tsocks/1.8%20beta%205/, and compile it.)

2. add/modify the config file ”’/etc/tsocks.conf”’

 
server = proxy-shz.iii.com  #your local proxy server: proxy-shz.iii.com, or proxy.jf.iii.com 
server_type = 5 #SOCKS version, use 5 as default
server_port = 1080 #SOCKS proxy port, use 1080 as default
local
= 10.0.0.0/255.0.0.0 #internal network; will not use proxy when accessing this subnet

Note: make sure the proxy server is in your local network. (Maybe it’s the proxy server in your Intel site.)

3. use git clone with tsocks:

 
tsocks git clone git://git.kernel.org/pub/scm/virt/kvm/qemu-kvm.git qemu-kvm.git

git clone a http repository
If your repository is using HTTP (something like “http://git.kernel.org/pub/scm/virt/kvm/qemu-kvm.git”), you only need to export ‘http_proxy’ environment variable before cloning.
for example:



export http_proxy=proxy.pd.iii.com:911
git clone http://git.kernel.org/pub/scm/virt/kvm/qemu-kvm.git qemu-kvm.git
  评论这张
 
阅读(1713)| 评论(0)
推荐 转载

历史上的今天

评论

<#--最新日志,群博日志--> <#--推荐日志--> <#--引用记录--> <#--博主推荐--> <#--随机阅读--> <#--首页推荐--> <#--历史上的今天--> <#--被推荐日志--> <#--上一篇,下一篇--> <#-- 热度 --> <#-- 网易新闻广告 --> <#--右边模块结构--> <#--评论模块结构--> <#--引用模块结构--> <#--博主发起的投票-->
 
 
 
 
 
 
 
 
 
 
 
 
 
 

页脚

网易公司版权所有 ©1997-2017