kw1jjang / CalVoD

CalVoD
http://www.eecs.berkeley.edu/~kw1jjang/
BSD 3-Clause "New" or "Revised" License
0 stars 0 forks source link

Have caches automatically get public ip address #12

Closed ryankashi closed 8 years ago

ryankashi commented 8 years ago

http://stackoverflow.com/questions/9481419/how-can-i-get-the-public-ip-using-python2-7 Just do: from urllib2 import urlopen my_ip = urlopen('http://ip.42.pl/raw').read()

Automatically make caches take the public ip address via doing: python cache.py public If public, do the above for the address.

chenjiayuan commented 8 years ago

In case we decide to fetch the ip address in the shell script, this single line will return the public address: curl ifconfig.co