Skip to content

Instantly share code, notes, and snippets.

@wozozo
Created May 31, 2017 07:30
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save wozozo/49b93c0579006bbaa929ce67956d1c5f to your computer and use it in GitHub Desktop.
Save wozozo/49b93c0579006bbaa929ce67956d1c5f to your computer and use it in GitHub Desktop.
import threading
from uuid import uuid4
import redis
r = redis.StrictRedis(host='', port=0, db=0, password='')
class Attacker(threading.Thread):
def __init__(self, name):
threading.Thread.__init__(self)
self.name = name
def run(self):
for i in range(1000):
key = str(uuid4())
r.set(key, i)
print(f'{self.name}: {i} ({key})')
for i in range(20):
attacker_ = Attacker(f'Attacker{i}')
attacker_.start()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment