Skip to content

Instantly share code, notes, and snippets.

View koolay's full-sized avatar
🏠
Working from home

koolay koolay

🏠
Working from home
  • Mars
View GitHub Profile
@itaysk
itaysk / prepull.yaml
Last active January 26, 2024 17:37
Kubernetes: Pre-pull images into node (moved to: https://github.com/itaysk/kube-imagepuller )
###
# There's a newer version available here:
# https://github.com/itaysk/kube-imagepuller
# All future updates will be made there.
# Please also post you questions as issues on that repo instead of commenting here
###
apiVersion: apps/v1beta2
kind: DaemonSet
@ruanbekker
ruanbekker / setup-kubernetes-ubuntu-16.md
Last active October 21, 2023 08:25
Install a 3 Node Kubernetes Cluster on Ubuntu 16

Master: Dependencies

apt update && apt upgrade -y
curl https://packages.cloud.google.com/apt/doc/apt-key.gpg | apt-key add -

cat <<EOF > /etc/apt/sources.list.d/kubernetes.list
deb http://apt.kubernetes.io/ kubernetes-xenial main
EOF
@dcwangmit01
dcwangmit01 / main.go
Last active March 2, 2024 14:54
Self-templating with golang text/template and gomplate
/*
Demo program illustrating usage of gomplate as a library.
This program will accept an input file and run it through the templating
engine as both the values dictionary as well as the template file. It will
repeat the process until the templating result stops changing, and print
the result to STDOUT.
This program add the gomplate datasources and functions to the golang
text/template engine. This requires the input to be have the gomplate
func compileInQuery(originalQuery string, argsWithInKeyword [][]interface{}, originalArg interface{}) (string, []interface{}, error) {
/**
capturing group result:
group 0: whole match
group 1: ([a-zA-Z_]+\.)?, table name
group 2: ([a-zA-Z_]+), column name
group 3: (NOT )?, NOT flag
*/
regex := regexp.MustCompile(`([a-zA-Z_]+\.)?([a-zA-Z_]+) ([Nn][Oo][Tt] )?[Ii][Nn] \(\?\?\?\)`)
match := regex.FindAllStringSubmatch(originalQuery, -1)
@cristaloleg
cristaloleg / golangci.yaml
Created March 28, 2023 07:01
Go linters configuration, the right version.
# See: https://olegk.dev/go-linters-configuration-the-right-version
run:
# Depends on your hardware, my laptop can survive 8 threads.
concurrency: 8
# I really care about the result, so I'm fine to wait for it.
timeout: 30m
# Fail if the error was met.