atomizasser
2005-09-24, 11:49
hi. i have founded some interest python script
import socket
import md5
from time import sleep
host = ''
remote = 'servers.ip.com'
port = some_random_port_no
rport = servers_port_no
paswd = 'girder_password'
def send(event):
s = socket.socket(socket.af_inet, socket.sock_stream)
try:
s.connect((remote, rport))
except:
print 'unable to make remote connection'
s.close()
return
# client/server authentication
rsp = grdr_resp(s,"quintessence")
m = md5.md5(rsp + ':' + paswd).hexdigest()
rsp = grdr_resp(s,m)
if rsp != 'accept':
print 'invalid password', rsp
# send the command
grdr_send(s,event)
# orderly shutdown of network sockets
grdr_send(s,'close')
s.shutdown(2)
s.close()
def grdr_send(s,dat):
s.send(dat + '\n')
def grdr_recv(s):
dat = s.recv(100)
return dat[:len(dat)-1]
def grdr_resp(s,dat):
grdr_send(s,dat)
return grdr_recv(s)
this script is for sent events to girder (i suppose). girder is a program that can control your windows appliactions with a remote control. if this script works in xbmc, maybe can to be very usefull, beacuse in lan network you will launch any appliccation remotly!!
import socket
import md5
from time import sleep
host = ''
remote = 'servers.ip.com'
port = some_random_port_no
rport = servers_port_no
paswd = 'girder_password'
def send(event):
s = socket.socket(socket.af_inet, socket.sock_stream)
try:
s.connect((remote, rport))
except:
print 'unable to make remote connection'
s.close()
return
# client/server authentication
rsp = grdr_resp(s,"quintessence")
m = md5.md5(rsp + ':' + paswd).hexdigest()
rsp = grdr_resp(s,m)
if rsp != 'accept':
print 'invalid password', rsp
# send the command
grdr_send(s,event)
# orderly shutdown of network sockets
grdr_send(s,'close')
s.shutdown(2)
s.close()
def grdr_send(s,dat):
s.send(dat + '\n')
def grdr_recv(s):
dat = s.recv(100)
return dat[:len(dat)-1]
def grdr_resp(s,dat):
grdr_send(s,dat)
return grdr_recv(s)
this script is for sent events to girder (i suppose). girder is a program that can control your windows appliactions with a remote control. if this script works in xbmc, maybe can to be very usefull, beacuse in lan network you will launch any appliccation remotly!!