Skip to content

Instantly share code, notes, and snippets.

View mikafinja's full-sized avatar
🐧
I'm on my ice floe

Mika Finja mikafinja

🐧
I'm on my ice floe
View GitHub Profile
blueprint:
name: Motion-activated Light by daytime
description: Turn on a light when motion is detected and set the brightness according to the current daytime.
domain: automation
source_url: https://example.com
input:
motion_entity:
name: Motion Sensor
selector:
entity:
#!/bin/bash
# download latest version of factorio server
/usr/bin/wget https://factorio.com/get-download/latest/headless/linux64 -O /home/factorio/factorio.tar.xz --quiet
# ensure directory for new version is present
/usr/bin/mkdir -p /home/factorio/new
# ensure backup dir is present
/usr/bin/mkdir -p /home/factorio/backup
@mikafinja
mikafinja / .bashrc_ssh_tab_complete.sh
Last active September 20, 2017 08:29
bash .ssh/config tab completion
_ssh()
{
local cur prev opts
COMPREPLY=()
cur="${COMP_WORDS[COMP_CWORD]}"
prev="${COMP_WORDS[COMP_CWORD-1]}"
opts=$(grep '^Host' ~/.ssh/config ~/.ssh/config.d/* | grep -v '[?*]' | cut -d ' ' -f 2-)
COMPREPLY=( $(compgen -W "$opts" -- ${cur}) )
return 0
@mikafinja
mikafinja / endpoints.md
Last active November 18, 2016 12:05 — forked from derhuerst/_.md
List of HAFAS API Endpoints