Skip to content

Instantly share code, notes, and snippets.

View abderraouf-adjal's full-sized avatar

Abderraouf Adjal abderraouf-adjal

  • Algeria
View GitHub Profile
@abderraouf-adjal
abderraouf-adjal / battery-charge-threshold.service
Created October 26, 2022 00:23
ThinkPad T15 G2 battery threshold limits systemd script
[Unit]
Description=Set the battery charge threshold
After=multi-user.target
StartLimitBurst=0
[Service]
Type=oneshot
Restart=on-failure
ExecStartPre=/bin/sleep 10
ExecStart=/bin/bash -c 'echo 50 > /sys/class/power_supply/BAT0/charge_control_end_threshold && echo 45 > /sys/class/power_supply/BAT0/charge_control_start_threshold'
@abderraouf-adjal
abderraouf-adjal / diffie–hellman_copy-paste.py
Created March 23, 2019 18:28
simple DH script from my teen days
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
# Copyright (c) 2015 Abderraouf Adjal
#
# Permission is hereby granted, free of charge, to any person obtaining a copy of this software
# and associated documentation files (the "Software"), to deal in the Software without restriction,
# including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense,
# and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so,
# subject to the following conditions:
@abderraouf-adjal
abderraouf-adjal / high-frequency-square-wave-generator-esp8266.ino
Created August 24, 2018 14:46 — forked from Jamesits/high-frequency-square-wave-generator-esp8266.ino
High-accuracy square wave generator (up to 250KHz) based on ESP8266, with runtime adjustable frequency, PWM width and offset.
// High-accuracy square wave generator
// based on ESP8266
// with runtime adjustable frequency, PWM width and offset
// Output wave at pin 5 (configurable from 0 to 15, but not 16)
// by James Swineson <github@public.swineson.me>, 2017-10
// https://gist.github.com/Jamesits/92394675c0fe786467b26f90e95d3904
// See https://blog.swineson.me/implementation-of-6mbps-high-speed-io-on-esp8266-arduino-ide/
// for more information (article in Chinese)
// Arduino UNO version: https://gist.github.com/Jamesits/8d164818946a65d0cafcd6203e3e5049
@abderraouf-adjal
abderraouf-adjal / osdevlinks.txt
Created May 22, 2017 01:04
OSdev links for hsoub io
@abderraouf-adjal
abderraouf-adjal / c_cpp_reference.me
Created December 19, 2016 23:42
C / C++ Reference Links
[DevDocs - C documentation](https://devdocs.io/c/).
[DevDocs - C++ documentation](https://devdocs.io/cpp/).
[The Open Group Base Specifications Issue 7, 2016 Edition](http://pubs.opengroup.org/onlinepubs/9699919799/).
[The Base Specifications Issue 7](http://pubs.opengroup.org/onlinepubs/9699919799/nfindex.html).
[Reference - C++ Reference](http://www.cplusplus.com/reference/).
[C reference - cppreference.com](http://en.cppreference.com/w/c).
[C++ reference - cppreference.com](http://en.cppreference.com/w/cpp).
[Fundamental types - cppreference.com](http://en.cppreference.com/w/cpp/language/types).
[iso-9899 - C](http://www.iso-9899.info/wiki/Main_Page).
[Quick Reference - C - Lessons99 | Guru99](https://www.lessons99.com/quick-reference-c-programming.html).
@abderraouf-adjal
abderraouf-adjal / temperature_units_conv.c
Created December 17, 2016 20:01
Conversion of units of temperature
/* Conversion of units of temperature */
/*
* Copyright (c) 2014 Abderraouf Adjal
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
make_token:
$token = mcrypt_create_iv(20, MCRYPT_DEV_URANDOM);
if ($token === FALSE) {
goto make_token;
}
$token = bin2hex($token);
@abderraouf-adjal
abderraouf-adjal / ShowInfo.ino
Created October 21, 2015 10:08
Show what the Arduino has to tell you, Info & speed
// -----------------------------------------------------
// Arduino ShowInfo
// Show what the Arduino has to tell you.
//
// 10 April 2012: Extra speed tests,
// and a few other additions.
// 17 April 2012: The name 'ADCW' is preferred over 'ADC'.
// 23 April 2012: Changed PB5 into PORTB5.
// 1 July 2012 : Added i2c_scanner.
// More speed tests.
@abderraouf-adjal
abderraouf-adjal / keybase
Created September 23, 2015 10:52
Keybase proof
### Keybase proof
I hereby claim:
* I am abderraouf-adjal on github.
* I am abderraouf_adjal (https://keybase.io/abderraouf_adjal) on keybase.
* I have a public key whose fingerprint is FB4F 8675 7628 0E36 8839 C9FD 6706 3A16 8959 2E43
To claim this, I am signing this object:
@abderraouf-adjal
abderraouf-adjal / learn_crypto.txt
Last active August 24, 2018 09:13
Learn crypto links
أساسيات التشفير - رواق
http://www.rwaq.org/courses/introduction-to-encryption
Applied Cryptography - UDACITY
https://www.udacity.com/course/cs387
Theory and Practice of Cryptography - GoogleTechTalks
http://youtu.be/IzVCrSrZIX8
CISSP Training - Cryptography - The Geek Academy