This file contains hidden or 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
| #!/usr/bin/python36 | |
| import boto3 | |
| import requests | |
| import os | |
| def ec2_associate_eip(aws_instance, region_name, tag_name, tag_value): | |
| client = boto3.client('ec2', region_name=region_name) | |
| eip_list = client.describe_addresses(Filters=[{'Name': f'tag:{tag_name}', 'Values': [tag_value]}]) | |
| free_eips = [] |
This file contains hidden or 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 | |
| import json | |
| from datetime import datetime | |
| import email | |
| from email import policy | |
| def print_with_timestamp(*args): | |
| print(datetime.utcnow().isoformat(), *args) |
This file contains hidden or 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
| from datetime import datetime | |
| import json | |
| import pytz | |
| def return_day(timestamp: str, local_timezone: str): | |
| return datetime.fromtimestamp(int(timestamp/1000)).astimezone(pytz.timezone(local_timezone)).strftime( | |
| '%m/%d/%Y') | |
This file contains hidden or 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
| #!/usr/local/bin/python3 | |
| import argparse | |
| import botocore.exceptions | |
| import socket | |
| import random | |
| import shlex | |
| import boto3 | |
| import json | |
| import os |
This file contains hidden or 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 datetime | |
| from PyPDF2 import PdfFileMerger | |
| import os | |
| def get_pdf_files_from_current_folder(current_folder: str): | |
| output_list = [] | |
| for item in os.listdir(current_folder): | |
| if item.endswith('.pdf'): | |
| output_list.append(item) |
This file contains hidden or 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
| #!/usr/local/bin/python3 | |
| import configparser | |
| import boto3 | |
| import pyotp | |
| import keyring | |
| if __name__ == '__main__': | |
| try: | |
| # mfa-secret - the name of secret in MacOS keychain access | |
| mfa_token_secret = keyring.get_password("mfa-secret", "mfa-secret") |
This file contains hidden or 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 re | |
| from selenium import webdriver | |
| from pprint import pprint | |
| BROWSERSTACK_URL = 'https://XXXX:YYYY@hub-cloud.browserstack.com/wd/hub' | |
| desired_cap = { | |
| 'os': 'Windows', | |
| 'os_version': '10', | |
| 'browser': 'Chrome', | |
| 'browser_version': '80', |
This file contains hidden or 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 requests | |
| import googleapiclient.discovery | |
| from oauth2client.client import GoogleCredentials | |
| from time import sleep | |
| from random import randint | |
| ''' | |
| permissions | |
| compute.addresses.get | |
| compute.addresses.list |
This file contains hidden or 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
| This is a simple guide that explains how to use forticlient with Gsuite LDAP. | |
| * Google workspaces LDAP is available for customers with one of the following subscriptions: Business Plus; Enterprise; Education Fundamentals, Standard, Teaching and Learning Upgrade, and Plus. | |
| Requirements: | |
| 1. Google workspaces subscription. | |
| 2. Fortigate. | |
| 3. Server for stunnel. | |
| Setup instructions: | |
| 1. Enable Google workspaces LDAP, and download the certificate. more details are available in this guide: https://support.google.com/a/answer/9048434?hl=en |
This file contains hidden or 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
| network: | |
| ethernets: | |
| ens5: | |
| addresses: | |
| - <ENS5_IP>/32 | |
| match: | |
| macaddress: <ENS5_MAC_ADDRESS> | |
| routes: | |
| - table: 2 | |
| to: <ENS5_GATEWAY>/32 |