Skip to content

Instantly share code, notes, and snippets.

Auvergne-Rhône-Alpes

Code Postal Nom et Adresse de l'Établissement Note sur 10 URL +
38200 ALTITUDE 38 VIENNE BMW, ROUTE DE CHASSE, SEYSSUEL 9,71 https://www.groupe-altitude.com/concessions/altitude-38-bmw-vienne/

Bourgogne-Franche-Comté

Code Postal Nom et Adresse de l'Établissement Note sur 10 URL +
25480 BMW BESANCON HESS AUTOMOBILE, RUE ARIANE II, MISEREY SALINES 9,36 https://www.bmw-besancon.fr/
71300 AUTO BOURGOGNE VACHER, 5 RUE DE SEMUR, MONTCEAU LES MINES 8,39 https://www.abv-bmw-mini.com/
@brahimmachkouri
brahimmachkouri / lmstudio-update.sh
Created December 31, 2025 11:19
LMStudio for Linux update
#!/usr/bin/env bash
set -euo pipefail
LMSTUDIO_DIR="/opt/lmstudio"
LMSTUDIO_BIN="${LMSTUDIO_DIR}/LM-Studio.AppImage"
LMSTUDIO_TMP="${LMSTUDIO_DIR}/LM-Studio.AppImage.new"
LMSTUDIO_URL="https://lmstudio.ai/download/latest/linux/x64"
# Vérification exécution en root
@brahimmachkouri
brahimmachkouri / MacBook-check-trackpad.md
Created December 11, 2025 14:13
MacBook trackpad Check

Guide pas à pas – Trackpad de MacBook qui ne fonctionne plus

Ce document détaille, étape par étape, ce qu’il faut faire quand un MacBook arrive avec un trackpad qui ne fonctionne plus (ou mal).
Objectif : déterminer si le problème vient du logiciel, du matériel, ou d’une batterie qui gonfle, puis décider quoi faire.


0. Précautions de base

@brahimmachkouri
brahimmachkouri / chat-sidebar.js
Created December 3, 2025 15:14
Réglage de la taille de la sidebar ChatGPT
// ==UserScript==
// @name ChatGPT Sidebar Width Controller
// @namespace https://tampermonkey.net/
// @version 2.0
// @description Permet de changer dynamiquement la largeur de la sidebar ChatGPT via un menu Tampermonkey
// @author BM
// @match https://chat.openai.com/*
// @match https://chatgpt.com/*
// @grant GM_registerMenuCommand
// @grant GM_setValue
@brahimmachkouri
brahimmachkouri / cpxs.sh
Created November 15, 2025 17:15
Crée une archive tar.xz compressée de manière sécurisée en utilisant la compression parallèle XZ
#!/usr/bin/env bash
# cpxs.sh — tar -> xz parallèle, safe by default
# Usage: ./cxps.sh -s /chemin/du/repertoire [-o sortie.tar.xz] [-t threads] [-l level] [-e exclude] [-p] [-v] [-F] [-h]
# Voir exemples en bas.
set -euo pipefail
IFS=$'\n\t'
prog=$(basename "$0")
usage() {
@brahimmachkouri
brahimmachkouri / flattenrepo.py
Last active January 20, 2026 14:55
Création d'un document Markdown contenant l'arborescence et le contenu des fichiers d'un projet de développement d'application
#!/usr/bin/env python3
# Aplatit un repository en un seul fichier Markdown
# BM 20260120
import os
import tempfile
import subprocess
import shutil
import argparse
import zipfile
@brahimmachkouri
brahimmachkouri / pdf_to_cbx.py
Created August 30, 2025 16:09
Conversion PDF -> CBZ/CBR
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
pdf_to_cbx.pyConvertir un PDF en CBZ (ou CBR si 'rar' est disponible)
=======================================================================
Dépendances Python : PyMuPDF (pymupdf), Pillow
Installation rapide :
pip install --upgrade pymupdf pillow
@brahimmachkouri
brahimmachkouri / install_portainer.sh
Last active May 30, 2025 19:07
Ubuntu : install Portainer
#!/usr/bin/env bash
set -euo pipefail
cleanup() { [[ -n "${SUDO_LOOP_PID:-}" ]] && kill "$SUDO_LOOP_PID"; }
trap cleanup EXIT
command -v sudo >/dev/null || { echo "❌ sudo manquant"; exit 1; }
sudo -v
( while true; do sudo -n true; sleep 60; done ) & SUDO_LOOP_PID=$!
@brahimmachkouri
brahimmachkouri / monitor_dashboard.py
Last active May 21, 2025 14:25
Dashboard pour monitorer une machine sous Ubuntu
#!/bin/python3
# Paquets requis : nvidia-utils, python3, python3-pip, lm-sensors, nvme-cli, smartmontools, docker.io
# Libs python :
# pip3 install psutil textual rich
# 'r' pour recharger, 'q' pour quitter
from textual.app import App, ComposeResult
from textual.containers import Horizontal, Vertical
from textual.widgets import Static
from textual.reactive import reactive
@brahimmachkouri
brahimmachkouri / install_docker.sh
Last active August 6, 2025 15:27
Ubuntu : Install Docker
#!/usr/bin/env bash
set -euo pipefail
# ---------- Fonctions ----------
cleanup() { [[ -n "${SUDO_LOOP_PID:-}" ]] && kill "$SUDO_LOOP_PID"; }
trap cleanup EXIT
need_cmd() { command -v "$1" &>/dev/null || { echo -e "\e[31m❌ $1 introuvable\e[0m"; exit 1; }; }
need_cmd sudo