This file contains 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 pandas as pd | |
import numpy as np | |
from datetime import datetime | |
from argparse import ArgumentParser, Namespace | |
DATETIME_COLUMNS = [ | |
"Joined Group on", | |
"Last visited group on", | |
"Last Attended", | |
] |
This file contains 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
module purge | |
for credential in aws-dev aws-uat; do | |
echo "Credentials: ${credential}" | |
module load ${credential} | |
aws iam list-users | |
aws iam list-roles | |
module unload ${credential} | |
echo "" | |
done |
This file contains 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
# Requires `awscli` (installed with pip) and a modern python version (>=3.6) | |
from datetime import datetime, timedelta | |
from subprocess import check_output | |
from json import loads, dumps | |
from typing import Tuple, NamedTuple | |
from multiprocessing import Pool | |
def sizeof_fmt(num: float, suffix: str = 'B') -> str: |
This file contains 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 requests import get | |
from json import loads | |
print( | |
loads( | |
get('http://pimpyourwaste.bcaron.me/pieces?min_volume=2.0,1.0,1.0').text, | |
), | |
) |
This file contains 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
# Inspired from http://coding4streetcred.com/blog/post/Asymmetric-Encryption-Revisited-(in-PyCrypto) | |
# PyCrypto docs available at https://www.dlitz.net/software/pycrypto/api/2.6/ | |
from Crypto import Random | |
from Crypto.PublicKey import RSA | |
import base64 | |
def generate_keys(): | |
# RSA modulus length must be a multiple of 256 and >= 1024 | |
modulus_length = 256 * 4 * 4 # use larger value in production |
This file contains 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
add :: Int -> Int -> Int | |
add x y = x + y | |
fs :: [(Int -> Int)] | |
fs = map (\n -> add n) [1..3] | |
main = do | |
print $ map (\f -> f 0) fs |