Skip to content

Instantly share code, notes, and snippets.

View guilhem's full-sized avatar
Ohai!

Guilhem Lettron guilhem

Ohai!
View GitHub Profile
@guilhem
guilhem / deploy.le.yaml
Created April 23, 2024 09:23
stack for a oauth2 auth proxy with EntraID (Azure AD) in front of all services on a kubernetes cluster
---
apiVersion: cert-manager.io/v1
kind: ClusterIssuer
metadata:
name: letsencrypt-production
namespace: cert-manager
spec:
acme:
# You must replace this email address with your own.
# Let's Encrypt will use this to contact you about expiring
@guilhem
guilhem / tpm2_startup.service
Last active March 30, 2024 20:50
a set of systemd unit to fix tpm errors "tpm tpm0: a tpm error (256) occurred attempting get random"
[Unit]
Description=Execute TPM2 Startup with Delay After Suspend
After=systemd-suspend.service systemd-hybrid-sleep.service systemd-hibernate.service
[Service]
Type=oneshot
ExecStartPre=/bin/sleep 5
ExecStart=/usr/bin/tpm2_startup
[Install]
@guilhem
guilhem / QCM.md
Last active November 19, 2023 10:57
Questions pour évaluer au DevOps (2023)

What was a key aspect of the origin story of DevOps? a) The invention of the internet. b) The widespread adoption of cloud computing. c) A secret society of developers and operations staff. d) The discovery of coffee as a productivity booster.

When was the Agile Manifesto first introduced? A) 1999 B) 2001 C) 2005

@guilhem
guilhem / 00-WordPressContentComponent.php.diff
Created November 28, 2022 14:32
Enable Taxonomy term caching for SabaiApps Directories WordPress plugin
1469,1472c1469
< global $wpdb;
< if (!empty($id)
< && ($term = $wpdb->get_row($wpdb->prepare("SELECT taxonomy FROM $wpdb->term_taxonomy WHERE term_id = %d LIMIT 1", $id)))
< ) {
---
> if (!empty($id) && ($term = get_term($id))){
@guilhem
guilhem / meta.yaml
Last active August 8, 2022 16:34
parse json and export output in github actions
jobs:
job:
steps:
- name: Docker meta
id: meta
uses: docker/metadata-action@v4
with:
images: my/image
- id: version
run: |
@guilhem
guilhem / gist:8185e0fa9f043434984e9adb93ac8231
Created July 15, 2022 14:12
kyverno 1.7.2-rc1 with --disableMetrics=true
I0715 14:09:41.134709 1 controller.go:231] PolicyController "msg"="policy created" "kind"="ClusterPolicy" "name"="block-updates-deletes" "uid"="230551e2-901c-4209-ae4b-1c26b9e05af2"
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x10 pc=0x2088154]
goroutine 4790 [running]:
github.com/kyverno/kyverno/pkg/metrics/policychanges.registerPolicyChangesMetric(0x0, {0x27cfba3, 0x7}, {0x27cf965, 0x7}, {0x27ca52f, 0x5}, {0x0, 0x32da7b0}, {0xc000dea4c8, ...}, ...)
/src/pkg/metrics/policychanges/policyChanges.go:23 +0xb4
github.com/kyverno/kyverno/pkg/metrics/policychanges.RegisterPolicy(0xc00010c060, {0x3334698, 0xc000318a00}, {0x27cf9ff, 0x7})
/src/pkg/metrics/policychanges/policyChanges.go:48 +0xa8
github.com/kyverno/kyverno/pkg/policy.(*PolicyController).registerPolicyChangesMetricAddPolicy(0x440bc5, {{0x32da7b0, 0xc000a390e0}, 0x0}, {0x3334698, 0xc000318a00})
@guilhem
guilhem / #SteamDeck information
Last active May 24, 2022 08:07
steamdeck informations
SteamDeck Linux information.
Comment for new file content.
@guilhem
guilhem / swag.yaml
Created May 4, 2022 13:55
Github action to maintain swag docs up to date
name: swagger
on:
push:
tags:
- v*
branches:
- master
- main
pull_request:
@guilhem
guilhem / swaggo.yaml
Last active December 22, 2021 13:25
Github action for swaggo
jobs:
swagger:
name: docs
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: supplypike/setup-bin@v1
with:
uri: 'https://github.com/swaggo/swag/releases/download/v1.7.6/swag_1.7.6_Linux_x86_64.tar.gz'
@guilhem
guilhem / kubectl.md
Last active October 11, 2021 09:18
kubectl cheatsheet

list all ingress hosts

kubectl get ing -o jsonpath='{range .items[*]}{@.metadata.name}:{.spec.rules[*].host}{"\n"}{end}'