daily pastebin goal
59%
SHARE
TWEET

Untitled

a guest Jul 23rd, 2018 64 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. import socket
  2. import sys
  3.  
  4. globneck = 60
  5. globrot = 90
  6. stoploop = 0
  7.  
  8. def listen():
  9.     sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
  10.  
  11.     # Gather received data here
  12.     alldata = ''
  13.  
  14.     # Bind the socket to the port
  15.     server_address = ('localhost', 15000)
  16.     sock.bind(server_address)
  17.  
  18.     # Listen for incoming connections
  19.     sock.listen(1)
  20.  
  21.     while True:
  22.         # Wait for a connection
  23.         connection, client_address = sock.accept()
  24.         try:
  25.             # Receive the data in small chunks and retransmit it
  26.             while True:
  27.                 data = connection.recv(32)
  28.  
  29.                 if data:
  30.                     alldata += data
  31.                 else:
  32.                     print commands.getoutput('/bin/echo "alldata ' + alldata + '\n" >> /tmp/debuggia')
  33.                     #eval(alldata)
  34.                     exec(alldata)
  35.                     alldata = ''
  36.                     break
  37.         finally:
  38.             # Clean up the connection
  39.             connection.close()
  40.  
  41. listen()
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top