Skip to content

Instantly share code, notes, and snippets.

View daringer's full-sized avatar

Markus Meissner daringer

View GitHub Profile
#!/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!
#
#!/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 July 27, 2018 17:57
Muellmax.de get trash collection dates
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 August 11, 2014 15:02
Header for LaTeX with short descriptions of packages - for scientific publications/dissertations/books/articles in natural sciences (computer science, electrical engineering, physics, math, ...)
%%
%% 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 June 7, 2014 09:59
Some useful bash helper functions
#!/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 June 7, 2014 04:17
generate a bash alias for each (exact) host line from .ssh/config
#!/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 August 29, 2015 14:02
Fancier MOSFET devices for (La)Tex/Tikz/CircuiTikz
%%% 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 August 29, 2015 14:01 — forked from felipec/asus_fan.c
OLD/DEPRECATED/OBSOLETE/DONOTUSE: ASUS Fan control linux kernel module - NOW HERE: https://github.com/daringer/asus-fan
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)/