Skip to content

Instantly share code, notes, and snippets.

View diyfr's full-sized avatar

Stéphane diyfr

  • Nantes, FR
View GitHub Profile
@diyfr
diyfr / readme.md
Created September 29, 2023 14:39
AdGuard Home + Traefik

edit traefik.yml

entryPoints:
  web:
    address: ":80"
  websecure:
    address: ":443"
  dot: # <- ADD THIS
    address: ":853"  # <- ADD THIS
@diyfr
diyfr / readme.md
Created April 1, 2023 17:45
WSL2 Network not working on Windows 11

Reset wdsl2 network on Windows 11

Start resetWSL2.bat in admin mode and restart WSL2 Virtual Machine

@diyfr
diyfr / readme.md
Created January 3, 2023 15:11
User system no login

Options de useradd
-m ajoute le home directory
-r crée un user system
-g affecte le user au group

sudo useradd -r -m -g root ansible
@diyfr
diyfr / readme.md
Created December 28, 2022 18:00
Tasmota & Double relais pour garage et portail

Utilisation d'un double relais
dreamodule esp32 relay

ll changer les gpios utilsé par les relais par défaut car ils sont initialisés lors du boot de l'ESP32
17->22
16->21

Configuration du Tasmota
Utilisation de l'index sur les relais

@diyfr
diyfr / ovh-availablity.sh
Last active July 26, 2022 17:47
Vérifier dispo serveur OVH et notif sur pushbullet
#!/bin/bash
# Pour ne pas avoir trop de notif dès la dispo
DONT_SPAM=/tmp/ovh.exist
#https://www.pushbullet.com/#settings/account to retrieve your API key/access
TOKEN=<VOTRE_TOKEN PUSHBULLET>
# remplacer planCode, server dans l'url à votre convenance et le datacenter recherché dans le filtre jq contains (ici= fr)
if [ ! -f "${DONT_SPAM}" ]; then
RESULT=$(curl -s 'https://www.ovh.com/engine/apiv6/dedicated/server/datacenter/availabilities?excludeDatacenters=false&planCode=22sk080&server=22sk080' | jq -r '.[0].datacenters[] | select (.datacenter |contains ("ca")).availability')
if [ $RESULT != "unavailable" ]; then
@diyfr
diyfr / fsm.c
Created March 29, 2022 05:51 — forked from ankurs/fsm.c
FSM in C
/**
* @file fsm.c
* @brief an implementation for a FSM in C, this file contains
* implementation of definations.
* License GPLv3+
* @author Ankur Shrivastava
*/
#include "fsm.h"
#include<stdlib.h>
@diyfr
diyfr / Dockerfile
Last active June 3, 2021 13:40
Angular Multistage
# BUILD
FROM node:slim AS build
COPY . /app
WORKDIR /app
RUN npm run ng build -- --prod --base-href='\${BASE_URL}'
# RUN
FROM nginx:alpine AS run
@diyfr
diyfr / readme.MD
Last active October 25, 2024 15:33
Home Assistant via tunnel ssh

Accéder à son Home Assistant hébérgé derrière sa box Internet

Prerequis :

1- Home assistant installé et fonctionnel depuis votre réseau interne
2- Serveur distant avec docker , docker-compose et traefik

Serveur distant

Construire une image dédiée

builder une image docker à partir de ce Dockerfile

@diyfr
diyfr / fix.js
Created May 5, 2021 13:41
PreventDefault error on OpenLayers 2
const eventListenerOptionsSupported = () => {
let supported = false;
try {
const opts = Object.defineProperty({}, 'passive', {
get() {
supported = true;
}
});
@diyfr
diyfr / Doc.md
Created April 20, 2021 08:33
Microsoft Teams Message Card

Dont miss header Content-Type:application/json

{
  "@type": "MessageCard",
  "@context": "http://schema.org/extensions",
  "summary": "Test",
  "themeColor": "AA78D7",
  "title": "TEST",
 "sections": [