Skip to content

Instantly share code, notes, and snippets.

View bastjan's full-sized avatar

Sebastian Widmer bastjan

View GitHub Profile
@bastjan
bastjan / main.go
Created October 24, 2023 15:26
go-jsonnet native funtion callback
package main
import (
"fmt"
"log"
"github.com/google/go-jsonnet"
"github.com/google/go-jsonnet/ast"
)
@bastjan
bastjan / sudo-tid.md
Created June 15, 2022 18:39
Add Touch ID to sudo

Add Touch ID to sudo

Edit /etc/pam.d/sudo add after header:

auth       sufficient     pam_tid.so

File should look like this in the end:

@bastjan
bastjan / braindump.jira
Created December 17, 2021 15:49
openshift logging elasticsearch tenant log size retention braindump
h2. Summary
*As* a VSHN customer user
*I want* to search and visualise my logs
*So that* I can check my application health and be aided with debugging it.-
h2. Context
APPUiO Public has 2.4TB Log Volumes for ~10 days retention.
@bastjan
bastjan / release4.8-4.9.diff
Created November 15, 2021 15:23
Full diff between OCP 4.8 and 4.9 monitoring rules
diff -rub compiled-4.8/openshift4-monitoring/openshift4-monitoring/prometheus_rules.yaml compiled/openshift4-monitoring/openshift4-monitoring/prometheus_rules.yaml
--- compiled-4.8/openshift4-monitoring/openshift4-monitoring/prometheus_rules.yaml 2021-11-15 16:12:31.000000000 +0100
+++ compiled/openshift4-monitoring/openshift4-monitoring/prometheus_rules.yaml 2021-11-15 16:13:35.000000000 +0100
@@ -156,8 +156,10 @@
syn: 'true'
- alert: SYN_SamplesTBRInaccessibleOnBoot
annotations:
- message: 'Samples operator could not access ''registry.redhat.io'' during
- its initial installation and it bootstrapped as removed.
+ message: 'One of two situations has occurred. Either
@bastjan
bastjan / kyverno-merge-cm.yaml
Last active November 3, 2021 09:33
Merge two config maps using kyverno
apiVersion: v1
kind: Namespace
metadata:
name: merge-configmap
labels:
test: insert-merged
---
apiVersion: v1
kind: ConfigMap
metadata:
@bastjan
bastjan / find-clusterroles.sh
Last active September 7, 2021 07:46
Find clusterroles with permissions to create/edit namespaces
#!/bin/bash
set -euo pipefail
kubectl --as=cluster-admin get clusterrole -ojson | jq '[ .items[]
| select(
.rules[]?
| select(
(.apiGroups[]? == "" or .apiGroups[]? == "*")
and
@bastjan
bastjan / PodDisruptionBudget-test.yaml
Created September 3, 2021 14:14
PodDisruptionBudget test
apiVersion: apps/v1
kind: Deployment
metadata:
name: readiness-test-ready
spec:
selector:
matchLabels:
app: readiness-test-ready
pdb: readiness-test
template:
@bastjan
bastjan / proxy-env.go
Created April 28, 2020 09:33
GO: Support proxy env variable
&http.Transport{
Proxy: http.ProxyFromEnvironment,
}
@bastjan
bastjan / extract-images.sh
Created April 27, 2020 14:59
extract images from tanka deployment
tk eval environments/default | jq --raw-output '[paths(scalars) as $$p | select($$p[-1] == "image") | getpath($$p)] | unique[]' | tee -a images.txt
@bastjan
bastjan / docker-wo-docker.md
Last active April 21, 2020 12:49
docker without docker