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
""" | |
Utilities common to all tests using spark | |
""" | |
import pytest | |
from pyspark.sql import SparkSession | |
from pyspark import SparkContext, SparkConf | |
import logging | |
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
""" | |
Utils to interact with DB using pg8000 library | |
Note: assumes py3.5+ | |
[Example usage] | |
# OPTIONALLY retrieve DB password from AWS SSM | |
import boto3 |
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
apiVersion: v1 | |
clusters: | |
- cluster: | |
certificate-authority-data: <certificateAuthority.data from describe-cluster> | |
server: <endpoint from describe-cluster> | |
name: <cluster-name> | |
contexts: | |
- context: | |
cluster: <cluster-name> | |
user: aws |
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
""" | |
Minimal character-level Vanilla RNN model. Written by Andrej Karpathy (@karpathy) | |
BSD License | |
""" | |
import numpy as np | |
# data I/O | |
data = open('input.txt', 'r').read() # should be simple plain text file | |
chars = list(set(data)) | |
data_size, vocab_size = len(data), len(chars) |
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
export AWS_NUKE_VERSION=2.7.0 | |
sudo apt-get install -y wget | |
wget https://github.com/rebuy-de/aws-nuke/releases/download/v$AWS_NUKE_VERSION/aws-nuke-v$AWS_NUKE_VERSION-linux-amd64.tar.gz --no-check-certificate | |
tar xvf aws-nuke-v$AWS_NUKE_VERSION-linux-amd64.tar.gz | |
chmod +x aws-nuke-v$AWS_NUKE_VERSION-linux-amd64 | |
sudo mv aws-nuke-v$AWS_NUKE_VERSION-linux-amd64 /usr/local/bin/aws-nuke | |
# test it | |
aws-nuke --help |
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
regions: | |
- eu-west-1 | |
account-blacklist: | |
- "999999999999" # production | |
resource-types: | |
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
regions: | |
- eu-west-1 | |
account-blacklist: | |
- "999999999999" # production | |
resource-types: | |
# only nuke these three resources | |
targets: |
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
#!/usr/bin/env bash | |
set -x -e | |
JUPYTER_PASSWORD=${1:-myJupyterPassword} | |
PYTHON_VERSION=${2:-3.5} | |
test -d ~/venv_notebooks || python -m virtualenv venv_notebooks --python=python$PYTHON_VERSION | |
. venv_notebooks/bin/activate |
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
# terraform validate will catch typo in resource reference | |
resource "aws_s3_bukcet" "wrong_resource" { | |
name = "my-bucket" | |
} | |
# terraform validate will catch wrong CIDR | |
resource "aws_vpc" "default" { | |
cidr_block = "0.0.0.0/0" | |
} |
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
package tests | |
import ( | |
"github.com/gruntwork-io/terratest/modules/aws" | |
"github.com/gruntwork-io/terratest/modules/terraform" | |
"github.com/stretchr/testify/assert" | |
"testing" | |
) | |
func TestTerraformAwsEnvironment(t *testing.T) { |