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
# see all images | |
sudo docker images | |
# docker tag command help | |
docker tag --help | |
# add your tag to the image | |
sudo docker tag monolith:1.0.0 <your username>/monolith:1.0.0 | |
# you can also rename the image | |
sudo docker tag monolith:1.0.0 udacity/example-monolith:1.0.0 |
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
"""simple Dockerfile | |
FROM alpine:3.1 # starter image (typical) | |
MAINTAINER <name> <email> | |
ADD hello /usr/bin/hello # ADD <bin> <path-on-image> | |
ENTRYPOINT ["hello"] # run hello app on startup | |
""" | |
# install GO | |
wget https://storage.googleapis.com/golang/go1.6.2.linux-amd64.tar.gz | |
rm -rf /usr/local/bin/go |
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
# install docker | |
sudo apt-get install docker | |
# the above command did not work (8/24/18); try the command below | |
sudo curl -sSL https://get.docker.com/ | sh | |
# pull nginx image | |
sudo docker pull nginx:1.10.0 | |
sudo docker images | |
# verify the versions match |
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
# update the virtual machine | |
sudo apt-get update | |
# install nginx | |
sudo apt-get install nginx | |
# check version | |
sudo nginx -v | |
# start the nginx service |
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
import yaml | |
with open("apikey.yaml", 'r') as f: | |
try: | |
credentials_dict = yaml.load(f) | |
except yaml.YAMLError as exc: | |
print(exc) |
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
import numpy as np | |
import matplotlib.pyplot as plt | |
import scipy.stats as scs | |
def z_val(sig_level=0.05, two_tailed=True): | |
"""Returns the z value for a given significance level""" | |
z_dist = scs.norm() | |
if two_tailed: | |
sig_level = sig_level/2 | |
area = 1 - sig_level |
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
import scipy.stats as scs | |
def min_sample_size(bcr, mde, power=0.8, sig_level=0.05): | |
"""Returns the minimum sample size to set up a split test | |
Arguments: | |
bcr (float): probability of success for control, sometimes | |
referred to as baseline conversion rate | |
mde (float): minimum change in measurement between control |
NewerOlder