http://los-vmm.sc.intel.com/wiki/OpenStack_New_Hire_Guide#Apply_JIRA_account

Set up your proxy.

The bellow proxies as follow:

(1) http-proxy: proxy.xxx.com port: 911

(3) socks5-proxy: proxy.xxx.com port: 1080

Set the bash proxy environment value
$ echo "declare -x http_proxy=\"http://proxy-shz.glb.intel.com:911\"
declare -x https_proxy=\"http://proxy-shz.glb.intel.com:911\"
declare -x no_proxy=\"`hostname`,localhost,127.0.0.1,127.0.1.1,.local,10.238.154.0/24,10.248.2.5,10.239.27.228,172.17.6.9,172.16.0.1,192.168.253.10,192.168.253.11,192.168.253.12,192.168.253.13,192.168.253.14,192.168.253.15,192.168.253.16,192.168.253.17,192.168.253.18,/usr/bin/wpp192.168.253.19,192.168.253.20,192.168.253.21,192.168.253.22,192.168.253.23,192.168.253.24,192.168.253.25,192.168.253.26,192.168.253.27,192.168.253.28,192.168.253.29,192.168.253.30\"
declare -x GIT_PROXY_COMMAND=\"/bin/socks-gw\"" >> ~/.bashrc
$ echo "http_proxy=\"http://proxy-mu.intel.com:911/\"
socks_proxy=\"socks://proxy.ir.intel.com:1080/\"" >> /etc/environment
Set the proxychains proxy

you can use proxychains to run some application that need to access the internet. Such as 'tox' for Open Stack test.

$ sudo echo  'socks5 10.7.211.16 1080' >> /etc/proxychains.conf
$ sudo echo '#!/bin/bash
sudo https_proxy= http_proxy= HTTP_PROXY= HTTPS_PROXY= proxychains $@ ' >> /usr/bin/myproxychains
$ sudo chmod a+x /usr/bin/myproxychains

Then you can run tox by:

$ myproxychains tox -e py27
Set the tsocks proxy
$ echo "server = 10.7.211.16
# Server type defaults to 4 so we need to specify it as 5 for this one
server_type = 5
# The port defaults to 1080 but I've stated it here for clarity
server_port = 1080" >> /etc/tsocks.conf
Set up the pip proxy
$ cp /usr/local/bin/pip  /usr/local/bin/pip.org
$ echo '#!/bin/bash
/usr/bin/pip.org --proxy=http://proxy-shz.glb.intel.com:911 $*' > /usr/local/bin/pip.proxy
$ sudo chmod a+x /usr/local/bin/pip.proxy
$ sudo rm /usr/local/bin/pip
$ ln -s /usr/local/bin/pip /usr/local/bin/pip.proxy
Set up the git proxy
$ sudo echo '#!/bin/bash
connect -H "proxy-mu.intel.com:911" -S "proxy.ir.intel.com:1080" $@' > /bin/socks-gw
$ sudo chmod a+x /bin/socks-gw
$ echo "declare -x GIT_PROXY_COMMAND=\"/bin/socks-gw\"" >> ~/.bashrc

if you hit git review bug error as follow:

   taget@taget-2012-Client-Platform:/opt/stack/nova$ git review -d 142975
Cannot query patchset information
The following command failed with exit code 255
"ssh -x gerrit query --format=JSON --current-patch-set change:142975"
ERROR: You must specify the destination port correctly.
usage: connect [-dnhst45] [-p local-port][-R resolve] [-w timeout]
[-H proxy-server[:port]] [-S [user@]socks-server[:port]]
[-T proxy-server[:port]]
[-c telnet-proxy-command]
host port
ssh_exchange_identification: Connection closed by remote host ==

refer: http://www.mediawiki.org/wiki/Gerrit/git-review#.22Cannot_query_patchset_information.22

or try this:

[global] index-url="http://otccloud06.sc.intel.com/pypi/simple" [easy_install] index-url=http://otccloud06.sc.intel.com/pypi/simple

Set up the ssh proxy
$ sudo echo 'ProxyCommand socks-gw  %h %p' >> ~/.ssh/config

maybe some site do not need proxy.

