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 sys | |
import os | |
import time | |
from watchdog.observers import Observer | |
from watchdog.events import FileModifiedEvent, FileCreatedEvent | |
import boto3 | |
import mimetypes | |
from botocore.exceptions import ClientError | |
# Create an S3 client |
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 ConfigParser import SafeConfigParser | |
credentials = os.path.join(os.environ['HOME'], '.aws', 'credentials') | |
parser = SafeConfigParser() | |
parser.read(credentials) | |
print parser.get('default', 'aws_access_key_id',) | |
parser.set('default', 'aws_access_key_id', 'AKXXX55555XXXXXXXXXA') | |
parser.set('default', 'aws_secret_access_key', 'XXXXXXXXXX00000/555XXXXX555555555XXXXX') |
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
# Find the IAM username belonging to the TARGET_ACCESS_KEY | |
import boto3 | |
from botocore.exceptions import ClientError | |
iam = boto3.client('iam') | |
def find_user(key): | |
try: | |
key_info = iam.get_access_key_last_used(AccessKeyId=key) |
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/env python3 | |
# python3 strokeit.py 192.168.1.0/24 0 1024 | |
import subprocess | |
import ipaddress | |
import os | |
import sys | |
strokeEC="/System/Library/CoreServices/Applications/Network Utility.app/Contents/Resources/stroke" |
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/env python | |
import json | |
import boto3 | |
import botocore | |
s3 = boto3.resource('s3') | |
client = boto3.client('s3') | |
sns = boto3.client('sns') |
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
--- | |
- name: trigger jenkins job | |
shell: "{{ lookup('template', 'trigger-jenkins.j2') }}" | |
delegate_to: localhost | |
- name: wait for job to complete | |
wait_for: | |
path: {{ lockfile }} | |
timeout: 600 |
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
query_boolean: false | |
query_string: "{{ query_boolean | bool | to_json }}" |
NewerOlder