/\croot
:set ic
:set scs
import groovy.json.JsonSlurper;
def res = new JsonSlurper().parseText( context.expand( '${post-topic#response}' ));
log.info "topic id:" + res.id;
testRunner.testCase.testSuite.project.setPropertyValue("topicId", "${res.id}" ) ;#!/usr/bin/python
# 'apt-get install python-geoip' if needed
import GeoIP,os
stream = os.popen("netstat -tna | awk -F' +|:' '/:80/ {print $6}' | sort | uniq -c | sort -n ")
gi = GeoIP.new(GeoIP.GEOIP_MEMORY_CACHE)
s=0
for line in stream.readlines():
line = line.strip()
l =line.split() # strip the last from the line
# print l
print l[0], "\t",l[1],"\t", gi.country_code_by_addr(l[1])
s+=int(l[0])
print 'Total:',s