Skip to content

Instantly share code, notes, and snippets.

View carlessanagustin's full-sized avatar

carles san agustin carlessanagustin

View GitHub Profile
@carlessanagustin
carlessanagustin / azure-pipeline.yaml
Last active September 16, 2020 10:08
Azure Pipeline basic infrastructure check
trigger: none
pr: none
#pool:
stages:
- stage: infrastructure
displayName: infrastructure stage
#variables:
#condition:
jobs:
@carlessanagustin
carlessanagustin / test.dp.yaml
Created September 9, 2020 14:43
Simple Centos Deployment for Kubernetes
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: centos-dp
labels:
app: centos
spec:
replicas: 1
selector:
@carlessanagustin
carlessanagustin / pipeline.yaml
Created September 4, 2020 08:58
Azure Devops Pipeline predefined variables print
trigger:
branches:
include:
- master
- develop
- refs/tags/*
pool:
vmImage: 'ubuntu-18.04'
@carlessanagustin
carlessanagustin / ingress.yaml
Created July 28, 2020 13:54
Kubernetes Ingress path redirection
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 April 27, 2021 12:44
Create SSL/TLS Certificate for Ingress Controller and push to Kubernetes
#!/usr/bin/env bash
'''
USAGE:
./create_self_signed_certificate.sh <expiry_days> <namespace> <secret_name>
EXAMPLE:
./create_self_signed_certificate.sh 3650 ingress ingress-tls
SOURCE:
@carlessanagustin
carlessanagustin / iterm2.md
Created March 11, 2020 06:51 — forked from squarism/iterm2.md
iterm2 cheatsheet

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 February 21, 2020 12:20
Enable/disable nodes from Kubernetes
# 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 February 12, 2020 23:25
Prestashop stack with Docker Compose
version: '3'
volumes:
db-data:
services:
app:
image: prestashop/prestashop:1.7
environment:
- DB_SERVER=db
@carlessanagustin
carlessanagustin / rotate_string.py
Created February 5, 2020 04:06
Rotate string in Python
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 April 28, 2024 11:06
Install Docker Engine & Docker Compose in RedHat based Linux Distribution
#!/usr/bin/env bash
DOCKERCOMPOSE_VERSION=1.25.0
# Docker Engine Community Edition
yum remove \
docker \
docker-client \
docker-client-latest \