Skip to content

Instantly share code, notes, and snippets.

Avatar

carles san agustin carlessanagustin

View GitHub Profile
@carlessanagustin
carlessanagustin / azure-pipeline.yaml
Last active Sep 16, 2020
Azure Pipeline basic infrastructure check
View azure-pipeline.yaml
trigger: none
pr: none
#pool:
stages:
- stage: infrastructure
displayName: infrastructure stage
#variables:
#condition:
jobs:
@carlessanagustin
carlessanagustin / test.dp.yaml
Created Sep 9, 2020
Simple Centos Deployment for Kubernetes
View test.dp.yaml
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: centos-dp
labels:
app: centos
spec:
replicas: 1
selector:
@carlessanagustin
carlessanagustin / pipeline.yaml
Created Sep 4, 2020
Azure Devops Pipeline predefined variables print
View pipeline.yaml
trigger:
branches:
include:
- master
- develop
- refs/tags/*
pool:
vmImage: 'ubuntu-18.04'
@carlessanagustin
carlessanagustin / ingress.yaml
Created Jul 28, 2020
Kubernetes Ingress path redirection
View ingress.yaml
apiVersion: networking.k8s.io/v1beta1
kind: Ingress
metadata:
name: ingress-path
annotations:
kubernetes.io/ingress.class: internal
nginx.ingress.kubernetes.io/rewrite-target: /$2
nginx.ingress.kubernetes.io/use-regex: "true"
spec:
rules:
@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)
You can’t perform that action at this time.