Skip to content

Instantly share code, notes, and snippets.

View JeanOlivier's full-sized avatar

Jean Olivier Simoneau JeanOlivier

View GitHub Profile
@JeanOlivier
JeanOlivier / Enable_show_battery_estimated_time_remaining_for_all_users.reg
Created April 4, 2024 14:30
Enable Battery time left estimator on Win11 (not mine, for reference)
Windows Registry Editor Version 5.00
; Created by: Shawn Brink
; Created on: January 13, 2023
; Tutorial: https://www.elevenforum.com/t/enable-or-disable-show-battery-estimated-time-remaining-in-windows-11.11885/
[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Power]
"EnergyEstimationDisabled"=-
"UserBatteryDischargeEstimator"=-
@JeanOlivier
JeanOlivier / Disable_show_battery_estimated_time_remaining_for_all_users.reg
Created April 4, 2024 14:27
Disable Battery time left estimator on Win11 (back to normal) (not mine, for reference)
Windows Registry Editor Version 5.00
; Created by: Shawn Brink
; Created on: January 13, 2023
; Tutorial: https://www.elevenforum.com/t/enable-or-disable-show-battery-estimated-time-remaining-in-windows-11.11885/
[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Power]
"EnergyEstimationDisabled"=dword:00000001
"UserBatteryDischargeEstimator"=dword:00000001
@JeanOlivier
JeanOlivier / Caps_lock_is_ESC.reg
Created April 4, 2024 14:24
Windows 10/11 registry modification to replace Caps Lock by Escape
Windows Registry Editor Version 5.00
[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Keyboard Layout]
"Scancode Map"=hex:00,00,00,00,00,00,00,00,02,00,00,00,01,00,3a,00,00,00,00,00
; Data = 00000000 00000000 0200000000 01003A00 00000000
; 0x00000000 Header: Version. Set to all zeroes.
; 0x00000000 Header: Flags. Set to all zeroes.
; 0x00000002 Two entries in the map (including null entry).
@JeanOlivier
JeanOlivier / Daikin_PID.py
Created January 6, 2024 01:36
Home Assistant pyscript faikin Daikin PID
# Trying to do a PID for the daikin
#
# This is a WIP prototype. Only heating was tested.
# Using log.error because I can't seem to be able to find how to read other log levels.
from random import choices
ENABLED = True # Disabled if False. If true, the PID takes over when the Daikin is on.
target_temp = 22.5
@JeanOlivier
JeanOlivier / imshow_smart.py
Created November 30, 2023 20:15
imshow_smart
from pylab import *
def ax_add_comment(ax, comment, fontsize=10, x=.5,y=.97):
try:
ax.commenttext.remove() # We avoid writing it over itself repeatedly
except:
pass
if not hasattr(ax, "plot3D"):
ax.commenttext = ax.text(x, y, comment, horizontalalignment='center', verticalalignment = 'top', fontsize=fontsize, transform=ax.transAxes)
@JeanOlivier
JeanOlivier / daikin_scheduler.py
Last active November 8, 2023 16:21
Home Assistant pyscript faikin Daikin Scheduler
# Defining some lists for convenience
weekdays = [
"monday",
"tuesday",
"wednesday",
"thursday",
"friday",
]
weekend = ["saturday", "sunday"]
@JeanOlivier
JeanOlivier / MM2022_live_talks_downloader.py
Created March 19, 2022 05:13
March Meeting 2022 Live talks downloader. Procedure + code to download the live talks once they're available on demand. Might be useful for many similar livestreams with non-predictable chunk filenames.
#!/usr/env python3
# -*- coding: utf-8 -*-
import os
import json
import subprocess
from base64 import b64decode
from haralyzer import HarParser, HarPage
from dateutil import parser as dateparser
@JeanOlivier
JeanOlivier / size_of_jpg_files.sh
Created October 27, 2021 21:05
Get the total size of files with a specific extension
# Change the ./ and ".jpg" part to your own needs.
# The `| numfmt --to=si` part get human readable output, remove it to get a number of bytes.
find ./ -type f -name "*.jpg" -printf "%s\n" | gawk -M '{t+=$1}END{print t}' | numfmt --to=si
@JeanOlivier
JeanOlivier / private_fork.md
Created March 19, 2021 18:24 — forked from 0xjac/private_fork.md
Create a private fork of a public repository

The repository for the assignment is public and Github does not allow the creation of private forks for public repositories.

The correct way of creating a private frok by duplicating the repo is documented here.

For this assignment the commands are:

  1. Create a bare clone of the repository. (This is temporary and will be removed so just do it wherever.)

git clone --bare git@github.com:usi-systems/easytrace.git

@JeanOlivier
JeanOlivier / ma_figure.py
Created September 9, 2020 22:21
Exemple figures python compilées avec math latex et packages personels
#!/usr/bin/env python
# -*- coding: utf-8 -*-
try:
__ISINTERACTIVE__ = __IPYTHON__
except:
__ISINTERACTIVE__ = False
print "IS NOT INTERACTIVE"