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
""" | |
Craft a web request to the AWS rest API and hit an endpoint that actually works but isn't supported in the boto3 or AWS CLI | |
Based on https://gist.github.com/andrewmackett/5f73bdd29aeed4728ecaace53abbe49b | |
Usage :- python3 rds_log_downloader.py --region <region> --db <db_name> --logfile <log_file_to_download> --output <output_file_path> | |
Note:- | |
The above command also supports profile. You can pass profile name using --profile or -p paramater. It's an optional parameter though. |
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
ARN Base Pattern :- | |
arn:<aws_parition>:<aws_service>:[<aws_region>]:<account_id>:<root | resource_type>:/<resource_name>[/<sub_resource_names>...] | |
i. <aws_partition> | |
Regex - (aws|aws-us-gov|aws-cn) | |
ii. <aws_service> - No fixed pattern | |
iii. <aws_region> - No fixed pattern | |
Most of the regions occur in combination of 2 letter followed by "-" followed by a combination of direction based word , followed by a "-" and then a digit. |
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
#Source : https://stackoverflow.com/a/33630650 | |
import Image | |
photo = Image.open('art.png') #your image | |
photo = photo.convert('RGB') | |
width = photo.size[0] #define W and H | |
height = photo.size[1] | |
widthtext="" | |
for y in range(0, height): #each pixel has coordinates |
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
#Depends on selenium package for python, selenium chrome driver, google-chrome / chrome browser | |
import os | |
from selenium import webdriver | |
from selenium.webdriver.common.keys import Keys | |
from selenium.webdriver.support import expected_conditions as EC | |
import selenium.webdriver.support.ui as ui | |
from selenium.webdriver.common.by import By | |
#Download Chromium Driver for Selenium and place it in class path before executing this program (Link :- https://www.seleniumhq.org/download/) |