Skip to content

Instantly share code, notes, and snippets.

@proger
Created February 28, 2011 19:23
Show Gist options
  • Select an option

  • Save proger/847850 to your computer and use it in GitHub Desktop.

Select an option

Save proger/847850 to your computer and use it in GitHub Desktop.
import sys
import random
import struct
import time
packet = lambda *args: struct.pack('!HQBBBB', 0xbaba, *args)
seq = 1
while True:
p = packet(seq, *[random.randint(1, 255) for i in xrange(4)])
sys.stdout.write(p)
sys.stdout.flush()
time.sleep(.1)
seq += 1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment