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
{{- if eq .name "efs" }} | |
Resources: | |
filesystem: | |
Type: AWS::EFS::FileSystem | |
Properties: | |
Encrypted: {{ .stack.encrypt }} | |
{{- if .stack.encrypt }} | |
KmsKeyId: !GetAtt | |
- key | |
- Arn |
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
/* | |
This package contains a simple Go code | |
for acquiring the IP Address Ranges utilised by Google Cloud Platform. | |
This process is based on documentation provided by Google | |
see: https://cloud.google.com/compute/docs/faq#find_ip_range | |
Author: Shaun Remekie | |
Email: [email protected] | |
*/ |
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
''' | |
Apache Beam Python Batch Example | |
''' | |
class Batch(beam.DoFn): | |
""" | |
Batch - batch items from PCollection | |
""" | |
def __init__(self, n): | |
import json |
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
function httpGet(theUrl) | |
{ | |
var xmlHttp = new XMLHttpRequest(); | |
xmlHttp.open( "GET", theUrl, false ); // false for synchronous request | |
xmlHttp.send( null ); | |
return xmlHttp.responseText; | |
} |
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 google.cloud import bigquery | |
# create a client | |
client = bigquery.Client().from_service_account_json('<your-JSON-key.json>') | |
# create a query | |
q = "select * from dataset.table" | |
# run query | |
rows = client.query(q) |
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 concurrent.futures import ThreadPoolExecutor, as_completed | |
import time, random | |
class Jobs(object): | |
# create queue | |
queue = ThreadPoolExecutor(max_workers=4) | |
jobs = [] | |
@staticmethod |
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 boto3 import Session | |
from sys import argv | |
from os import unlink, path | |
serial = "arn:aws:iam::<Account Number>:mfa/<Username>" | |
profile = "<your aws config source profile here>" | |
credfile = os.path.join(os.getenv("HOME"), ".aws/credentials") | |
def set_creds(token): |