Skip to content

Instantly share code, notes, and snippets.

@hekmon
hekmon / README.md
Last active April 19, 2024 00:40
EDF Time based Tempo prices

Simply include the file within your configuration.yaml file like this:

# ...
template: !include templates.yaml
# ...

You will need prices input number from this gist and the RTE Tempo extension.

@hekmon
hekmon / README.md
Last active May 19, 2024 11:47
EDF Tarif Bleu prices within Home Assistant

Simply include the file within your configuration.yaml file like this:

# ...
input_number: !include input_numbers.yaml
# ...

Restart your Home Assistant to update the values (reloading YAML will not be enough).

@hekmon
hekmon / README.md
Last active June 26, 2022 19:55
Linux TCP tuning for CIFS over WAN/VPN

TCP Tuning for CIFS over VPN/WAN

If your bandwitch allows it, this will enable stutter free streaming of 4K remuxes over CIFS/VPN/WAN.

Install

sudo wget 'https://gist.github.com/hekmon/78b30ae8cb76b076d01bddaf79b2c693/raw/d063a1bee463745ce2b8ded41475b5d9c179c7b4/sysctl.conf' -O '/etc/sysctl.d/90-CIFS_over_WAN.conf'
sudo sysctl -p
@hekmon
hekmon / awscliv2.sh
Last active May 23, 2023 16:02
AWS CLI v2 - install and update on a bash based linux system
#!/bin/bash -e
# https://docs.aws.amazon.com/cli/latest/userguide/install-cliv2-linux.html#cliv2-linux-install
# https://docs.aws.amazon.com/cli/latest/userguide/cli-configure-completion.html
echo "* Switching to tmp folder..."
cd "$(mktemp -d)"
echo
echo "* Downloading the AWS cli..."
wget -q "https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip" -O awscliv2.zip
@hekmon
hekmon / chroot.sh
Last active September 7, 2020 11:04
Quick live rescue chroot script
#!/bin/bash -e
ROOT=$1
HOME=$2
if [ ! -b "$ROOT" ]
then
echo "First parameter (/) is not a block device" >&2
exit 1
fi
@hekmon
hekmon / dp_autostop.go
Last active February 1, 2021 17:39
Golang "autostop" design pattern: controller with clean context stop (avoid Start() Stop() workflow)
package foobar
import (
"context"
"errors"
)
// Controller is a base pattern controller
type Controller struct {
ctx context.Context