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, timedelta | |
REGION = 'us-east-1' | |
TAG = 'A' | |
ARN = 'arn:aws:sns:us-east-1:12345678:snsName' | |
UTILIZATION_PERCENTAGE = 0.5 | |
TIME = 60 * 60 * 2 |
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 | |
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 |
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 boto3 | |
import random | |
print('[INFO] Processing started') | |
random.seed(datetime.now()) | |
dt = datetime.now() |
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 | |
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 |
NewerOlder