This file contains 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
#credits to: http://www.lecloud.net/post/61401763496/install-update-to-python-2-7-and-latest-pip-on-ec2 | |
# install build tools (stick to a specific version to avoid environment drift) | |
# yum install -y make automake gcc gcc-c++ kernel-devel git | |
yum install -y make-1:3.81-20.7.amzn1.x86_64 \ | |
automake-1.13.4-2.14.amzn1.noarch \ | |
gcc48-4.8.2-7.87.amzn1.x86_64 \ | |
gcc48-c++-4.8.2-7.87.amzn1.x86_64 \ | |
kernel-devel-3.10.48-55.140.amzn1.x86_64 \ | |
git-1.8.3.1-2.37.amzn1.x86_64 |
This file contains 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
aws s3api list-objects --bucket $BUCKETNAME --query 'sum(Contents[].Size)' | awk '{print $0/1024/1024/1024" GB"}' |
This file contains 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
aws ec2 describe-subnets --query 'Subnets[?DefaultForAz == `true`] | @[0:2][].AvailabilityZone' --output text | sed -e 's/\t/,/g’ |
This file contains 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
aws ec2 describe-instances --query 'Reservations[?Instances[?length(Tags[?Key==`Environment`]) == `0`]].Instances[].InstanceId' | |
aws ec2 describe-instances --query 'Reservations[?Instances[?Tags[?Key==`Environment`]]].Instances[].InstanceId' |
This file contains 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
# $ aws --version | |
# aws-cli/1.10.8 Python/2.7.11 Darwin/15.3.0 botocore/1.3.30 | |
REGIONS=$(aws ec2 describe-regions --query 'Regions[].RegionName' --output text) | |
for R in $REGIONS ; do echo $R; aws ec2 describe-id-format --region $R --output text; done |
This file contains 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
# Set working directory | |
cd /home/ec2-user | |
# Install EB Command line tool | |
wget https://s3.amazonaws.com/elasticbeanstalk/cli/AWS-ElasticBeanstalk-CLI-2.6.3.zip | |
unzip AWS-ElasticBeanstalk-CLI-2.6.3.zip | |
sed -i -e "/PATH=/ aPATH=\$PATH:/home/ec2-user/AWS-ElasticBeanstalk-CLI-2.6.3/eb/linux/python2.7" /home/ec2-user/.bash_profile | |
chown -R ec2-user:ec2-user /home/ec2-user/.elasticbeanstalk && chown -R ec2-user:ec2-user /home/ec2-user/AWS-ElasticBeanstalk-CLI-2.6.3 && chmod 744 /home/ec2-user/AWS-ElasticBeanstalk-CLI-2.6.3/eb/linux/python2.7/eb | |
# Install Python 2.7 |
This file contains 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
option_settings: | |
"aws:elb:listener:443" : | |
ListenerProtocol : HTTPS | |
InstanceProtocol : HTTP | |
InstancePort : 80 | |
SSLCertificateId : "arn:aws:acm:us-east-1:012345678912:certificate/917....853" | |
"aws:elb:listener:80" : | |
ListenerEnabled : false |
This file contains 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
{ | |
"Records": [{ | |
"eventVersion": "2.0", | |
"eventSource": "aws:s3", | |
"awsRegion": "us-west-2", | |
"eventTime": "2014-11-27T21:08:30.487Z", | |
"eventName": "ObjectCreated:Put", | |
"userIdentity": { | |
"principalId": "AWS:ARxxxxxxxxxxSW:i-4fxxxxa5" | |
}, |
This file contains 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
{ | |
"Records": [{ | |
"eventVersion": "2.0", | |
"eventSource": "aws:s3", | |
"awsRegion": "us-west-2", | |
"eventTime": "2014-11-27T21:08:30.487Z", | |
"eventName": "ObjectCreated:Put", | |
"userIdentity": { | |
"principalId": "AWS:ARxxxxxxxxxxSW:i-4fxxxxa5" | |
}, |
This file contains 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
const HelloWorldIntentHandler = { | |
canHandle(handlerInput) { | |
return handlerInput.requestEnvelope.request.type === 'IntentRequest' && handlerInput.requestEnvelope.request.intent.name === 'HelloWorldIntent'; | |
}, | |
async handle(handlerInput) { | |
const { | |
accessToken | |
} = handlerInput.requestEnvelope.context.System.user; | |
let speechText = ''; | |
if (!accessToken) { |
OlderNewer