updated some aliases and scripts
This commit is contained in:
@@ -16,12 +16,12 @@ def avgdiff(values):
|
||||
c = sum([abs(x[0]-x[1]) for x in zip(a,b)])
|
||||
return c/len(a)
|
||||
|
||||
aggregator('avgdiff', avgdiff)
|
||||
vd.aggregator('avgdiff', avgdiff)
|
||||
|
||||
def distinct_list(values):
|
||||
return [x for x in set(values)]
|
||||
|
||||
aggregator('distinct_list', distinct_list)
|
||||
vd.aggregator('distinct_list', distinct_list)
|
||||
|
||||
def logtime(val):
|
||||
a=str(val)
|
||||
@@ -171,6 +171,15 @@ def ipinfo(ip, type="country"):
|
||||
except:
|
||||
return ""
|
||||
|
||||
def split_number2ip(number):
|
||||
number=str(number)
|
||||
import re
|
||||
pattern=re.compile("^([1-9]?[0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])([1-9]?[0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])([1-9]?[0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])([1-9]?[0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])$")
|
||||
match = pattern.match(number)
|
||||
if match:
|
||||
return ".".join(match.groups())
|
||||
else:
|
||||
return number
|
||||
|
||||
@functools.lru_cache()
|
||||
def mx_lookup(domain):
|
||||
|
||||
Reference in New Issue
Block a user