$ cat ~/.ssh/config
Host github.com
ProxyCommand /usr/local/bin/socks-gw %h %p
Host openstack.org
ProxyCommand /usr/local/bin/socks-gw %h %p
HostName review.openstack.org
User shaohefeng
Port 29418
$ cat /usr/local/bin/socks-gw
#!/bin/bash
case $1 in
*.intel.com|192.168.*|127.0.*|localhost|10.*)
PROXY=
# METHOD="-X connect"
 ;;
*)
PROXY='-H proxy-mu.intel.com:911 -S proxy.ir.intel.com:1080'
# METHOD="-X 5 -x proxy-mu.intel.com:1080"
 ;;
esac
# /bin/nc $METHOD $*
#/bin/nc.openbsd $METHOD $*
connect $PROXY $*

Test:

$ ssh user@localhost
$ ssh user@review.openstack.org -p 29418
Set up the apt

You can either setup to proxy for apt

$ sudo echo '
Acquire::http::proxy "http://proxy-mu.intel.com:911/";
Acquire::socks::proxy "socks://proxy.jf.intel.com:1080/"; ' >> /etc/apt/apt.conf

or you can use the local apt mirrors http://linux-ftp.sh.intel.com/pub/mirrors/ubuntu/ by modifying the /etc/apt/sources.list

Set up the openstack pip local source repository
$ wget https://raw.githubusercontent.com/taget/mybin/master/openstack-tools/create_dir.sh
$ sed -i -e 's/\(^\s\+\)pip/\1myproxychains pip/' create_dir.sh
$ grep usage -n4 create_dir.sh
$ sudo chmod a+x create_dir.sh && sudo mv create_dir.sh /usr/bin/
$ sudo echo '[global]
# proxy=http://proxy-shz.intel.com:911
index-url=http://127.0.0.1:7799/tmp
# index-url=http://pypi.douban.com/simple
cache-dir=/home/shhfeng/.pipcache/pip
# [install]
# use-mirrors = true
# index-url=http://pypi.douban.com/simple' > ~/.pip/pip.conf
$ sudo echo "sudo sed -i -e 's/^\s\?\(index-url\)/# \1/' ~/.pip/pip.conf" > /usr/bin/en_pip_url
$ sudo echo "sudo sed -i -e 's/^#\s\?\(index-url\)/\1/' /home/shhfeng/.pip/pip.conf" > /usr/bin/dis_pip_url
$ sudo chmod a+x /usr/bin/en_pip_url /usr/bin/dis_pip_url
$echo 'Listen 7799
<VirtualHost *:7799>
ServerName localhost
DocumentRoot /var/www
<Directory /var/www>
Options Indexes FollowSymLinks MultiViews
AllowOverride None
Order allow,deny
Allow from all
</Directory>
ErrorLog /var/log/apache2/pip_error.log
</VirtualHost> ' > /etc/apache2/sites-available/pip.conf
$ ln -s /etc/apache2/sites-available/pip.conf /etc/apache2/sites-enabled/pip.conf
$ sudo service apache2 restart
$ sudo echo '#!/bin/bash
for x in `ls /opt/stack/`
do
if [ -f /opt/stack/$x ]; then
continue
fi
if [ -e "/opt/stack/$x/.git" ]; then
create_dir.sh $x
fi
done' > /usr/bin/create_pip
$ sudo chmod a+x /usr/bin/create_pip

you can also ref this link: https://www.berrange.com/posts/2014/11/14/faster-rebuilds-for-python-virtualenv-trees/

