In office http_proxy is required . This script will help to set the http_proxy
1. Create python script to get IP
2. Add in alias for every bash login
Python Script :
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 | #!/bin/python import socket officeProxy='Myoffice:80' def get_ip(): s = socket.socket(socket.AF_INET, socket.SOCK_DGRAM) try: # doesn't even have to be reachable s.connect(('10.255.255.255', 1)) IP = s.getsockname()[0] except: IP = '127.0.0.1' finally: s.close() return IP def setProxyINBashShell(): if get_ip().startswith("10"): print officeProxy else : print '' if __name__ == '__main__': setProxyINBashShell() |
2. Alias
#### Smart Proxy
http_proxy=`/home/sterin/Templates/shell/smartProxy.py`
export http_proxy=$http_proxy
Code is highlighted using : http://hilite.me/
888 Casino NJ Promo Code & Review - JtmHub
ReplyDelete888casino NJ Promo Code & Review 2021 A welcome bonus of up to 태백 출장마사지 $500 제주 출장샵 and a $100 deposit 평택 출장샵 bonus. 정읍 출장샵 888casino NJ offers an 경기도 출장마사지 incredible