Skip to content

Instantly share code, notes, and snippets.

View mdeweerd's full-sized avatar

MDW mdeweerd

  • France
View GitHub Profile
@mdeweerd
mdeweerd / !README.md
Last active December 24, 2024 20:54
Screen/bash setup for Home Assistant "Terminal & SSH" add-on

Home Assistant "Terminal & SSH" screen configuration.

Purpose

  • Start gnu screen automatically when connecting interactively to Home Assistant (keep terminal session across connections).
  • Provide a status line in the terminal
  • Define some aliases
  • Automatically "re-install" after add-on upgrade (create symbolic links,
@mdeweerd
mdeweerd / renew_ssl_cert.yaml
Last active January 17, 2025 19:00 — forked from e28eta/renew_ssl_cert.yaml
Homeassistant Blueprint for SSL-Certificate renewal
---
blueprint:
name: Renew Let's Encrypt Certificate
description: Renew Certificate when due date is below given value
domain: automation
input:
cert_expiry_sensor:
name: Certificate Expiry Sensor
description: "Sensor from the Certificate Expiry Integration (https://www.home-assistant.io/integrations/cert_expiry)"
selector:
@mdeweerd
mdeweerd / automation1.yaml
Last active October 24, 2022 21:14
Quick implementation to call scripts from AppDaemon
---
alias: DemoScript1
description: ''
trigger:
- platform: time_pattern
minutes: '45'
hours: '1'
condition: []
action:
# Trigger script 1
@mdeweerd
mdeweerd / rc.local
Created May 25, 2022 17:57 — forked from dunkelstern/rc.local
iptables rules for vpn config
# for ISAKMP (handling of security associations)
iptables -A INPUT -p udp --dport 500 --j ACCEPT
# for NAT-T (handling of IPsec between natted devices)
iptables -A INPUT -p udp --dport 4500 --j ACCEPT
# for ESP payload (the encrypted data packets)
iptables -A INPUT -p esp -j ACCEPT
# for the routing of packets on the server
iptables -t nat -A POSTROUTING -j SNAT --to-source %IP% -o eth0
# internet access
iptables -t nat -A POSTROUTING -s 10.0.42.0/24 -o eth0 -m policy --dir out --pol ipsec -j ACCEPT
  • 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}