Skip to content

Instantly share code, notes, and snippets.

View dennybaa's full-sized avatar

Denis Baryshev dennybaa

View GitHub Profile
name: Publish Image
on:
workflow_dispatch:
inputs:
imageName:
type: string
description: Directory and the image name with a Dockerfile
env:
apiVersion: argoproj.io/v1alpha1
kind: ApplicationSet
metadata:
name: webapp-playdemo
namespace: argocd
spec:
generators:
- list:
elements:
- stage: dev
@dennybaa
dennybaa / kubconfig
Created April 14, 2022 07:05
~/.kube/config generator
#!/bin/sh
## ~/.kube/config generator
##
## - creates ~/.kube/config file with the provided context name
## - uses authentication helper which cats token from the path given (used with volume projection)
: ${KUBE_CONTEXT:?kube context name is not provided}
: ${KUBE_TOKENPATH:?path to Kubernetes token path is not provided}
mkdir -p $HOME/.kube/bin
templates:
- |
# Service account which can decrypt helm secrets
apiVersion: v1
kind: ServiceAccount
metadata:
name: github-actions-deployer
namespace: github-actions
annotations:
iam.gke.io/gcp-service-account: XXXX@YYYY.iam.gserviceaccount.com
@dennybaa
dennybaa / sonoff-flash.sh
Last active May 17, 2020 20:41
Flash sonoff with Tasmota #sonoff #tasmota
#!/bin/bash
## Hotspot should be created
# sonoffDiy 20170618sn
# ref: https://www.sigmdel.ca/michel/ha/sonoff/sonoff_mini_en.html
# ref: https://github.com/itead/Sonoff_Devices_DIY_Tools/blob/master/other/SONOFF%20DIY%20MODE%20Protocol%20Doc%20v1.4.md
download() {
# Download latest
# Get lite version (must be less 508kb!)
@dennybaa
dennybaa / deployment.yml
Created April 12, 2019 05:48 — forked from troyharvey/deployment.yml
Using Kubernetes envFrom for environment variables #k8s #envfrom
# Use envFrom to load Secrets and ConfigMaps into environment variables
apiVersion: apps/v1beta2
kind: Deployment
metadata:
name: mans-not-hot
labels:
app: mans-not-hot
spec:
replicas: 1
@dennybaa
dennybaa / semver-regex.md
Last active April 4, 2019 13:21 — forked from jhorsman/semver-regex.md
Semantic versioning regex #semver #regex

Semantic versioning regex

^([0-9]+)\.([0-9]+)\.([0-9]+)(?:-([0-9A-Za-z-]+(?:\.[0-9A-Za-z-]+)*))?(?:\+[0-9A-Za-z-]+)?$

^([0-9]|[1-9][0-9]*)\.([0-9]|[1-9][0-9]*)\.([0-9]|[1-9][0-9]*)(?:-([0-9A-Za-z-]+(?:\.[0-9A-Za-z-]+)*))?(?:\+([0-9A-Za-z-]+(?:\.[0-9A-Za-z-]+)*))?$

example

http://regexr.com/3er1i

also see

@dennybaa
dennybaa / backup.yml
Last active May 13, 2020 18:44
backup resource #heptio
apiVersion: ark.heptio.com/v1
kind: Backup
metadata:
creationTimestamp: 2018-11-08T14:33:07Z
generation: 1
name: my-db-test
namespace: heptio-ark
resourceVersion: "33426"
selfLink: /apis/ark.heptio.com/v1/namespaces/heptio-ark/backups/my-db-test
uid: 35c1bb4f-e363-11e8-8d80-02ec800e0240
@dennybaa
dennybaa / tips.md
Last active September 2, 2018 09:20
Generate self-signed wildcard openssl certificate #openssl #tips #self-signed

Generate self-signed wildcard openssl certificate

generate csr and key

cat <<-EOF > /tmp/config.ss
[req]
distinguished_name = dn
req_extensions = v3_req
prompt = no
@dennybaa
dennybaa / tips.md
Last active July 3, 2020 14:59
K8S tips #k8s #tips

K8S tips

CLI

update config map from file

k create cm nginx-lb-config --from-file=nginx-lb.configmap --dry-run -o yaml | k replace cm nginx-lb-config -f -