Skip to content

Instantly share code, notes, and snippets.

View philmb3487's full-sized avatar

Philippe Michaud-Boudreault philmb3487

View GitHub Profile
@philmb3487
philmb3487 / gist:448d57653c83a4d24d1fb82f5e18f07b
Created April 17, 2021 15:00
Coffee Lake (Tested on i5-9300H) Backlight Set Logic
// coffee lake chips use the BXT methods.
current = INREG(0xC8258);
max = INREG(0xC8254);
printf ("current backlight value: %d%%\n", current * 100 / max);
if (argc > 1) {
uint32_t v = atoi (argv[1]) * max / 100;
if (v > max)
v = max;
@philmb3487
philmb3487 / gist:1510e5b3324e674575e8db1cf20bb1c9
Created February 25, 2020 15:42
HUAWEI MATE 8 8.0 PARTITIONS
lrwxrwxrwx 1 root root 21 2020-02-25 16:33 3rdmodem -> /dev/block/mmcblk0p43
lrwxrwxrwx 1 root root 21 2020-02-25 16:33 3rdmodemnvm -> /dev/block/mmcblk0p14
lrwxrwxrwx 1 root root 21 2020-02-25 16:33 3rdmodemnvmbkp -> /dev/block/mmcblk0p15
lrwxrwxrwx 1 root root 21 2020-02-25 16:33 bootfail_info -> /dev/block/mmcblk0p49
lrwxrwxrwx 1 root root 21 2020-02-25 16:33 cache -> /dev/block/mmcblk0p44
lrwxrwxrwx 1 root root 21 2020-02-25 16:33 cust -> /dev/block/mmcblk0p53
lrwxrwxrwx 1 root root 21 2020-02-25 16:33 dfx -> /dev/block/mmcblk0p42
lrwxrwxrwx 1 root root 21 2020-02-25 16:33 dto -> /dev/block/mmcblk0p35
lrwxrwxrwx 1 root root 21 2020-02-25 16:33 dts -> /dev/block/mmcblk0p34
lrwxrwxrwx 1 root root 21 2020-02-25 16:33 erecovery_kernel -> /dev/block/mmcblk0p22

Keybase proof

I hereby claim:

  • I am sinetek on github.
  • I am sinetek (https://keybase.io/sinetek) on keybase.
  • I have a public key ASAkNqOKo7Csd0mGZcqrG8J3uZRResxqIIiMKWQH8SFGBwo

To claim this, I am signing this object:

@philmb3487
philmb3487 / gist:27420532e1ae578fff4c4908676328c0
Created January 12, 2018 05:38
Computing Merkle Tree: Example in C++.
#include <QCoreApplication>
#include <QDebug>
#include <QByteArray>
#include <QCryptographicHash>
QByteArray sha256(QByteArray in)
{
QCryptographicHash hash (QCryptographicHash::Sha256);
@philmb3487
philmb3487 / Plextor M8Pe NVMe
Created March 11, 2017 11:05
Plextor M8Pe NVMe
mint smartmontools # ./smartctl -a /dev/nvme0
smartctl 6.6 (build date Mar 11 2017) [x86_64-linux-4.4.0-53-generic] (local build)
Copyright (C) 2002-17, Bruce Allen, Christian Franke, www.smartmontools.org
=== START OF INFORMATION SECTION ===
Model Number: PLEXTOR PX-256M8PeG
Serial Number: P02630104013
Firmware Version: 1.01
PCI Vendor ID: 0x14a4
PCI Vendor Subsystem ID: 0x1b4b
Offset (0xB0),
// HDEN, 32,
// HDEP, 32,
DEN0
DEN1
DEN2
DEN3
@philmb3487
philmb3487 / gist:88168de6f9c512deeeea57ccdab7befc
Last active January 17, 2017 21:08
multimedia keys X240 ACPI
F1 - mute works {ps2 code?}
F2 - sound down works {ps2 code?}
F3 - sound up works {ps2 code?}
F4 - mike mute ACPI event _Q6A
F5 - brightness down ACPI event _Q15
F6 - brightness up ACPI event _Q14
F7 - camera? ACPI event _Q16
F8 - rfkill? ACPI event _Q64
Libraries have been installed in:
/usr/local/lib
If you ever happen to want to link against installed libraries
in a given directory, LIBDIR, you must either use libtool, and
specify the full pathname of the library, or use the `-LLIBDIR'
flag during linking and do at least one of the following:
- add LIBDIR to the `DYLD_LIBRARY_PATH' environment variable
during execution
package = nyancat
version = 1.5.1
tarname = $(package)
distdir = $(tarname)-$(version)
all clean check nyancat:
cd src && $(MAKE) $@
dist: $(distdir).tar.gz
@philmb3487
philmb3487 / gist:aad2b00849c9dc1a61141da714715255
Last active October 6, 2016 05:01
PacBSD installation on Lenovo X240 laptop.
This is a series of notes as of september 24, 2016.
PGP errors : turn off the PGP checking in /etc/pacman.conf
Then use pacstrap base base-devel
```
SigLevel = None DatabaseOptional
```