This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
#usage: | |
#python3 ./miflora-domoticz.py --idx_temp 61 --idx_lux 62 --idx_moist 63 --idx_cond 64 --backend gatttool poll C4:7C:8D:63:7A:11 | |
import argparse | |
import re | |
import logging | |
#domoticz |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SERVER="Ubuntu (192.168.1.54)" | |
EMAIL='[email protected]' | |
ALERTMESSAGE='/tmp/ALERTMESSAGE_cert.tmp' | |
if /usr/bin/openssl x509 -checkend 86400 -noout -in /etc/letsencrypt/live/my.domain.eu/fullchain.pem | |
then | |
echo "Certificate is good for another day!" | |
else | |
echo "To: $EMAIL" > $ALERTMESSAGE |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/etc/cron.hourly/ddns: | |
#!/bin/bash | |
YDNS_USER= | |
YDNS_PASSWD= | |
HOST=.ydns.eu | |
INTERFACE=pppoe0 | |
IP=$(ip address show ${INTERFACE} | grep 'inet ' | awk '{print $2}') | |
curl --basic -u "$YDNS_USER:$YDNS_PASSWD" --silent "https://ydns.io/api/v1/update/?host=${HOST}&ip=${IP}" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This configuration allows you to use physical button on your Sonoff S20, add one button to Home Assistant and for safe turn off after x minutes. | |
esphomeyaml: | |
name: sonoffs20_esphomeyaml_1 | |
platform: ESP8266 | |
board: esp01_1m | |
wifi: | |
ssid: '' | |
password: '' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
esphomeyaml: | |
name: sonoff_1 | |
platform: ESP8266 | |
board: esp01_1m | |
wifi: | |
ssid: '' | |
password: '' | |
manual_ip: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
for f in *.png ; do convert "$f" -fill black -colorize 100 "${f%.png}.png" ; done |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
!!!NOT WORKING!!! | |
configure | |
set interfaces wireguard wg0 address 10.xx.xxx.253/32 | |
set interfaces wireguard wg0 listen-port 51820 | |
set interfaces wireguard wg0 route-allowed-ips false | |
set interfaces wireguard wg0 peer JuE+ endpoint mullvadserverip:51820 | |
set interfaces wireguard wg0 peer JuE+ allowed-ips 0.0.0.0/0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
I wanted to route only specific IPs trough a Wireguard interface. I am not expert in any way, but I am trying to explain you as best I can how I did it. | |
Setup a WG connection as usual on one of your device in your network (In my example I will call it "Ubuntu server", 192.168.1.54): | |
[Interface] | |
Address = something/24 | |
PrivateKey = longprivatekeyR5FE= | |
Table = 43 | |
PostUp = ip rule add from 192.168.1.91 table 43; iptables -w -A FORWARD -i %i -j ACCEPT; iptables -w -A FORWARD -o %i -j ACCEPT; iptables -w -t nat -A POSTROUTING -o ens160 -j MASQUERADE; iptables -t nat -A POSTROUTING -o %i -j MASQUERADE |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
python -c 'from twisted.web.server import Site; from twisted.web.static import File; from twisted.internet import reactor; from twisted.python import log; import sys; log.startLogging(sys.stdout); reactor.listenTCP(1990, Site(File("."))); reactor.run()' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"firewall": { | |
"modify": { | |
"LOAD_BALANCE": { | |
"description": "LOAD_BALANCE", | |
"rule": { | |
"2501": { | |
"action": "modify", | |
"modify": { | |
"table": "5" |
OlderNewer