Skip to content

Instantly share code, notes, and snippets.

View adamshamsudeen's full-sized avatar
🎯
Focusing

Adam Shamsudeen adamshamsudeen

🎯
Focusing
View GitHub Profile
@adamshamsudeen
adamshamsudeen / redis-producer-consumer.py
Last active November 18, 2021 07:26 — forked from igniteflow/redis-producer-consumer.py
A very simple implementation of a Redis producer-consumer messaging queue in Python3
import redis
import time
import sys
def producer():
r = redis.Redis()
i = 0
while True:
r.rpush('queue', 'Message %d' % i)
@adamshamsudeen
adamshamsudeen / cmd.sh
Created January 8, 2019 07:18 — forked from meain/cmd.sh
Example of using Apache Bench (ab) to POST JSON to an API
# post_loc.txt contains the json you want to post
# -p means to POST it
# -H adds an Auth header (could be Basic or Token)
# -T sets the Content-Type
# -c is concurrent clients
# -n is the number of requests to run in the test
ab -p post_loc.txt -T application/json -H 'Authorization: Token abcd1234' -c 10 -n 2000 http://example.com/api/v1/locations/