Settings for various agents under Linux

Source: Internet
Author: User
Tags proxychains

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,1 92.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 this need to access the Internet. Such as ' Tox ' for Open Stack test.

$ sudo echo  ' socks5 10.7.211.16 ' >>/etc/proxychains.conf$ sudo echo ' #!/bin/bashsudo https_proxy= HTTP_PR oxy= http_proxy= https_proxy= proxychains [email protected] '  >>/usr/bin/myproxychains$ sudo chmod a+x/usr/bi N/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 oneserver_type = AA the Por T defaults to more but I ' ve stated it's here for clarity Server_port = ">>/etc/tsocks.conf

Set up the PIP proxy
$ cp/usr/local/bin/pip  

Set up the git proxy
$ sudo echo ' #!/bin/bashconnect-  h ' proxy-mu.intel.com:911 "-S" proxy.ir.intel.com:1080 "[email protected] ' >/ 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:

   [Email protected]:/opt/stack/nova$ git review-d 142975   cannot query Patchset information the   following command F Ailed with exit code 255   "Ssh-x   Gerrit Query--format=json--current-patch-set change:142975"   error:you mus T specify the destination port correctly.   Usage:connect [-dnhst45] [-P local-port][-r Resolve] [-w timeout]          [-H proxy-server[:p ORT]] [-s [e-mail Protected]]so cks-server[:p ORT]          [-t proxy-server[:p ORT]]         [-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.COMPROXYCOMMAND/USR/LOCAL/BIN/SOCKS-GW%h%phost 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/bashcase $ 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" c13/>;; esac#/bin/nc $METHOD $*connect $PROXY $*

Test:

$ ssh [email protected]$ ssh [email protected]-P 29418

Set up the APT

Can either setup to proxy for apt

$ sudo echo ' acquire::http::p Roxy "http://proxy-mu.intel.com:911/"; Acquire::socks::p Roxy "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.L Ist

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 creat e_dir.sh/usr/bin/
 sudo echo ' [global]# proxy=http://proxy-shz.intel.com:911index-url=http://127.0.0.1:7799/tmp# index-url=http ://pypi.douban.com/simplecache-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 ' &G T /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/bashfor x in ' ls/opt/stack/'    does        if [-f/opt/stack/$x]; then            continue        fi        if [-E "/opt/stack/$x/.git"]; Then            create_dir.sh $x        fi do    ' >/usr/bin/create_pip$ sudo chmod a+x/usr/bin/create_pip

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

Settings for various agents under Linux

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.