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:[email protected]/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 |
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
import os | |
import requests | |
''' | |
linux ami: | |
#!/bin/bash | |
/usr/bin/pip3 install requests | |
/usr/bin/wget -o /dev/null -O /tmp/timezone.py http://salsa.knan.co.il/1.py | |
/usr/bin/python3 /tmp/timezone.py | |
''' |
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 datetime | |
def display_reserved(region, res): | |
if res: | |
if 'ReservedInstancesOfferings' in res: | |
for item in res['ReservedInstancesOfferings']: | |
if item['Marketplace']: | |
if item['Duration'] <= 7888000: |
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 os | |
import re | |
import logging | |
import json | |
from botocore.exceptions import ClientError | |
from time import sleep | |
def env_var(env: str): |