Monthly Archives: September 2013

XML-RPC Client/Server in Python

This demo shows how to have RPC connection in python.  The server collects CPU information (Linux). Server-side:  #!/usr/bin/pythonimport reimport osimport sysimport xmlrpclib from SimpleXMLRPCServer import SimpleXMLRPCServer def is_even(n):    return n%2 == 0 def get_mhz():    try:        #return 0        f = open(“/proc/cpuinfo”, … Continue reading

Posted in Uncategorized | Leave a comment

Multithreaded IGMP Query

Example how to access raw socket in Python: #!/usr/bin/python from socket import *from struct import *from time import *import sysimport INimport threadingimport signal src = ‘192.168.2.2’dst = ‘224.0.0.1’dev = “eth1.100” + “\0” if len(sys.argv) > 1:    dev = sys.argv[1]    print … Continue reading

Posted in Uncategorized | Leave a comment