View keycloak.sh
#!/bin/bash | |
export TKN=$(curl -X POST 'http://localhost:8080/auth/realms/master/protocol/openid-connect/token' \ | |
-H "Content-Type: application/x-www-form-urlencoded" \ | |
-d "username=admin" \ | |
-d 'password=admin' \ | |
-d 'grant_type=password' \ | |
-d 'client_id=admin-cli' | jq -r '.access_token') | |
curl -X GET 'http://localhost:8080/auth/admin/realms' \ |
View docker-compose.yml
version: '3' | |
services: | |
webserver: | |
image: nginx:latest | |
command: [nginx-debug, '-g', 'daemon off;'] | |
ports: | |
- "8080:80/tcp" |
View functions.tf
##-------------------------- | |
## Terraform: Functions ## | |
##-------------------------- | |
## Open terraform console | |
terraform console | |
####################### | |
## Numeric Functions ## | |
####################### |
View detect_os.sh
: ' | |
thanks to https://packagecloud.io/ | |
You can find a list of supported OSes and distributions on our website: https://packagecloud.io/docs#os_distro_version | |
' | |
detect_os_deb () | |
{ | |
if [[ ( -z "${os}" ) && ( -z "${dist}" ) ]]; then | |
# some systems dont have lsb-release yet have the lsb_release binary and | |
# vice-versa |
View azure-pipeline.yaml
trigger: none | |
pr: none | |
#pool: | |
stages: | |
- stage: infrastructure | |
displayName: infrastructure stage | |
#variables: | |
#condition: | |
jobs: |
View test.dp.yaml
--- | |
apiVersion: apps/v1 | |
kind: Deployment | |
metadata: | |
name: centos-dp | |
labels: | |
app: centos | |
spec: | |
replicas: 1 | |
selector: |
View pipeline.yaml
trigger: | |
branches: | |
include: | |
- master | |
- develop | |
- refs/tags/* | |
pool: | |
vmImage: 'ubuntu-18.04' |
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: |
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 |
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... |
NewerOlder