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
| https://s3.amazonaws.com/dreis-iot/immersion-day/IoT+ID+-+HOL+-+FIrst+Lab+-+Connecting+a+Device.pdf |
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 | |
| DEST="dreis-datasets" | |
| # Download files from https://archive.org/download/stackexchange | |
| wget https://archive.org/download/stackexchange/stackoverflow.com-Badges.7z & | |
| wget https://archive.org/download/stackexchange/stackoverflow.com-Comments.7z & | |
| wget https://archive.org/download/stackexchange/stackoverflow.com-PostHistory.7z & | |
| wget https://archive.org/download/stackexchange/stackoverflow.com-PostLinks.7z & |
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
| #Append time to a list using face_id as key. Create list if it doesn't exist. | |
| def log_event(face_id, similarity): | |
| now = datetime.datetime.now() | |
| create_dynamodb = dynamodb_events_table.update_item( | |
| Key={ | |
| 'FaceId': face_id, | |
| 'Timestamp': str(now.date()) | |
| }, |
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 | |
| INSTANCE_ID=`curl http://169.254.169.254/latest/meta-data/instance-id` #para pegar o id da instância | |
| VOL_ID=`aws ec2 create-volume --availability-zone us-east-1a --output text --query "VolumeId" --snapshot-id xxxxxxx --region us-east-1` | |
| aws ec2 attach-volume --volume-id $VOL_ID --instance-id $INSTANCE_ID --device /dev/sdf --region us-east-1 |
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
| package org.reisjr.iot; | |
| import java.util.Random; | |
| import com.amazonaws.services.iot.AWSIot; | |
| import com.amazonaws.services.iot.model.AttachPolicyRequest; | |
| import com.amazonaws.services.iot.model.AttachThingPrincipalRequest; | |
| import com.amazonaws.services.iot.model.CreateKeysAndCertificateRequest; | |
| import com.amazonaws.services.iot.model.CreateKeysAndCertificateResult; | |
| import com.amazonaws.services.iot.model.CreatePolicyRequest; |
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
| pip install --upgrade awscli | |
| aws mediastore put-lifecycle-policy --container-name myfirstcontainer --lifecycle-policy file://policy.json | |
| aws mediastore get-lifecycle-policy --container-name myfirstcontainer |
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
| schema = aws_kinesisanalytics.CfnApplication.InputSchemaProperty( | |
| record_columns=[col1], | |
| record_format=aws_kinesisanalytics.CfnApplication.RecordFormatProperty( | |
| record_format_type="CSV", | |
| mapping_parameters=aws_kinesisanalytics.CfnApplication.MappingParametersProperty( | |
| csv_mapping_parameters=aws_kinesisanalytics.CfnApplication.CSVMappingParametersProperty( | |
| record_column_delimiter=";", | |
| record_row_delimiter="|" | |
| ) | |
| ) |
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 -e | |
| # This is an example on how to setup roles using CLI | |
| # for cross account access in Kinesis. | |
| # WARNING: You should review this code before using it on your account | |
| # See https://docs.aws.amazon.com/IAM/latest/UserGuide/tutorial_cross-account-with-roles.html | |
| if [ "$#" -ne 2 ]; then | |
| CMD=`basename "$0"` | |
| echo "./$CMD <profile-account-with-resource> <profile-account-use-resource>" |
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
| import subprocess | |
| from xml.etree import ElementTree as ET | |
| import pandas as pd | |
| import re | |
| import logging | |
| import sys | |
| import os.path | |
| logging.basicConfig(level=logging.DEBUG) | |
| logger = logging.getLogger(__name__) |