Skip to content

Instantly share code, notes, and snippets.

View sylvainblot's full-sized avatar
🏠
Working from home

Sylvain sylvainblot

🏠
Working from home
View GitHub Profile
@mdonkers
mdonkers / server.py
Last active May 21, 2024 00:06
Simple Python 3 HTTP server for logging all GET and POST requests
#!/usr/bin/env python3
"""
License: MIT License
Copyright (c) 2023 Miel Donkers
Very simple HTTP server in python for logging requests
Usage::
./server.py [<port>]
"""
from http.server import BaseHTTPRequestHandler, HTTPServer
@dm0-
dm0- / auto-update-kmods.ignition
Last active September 28, 2023 10:03
Automatically update custom kernel modules on CoreOS
{
"ignition": { "version": "2.0.0" },
"systemd": {
"units": [
{
"name": "auto-update-kmods.service",
"enable": true,
"contents": "[Unit]\nDescription=Install custom kernel modules\nAfter=lib-modules.mount network-online.target\nRequires=lib-modules.mount network-online.target\nConditionPathExists=!/opt/modules/%v\nConditionPathExistsGlob=/lib/modules/auto-update-kmods.d/*.sh\n\n[Service]\nType=oneshot\nExecStart=/bin/bash -ex /lib/modules/auto-update-kmods.sh\n\n[Install]\nWantedBy=multi-user.target\n"
},
{
# Routage/multiplexage HTTP dans kubernetes avec des Ingress et Traefik.
#
# On lance deux apps, sur les domaines, respectivement, foo.local et bar.local.
#
# Devant l'ingress controller, on utilise un service de type 'NodePort', qui
# choisir un port dans le range 30000-32767 et l'exposera sur les nodes.
#
# Si on commente la ligne 'NodePort' et on decommente la ligne 'LoadBalancer',
# kubernetes vas configurer un ELB AWS automatiquement pour renvoyer tout les
# flux http sur le service kubernetes traefik-lb-svc.
@AdySan
AdySan / FiberOpticLamp.ino
Created January 14, 2016 04:40
Philips Hue Clone using ESP8266
#include <ESP8266WiFi.h>
#include <WiFiClient.h>
#include <ESP8266mDNS.h>
#include <WiFiUdp.h>
#include <ArduinoOTA.h>
#include <PubSubClient.h>
#include <Adafruit_NeoPixel.h>
#define PIN D8
Adafruit_NeoPixel strip = Adafruit_NeoPixel(6, PIN, NEO_GRB + NEO_KHZ800);