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
######################################## | |
## ## | |
## Rancher Lab ## | |
## ## | |
######################################### | |
######################################### | |
## Requirements: ## | |
## - Docker for mac and k8s enabled ## | |
## - Helm ## | |
## - KIND ## |
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
#################### | |
# Create a cluster # | |
#################### | |
# Install [AWS CLI](https://aws.amazon.com/cli/) and make sure you have AWS admin permissions | |
# Install [eksctl](https://github.com/weaveworks/eksctl) | |
export AWS_ACCESS_KEY_ID=[...] # Replace [...] with the AWS Access Key ID |
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
###################### | |
# Create The Cluster # | |
###################### | |
# Make sure that you're using eksctl v0.1.5+. | |
# Follow the instructions from https://github.com/weaveworks/eksctl to intall eksctl. | |
export AWS_ACCESS_KEY_ID=[...] # Replace [...] with AWS access key ID |
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
#!/bin/bash | |
export TF_VAR_billing_account=$(gcloud beta billing accounts list \ | |
--filter='displayName:"My Billing Account"' \ | |
--format='value(ACCOUNT_ID)') | |
export TF_ADMIN=${USER}-terraform-admin | |
export TF_CREDS=~/.gcp/${USER}-terraform-admin.json | |
gcloud projects create ${TF_ADMIN} \ |
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
#!/bin/bash | |
########################################################################################################################################################################### | |
# Sample #1 | |
# | |
# Write a program most_active_users that is called with two command line arguments, an /etc/passwd file and its respective /etc/group file, eg: | |
# | |
# most_active_users passwd group | |
# most_active_users should write to stdout the group with the highest number of users that can currently log in, along with the actual count, delimited by a : character. | |
# | |
# For example, given then included files passwd and group, the output should be: |
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
#!/bin/bash | |
export ZSH_VERSION=5.6.2 | |
export ZSH_HOME="$HOME/.local/bin/zsh/bin/zsh" | |
#Create ZSH_DIRECTORY | |
mkdir -p $ZSH_HOME | |
#get zsh binary | |
wget "https://astuteinternet.dl.sourceforge.net/project/zsh/zsh/${ZSH_VERSION}/zsh-${ZSH_VERSION}.tar.xz" | |
#uncompress zsh | |
tar -xzvf "zsh-${ZSH_VERSION}.tar.xz" -C $ZSH_HOME |
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
import psutil | |
import statsd | |
import time | |
import argparse | |
from multiprocessing import Pool | |
PARSER = argparse.ArgumentParser() | |
PARSER.add_argument("-p", "--port", | |
type=int, | |
help="Port, default [8125]", default="8125") |
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
packer build terraform/packer-kubernetes.json | |
cd terraform | |
terraform init | |
aws ec2 create-key-pair --key-name k8s-key | jq -r '.KeyMaterial' > k8s-key.pem | |
terraform plan -target="aws_instance.kube-master" \ | |
-target="aws_eip_association.eip_assoc" -var k8s_key_name="k8s-key" -out=plan | |
ssh-keyscan $(terraform output master-ip) >> ~/.ssh/known_hosts | |
JOIN_COMMAND=$(ssh -i k8s-key.pem ubuntu@$(terraform output master-ip) "sudo kubeadm token create --print-join-command") | |
ssh -i k8s-key.pem ubuntu@$(terraform output master-ip) |
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
minikube start --vm-driver=virtualbox | |
kubectl get nodes | |
git clone https://github.com/vfarcic/k8s-specs.git | |
cd k8s-specs | |
kubectl run db --image mongo |
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
import os | |
import json | |
current_path = os.path.dirname(os.path.abspath(__file__)) | |
user_times = {} | |
user_stdout = {} | |
for root, subdirs, files in os.walk(current_path): | |
for file in files: | |
data = {} | |
try: |
NewerOlder