Skip to content

Instantly share code, notes, and snippets.

View gmlp's full-sized avatar
🏠
Working from home

Gonzalo Lopez gmlp

🏠
Working from home
  • DigitalOnUs
  • Fresnillo, Zacatecas
View GitHub Profile
########################################
## ##
## Rancher Lab ##
## ##
#########################################
#########################################
## Requirements: ##
## - Docker for mac and k8s enabled ##
## - Helm ##
## - KIND ##
@gmlp
gmlp / eks-jx.sh
Created October 11, 2019 00:36 — forked from vfarcic/eks-jx.sh
####################
# 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
######################
# 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
#!/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} \
#!/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:
#!/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
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")
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)
@gmlp
gmlp / 03-pod.sh
Created December 28, 2017 21:26 — forked from vfarcic/03-pod.sh
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
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: