Skip to content

Instantly share code, notes, and snippets.

View ashhadulislam's full-sized avatar

Ashhad ashhadulislam

View GitHub Profile
curl -X POST \
http://192.168.99.100:32358/putimage \
-H 'Content-Type: application/json' \
-H 'Postman-Token: 5135679d-fe27-499e-80a9-2295d436afac' \
-H 'cache-control: no-cache' \
-d '{
"image_name":"test messagse"
}'
@ashhadulislam
ashhadulislam / create_items.txt
Last active August 18, 2020 08:32
Setting the devices for which you want to stream data
list_measure_groups=["IMU","GSR","ECG"]
device_name=["headband","fitbit","chest_mount"]
# import testdata
import json
from boto import kinesis
import sys
# seed the pseudorandom number generator
from random import seed
from random import randint
import time
import random
seed(1)
i=0
while 1==1:
new_dict={}
new_dict["timestamp"]=int(time.time())
new_dict["dataNum"]="data"+str(i)
new_dict["device_name"]="dev"
new_dict["HeartRate"]=random.randint(60, 120)
kinesis.put_record("end-stream", json.dumps(new_dict), "partitionkey")
import json
from boto import kinesis
import sys
from random import seed
from random import randint
import time
import random
kinesis = kinesis.connect_to_region("us-east-2")
{
"MillisBehindLatest":2000,
"NextShardIterator":"A really long shard identfier",
"Records":[
{
"ApproximateArrivalTimestamp":1597844626.467,
"Data":"The main data in string form",
"PartitionKey":"partitionkey",
"SequenceNumber":"A really long sequence number"
}
{
"MillisBehindLatest":0,
"NextShardIterator":"Super Long shard Iterator",
"Records":[
]
}
from boto import kinesis
import time
kinesis = kinesis.connect_to_region("us-east-2")
shard_id = 'shardId-000000000000' #we only have one shard!
shard_it = kinesis.get_shard_iterator("end-stream", shard_id, "LATEST")["ShardIterator"]