Skip to content

Instantly share code, notes, and snippets.

View guilhem's full-sized avatar
Ohai!

Guilhem Lettron guilhem

Ohai!
View GitHub Profile
<!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: |
@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.