Skip to content

Instantly share code, notes, and snippets.

View ebuildy's full-sized avatar
🌴
A Montréal - hey bière ??

Thomas Decaux ebuildy

🌴
A Montréal - hey bière ??
View GitHub Profile

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
{{- $podValues := .Values.unsealedJob.pod -}}
{{- $jobValues := .Values.unsealedJob.job -}}
{{- $containerValues := .Values.unsealedJob.container -}}
apiVersion: batch/v1
kind: Job
metadata:
name: vault-unsealed-{{ $jobValues.version }}
spec:
template:
spec:
@ebuildy
ebuildy / k8s_node_capacity_dashboard.json
Created June 26, 2023 20:39
grafana kubernetes node capacity dashboard
{
"annotations": {
"list": [
{
"builtIn": 1,
"datasource": {
"type": "grafana",
"uid": "-- Grafana --"
},
"enable": true,
@ebuildy
ebuildy / index-compare.sh
Created June 20, 2023 15:30
Compare elasticsearch indices mapping
#!/bin/bash
##
# Requirements: jq, jd, curl
# Variables:
# - ES_AUTH --> elasticsearch auth
##
alias es_curl="curl -H "application/json" -u $ES_AUTH"
@ebuildy
ebuildy / send.json
Created February 17, 2023 18:33
elasticsearch APM get max duration percentiles for 10 minutes
POST apm-*-span/_search
{
"size": 0,
"query": {
"bool": {
"must": [
{
"range": {
"@timestamp": {
"gte": "2023-02-16T13:00:00.540Z"
@ebuildy
ebuildy / impl-workflow.yaml
Last active November 12, 2022 21:21
ETL to elasticsearch with pyspark , argo-workflow , kubernetes
apiVersion: argoproj.io/v1alpha1
kind: Workflow
metadata:
generateName: djobi-workflow-
spec:
entrypoint: djobi
serviceAccountName: workflow
ttlStrategy:
@ebuildy
ebuildy / simple-pyspark-argo-workflow.yaml
Last active November 10, 2022 00:09
Play with pyspark from argo workflow
apiVersion: argoproj.io/v1alpha1
kind: Workflow
metadata:
generateName: pyspark-
spec:
entrypoint: pyspark
templates:
- name: pyspark
inputs:
@ebuildy
ebuildy / s3-delete-keys.ts
Last active October 4, 2022 17:56
Play with AWS S3 API on javascript
public async deleteKeys(keys: string[]): Promise<any[]> {
function spliceIntoChunks(arr: any[], chunkSize: number) {
const res = [];
while (arr.length > 0) {
const chunk = arr.splice(0, chunkSize);
res.push(chunk);
}
return res;
}