Skip to content

Instantly share code, notes, and snippets.

Avatar

Grégoire MOLVEAU gmolveau

View GitHub Profile
@gmolveau
gmolveau / firefox_dark_background.md
Last active March 21, 2023 09:07
Firefox dark background / theme for new tab and loading screen
View firefox_dark_background.md

Firefox Dark Background

  • How to change the background on Firefox to a dark one on new tab / loading screen ?

Procedure

  • Type about:config in the URL bar
  • Search toolkit.legacyUserProfileCustomizations.stylesheets and double-click the field to set it to true
  • Type about:support in the URL bar
  • Look for Profile folder field and click on the open button next to it.
@gmolveau
gmolveau / chaudiere_pression.md
Last active March 17, 2023 19:38
Chaudiere Chaffoteaux Mira C Green - basse pression - perte - erreur 108
View chaudiere_pression.md

source : https://www.apreslachat.com/forum/CHAFFOTEAUX/Mira-C-Green/Code-erreur-108/2276549/277062

  1. ouvrir vanne d'arrivée d'eau (petite vanne bleue, 2eme en partant de la droite, sous la vanne noire d'arrivée eau chaude sanitaire)
  2. ouvrir vanne remplissage circuit de chauffage (petite vanne la plus à gauche )
  3. controler la pression sur le manomètre en la conservant vers 1,8 bar
  4. refermer vanne remplissage circuit de chauffage (etape 2)
  5. refermer vanne d'arrivée d'eau (étape 1)

img chaudiere

@gmolveau
gmolveau / usb-automount.sh
Last active March 16, 2023 22:39
ubuntu server automount usb hard drive exfat
View usb-automount.sh
sudo fdisk -l
sudo blkid
# note the UUID
# create the folder where you want the USB drive to be mounted
sudo mkdir -p /media/usb
# if your USB drive is in exfat
sudo apt install exfat-fuse exfat-utils
@gmolveau
gmolveau / markdown-bash-execute.md
Last active March 16, 2023 17:53
Markdown Bash Execute
View markdown-bash-execute.md

Markdown Bash Execute

  • Execute bash code block from a markdown file → ```bash [...] ```

Getting started

  • add this to your .bashrc or .zshrc or .what-ever.rc
# markdown bash execute
@gmolveau
gmolveau / diff-so-fancy-install.sh
Created July 29, 2020 19:28
ubuntu/debian diff-so-fancy install
View diff-so-fancy-install.sh
# tired of "Unable to locate package diff-so-fancy ?"
# choose a folder that is in your PATH or create a new one
mkdir -p ~/bin
# add ~/bin to your PATH (.bashrc or .zshrc)
cd ~/bin
git clone https://github.com/so-fancy/diff-so-fancy diffsofancy
chmod +x diffsofancy/diff-so-fancy
ln -s ~/bin/diffsofancy/diff-so-fancy ~/bin/diff-so-fancy
@gmolveau
gmolveau / how_to_reverseproxy_proxypass_nginx_letsencrypt.md
Last active March 9, 2023 13:03
How to use nginx as a reverse-proxy with letsencrypt
View how_to_reverseproxy_proxypass_nginx_letsencrypt.md

How to use nginx as a reverse-proxy with letsencrypt

Your infrastructure

generated via plantuml

Imgur

Requirements

@gmolveau
gmolveau / uuid_user.py
Last active March 8, 2023 15:19
sqlalchemy uuid for sqlite
View uuid_user.py
########################
# UUID for SQLite hack #
########################
from sqlalchemy.types import TypeDecorator, CHAR
from sqlalchemy.dialects.postgresql import UUID
import uuid
class GUID(TypeDecorator):
@gmolveau
gmolveau / flask_separate_thread.py
Last active March 6, 2023 07:27
run a flask application in a separate thread
View flask_separate_thread.py
# please use python3 and flask > 1.0
# run this with : python3 flask_separate_thread.py
# https://web.archive.org/web/20210329135424/https://pymotw.com/3/threading/
# https://web.archive.org/web/20210329135553/https://eli.thegreenplace.net/2011/08/22/how-not-to-set-a-timeout-on-a-computation-in-python
import time
import threading
from flask import Flask
app = Flask(__name__)
@gmolveau
gmolveau / recutils_tutorial_example.md
Last active March 4, 2023 17:31
A quick tutorial / example / cheatsheet of recutils https://www.gnu.org/software/recutils
View recutils_tutorial_example.md

recutils tutorial example

https://www.gnu.org/software/recutils/

GNU Recutils is a set of tools and libraries to access human-editable, plain text databases called recfiles.

TO install on mac : brew install recutils

add this to a new file named books.rec

@gmolveau
gmolveau / bash_check_env_vars.sh
Created March 1, 2023 13:34
bash check that a list of environment variables is set
View bash_check_env_vars.sh
missing=0
ENV_VARS=(
DB_USER
DB_NAME
DUMP_FILE
)
for env_var in "${ENV_VARS[@]}"; do
if [ -z "${!env_var:-}" ]; then
echo "missing variable: ${env_var}"
missing=1