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
Transfer Data TO EC2 | |
scp -i ~/.ssh/<your pem keyname>.pem <data to transfer> ec2-user@<IP Address>:<desired folder>/<data to transfer> | |
scp -i ~/.ssh/ec2.pem users.json ec2-user@192.28.25.144:app/users.json | |
Transfer Data FROM EC2 (Take note that there is a dot (.) on the end) | |
scp -i ~/.ssh/ec2.pem ec2-user@192.28.25.44:app/users.txt . |
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
import boto3, os, json, time | |
REGION = os.environ['REGION'] | |
ASG_NAME = os.environ['ASG_NAME'] | |
SSM_PARAMETER_NAME = os.environ['SSM_PARAMETER_NAME'] | |
ssm = boto3.client('ssm', region_name=REGION) | |
autoscaling = boto3.client('autoscaling', region_name=REGION) | |
ec2 = boto3.client('ec2', region_name=REGION) | |
def lambda_handler(event, context): |
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
import boto3, os, json, time | |
REGION = os.environ['REGION'] | |
ASG_NAME = os.environ['ASG_NAME'] | |
SSM_PARAMETER_NAME = os.environ['SSM_PARAMETER_NAME'] | |
ssm = boto3.client('ssm', region_name=REGION) | |
ec2 = boto3.client('ec2', region_name=REGION) | |
autoscaling = boto3.client('autoscaling', region_name=REGION) | |
def lambda_handler(event, context): |
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
import boto3, os, json | |
REGION = os.environ['REGION'] | |
ASG_NAME = os.environ['ASG_NAME'] | |
SSM_PARAMETER_NAME = os.environ['SSM_PARAMETER_NAME'] | |
ssm = boto3.client('ssm', region_name=REGION) | |
autoscaling = boto3.client('autoscaling', region_name=REGION) | |
def lambda_handler(event, context): |
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
# | |
# Real-time Monitoring of 5XX Errors using AWS Lambda, CloudWatch Logs and Slack | |
# Author: Tutorials Dojo Team | |
# | |
import json | |
import urllib3 | |
import base64, zlib | |
http = urllib3.PoolManager() |
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 | |
for i in {1..250} | |
do | |
curl -o /dev/null \ | |
-w "%{time_starttransfer}\n" \ | |
https://google.com >> prod.txt | |
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
# Get the latest file that's added in the folder | |
LATEST_FILE=`ls -tp | grep -v /$ | head -1` | |
echo $LATEST_FILE | |
# Upload the new file to your Amazon S3 Bucket. | |
# In this example, the "jonbonso-media" S3 bucket has an associated CloudFront distribution | |
# with a custom domain of "media.jonbonso.com" | |
aws s3 cp $LATEST_FILE s3://jonbonso-media |
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
{ | |
"Version": "2012-10-17", | |
"Statement": [{ | |
"Sid": "Dynamic Start and Stop Scheduler Functions - Tutorials Dojo", | |
"Action": [ | |
"autoscaling:EnterStandby", | |
"autoscaling:ExitStandby", | |
"autoscaling:PutScalingPolicy", | |
"autoscaling:SetDesiredCapacity" | |
], |
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
MY_IP=`curl checkip.amazonaws.com` | |
echo $MY_IP | |
aws ec2 authorize-security-group-ingress \ | |
--group-id sg-01298cde13c80c75 \ | |
--protocol tcp \ | |
--port 22 \ | |
--cidr $MY_IP/32 \ | |
--region us-east-1 |
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 Certified Solutions Architect-Professional SAP-C01 New Feb 2019 Version Exam | |
## Final Tips: | |
1. Don't cram! If you are not ready to take the SAP-C01 exam, then just re-schedule it to a later date. Haste makes waste! | |
2. Read the question first and then look at the options. Most of the time, you will notice that there are two seemingly similar options which only differs in one or several keywords. This will help you eliminate the wrong options much easier. | |
3. Take the free AWS Exam Readiness course in https://aws.training and other free courses/videos there. | |
## Exam Notes: | |
- The new exam has *75* questions that you have to finish within *3* hours (180 minutes) with a minimum passing score of 750 out of 1000. The official AWS exam page says the exam is 170 minutes, but that is actually incorrect. I took the exam and it is 180 minutes and not 170 minutes. |
NewerOlder