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
echo "auto_prepend_file=/opt/www/proxy.php" >> /etc/php5/cli/php.ini
@ebuildy
ebuildy / index.py
Last active July 16, 2023 00:23
List gitlab container registry size, per project, via gitlab API
import gitlab
import urllib3
import humanfriendly
import timeago, datetime
# 2020-04-24T12:04:26.475+00:00
date_now = datetime.datetime.now()
urllib3.disable_warnings(urllib3.exceptions.InsecureRequestWarning)
{{- $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 / base.yaml
Last active June 3, 2023 17:05
Ansible + argoCD API recipes
---
- tags: ["always"]
set_fact:
argocd_url: http://localhost:2369
api_headers: &api_headers
Authorization: "Bearer {{ lookup('env', 'ARGO_TOKEN') }}"
@ebuildy
ebuildy / README.md
Created February 6, 2018 20:19
Use Socat to support multiple backend with jwilder/nginx-proxy

Problem from nginx-proxy/nginx-proxy#59, you cannot setup multiple backend for one container.

The solution here, is to use socat as an HTTP proxy.

My use case is "I setup a Apache Spark cluster, I want to access to web UI of master and worker".