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
#!/bin/bash | |
yum update -y | |
yum install httpd -y | |
service httpd start | |
chkconfig httpd on | |
echo "<html><h1>This is Webserver X</h1></html>" > /var/www/html/index.html |
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
#Install CodeDeploy agent on your EC2 instance: | |
sudo yum update -y | |
sudo yum install ruby | |
sudo yum install wget | |
cd /home/ec2-user | |
wget https://aws-codedeploy-eu-central-1.s3.amazonaws.com/latest/install | |
chmod +x ./install | |
sudo ./install auto | |
sudo service codedeploy-agent status | |
#Create your application.zip and load it into CodeDeploy: |
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
#!/bin/bash | |
yum update -y | |
yum install httpd php php-mysql -y | |
chkconfig httpd on | |
service httpd start | |
echo "<?php phpinfo();?>" > /var/www/html/index.php | |
cd /var/www/html | |
wget https://s3.amazonaws.com/acloudguru-production/connect.php |
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
# as per https://docs.aws.amazon.com/AmazonECS/latest/developerguide/docker-basics.html | |
sudo yum update -y | |
sudo amazon-linux-extras install docker | |
sudo service docker start | |
sudo usermod -a -G docker ec2-user |
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
# assumes a kinesis firehose delivery system is in place (e.g. demo-firehose-stream) | |
# NodeJS Lambda function to append CRs as follows with a timeout > 1 min | |
# Configure this to deposit results in S3 | |
console.log('Loading function'); | |
exports.handler = async (event, context) => { | |
/* Process the list of records and transform them */ |
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
#!/bin/bash | |
############# | |
# 1. Copy this script into EC2 User Data | |
# 2. Enable Cloudwatch detailed monitoring | |
# Usage: "curl localhost:80/?workload=1000" | |
############# | |
yum update -y | |
curl --silent --location https://rpm.nodesource.com/setup_10.x | bash - |
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
echo "Alan" | base64 | base64 --decode | |
convert -size 2560x1600 canvas:red ~/tx.png # reaquires imagemagick | |
find . -maxdepth 1 -type f -name '*x.png*' -exec ls -l {} \; | |
base64 ~/tx.png > ~/tx.png.b64 | |
zip ~/tx.png.b64.zip ~/tx.png.b64 | |
cp ~/tx.png.b64.zip ~/rx.png.b64.zip |
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
# execute the following command from the terminal of a new c9 workspace | |
git clone https://github.com/amcginlay/nodejs-chat.git | |
cd nodejs-chat | |
npm install | |
# Now ... | |
# - open server.js and click the green run button | |
# - click Preview / Preview Running Application | |
# - in the mini-browser window, click the stacked window icon to open in a new tab |
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
- Create VPC-A in us-west-2 on 10.100.0.0/16 with IGW and public subnet on 10.100.0.0/24 | |
- Create VPC-B in us-east-2 on 10.200.0.0/16 with IGW and public subnet on 10.200.0.0/24 | |
- Create EC2-A in 10.100.0.0/24 with all TCP & ICMP ports open to 10.200.0.0/24 | |
- Create EC2-B in 10.200.0.0/24 with all TCP & ICMP ports open to 10.100.0.0/24 | |
- Allocate EC2-B an Elastic IP address | |
- Create a Virtual Private Gateway (VGW) attached to VPC-A | |
- Create a Customer Gateway (CGW) referencing EC2-B's Elastic IP address | |
- Create a VPN Connection (VPN), referencing the VGW, the CGW and static route 10.200.0.0/24 | |
- Download the Generic VPN configuration file |
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
# assumes a data stream named "demo-stream" with one shard exists | |
# inspect data stream and copy identity SHARD_ID variable (e.g. ShardId-????) | |
aws kinesis list-streams | |
STREAM_NAME=demo-stream | |
aws kinesis describe-stream --stream-name ${STREAM_NAME} | |
SHARD_ID=shardId-000000000000 | |
# add four records |
OlderNewer