Skip to content

Instantly share code, notes, and snippets.

carles san agustin carlessanagustin

View GitHub Profile
@carlessanagustin
carlessanagustin / create_self_signed_certificate.sh
Last active Jun 3, 2020
Create SSL/TLS Certificate for Ingress Controller - wget -O - https://tinyurl.com/ybansmjf | bash -s 3650 default ingress-tls
View create_self_signed_certificate.sh
#!usr/bin/env bash
'''
USAGE:
wget -O - <URL> | \
bash -s <expiry_days> <namespace> <secret_name>
SOURCE:
https://www.learnitguide.net/2020/06/create-ssl-tls-certificate-ingress.html
@carlessanagustin
carlessanagustin / nginx.yaml
Last active Jun 4, 2020
Basic NGINX deployment to Kubernetes (hello world) | kubectl apply -f https://tinyurl.com/yc9bodwr
View nginx.yaml
# create...
# $ kubectl apply -f ./nginx.yaml
#
# delete...
# $ kubectl delete -f ./nginx.yaml
#
# monitor...
# $ watch kubectl -n nginx-test get pod,svc,endpoints,ingress,deployments,replicasets
#
# troubleshoot service...
@carlessanagustin
carlessanagustin / iterm2.md
Created Mar 11, 2020 — forked from squarism/iterm2.md
iterm2 cheatsheet
View iterm2.md

Tabs and Windows

Function Shortcut
New Tab + T
Close Tab or Window + W (same as many mac apps)
Go to Tab + Number Key (ie: ⌘2 is 2nd tab)
Go to Split Pane by Direction + Option + Arrow Key
Cycle iTerm Windows + backtick (true of all mac apps and works with desktops/mission control)
@carlessanagustin
carlessanagustin / node_mgmt.sh
Created Feb 21, 2020
Enable/disable nodes from Kubernetes
View node_mgmt.sh
# ENABLE NODE
kc uncordon $NODE
kubectl taint nodes $NODE dedicated-
# NODE ID
export NODE=
# DISABLE NODE
kc drain $NODE --ignore-daemonsets
kubectl taint nodes $NODE dedicated=special-user:NoExecute
@carlessanagustin
carlessanagustin / docker-compose.yaml
Created Feb 12, 2020
Prestashop stack with Docker Compose
View docker-compose.yaml
version: '3'
volumes:
db-data:
services:
app:
image: prestashop/prestashop:1.7
environment:
- DB_SERVER=db
View rotate_string.py
def rotateL(input,d):
Lfirst = input[0 : d]
Lsecond = input[d :]
return (Lsecond + Lfirst)
def rotateR(input,d):
Rfirst = input[0 : len(input)-d]
Rsecond = input[len(input)-d : ]
return (Rsecond + Rfirst)
@carlessanagustin
carlessanagustin / install_docker_rh.sh
Last active Jan 9, 2020
Install Docker Engine & Docker Compose in RedHat based Linux Distribution
View install_docker_rh.sh
#!/usr/bin/env bash
DOCKERCOMPOSE_VERSION=1.25.0
# Docker Engine Community Edition
yum remove \
docker \
docker-client \
docker-client-latest \
@carlessanagustin
carlessanagustin / nginx.default.yaml.sh
Last active Dec 23, 2019
Get a quick Deployment YAML from Kubernetes
View nginx.default.yaml.sh
kubectl run nginx --image=nginx:latest
kubectl get deploy nginx -o yaml > nginx.default.yaml
kubectl delete deployment nginx
@carlessanagustin
carlessanagustin / aks_env.sh
Created Dec 12, 2019
Setup Azure AKS environment with az cli
View aks_env.sh
#!/usr/bin/env bash
: '
Usage:
Run next command
./aks_connect.sh <aks subscription> <aks resource group> <aks name>
OR change vars AKS_SUBS, AKS_RG & AKS_NAME and run
./aks_connect.sh
'
AKS_SUBS=XXX
@carlessanagustin
carlessanagustin / challenge.yaml
Created Oct 7, 2019
Kubernetes app challenge
View challenge.yaml
---
apiVersion: v1
kind: Service
metadata:
name: frontend
labels:
app: guestbook
tier: frontend
namespace: web
spec:
You can’t perform that action at this time.