Skip to content

Instantly share code, notes, and snippets.

@bdnf
Created June 27, 2020 10:56
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bdnf/78985d0faf47173bd866de90f7065536 to your computer and use it in GitHub Desktop.
Save bdnf/78985d0faf47173bd866de90f7065536 to your computer and use it in GitHub Desktop.
Simulate heart rate data from sensor and stream it to AWS Kinesis Stream
#!/bin/sh
while true
do
deviceID=$(( ( RANDOM % 10 ) + 1 ))
heartRate=$(jot -r 1 60 140)
echo "$deviceID,$heartRate"
aws kinesis put-record --stream-name <your_stream_name> --data "$deviceID,$heartRate"$'\n' --partition-key $deviceID --region us-east-1
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment