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 / README.md
Last active March 27, 2025 16:25
flowchart for Kubernetes Node Shutdown

Kubernetes Node Shutdown

flowchart TD
    subgraph Node
    P((Node: Ready))
    P --> A[Node Shutdown]
    A --> B{Is graceful? not a kernel panic}
    B -->|Yes| C{node graceful enabled?}
    C -->|Yes| H@{ shape: processes, label: "evict pods" }
@guilhem
guilhem / bake.hcl
Created February 19, 2025 14:34
sample of bake config
group "default" {
targets = ["app", "editor"]
}
variable "TAG" {
default = "test"
}
variable "APP_VERSION" {
default = "2"
<!DOCTYPE html>
<html lang="en">
<head><meta charset="utf-8"/>
<meta content="width=device-width, initial-scale=1.0" name="viewport"/>
<title>demo-pgo</title><script src="https://cdnjs.cloudflare.com/ajax/libs/require.js/2.1.10/require.min.js"></script>
<style type="text/css">
pre { line-height: 125%; }
td.linenos .normal { color: inherit; background-color: transparent; padding-left: 5px; padding-right: 5px; }
span.linenos { color: inherit; background-color: transparent; padding-left: 5px; padding-right: 5px; }
apiVersion: apps/v1
kind: DaemonSet
metadata:
name: osquery
spec:
selector:
matchLabels:
app: osquery
template:
metadata:
#!/bin/bash
# Vérifier que le paramètre de prix est fourni
if [ -z "$1" ]; then
echo "Usage: $0 <max_resale_value>"
exit 1
fi
# Définir le prix maximal à partir du premier paramètre
MAX_RESALE_VALUE=$1
@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: |