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 | |
| wget http://mirror.nbtelecom.com.br/apache/maven/maven-3/3.5.0/binaries/apache-maven-3.5.0-bin.tar.gz | |
| tar zxvf apache-maven-3.5.0-bin.tar.gz | |
| sudo yum install -y git java-devel | |
| git clone https://github.com/Parquet/parquet-mr.git | |
| cd parquet-mr/parquet-tools/ | |
| sed -i 's/1.6.0rc3-SNAPSHOT/1.6.0/g' pom.xml | |
| ~/apache-maven-3.5.0/bin/mvn clean package -Plocal | |
| java -jar target/parquet-tools-1.6.0.jar schema ~/000000_0 |
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
| dynamodb = boto3.resource('dynamodb') | |
| table = dynamodb.Table(ddb_table) | |
| table.put_item( | |
| Item={ | |
| 'device_id': event['clientId'], | |
| 'timestamp': str(event['timestamp']), | |
| 'status': event['eventType'] | |
| }, | |
| ConditionExpression=':ts >= #ts_old OR attribute_not_exists(#ts_old)', |
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
| #Creting network interfaces - ENIs | |
| aws ec2 create-network-interface --subnet-id subnet-002f9xxx | |
| aws ec2 create-network-interface --subnet-id subnet-002f9xxx | |
| #Getting EIPs | |
| aws ec2 allocate-address | |
| aws ec2 allocate-address | |
| #Associating EIPs to ENIs | |
| aws ec2 associate-address --network-interface-id eni-xxxxxxx --allocation-id eipalloc-xxxxxxxx |
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
| mkdir SampleLambdaFunction | |
| chmod 644 SampleLambdaFunction.py | |
| cp SampleLambdaFunction.py SampleLambdaFunction | |
| cd SampleLambdaFunction | |
| pip install "elasticsearch>=2.0.0,<3.0.0" -t . | |
| pip install requests_aws4auth -t . | |
| zip -9r ../SampleLambdaFunction.zip . |
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
| INSTANCE_ID=`aws ec2 run-instances --instance-type t2.micro \ | |
| --user-data file://user-data.sh \ | |
| --security-group-ids sg-569b5555 \ | |
| --instance-initiated-shutdown-behavior terminate \ | |
| --iam-instance-profile "Name=nonono" \ | |
| --image-id ami-0b33d91d \ | |
| --count 1 \ | |
| --key-name bastion-host \ | |
| --region us-east-1 --query "Instances[0].InstanceId" | sed 's/"//g'` |
NewerOlder