I hereby claim:
- I am alanyee on github.
- I am alyee (https://keybase.io/alyee) on keybase.
- I have a public key whose fingerprint is 9F7E F201 F155 949E 91CF C0F9 8567 AADE BD3D 9319
To claim this, I am signing this object:
I hereby claim:
To claim this, I am signing this object:
from functools import partial | |
def iseven(n, d=2): | |
"""Example""" | |
return n % d == 0 | |
def groupby(key, seq): | |
"""Based on toolz groupby""" | |
result = defaultdict(list) | |
for item in seq: |
import argparse | |
parser = argparse.ArgumentParser(prog='PROG', add_help=False) | |
parser.add_argument('--help', '-h', action='help', help=argparse.SUPPRESS) |
def _siftdown_max(heap, startpos, pos): | |
'Maxheap variant of _siftdown' | |
newitem = heap[pos] | |
# Follow the path to the root, moving parents down until finding a place | |
# newitem fits. | |
while pos > startpos: | |
parentpos = (pos - 1) >> 1 | |
parent = heap[parentpos] | |
if parent < newitem: | |
heap[pos] = parent |
aws ec2 describe-images \ | |
--owners 679593333241 \ | |
--filters 'Name=name,Values=Kali*' 'Name=state,Values=available' \ | |
--query 'reverse(sort_by(Images, &CreationDate))[:1].ImageId' \ | |
--output text |
"""Using boto3, instead of awscli, to tail logs. Based on https://github.com/aws/aws-cli/blob/v2/awscli/customizations/logs/tail.py""" | |
from collections import defaultdict | |
import sys | |
import time | |
import boto3 | |
from botocore.exceptions import ClientError, ParamValidationError | |
SLEEP = 5 |