Skip to content

Instantly share code, notes, and snippets.

View set_homeassistant_zwave_configs.bash
#!/bin/bash
# License: BSD
#
# !! ATTENTION !!
# Do not spam the zwave network with too many set-config at once, it will
# bring the communication & network down. Best case is increasing the sleep below again by
# the factor of 2!
#
View gist:49580328ca062e39ea2a902517333ee0
#!/bin/bash
URL="http://192.168.10.10:8123"
function set_config_param {
curl -X POST "${URL}/api/services/zwave/set_config_parameter" -H "Content-Type: application/json" --data "{ \"node_id\": ${1}, \"parameter\": ${2}, \"value\": ${3} }"
}
function set_wakeup {
curl -X POST "${URL}/api/services/zwave/set_wakeup" -H "Content-Type: application/json" --data "{\"node_id\": ${1}, \"value\": ${2}}"
@daringer
daringer / gist:220dae1d4d080d5a55d5897e0e4f0a5b
Created Jul 27, 2018
Muellmax.de get trash collection dates
View gist:220dae1d4d080d5a55d5897e0e4f0a5b
from selenium import webdriver as drv
from selenium.webdriver import ChromeOptions
from selenium.webdriver.common.keys import Keys
opts = ChromeOptions()
opts.add_argument("--headless")
br = drv.Chrome(chrome_options=opts)
br.get("http://www.hanau.de/lih/sicherheit/abfall/009613/index.html")
elems = br.find_element_by_tag_name("input")
br.get("http://www.muellmax.de/abfallkalender/his/res/HisStart.php")
@daringer
daringer / header.tex
Created Aug 11, 2014
Header for LaTeX with short descriptions of packages - for scientific publications/dissertations/books/articles in natural sciences (computer science, electrical engineering, physics, math, ...)
View header.tex
%%
%% Header file including short descriptions of packages
%% preferably to be used for natural sciences and such:
%% computer science, electrical engineering, physics, maths
%%
%% Author: Markus Meissner <coder@safemailbox.de>
%% License: BSD
%%
\documentclass[a4paper,11pt]{book}
@daringer
daringer / functions.sh
Created Jun 7, 2014
Some useful bash helper functions
View functions.sh
#!/bin/bash
##
## indir - execute given command ($2) in
## target directory ($1) with arguments ($3..N)
##
function indir {
if [[ "$1" = "" ]] || [[ "$2" = "" ]]; then
echo "[i] Usage: indir <target_dir> <command> <arg1> .. <argN>"
return 1
@daringer
daringer / ssh_aliases.sh
Created Jun 7, 2014
generate a bash alias for each (exact) host line from .ssh/config
View ssh_aliases.sh
#!/bin/bash
##
## create an alias for each unambigous host entry in ${HOME}/.ssh/config
##
## instead of using "ssh myhostname" you can simply use "myhostname" to
## establish a ssh-connection to the host!
##
## You most likely have to change CACHE_FN to point somewhere,
## where you want to store the cache
@daringer
daringer / example.tex
Last active Aug 29, 2015
Fancier MOSFET devices for (La)Tex/Tikz/CircuiTikz
View example.tex
%%% author: Markus Meissner <coder@safemailbox.de>
%%%
%%% simple inverter example circuitikz
%%%
%%% TO USE FANCY MOSFET DEVICES:
%%% - get pgfcirctripoles.sty from https://gist.github.com/daringer/78649db64ff04a3b9849
%%% - place it in the _same directory_ as your .tex source file
%%% - TeX will now replace the pgfcirctripoles.tex from circuitikz with this one
%%% - set some style definitions (see below)
%%% - compile your TeX code and use the fancy MOSFET devices
@daringer
daringer / Makefile
Last active Aug 29, 2015 — forked from felipec/asus_fan.c
OLD/DEPRECATED/OBSOLETE/DONOTUSE: ASUS Fan control linux kernel module - NOW HERE: https://github.com/daringer/asus-fan
View Makefile
obj-m := asus_fan.o
KDIR := /lib/modules/$(shell uname -r)/build
PWD := $(shell pwd)
all:
$(MAKE) -C $(KDIR) M=$(PWD) modules
install:
# just copy the .ko file anywhere below:
# /lib/modules/$(uname -r)/