Skip to content

Instantly share code, notes, and snippets.

View ebuildy's full-sized avatar
🤟
South of France

Thomas Decaux ebuildy

🤟
South of France
View GitHub Profile
@ebuildy
ebuildy / remove_pod.sh
Created January 16, 2026 16:17
Remove a pod, the hard way
kubectl exec -it -n kube-system etcd-master-1 -- etcdctl \
--endpoints=https://127.0.0.1:2379 \
--cacert=/var/lib/rancher/rke2/server/tls/etcd/server-ca.crt \
--cert=/var/lib/rancher/rke2/server/tls/etcd/server-client.crt \
--key=/var/lib/rancher/rke2/server/tls/etcd/server-client.key \
del /registry/pods/envoy-gateway-system/envoy-gateway-system-envoy-gateway-helm-certgen-z48j8
@ebuildy
ebuildy / job.yaml
Created January 14, 2026 14:51
Download OVA and concert it to qcow2 for kubevirt virtual machine
---
apiVersion: batch/v1
kind: Job
metadata:
name: import-disk
spec:
backoffLimit: 0
template:
spec:
restartPolicy: Never
@ebuildy
ebuildy / utils_zbus_error.rs
Created November 21, 2025 13:56
Rust zbus error to string
use zbus::Error as ZbusError;
/// Convert a zbus::Error to a human-readable string
///
/// This function provides detailed error messages for different types of zbus errors,
/// making it easier to understand what went wrong when working with D-Bus operations.
///
/// # Arguments
///
/// * `error` - The zbus::Error to convert
@ebuildy
ebuildy / compose.yaml
Created July 25, 2025 13:39
Meilisearch docs scraper
services:
engine:
image: getmeili/meilisearch:v1.15.0
ports:
- 7700:7700
environment:
MEILI_MASTER_KEY: myMasterKey
scraper:
image: getmeili/docs-scraper:v0.12.12
@ebuildy
ebuildy / Dockerfile
Created October 26, 2024 20:38
Multi stage build
FROM dunglas/frankenphp:1-php8.3 AS php-base
RUN install-php-extensions .....
RUN useradd -D www-data
USER www-data
FROM php-base AS php-builder
@ebuildy
ebuildy / diagram.d2
Created September 23, 2024 12:12
Diagram about platform as-service
grid-rows: 1
legends: {
class: container
grid-rows: 3
explanation: |md
# YAML everywhere
A `project` is defined in YAML format, it contains ALL details:
@ebuildy
ebuildy / main.tf
Created May 29, 2024 18:48
Read YAML file from terraform
locals {
gitlab_groups_files = fileset(path.module, "../../../config/gitlab/*.yaml")
gitlab_groups_flatten = [for f in local.gitlab_groups_files : yamldecode(file(f)).groups]
gitlab_groups = ({
for group in flatten(local.gitlab_groups_flatten) :
group.path => {
name : group.name,
path : group.path,
description : try(group.description, ""),
projects : [for p in try(group.projects, []) : merge(p, group.project_defaults)]

Notebook PMS bug investigation

On doit trouver pourquoi certains produits attributes ont un stock négatifs.

On voit que reserved_quantity reste positif alors que le stock a été shipped côté PMS

query to find wrong stock

SELECT p.id_product, COUNT(*) as declinaisons, SUM(f.quantity) as q  
if ($sql)
{
$product_ids = Db::getInstance()->ExecuteS($sql);
$beginTime = microtime(true);
foreach ($product_ids as $product_id)
{
/**
#!/usr/bin/env python3
"""
To generate json plan:
terraform plan -var-file=..... -out=output.tfplan
terraform show -json output.tfplan > plan.json
"""
import argparse