Skip to content

Instantly share code, notes, and snippets.

View itsabdelrahman's full-sized avatar

Abdelrahman Abdelhafez itsabdelrahman

View GitHub Profile
#include <NewPing.h>
#include <Servo.h>
#define SERIAL_BAUD 115200
#define TRIGGER_PIN 11
#define ECHO_PIN 12
#define MAX_DISTANCE 200
#define SERVO_PIN 9
@itsabdelrahman
itsabdelrahman / linux-server-setup.md
Last active April 1, 2024 08:00
Linux Debian Server Setup

Linux Ubuntu/Debian Server Setup

On remote machine

As root

  1. Change root password
    • $ passwd
  2. Create user & their home directory
  • $ useradd -m
@itsabdelrahman
itsabdelrahman / date-fns-next-n-weekdays.js
Created July 23, 2023 13:53
Get next n-weekdays using date-fns
import { addDays, isWeekend } from "date-fns";
function nextNWeekdays(date, count) {
return nextNWeekdaysHelper(date, count, []);
}
function nextNWeekdaysHelper(date, count, nextWeekdaysSoFar) {
if (count === nextWeekdaysSoFar.length) {
return nextWeekdaysSoFar;
}
@itsabdelrahman
itsabdelrahman / proof.md
Created April 15, 2024 08:08
Keyoxide prood

openpgp4fpr:86EB237F8E8A19FE930F808ADD5C6B030F305FA1