Skip to content

Instantly share code, notes, and snippets.

View developer-guy's full-sized avatar
🐾
Every artifact can be verifiably traced to Source Code and Hardware

Batuhan Apaydın developer-guy

🐾
Every artifact can be verifiably traced to Source Code and Hardware
View GitHub Profile
@developer-guy
developer-guy / generate_certificate.sh
Created August 30, 2021 12:56
Generate certificate suitable for use with any Kubernetes Mutating Webhook: https://github.com/newrelic/k8s-webhook-cert-manager
./generate_certificate.sh --service ${WEBHOOK_SERVICE_NAME} --webhook
${WEBHOOK_NAME} --secret ${SECRET_NAME} --namespace ${WEBHOOK_NAMESPACE}
@developer-guy
developer-guy / certificator.yaml
Created August 30, 2021 12:27
Certificator Job Resource Definition
apiVersion: v1
kind: ServiceAccount
metadata:
name: webhook-cert-sa
namespace: default
annotations:
"helm.sh/hook": pre-install,pre-upgrade
"helm.sh/hook-delete-policy": before-hook-creation
labels:
app: webhook-cert-sa
@developer-guy
developer-guy / README.md
Created August 16, 2021 10:26 — forked from dims/README.md
Kubernetes Resources
@developer-guy
developer-guy / Makefile
Created July 28, 2021 11:15
A Makefile target that allows us to display all the targets within the Makefile
.DEFAULT_GOAL := help
.PHONY: help
help:
@LC_ALL=C $(MAKE) -pRrq -f $(lastword $(MAKEFILE_LIST)) : 2>/dev/null | awk -v RS= -F: '/^# File/,/^# Finished Make data base/ {if ($$1 !~ "^[#.]") {print $$1}}' | sort | egrep -v -e '^[^[:alnum:]]' -e '^$@$$'
@developer-guy
developer-guy / cluster-config2.yaml
Created July 21, 2021 17:31
falco and audit logging cluster config
kind: Cluster
apiVersion: kind.x-k8s.io/v1alpha4
nodes:
- role: control-plane
extraMounts:
- hostPath: /tmp/audit
containerPath: /tmp/audit
# allow Falco to use devices provided by the kernel module
- hostPath: /dev
containerPath: /dev
@developer-guy
developer-guy / main.go
Last active July 5, 2021 06:26
List images within the Dockerfile via go programmatically using Moby Buildkit's official parser
package main
import (
"fmt"
"os"
"github.com/google/go-containerregistry/pkg/authn"
"github.com/google/go-containerregistry/pkg/name"
"github.com/google/go-containerregistry/pkg/v1/remote"
"github.com/moby/buildkit/frontend/dockerfile/parser"

Brew Bundle Brewfile Tips

Copyright & License

Unless otherwise noted (either in this file or in a file's copyright section) the contents of this gist are Copyright ©️2020 by Christopher Allen, and are shared under spdx:Creative Commons Attribution Share Alike 4.0 International (CC-BY-SA-4.) open-source license.

Sponsor

If you more tips and advice like these, you can become a monthly patron on my GitHub Sponsor Page for as little as $5 a month; and your contributions will be multipled, as GitHub is matching the first $5,000! This gist is all about Homebrew, so if you like it you can support it by donating to them or becoming one of their Github Sponsors.

@developer-guy
developer-guy / k8s-list-virtualservices.go
Created May 3, 2021 20:53 — forked from dwmkerr/k8s-list-virtualservices.go
Example showing how to list Istio VirtualService CRDs Golang
// Example showing how to patch Kubernetes resources.
package main
import (
"fmt"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/runtime/schema"
"k8s.io/client-go/dynamic"
_ "k8s.io/client-go/plugin/pkg/client/auth"

jr, jp, jb (alias to opa eval): Cheatsheet

jr, jp and jb are commands for JSON modification.

Basic usages

$ data='{"name":"chris", "friends":["alice", "bob"]}'
# jr
$ echo $data | jr 'i.name'
@developer-guy
developer-guy / main.go
Created April 24, 2021 13:59
Creating&Resolving symlinks in Go
package main
import (
"fmt"
"log"
"os"
"path/filepath"
)
func main() {