ble2mqtt was very unstable for me and I only use the wp6003 sensor anyway, so I wrote this small python script. based on https://github.com/zu2/wp6003 add configuration.yaml to home assistants configuration.yaml.
Requirements: bleak paho click
ble2mqtt was very unstable for me and I only use the wp6003 sensor anyway, so I wrote this small python script. based on https://github.com/zu2/wp6003 add configuration.yaml to home assistants configuration.yaml.
Requirements: bleak paho click
| #!/bin/bash -e | |
| FOLDER="/home/roman/Scanned/" | |
| PORT="$(lsusb | grep CanoScan | pcregrep -o1 "Bus ([0-9]*)")" | |
| DEVICE="$(lsusb | grep CanoScan | pcregrep -o1 "Device ([0-9]*)")" | |
| SCANBD_DEVICE="genesys:libusb:${PORT}:${DEVICE}" | |
| scanimage --format jpeg -d ${SCANBD_DEVICE} --source Flatbed --resolution 300 -o /tmp/scan.jpg |
| from flask import Flask, g, request, redirect | |
| from datetime import datetime | |
| import sqlite3 | |
| import random | |
| app = Flask(__name__) | |
| DATABASE = "short.db" | |
| SECRET = "UltraSecretCode32904235235" |
| FROM rust:slim-buster | |
| RUN apt-get update | |
| RUN apt-get install -y \ | |
| wget unzip curl \ | |
| build-essential cmake git libgmp3-dev libprocps-dev python-markdown libboost-all-dev libssl-dev pkg-config libopencv-dev | |
| # install verifiable image redacting library with workaround for now (see https://github.com/snp-labs/verifiable-image-redacting/issues/1 ) | |
| RUN git clone https://github.com/Romern/verifiable-image-redacting \ | |
| && cd verifiable-image-redacting \ |
| import {inspect} from 'util'; | |
| import {Takeaway, TakeawayConfig} from 'takeaway'; | |
| (async () => { | |
| try { | |
| const plz = "52080"; | |
| const coordLNG = '50.7'; | |
| const coordLAT = '6.0'; | |
| // Initialize configuration |
| #!/bin/bash | |
| USER="AB12345" | |
| PASS="hunter2" | |
| echo "Getting courses..." | |
| COURSES=$(curl -s --ntlm -u "${USER}:${PASS}" https://www3.elearning.rwth-aachen.de/l2p/foyer/SitePages/PastCourses.aspx | grep -oE "https://www[0-9].elearning.rwth-aachen.de/(ws|ss)[0-9]{2}/[0-9]{2}(ws|ss)-[0-9]*") | |
| echo "Recursively download all courses using wget..." | |
| while IFS= read -r c |
| import org.jsoup.Jsoup; | |
| import org.jsoup.nodes.Document; | |
| import org.jsoup.nodes.Element; | |
| import org.jsoup.select.Elements; | |
| import org.jsoup.nodes.Attributes; | |
| import java.io.File; | |
| import java.nio.charset.StandardCharsets; | |
| import java.io.IOException; | |
| import java.nio.file.Files; | |
| import java.util.*; |
| <?xml version="1.0" encoding="UTF-8"?> | |
| <Mpeg7 | |
| xmlns="urn:mpeg:mpeg7:schema:2001" | |
| xmlns:mpeg7="urn:mpeg7:schema:2001" | |
| xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> | |
| <Description xsi:type="ContentEntityType"> | |
| <MultimediaContent xsi:type="VideoType"> | |
| <Video id="videosegment"> | |
| <MediaLocator> | |
| <MediaUri>https://admin.streaming.rwth-aachen.de/files/mediapackage/e97569b7-9bb9-4ed0-bd4f-9adbb66595cc/db24fdd6-6d07-44bf-9677-f663fce8e2c0/IDS_01_intro.mp4</MediaUri> |
| import pikepdf | |
| import sys | |
| if len(sys.argv)<3: | |
| print(f"Usage {sys.argv[0]} input.pdf output.pdf") | |
| exit(1) | |
| input = sys.argv[1] | |
| output = sys.argv[2] |
| import requests | |
| from requests.auth import HTTPBasicAuth | |
| import json | |
| from pathlib import Path | |
| apikey = 'ZTJlOWNhZGUtNzlmZS00ZGU2LTkwYjMtZDk1ODRlMDkwODM5' #from the APK | |
| secret = 'MTRjZTVjM2EtOGVlZi00OTU3LWFmNjktNTllODFhNmYyNzI5' #from the APK | |
| def download_file(url, filename): | |
| with requests.get(url, stream=True) as r: |