Skip to content

Instantly share code, notes, and snippets.

View ljmocic's full-sized avatar

Ljubiša Moćić ljmocic

View GitHub Profile
import boto3
import json
from datetime import datetime, timedelta
REGION = 'us-east-1'
TAG = 'A'
ARN = 'arn:aws:sns:us-east-1:12345678:snsName'
UTILIZATION_PERCENTAGE = 0.5
TIME = 60 * 60 * 2
import os
import requests
import psutil
import time
import json
# Here you can find basic configuration settings set through variables
IP_TO_PING = '192.168.1.1' # IP of your computer on the network for ping
API_ENDPOINT = 'https://www.yoururl.com/' # API endpoint which needs to be notified if everything goes as planned
DATA_FILE = 'data.json' # Since we use the file for saving the counter, here is the name of the file where it will be saved
from datetime import datetime
import json
import boto3
import random
print('[INFO] Processing started')
random.seed(datetime.now())
dt = datetime.now()
import boto3
iam = boto3.client('iam',
aws_access_key_id='xxxx',
aws_secret_access_key='xxxx')
def user_in_group(user, group_name):
for group in iam.list_groups_for_user(UserName=user)['Groups']:
if group_name == group['GroupName']:
return True