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
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
{ | |
"Version": "2012-10-17", | |
"Statement": [{ | |
"Sid": "Tutorials Dojo - DescribeAutoScalingGroups", | |
"Effect": "Allow", | |
"Action": "autoscaling:DescribeAutoScalingGroups", | |
"Resource": "*" | |
}, | |
{ | |
"Sid": "Tutorials Dojo - Allow PutParameter", |
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, 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
{ | |
"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
Tutorials Dojo is an active contributor to the official AWS documentation. | |
We've raised several pull-requests to the official AWS Github repositories that remediate incorrect information in the AWS docs, and not just simple grammar typos. | |
Here are the latest ones that got approved by the AWS team recently: | |
https://github.com/awsdocs/amazon-cloudwatch-user-guide/pull/42 | |
https://github.com/awsdocs/elb-application-load-balancers-user-guide/pull/21 | |
https://github.com/awsdocs/amazon-s3-developer-guide/pull/79 | |
https://github.com/awsdocs/amazon-dynamodb-developer-guide/pull/207 |
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
// Add this code to automatically | |
// exit if this php file is accessed directly | |
defined( 'ABSPATH' ) || exit; |
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 | |
# | |
COUNTER=0 | |
echo "Generating Random MAC Address..." | |
while [ $COUNTER -lt 100 ]; do | |
mac=`openssl rand -hex 6 | sed 's/\(..\)/\1:/g; s/.$//'` | |
#echo "$mac" | |
if [ ${mac:0:2} = 80 ] | |
then | |
echo "$mac" |
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
{ | |
"name": "coral-livefyre-api-scraper", | |
"version": "1.0.0", | |
"description": " API scraper to fetch data and generate dump file", | |
"main": "index.js", | |
"scripts": { | |
"build": "rimraf dist/ && babel ./ --out-dir dist/ --ignore ./node_modules,./.babelrc,./package.json,./npm-debug.log --copy-files", | |
"start": "babel-node --presets es2015 index.js" | |
}, | |
"keywords": [ |