linux下各种代理的设置的更多相关文章

  1. [转载]Linux下终端字体颜色设置方法

    原文地址:Linux下终端字体颜色设置方法作者:router 网上类似的文章有很多,但是都是转来转去的,没有经过测试,按照很多文章的方法会造成你设置之后的终端在换行和删除输入字符时终端显示会乱七八糟, ...

  2. Linux下网卡混杂模式设置和取消

    工作中发现一个网卡工作状态不对了,查看了一下,发现这个网卡和正常工作的网卡  信息不一样,它显示的居然是混杂模式,而正常工作的是  running 模式 ,所以来了解下混杂模式怎么取消... 下文来自 ...

  3. 环境变量解释以及在Linux下的环境变量设置

    一.环境变量解释 环境变量是什么? 引用百度百科里面的解释:环境变量是操作系统中一个具有特定名字的对象,它包含了一个或者多个应用程序所将使用到的信息.例如Windows系统中的path环境变量,当要求 ...

  4. Linux 下配置 hosts 并设置免密登录

    Linux 下配置 hosts 并设置免密登录 作者:Grey 原文地址: 博客园:Linux 下配置 hosts 并设置免密登录 CSDN:Linux 下配置 hosts 并设置免密登录 说明 实现 ...

  5. Linux下安装 Posgresql 并设置基本参数

    在Linux下安装Postgresql有二进制格式安装和源码安装两种安装方式,这里用的是二进制格式安装.各个版本的Linux都内置了Postgresql,所以可直接通过命令行安装便可.本文用的是Cen ...

  6. Linux 下三种方式设置环境变量

    1.在Windows 系统下,很多软件安装都需要配置环境变量,比如 安装 jdk ,如果不配置环境变量,在非软件安装的目录下运行javac 命令,将会报告找不到文件,类似的错误. 2.那么什么是环境变 ...

  7. (转)Linux下tomcat JVM内存设置步骤

    java.lang.OutOfMemoryError: PermGen space java.lang.OutOfMemoryError: Java heap space -------------- ...

  8. 转:// LINUX下为ORACLE数据库设置大页--hugepage

    一.在解释什么情况下需要开启大页和为啥需要开启大页前先了解下Linux下页的相关的知识:以下的内容是基于32位的系统,4K的内存页大小做出的计算1)目录表,用来存放页表的位置,共包含1024个目录en ...

  9. Linux下使用 xrandr 命令设置屏幕分辨率

    最近在Linux下修改屏幕分辨率的时候,发现了一个非常有用的命令:xrandr 使用这个命令,可以方便的设置您显示器的的分辨率.尤其是当你使用了一些需要或者会自动改动您屏幕分辨率的程序以后. 您可以使 ...

随机推荐

  1. CSS自学笔记(9):CSS拓展(二)

    CSS图片 当一个网页上有一张或多张图片,而且这些图片的尺寸比较大时,为了是网页布局更紧凑合理,我们可以将这些图片放到一个图片库里,可以有效的防止图片过大可能会对网页布局造成的不良影响. 通过CSS我 ...

  2. 打造完美的go开发环境

    这篇原来是给公司里使用go开发的交流用的,主要是工具的安装,用markdown写的,发布了内部gitlab上,仓促发布到blog上面,也没改啥格式,现在整理一下,然后增加一点说明 基础开发工具 sub ...

  3. Intellij IDEA开发第一个android应用教程

    用惯eclipse的同学们可以试试通过Intellij IDEA来开发一个android应用.下面是具体的教程. 首先:下载Intellij IDEA.最新版本是12.官方提供两个版本.一个是Comm ...

  4. 只有电信3G是公网ip。

    只有电信3G是公网ip,其它网络拿到是内部网.

  5. CC++初学者编程教程(13) 基于Oracle linux 的Oracle12c环境搭建

    1设置虚拟机选项 2 设置文件夹共享 3启动文件夹共享向导 4 设置共享文件夹 5 启用共享 6 关闭虚拟机设置 7 开启虚拟机 8 登陆帐户 9 看见虚拟机桌面 10 安装vmwaretools 1 ...

  6. nova availability zone

    find a bug: at first there is only one zone. create aggregate host1 in zone1 create aggregate host1 ...

  7. 服务器:RAID、AHCI、IDE

    RAID 独立磁盘冗余阵列(RAID,redundant array of independent disks)是把相同的数据存储在多个硬盘的不同的地方(因此,冗余地)的方法.通过把数据放在多个硬盘上 ...

  8. iOS - SQLite Database 操作数据库

    iOS - SQLite Database 操作数据库   Sqlite 能被用在ios上做数据处理用,只要你懂得一点sql 就很容易使用sqlite 1:创建一个简单的View based appl ...

  9. Oracle的完整练习,纯手工打字,可能有一两点错误。。。

    PS:所有的表来源于Oracle自带的SCOTT用户下的表,初学者应该都知道的.emp表的SMITH被我删除了没有rollback,所以可能结果有点小出入. 1.选择部门30中的所有员工: SELEC ...

  10. Mac浏览器全屏设置

    在 mac 升级之后,以往点击放大的按钮,现在显示的效果是全屏: