Skip to content

Instantly share code, notes, and snippets.

View Eboubaker's full-sized avatar
🐐

E. Bekkouche Eboubaker

🐐
  • 01:09 (UTC +01:00)
View GitHub Profile
@Eboubaker
Eboubaker / read_write_lock.py
Last active December 13, 2024 08:36
updated
import contextlib
import threading
from typing import Generator
# Author : github.com/Eboubaker
# Fixed by: github.com/icezyclon
class ReentrantRWLock:
"""This class implements reentrant read-write lock objects.
A read-write lock can be aquired in read mode or in write mode or both.
Many different readers are allowed while no thread holds the write lock.
@Eboubaker
Eboubaker / icon.png
Last active May 18, 2024 12:16
TP dernier BDD
One of them is the last revision i dont have time to check now...
icon.png in images folder
#include <Arduino.h>
#include <SoftwareSerial.h>
#define ON HIGH
#define OFF LOW
SoftwareSerial SIM900A(10, 11); // RX, TX pins
String textMessage;
String pumpState;
const int pumpPin = 12; // pump connected to pin 12
<style>.VueHoverfade-enter-active, .VueHoverfade-leave-active {
transition: opacity .5s
}
.VueHoverfade-enter, .VueHoverfade-leave-to {
opacity: 0
}
.vh--outer[v-cloak] {
display: none
@Eboubaker
Eboubaker / Daily backup of local database.md
Last active July 30, 2023 12:26
Windows Daily backup of local database.

Create a file daily-backup.bat with contents:

@echo off
setlocal

:: set the variables

set DATABASE_SERVICE_NAME=MariaDB
set DB_USER=root
set DB_PASSWORD=gpassword
@Eboubaker
Eboubaker / f.md
Created September 21, 2022 13:13
Auto answer "Terminate batch job (Y/N)" message on windows terminal

the message is very annoying but can be handled using clink.
install clink and open file C:\Users\<username>\AppData\Local\clink\settings and set property terminate_autoanswer to 1

# name: Auto-answer terminate prompt
# type: enum
# Automatically answers cmd.exe's 'Terminate batch job (Y/N)?' prompts. 0 =
# disabled, 1 = answer 'Y', 2 = answer 'N'.
terminate_autoanswer = 1
@Eboubaker
Eboubaker / index.php
Last active August 19, 2022 19:26
Serve files in the current directory to the network.
<?php
$files = array_diff(scandir('.'), ['.', '..', 'index.php']);
if(empty($files)) die("no files in directory .");
foreach ($files as $f) {
echo "<div style='font-size: 1.3em;padding-left: 15px'><a href='$f'>$f</a></div>";
}
https://www.aaai.org/Papers/JAIR/Vol21/JAIR-2119.pdf
https://www.aaai.org/Papers/JAIR/Vol21/JAIR-2119.pdf