Skip to content

Instantly share code, notes, and snippets.

View mdeweerd's full-sized avatar

MDW mdeweerd

  • France
View GitHub Profile
  • Task 1
  • Task 2
  • Task 3
  • Task 4
  • Task 3
  • Task 4 tab later

No list item:

[x] Task without list.

@mdeweerd
mdeweerd / .-README.md
Last active January 29, 2024 09:27
Migrate Home Assistant sqlite3 to mariadb/mysql

Note

⚠️ The useful file is migrate_db.sh

(GITHUB gists do not allow us to manage the order easily)

@mdeweerd
mdeweerd / motion_controlled_scenes_with_sun_elevation_check.yaml
Created November 6, 2021 16:39 — forked from Martinnygaard/motion_controlled_scenes_with_sun_elevation_check.yaml
Homeassistant blueprint for motion-activated light scene with sun elevation sensor
blueprint:
name: Motion-activated light scene with optional ambient scene with sun elevation sensor
description: Turn on a light scene when motion is detected and the sun is below given threshold. Four different scenes can be defined depending on time of day.
domain: automation
source_url: https://gist.github.com/Martinnygaard/7645dcee2ca03d18c7a9523aa592605b
input:
motion_entity:
name: Motion Sensor
description: Choose which motion sensor to use. If multiple motion sensors should trigger this automation, then group them in a template sensor or regular group.
selector:
@mdeweerd
mdeweerd / .gitignore
Last active January 15, 2023 11:38
setup `monit` on home assistant
setupMonit.conf
@mdeweerd
mdeweerd / YouTube Video Data Tool.html
Last active October 31, 2021 13:25 — forked from jgrant41475/YouTube Video Data Tool.html
Fetches YouTube Video Information and creates a json-ld Video Object
<!doctype html>
<html class="no-js" lang="en">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Foundation | Welcome</title>
<!-- <link rel="stylesheet" href="css/foundation.css" /> -->
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/foundation/6.7.3/css/foundation.min.css" integrity="sha512-2meDMHyoDRV8O0gr5Diq32ch+6QqI9Af9Km4eFwgxZg356CbUI4S30C3zuUetkNAN4Bn+17y9OgxoQ3HnQ648w==" crossorigin="anonymous" referrerpolicy="no-referrer" />
</head>
<body>
@mdeweerd
mdeweerd / doBomHtml.sh
Created October 24, 2021 14:45
Script to generate Interactive BOM (runs on cygwin).
#!/bin/bash -x
#
# Generate Interactive BOM2HTML
#
# Only argument is .kicad_brd file
#
# Options can be set in 'bomhtml.conf' located in the directory of DESIGN.kicad_brd
# Can set KICAD_PYTHON in environment to change path.
KICAD_PYTHON=${KICAD_PYTHON:=/cygdrive/c/Program\ Files/KiCad/bin/python}
@mdeweerd
mdeweerd / convert_shape.py
Last active December 3, 2023 15:21 — forked from slazav/convert_shape.py
Convert OpenSCAD files to STEP or IGES using FreeCAD python library
#!/usr/bin/env /cygdrive/c/Program Files/FreeCAD 0.21/bin/python
#!/usr/bin/env /cygdrive/c/Program Files/FreeCAD 0.20/bin/python
#!/usr/bin/env python3
#!/usr/bin/env /cygdrive/c/Program Files/FreeCAD 0.20/bin/FreeCAD
#!/usr/bin/env /cygdrive/c/Program Files/FreeCAD 0.20/bin/FreeCADCmd
#!/usr/bin/freecad
#!/usr/bin/python
# (Options above for reminder, easy exchange of lines to adapt to local platform).
# /!\ Launch this script using the python provided/used by FreeCAD
# (Select/add the appropriate line above)
@mdeweerd
mdeweerd / Multipcap.pl
Last active April 20, 2021 00:47
wireshark / pcap tools
#!/usr/bin/env perl
# multipcap.pl
# License MIT + Any article (blog, site, documentation, etc)
# should link back to this page.
# Link : https://gist.github.com/mdeweerd/4bf3375b2ec56b5492a7a4695e19e92e
use strict;
#use File::PCAP::Reader; # Needed to read the pcap file
#use File::PCAP::Writer; # Needed to write the pcap file
@mdeweerd
mdeweerd / KICAD_GENERATE_GERBER.BAT
Last active October 23, 2021 12:54 — forked from Salamandar/kicad_generate_gerber.py
Python script that generates Gerber, Drill map, Position file, and zips everything.
@echo OFF
REM
REM WRAPPER FOR WINDOWS INCLUDING THE PYTHON PATH FROM KICAD ITSELF
REM
REM GIT: git@gist.github.com:df5b6a1462d3052a42dbaa0e35a5b952.git
REM URL: https://gist.github.com/df5b6a1462d3052a42dbaa0e35a5b952
REM
PATH="c:\Program Files\KiCad\bin";%PATH%
echo %~dp0
@mdeweerd
mdeweerd / logToPcap.pl
Last active May 27, 2021 22:14
Perl script to convert a regular log file as syslog messages in a pcap file for wireshark
#!/bin/perl
# SCRIPT TO CONVERT TEXT LOG TO PCAP FILE
# READS DATES FROM LOG FILE
# WHEN READING FROM PIPE (UNTESTED) WITHOUT DATES,
# THE CURRENT TIMESTAMP IS USED.
#
# Potential parameters to the script:
# Parameter ending in ".log" is the log input file
# Parameter ending in ".pcap" is the log output file
# Digit from 0 to 7 is the log index.