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 | |
REGION = 'us-east-1' | |
#list all sg - check | |
#find all attched sg - check | |
#filter | |
#delete | |
ec2 = boto3.client('ec2', region_name=REGION) |
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 | |
REGION = 'us-east-1' | |
STACK_NAME = "shawshank-redemption" | |
TABLE_NAME = 'ecs_images' | |
STABLE_IMAGE_TABLE = 'stable_images' | |
ecs = boto3.client('ecs', region_name=REGION) | |
dynamoClient = boto3.client('dynamodb',region_name=REGION) | |
CLUSTER_NAME = 'ActivePassiveCluster-us-east-1-dev-' | |
SERVICE_NAME = 'healthCheckService-us-east-1-dev' |
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 yaml, subprocess, json, re, sys | |
FILE_NAME = 'auth_config.yaml' | |
KUBERNETES_GROUP = 'system:masters' | |
cmd = f'kubectl get configmap aws-auth -n kube-system -o yaml > {FILE_NAME}' | |
MASTER_PARSER = '({["rolearn":"arn]+[:a-z0-9\/\w-]+"[,"\w\/-:{{{]*[-\w}}",:\[]*[\]]*})' #regex101 |
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, subprocess | |
KUBERNETES_GROUP = 'system:masters' | |
CLUSTER_NAME = 'elliotteks' | |
REGION = 'us-west-2' | |
iam = boto3.client('iam') |
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, sys, subprocess | |
BOOTSTRAP_FILES = "main.tf outputs.tf providers.tf variables.tf" | |
def execute_cmd(cmd): | |
subprocess.Popen(cmd,stdout=subprocess.PIPE,shell=True).communicate() | |
def gen_cmd_string(module,filename): | |
return f"touch {get_current_directoy()}/{module}/{filename}" |
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 | |
regions = ['us-east-1', 'us-west-1', 'us-west-2'] | |
def get_default_vpc(region='us-east-1'): | |
vpc_id = [v['VpcId'] for v in boto3.client('ec2',region_name=region).describe_vpcs()['Vpcs'] if v['IsDefault'] == True][0] | |
return {"type":"vpc","vpc_id": vpc_id} |
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
for dep in $(kubectl get deployment | awk '{print $1}'); do kubectl get deployment $dep -o yaml > $dep.yml; done |
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
#!/bin/bash | |
kubectl run nginx --image=nginx && \ | |
kubectl get pod nginx -o yaml | grep -A5 -B9 uid | grep -v uid | grep -v resource | grep -v creation > clean_base_nginx.yml && \ | |
sed -i.tmp 's/nginx/httpd/g' clean_base_nginx.yml && \ | |
kubectl delete pod nginx && \ |
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
BEGIN { | |
imagePullBackOff=0 | |
running=0 | |
errorImagePull=0 | |
} | |
{ |
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, jwt, json, os, time, sys | |
apikey = os.getenv('ZOOM_KEY') | |
apisecret = os.getenv('ZOOM_SECRET') | |
BASE_ZOOM_URL = 'https://api.zoom.us/v2/' | |
def generate_jwt(): | |
payload = {"iss": apikey,"exp": time.time() + 300} |