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
#### Get Network ACLS from the AWS API using aws cli | |
def p = 'aws ec2 describe-network-acls --output text'.execute() | 'grep NETWORKACLS'.execute() | ['awk', '{ print $3 }'].execute() | |
p.waitFor() | |
return p.text.tokenize() | |
### More to come |
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 io import BytesIO | |
import gzip | |
import shutil | |
def upload_gzipped(bucket, key, fp, compressed_fp=None, content_type='text/plain'): | |
"""Compress and upload the contents from fp to S3. | |
If compressed_fp is None, the compression is performed in memory. | |
""" |
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 OpenSSL import crypto | |
import os | |
import sys | |
import datetime | |
import whois | |
#Variables | |
TYPE_RSA = crypto.TYPE_RSA | |
TYPE_DSA = crypto.TYPE_DSA |
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
Regular expression cheat sheet for Varnish | |
Varnish regular expressions are NOT case sensitive. Varnish uses POSIX | |
regular expressions, for a complete guide, see: "man 7 regex" | |
Basic matching: | |
req.url ~ "searchterm" | |
True if req.url contains "searchterm" anywhere. | |
req.url == "searchterm" |