Skip to content

Instantly share code, notes, and snippets.

@brahimmachkouri
brahimmachkouri / multipass_cheatsheet.md
Last active January 26, 2025 21:40
Multipass cheatsheet

Multipass Cheat Sheet

Command Description
multipass launch --name <name> --memory <size> Launch a new VM with specified RAM. Example: --memory 4G for 4 GB of RAM.
multipass launch --name <name> --disk <size> Launch a new VM with specified disk space. Example: --disk 20G for 20 GB.
multipass launch --name <name> --cpus <count> Launch a new VM with specified number of CPUs. Example: --cpus 2 for 2 CPUs.
multipass transfer <file> <vm-name>:<destination> Copy files from the host to the specified VM.
multipass transfer : Copy files from the VM to the host.
@brahimmachkouri
brahimmachkouri / gdb-pwndbg.md
Created January 2, 2025 20:27
GDB/Pwndbg mémo

Déboguer un Programme avec GDB et Pwndbg

Ce tutoriel couvre les bases de l'utilisation de GDB avec l'extension Pwndbg pour déboguer des programmes en C ou des exécutables ELF.


1. Installation de GDB et Pwndbg

  1. Installer GDB :
@brahimmachkouri
brahimmachkouri / oci8_install.sh
Last active October 29, 2024 08:29
Installation de oci8
#!/bin/bash
# BM 20240830
# Testé avec Ubuntu 22.04, PHP 8.3 (Ondrej Sury) & Oracle Instant Client 21.15
# Vérification que le script est exécuté en tant qu'administrateur (root)
if [[ $EUID -ne 0 ]]; then
echo "Ce script doit être exécuté en tant qu'administrateur (root)."
exit 1
fi
@brahimmachkouri
brahimmachkouri / 2024-08-22-connexion-a-ms-sql-server-en-php-sous-ubuntu.md
Created August 22, 2024 10:02
Connexion à MS SQL Server en PHP sous Debian/Ubuntu
layout date title category tags
post
2024-08-22 04:40:00 -0700
Connexion à MS SQL Server en PHP sous Debian/Ubuntu
dev
mssql php ubuntu

Remarque : la procédure suivante a été réalisée pour une version 7.2 de PHP. Il se peut que vous deviez adapter quelques points...

@brahimmachkouri
brahimmachkouri / sources.list
Created September 2, 2023 14:25
Ubuntu Jammy repositories
deb http://fr.archive.ubuntu.com/ubuntu/ jammy main restricted
deb http://security.ubuntu.com/ubuntu jammy-security main restricted
deb http://fr.archive.ubuntu.com/ubuntu/ jammy-updates main restricted
deb http://fr.archive.ubuntu.com/ubuntu/ jammy universe multiverse
deb http://security.ubuntu.com/ubuntu jammy-security universe multiverse
deb http://fr.archive.ubuntu.com/ubuntu/ jammy-updates universe multiverse
deb http://fr.archive.ubuntu.com/ubuntu/ jammy-backports main restricted universe multiverse
@brahimmachkouri
brahimmachkouri / fabricjs_draw_rectangle.html
Last active November 25, 2022 13:56
Fabric.js : how to draw a rectangle with the mouse
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<title>fabric Creating rect with a mouse</title>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<meta name="robots" content="noindex, nofollow">
<meta name="googlebot" content="noindex, nofollow">
<meta name="viewport" content="width=device-width, initial-scale=1">
@brahimmachkouri
brahimmachkouri / pmx-shutdown.sh
Created November 1, 2022 17:47
Proxmox shutdown
#!/bin/bash
# get list of VMs on the node
VMIDs=$(/usr/sbin/qm list| awk '/[0-9]/ {print $1}')
# ask them to shutdown
for VM in $VMIDs
do
/usr/sbin/qm shutdown $VM
done
@brahimmachkouri
brahimmachkouri / bytes2str.sh
Last active August 26, 2022 08:33
Hexdump to string (oneliner version)
#!/bin/bash
xxd -ps -c 1 $1 | awk '{ print "0x" $0 }' ORS=',' | sed s/.$// && echo
@brahimmachkouri
brahimmachkouri / GZLP01.txt
Last active June 12, 2022 21:00
Cheats Zelda The Wind Waker [PAL] (Gamecube WiiRD Code)
Maximum Health
003CC531 00000050
Infinite Health
003CC533 00000050
Never Lose Health
041F4A90 60000000
Never Drown
@brahimmachkouri
brahimmachkouri / install_latest_fusion_inventory.sh
Created March 9, 2022 19:01
Automatic installation of the latest version of fusioninventory in GLPI plugins directory
#!/bin/bash
githubproject="https://github.com/fusioninventory/fusioninventory-for-glpi/releases/latest/"
url=$(curl -Ls -o /dev/null -w %{url_effective} $githubproject)
version=${url##*/}
tag=${version:4}
wget https://github.com/fusioninventory/fusioninventory-for-glpi/releases/download/$version/fusioninventory-$tag.tar.bz2
glpi_install=$(find /var -type f -name glpicrypt.key | sed -E 's/\/config\/glpicrypt\.key//')
tar xvf fusioninventory-$tag.tar.bz2 -C "$glpi_install/plugins/"
chown -R www-data:www-data "$glpi_install/plugins/fusioninventory"
rm fusioninventory-$tag.tar.bz2