Skip to content

Instantly share code, notes, and snippets.

View lukastillmann's full-sized avatar

Lukas Tillmann lukastillmann

View GitHub Profile
@lukastillmann
lukastillmann / ha_ikea_remote_blueprint.yaml
Last active January 7, 2024 10:11
Ikea remote control
blueprint:
name: IKEA four button remote for lights
description:
'Control lights with an IKEA four button remote (the square ones),
for use with [ZHA](https://www.home-assistant.io/integrations/zha/).
Extends [SwerveShot](https://community.home-assistant.io/u/SwerveShot)''s [version](https://community.home-assistant.io/t/zha-ikea-four-button-remote-for-lights/347657)
which is based on the work of [frenck](https://community.home-assistant.io/u/frenck)
with the five button version.
@lukastillmann
lukastillmann / gitcount.sh
Last active August 31, 2022 09:06 — forked from ezamelczyk/gitcount.sh
Git count lines by author
#!/bin/sh
git log --shortstat | grep -E "(Author: )(\b\s*([A-Z]\w+)){2}|fil(e|es) changed" | awk '
{
if($1 ~ /Author/) {
author = $2" "$3
} else {
files[author]+=$1
inserted[author]+=$4
deleted[author]+=$6
}
@lukastillmann
lukastillmann / buzzer.py
Created September 24, 2021 17:19
Connect an active piezo buzzer on a raspberry pi to Home Assistant using MQTT
# Benoetigte Module werden importiert und eingerichtet
import RPi.GPIO as GPIO
import time
import json
import paho.mqtt.client as mqtt
# setup buzzer
GPIO.setmode(GPIO.BCM)
@lukastillmann
lukastillmann / Dockerfile
Created April 29, 2021 17:17
Dockerfile to start and expose a ringojs web application
FROM adoptopenjdk/openjdk8:alpine
RUN apk add --no-cache bash
RUN wget https://github.com/ringo/ringojs/releases/download/v2.0.0/ringojs-2.0.0.tar.gz
RUN tar -xzf ringojs-2.0.0.tar.gz
ENV PATH="/ringojs-2.0.0/bin:${PATH}"
WORKDIR /code
@lukastillmann
lukastillmann / esphome_minimal.yaml
Last active November 27, 2020 11:11
Minimal ESPHome yaml
esphome:
name: x
platform: ESP8266
board: esp01_1m
wifi:
ssid: !secret wifi_ssid
password: !secret wifi_password
ota:
@lukastillmann
lukastillmann / kiosk.js
Last active July 28, 2019 18:44
Kiosk Mode for Home Assistant Lovelace Interface
// works with hassio 0.96
if (window.location.href.indexOf('dashboard') > 0) {
setInterval(function() {
try {
var header = document.querySelector('home-assistant')
.shadowRoot
.querySelector('home-assistant-main')
.shadowRoot
.querySelector('app-drawer-layout')
.querySelector('partial-panel-resolver')
@lukastillmann
lukastillmann / compile_vim_py3.sh
Last active May 24, 2019 07:10
Compile vim with python 3 and more
# see https://kowalcj0.wordpress.com/2013/11/19/how-to-compile-and-install-latest-version-of-vim-with-support-for-x11-clipboard-ruby-python-2-3/
./configure \
--enable-multibyte \ # for unicode?
--enable-python3interp \
--with-python3-config-dir=/usr/lib/python3.6/config-3.6m-x86_64-linux-gnu \ # this might be different
--with-compiledby="Lukas Tillmann <home@lukastillmann.eu>" \
--with-features=huge \
--enable-gui=auto \ # needed for xterm-clipboard support
--with-x \ # xterm-clipboard-support
@lukastillmann
lukastillmann / Readme.md
Created May 3, 2019 21:44 — forked from ciotlosm/Readme.md
Kiosk mode for lovelace

Kiosk mode

Installation

Add kiosk.js file with the content below to your www folder in config.

Like any other custom script, use ui-lovelace.yaml resources section to reference the kiosk.js file.

Make sure you add kiosk somewhere in your URL. You can use it in the id of your view or in the query string.

npm install --save-dev git+ssh://USER@SERVER:/myprivate.git
@lukastillmann
lukastillmann / ssh.md
Created July 13, 2018 20:22
set up ssh keys
  1. Create key pair: ssh-keygen -t rsa -b 4096 (-t = define type) (-b = bit size)
  2. Answer questions (save location, enter possible passphrase)
  3. Ensure ssh-agent is enabled: eval "$(ssh-agent -s)"
  4. Add key to ssh-agent: ssh-add ~/.ssh/file
  5. copy public key to new machine and add it to ~/.ssh/authorized_keys