This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
if [ ! -e /tmp/dnsip.txt ] ; then | |
ping mydomain.f3322.org -c1 | grep PING | awk '{ print $3 }' | sed 's/[()]//g' > /tmp/dnsip.txt | |
fi | |
mydnsip=$(head -1 /tmp/dnsip.txt) | |
curl -s http://icanhazip.com > /tmp/ip.txt | |
myip=$(head -1 /tmp/ip.txt) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#/usr/bin/python | |
#coding: utf-8 | |
global_ip_dict = [[[] for col in range(256)] for row in range(256)] | |
#input:apnic|CN|ipv4|112.0.0.0|4194304|20081215|allocated | |
#output:addr1,addr2,addr3,addr4,ip_num | |
def analyseLine(ip_line): | |
ip_str_list = ip_line.split('|') | |
if len(ip_str_list) < 7: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def getimg(self): | |
imgurl = request.args.get('imgurl','') | |
if len(imgurl) == 0: | |
return '<form action="/twip/getimg" method="get"><input type="text" size="50" name="imgurl" /> <input type="submit" value="submit" />' | |
urlobj = urllib2.urlopen(imgurl) | |
header = urlobj.info() | |
headers = {} | |
headers['Content-Type'] = header.get('Content-Type','image/png') | |
content = urlobj.read() | |
status = urlobj.getcode() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
cd /root |
NewerOlder