Skip to content

Instantly share code, notes, and snippets.

View bneumann's full-sized avatar

Benjamin Giesinger bneumann

View GitHub Profile
@bneumann
bneumann / getPowerConsumption.py
Created May 3, 2025 07:01
A simple python function that can return the current heating and hot water consumption for a Viessmann device
from PyViCare.PyViCare import ViCareOAuthManager
from PyViCare.PyViCare import PyViCare
from PyViCare.PyViCareGateway import Gateway
import json
from datetime import datetime
import logging
_LOGGER = logging.getLogger(__name__)
def getPowerConsumption(email, password, client_id):
@bneumann
bneumann / update_dns.sh
Created February 1, 2021 11:56
Simple DNS AAAA entry update script
#!/bin/bash
currentIp=$(ip -6 addr|awk '{print $2}'|grep -P '^(?!fe80)[[:alnum:]]{4}:.*/64'|cut -d '/' -f1)
lastIp=$(cat lastip.txt)
echo $currentIp
echo $lastIp
if [ "$currentIp" != "$lastIp" ]; then
echo "Updating IP"
log=$(curl -X GET "https://<domain>:<password>@<provider>?hostname=<subdomain>&myip=$currentIp")
echo $log
echo "Saving new IP"
@bneumann
bneumann / hg2git.sh
Created May 17, 2019 19:15
Bash script for mercurial to git conversion
#!/bin/bash
# make sure fast-export is cloned, you have an authors list and you are int the /tmp directory
# More: https://git-scm.com/book/en/v2/Git-and-Other-Systems-Migrating-to-Git
echo converting $1
rm -rf hg-$1
rm -rf git-$1
hg clone ssh://bgiesinger@bitbucket.org/phonicscore/$1 /tmp/hg-$1