Skip to content

Instantly share code, notes, and snippets.

brahimmachkouri / sources.list
Created September 2, 2023 14:25
Ubuntu Jammy repositories
deb jammy main restricted
deb jammy-security main restricted
deb jammy-updates main restricted
deb jammy universe multiverse
deb jammy-security universe multiverse
deb jammy-updates universe multiverse
deb jammy-backports main restricted universe multiverse
brahimmachkouri / fabricjs_draw_rectangle.html
Last active November 25, 2022 13:56
Fabric.js : how to draw a rectangle with the mouse
<!DOCTYPE html>
<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 /
Created November 1, 2022 17:47
Proxmox shutdown
# 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
/usr/sbin/qm shutdown $VM
brahimmachkouri /
Last active August 26, 2022 08:33
Hexdump to string (oneliner version)
xxd -ps -c 1 $1 | awk '{ print "0x" $0 }' ORS=',' | sed s/.$// && echo
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 /
Created March 9, 2022 19:01
Automatic installation of the latest version of fusioninventory in GLPI plugins directory
url=$(curl -Ls -o /dev/null -w %{url_effective} $githubproject)
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
brahimmachkouri / front_matter_block_github_blog.js
Created March 9, 2022 15:56
Tampermonkey usercript for pasting the "front matter" block in a github post
// ==UserScript==
// @name front_matter_block_github_blog
// @namespace brahimmachkouri
// @version 0.1
// @description Paste the "Front Matter" block for Github blogs : go in the edit post and CTRL-V
// @author Brahim Machkouri
// @include*/new/main/_posts
// @grant GM_setClipboard
// @match none
// ==/UserScript==
brahimmachkouri / portainerv2-template.json
Created March 9, 2022 14:35
Template for Portainer v2
"version": "2",
"templates": [
"categories": [
"description": "Airsonic is a free, web-based media streamer, providing ubiqutious access to your music. Use it to share your music with friends, or to listen to your own music while at work. You can stream to multiple players simultaneously, for instance to one player in your kitchen and another in your living room.",
"env": [
// GM_xmlhttpRequest GET
function getData(url, type = "document", usermethod = "GET") {
return new Promise((resolve, reject) => {
method: usermethod,
url: url,
responseType: type,
onload: function (response) {
if (response.status == 200) {
from tkinter import *
import webbrowser
class MyApp:
def __init__(self):
self.window = Tk()
self.window.title("My Application")