This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Reads and outputs Kinesis stream given as argument | |
# For oneliner see https://gist.github.com/vre/7ee11edb765bf9bbdf1ad4ab1790c7c1 | |
# Based on https://gist.github.com/LarsFronius/e579051d7f140fd803b0 | |
if [ -z "$1" ]; then | |
echo "This script outputs AWS Kinesis stream as ASCII" | |
echo "Usage: $0 <stream name>" | |
echo |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# On a mac, `brew install awscli` before running and define your AWS account keys. | |
# Set the 'streamname' to match the name of your Kinesis stream | |
# For shell scripted version see https://gist.github.com/vre/997b336499824a0e56999d030dce321a | |
# Based on https://gist.github.com/LarsFronius/e579051d7f140fd803b0 | |
# Works-For-Me aws-cli/1.11.36 | |
streamname=my-kinesis-stream-name; aws kinesis describe-stream --stream-name $streamname --output text | grep SHARDS | awk '{print $2}' | while read shard; do aws kinesis get-shard-iterator --stream-name $streamname --shard-id $shard --shard-iterator-type LATEST --output text | while read iterator; do while output=`aws kinesis get-records --shard-iterator $iterator --output text`; do iterator=`echo "$output" | head -n1 | awk '{print $2}'`; echo "$output" | awk 'NR > 1' | grep RECORDS | while read record; do echo $record | awk '{print $3}' | base64 -D; done; done; done; done |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
if [ `uname` != "Darwin" ]; then | |
echo "Run this on OS X " | |
exit 1 | |
fi | |
# pre ask password | |
sudo -v | |
# Set firewall rules so connection to virtualbox functions for Maverics |