Skip to content

Instantly share code, notes, and snippets.

View ThePrincelle's full-sized avatar
🏳️‍🌈
Proud

Maxime Princelle ThePrincelle

🏳️‍🌈
Proud
View GitHub Profile
@ThePrincelle
ThePrincelle / eedomus_command.py
Last active June 11, 2023 08:50
Script pour échange HA <> eedomus
# eedomus_command.py
import requests
api_user = "XXXXXX"
api_secret = "XXXXXXXXXXXXXXXX"
action = "periph.value"
@service
def eedomus_command(periph_id=None, value=None):
@ThePrincelle
ThePrincelle / lima-docker.yaml
Last active December 14, 2022 22:00
Lima Docker VM config
# Example to use Docker instead of containerd & nerdctl
# $ limactl start ./docker.yaml
# $ limactl shell docker docker run -it -v $HOME:$HOME --rm alpine
# To run `docker` on the host (assumes docker-cli is installed):
# $ export DOCKER_HOST=$(limactl list docker --format 'unix://{{.Dir}}/sock/docker.sock')
# $ docker ...
#vmType: "vz"
@ThePrincelle
ThePrincelle / iptables.sh
Last active November 24, 2021 16:54
iptables & docker
iptables -I DOCKER-USER -i <interface_ext> -j DROP
iptables -I DOCKER-USER -m state --state RELATED,ESTABLISHED -j ACCEPT
# Just in case there is a Traefik instance or to add a specific port
iptables -I DOCKER-USER -i <interface_ext> -p tcp --dport 80 -j ACCEPT
iptables -I DOCKER-USER -i <interface_ext> -p tcp --dport 443 -j ACCEPT
@ThePrincelle
ThePrincelle / battery-notification-25.yaml
Created January 5, 2021 17:59
Home Assistant Blueprint (check battery level on 25 chosen devices and send notification)
blueprint:
name: Battery Level Notification (25)
description:
Send a notification to a device when battery drops below a specified
value - Pick 25 devices
domain: automation
input:
battery_entity_0:
name: "Entity_01"
selector:
@ThePrincelle
ThePrincelle / clean-node-modules.sh
Created January 28, 2020 10:27
Clean Node Modules in current folder. (Warning ! : You can't reverse it !!!)
alias clean-node-modules="find . -name 'node_modules' -type d -prune -print -exec rm -rf '{}' \;"
@ThePrincelle
ThePrincelle / cockpit-install
Last active April 15, 2020 20:04
cockpit-install
sudo apt install cockpit cockpit-packagekit cockpit-networkmanager cockpit-storaged cockpit-docker
@ThePrincelle
ThePrincelle / install-zsh
Last active January 31, 2022 08:47
zshSettings
sudo apt-get install zsh curl git
chsh -s $(which zsh)