Skip to content

Instantly share code, notes, and snippets.

@Bouni
Bouni / abfall.py
Created February 7, 2019 16:12
Scrape disposal dates from Abfallwirtschaft Landkreis Waldshut website
import re
import requests
import html
# Hole Webseite
url = "https://www.abfall-landkreis-waldshut.de/de/termine/abfuhrtage.php?ort=78"
r = requests.get(url)
# baue Regex der alle notwendigen Mülltypen findet <td>Mülltyp</td><td>Daten</td>
trash_types = ["Restmüll","Biotonne","Grünabfälle","Gelber Sack","Blaue Tonne"]
# Load our handwheel.py script as handwheel (symlinked from ~/linuxcnc/handwheel.py -> /usr/bin/handwheel)
loadusr -Wn handwheel handwheel
#net handwheel.plus
# Jog Pendant
# loadrt encoder num_chan=1
# addf encoder.capture-position servo-thread
# addf encoder.update-counters base-thread
#
# #######################################
#
# HAL file for HostMot2 with 3 steppers
#
# Derived from Ted Hyde's original hm2-servo config
#
# Based up work and discussion with Seb & Peter & Jeff
# GNU license references - insert here. www.linuxcnc.org
#
#
# This config file was created 2016-08-12 11:49:56.526085 by the update_ini script
# The original config files may be found in the /home/pcw/linuxcnc/configs/7i76es1.old directory
[EMC]
# The version string for this INI file.
VERSION = 1.1
# Name of machine, for use with display, etc.
MACHINE = Reaktor-Mill
# PID loop signals
setp pid.0.Pgain [JOINT_0]P
setp pid.0.Igain [JOINT_0]I
setp pid.0.Dgain [JOINT_0]D
setp pid.0.bias [JOINT_0]BIAS
setp pid.0.FF0 [JOINT_0]FF0
setp pid.0.FF1 [JOINT_0]FF1
setp pid.0.FF2 [JOINT_0]FF2
setp pid.0.deadband [JOINT_0]DEADBAND
uname -a
Linux mill 4.9.0-8-rt-amd64 #1 SMP PREEMPT RT Debian 4.9.130-2 (2018-10-27) x86_64 GNU/Linux
LINUXCNC - 2.7.14-67-g66b42c137
Machine configuration directory is '/home/miller/linuxcnc'
Machine configuration file is '7i96-1k.ini'
Starting LinuxCNC...
emc/iotask/ioControl.cc 768: can't load tool table.
Found file(REL): ./hm2-pidstepper.hal
@Bouni
Bouni / ui-lovelace.yaml
Created December 14, 2018 09:00
Lovelace Home Assistant Config
title: Wasenweg
# Include external resources
#resources:
# - url: /local/my-custom-card.js
# type: js
# - url: /local/my-webfont.css
# type: css
# Optional background for all views. Check https://developer.mozilla.org/en-US/docs/Web/CSS/background for more examples.
#background: center / cover no-repeat url("/background.png") fixed
@Bouni
Bouni / configuration.yaml
Created November 7, 2018 07:39
Home-Assistant Luxtronik example config
luxtronik:
host: "192.168.88.11"
port: 8889
sensor:
- platform: luxtronik
sensors:
- 'ID_WEB_Temperatur_TVL'
- 'ID_WEB_Temperatur_TRL'
- 'ID_WEB_Sollwert_TRL_HZ'
@Bouni
Bouni / .vimrc
Created October 2, 2018 19:13
.vimrc
" decide wether we use vim or neovim
if has('nvim')
let $VIMHOME = '~/.config/nvim'
else
let $VIMHOME = '~/.vim'
endif
" set the plugvim path
let $PLUGVIM = expand($VIMHOME . '/autoload/plug.vim')
@Bouni
Bouni / swiss_hydrological_data.py
Created September 6, 2018 15:03
swiss_hydrological_data regex
location = re.findall(r"<option selected=\"selected\" value=\"\d+\">(.*)\s\(\s\d+\s\)</option>", response.text)
location = [s.strip() for s in location[0].split("-")]
captions = re.findall(r"<th class=\"text-center\" scope=\"col\">(\w+)<br>", response.text)
data = re.findall(r"<td class=\"text-center\">([\d\.]+)</td>", response.text)
['Rhein', 'Rekingen']
['Abfluss', 'Wasserstand', 'Temperatur']
['261', '322.28', '21.1', '250', '322.25', '21.1', '264', '322.29', '21.2']