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/env python3 | |
# | |
# Create ~/.aws/aws-mfa.yaml with the following content: | |
# | |
# --- | |
# default: | |
# account: 1234567890 | |
# username: [email protected] | |
# aws_profile: production |
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
def dig(d, keys, *args): | |
"""Locate a value in a nested dictionary. | |
Args: | |
d (dict): the dictionary | |
keys (list): list of keys to index the dictionary with | |
default (value|callable): value or callable to return in case of missing key | |
Returns: | |
Value at `d[k0][k1][...]` if all keys are present |
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 | |
import sys | |
import os | |
import getpass | |
import socket | |
import select | |
import threading | |
import logging | |
import yaml |
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/python3 | |
import os | |
import re | |
import logging | |
import boto3 | |
from queue import Queue | |
from threading import Thread | |
from datetime import datetime, timedelta, timezone |
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
body { | |
background-color: #eeeeee; | |
} | |
a { | |
color: #333333; | |
text-decoration: none; | |
} | |
.server-stats { |
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/python | |
import csv | |
import os | |
from datetime import datetime | |
skipped = open('no-target.csv', 'w') | |
targets = {} | |
with open('file_mapping.csv') as csvfile: |
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
try: | |
config = yaml.load(open(CONFIGFILE).read()) | |
except: | |
config = None | |
if not config: config = {} | |
username = config.get('username', None) | |
password = keyring.get_password(PROGRAM, username) if username else None |
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 | |
from OpenSSL import crypto | |
import click | |
def validate_country(ctx, param, value): | |
try: | |
assert len(value) == 2 | |
except AssertionError: | |
raise click.BadParameter('{} must be two letters'.format(param.name)) |
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/python | |
from __future__ import print_function | |
import os | |
import OpenSSL | |
import pem | |
import click | |
def get_cn(cert_pem): |
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/python | |
from __future__ import print_function | |
import sys | |
from datetime import datetime | |
import certifi | |
import pem | |
import OpenSSL | |
from acme import crypto_util as acme_crypto_util |