🤷♂️
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
# A vantablack friday: How to be prepared to stop DDoS Attacks after Halloween | |
# https://blog.evereven.tech | |
# Get API GW IDs and stage names | |
aws apigateway get-rest-apis --query 'items[*].[id,name]' --output json | |
> [ | |
> [ | |
> "abc123xyz", | |
> "my-api" | |
> ] |
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
# A vantablack friday: How to be prepared to stop DDoS Attacks after Halloween | |
# https://blog.evereven.tech | |
# Obtain Auto Scaling Group Name | |
aws autoscaling describe-auto-scaling-groups \ | |
--query 'AutoScalingGroups[*].[AutoScalingGroupName,MinSize,MaxSize,DesiredCapacity]' \ | |
--output json | |
> [ | |
> [ | |
> "my-asg-cool-name", |
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
# A vantablack friday: How to be prepared to stop DDoS Attacks after Halloween | |
# https://blog.evereven.tech | |
# Obtain distribution ID | |
aws cloudfront list-distributions --query 'DistributionList.Items[*].Id' --output json | |
> [ | |
> "E1PI*******PNY" | |
> ] | |
# Obtain codes from: https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2 |
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
# A vantablack friday: How to be prepared to stop DDoS Attacks after Halloween | |
# https://blog.evereven.tech | |
# Create a WebACL Group Rule | |
aws wafv2 create-rule-group \ | |
--name "emergency-ddos-rules" \ | |
--scope REGIONAL \ | |
--capacity 1000 \ | |
--visibility-config \ | |
MetricName=DDOSRuleMetric,SampledRequestsEnabled=true,CloudWatchMetricsEnabled=true \ |
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
<?php | |
// Ensure this script its used by consola or exit process | |
if (php_sapi_name() !== 'cli') { | |
die('This script can only be run from the command line.'); | |
} | |
// Load SDK de AWS | |
require 'vendor/autoload.php'; | |
use Aws\Exception\AwsException; |
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
<?php | |
// Ensure this script its used by consola or exit process | |
if (php_sapi_name() !== 'cli') { | |
die('This script can only be run from the command line.'); | |
} | |
// Database config (get all this data from wp-config.php) | |
$db_host = '<db_ip>:3306'; | |
$db_name = '<db_name>'; |
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
<?php | |
// Ensure this script its used by consola or exit process | |
if (php_sapi_name() !== 'cli') { | |
die('This script can only be run from the command line.'); | |
} | |
// Connect to datatase (get all this data from wp-config.php) | |
$db_host = '<db_ip>:3306'; | |
$db_name = '<db_name>'; |
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
BEGIN:VCARD | |
VERSION:3.0 | |
FN:John Doe | |
ORG:Example Corp | |
TITLE:Software Engineer | |
TEL;TYPE=WORK,VOICE:+1234567890 | |
EMAIL:[email protected] | |
END:VCARD |
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
provider "aws" { | |
region = "us-east-1" | |
} | |
locals { | |
s3_origin_id = "S3-business-card" | |
} | |
variable "zone_id" { | |
type = string |
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
async def generate_blurred( | |
image_path: str, | |
output_path: str, | |
original_filename: str, | |
original_extension: str, | |
faces_detail: dict, | |
ids_requested: dict, | |
) -> str: | |
image = Image.open(image_path) | |
imgWidth, imgHeight = image.size |