This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
output = "HTTP OK: HTTP/1.1 200 OK - 16499 bytes in 0.019 second response time |time=0.019284s;;;0.000000;10.000000 size=16499B;;;0" | |
# first split on the pipe | |
perf_data = output.split("|") | |
# each data point separated by a space | |
for p in perf_data[1].split(" "): | |
result = {} | |
p_values = p.split(";") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
Takes in a set of files calculates the value sum from time periods designated in a YAML file | |
Install library requirements first (pandas generally installed via OS, on Linux sudo apt install python3-pandas) | |
""" | |
import argparse | |
import datetime | |
import os | |
import os.path | |
import pandas | |
import sys |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
blueprint: | |
name: Low battery level detection & notification for all battery sensors | |
description: Regularly test all sensors with 'battery' device-class for crossing | |
a certain battery level threshold and if so execute an action. Marck/home-assistant-automation-blueprints/blob/main/low-battery-level-detection-notification-for-all-battery-sensors | |
domain: automation | |
input: | |
threshold: | |
name: Battery warning level threshold | |
description: Battery sensors below threshold are assumed to be low-battery (as | |
well as binary battery sensors with value 'on'). |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"""update_godaddy_dns.py | |
Updates a GoDaddy DNS record with a new external IP address using the GoDaddy API | |
Run in debug mode (-D) to check the IP but not update DNS records | |
https://developer.godaddy.com/doc/endpoint/domains | |
Requires: | |
configargparse | |
requests | |
""" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"""Backup utility | |
Performs a backup of files and directories given in a YAML configuration file. This is done by first putting them all in a tar archive | |
and then using the smbclient package to copy the file to the destination. | |
Run with: python3 backup.py -c /path/to/config.yaml | |
requires jinja2 and pyyaml """ | |
import argparse | |
import os |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"""calc_energy.py | |
calculate the energy usage based on a load percentage and max power rating | |
""" | |
def calc_energy(current_load, max_load, min=5, unit='W'): | |
# load percent * max load | |
current_power = (current_load/100) * max_load | |
# multiply the power by the time increment | |
# time increment should be in hours |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import argparse | |
import os.path | |
from PIL import Image | |
def create_palette(colors): | |
result = [] | |
for c in colors: | |
rgb_values = c.split(',') | |
# there must be 3 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
#will either check your addon (same as PR will do) or send a pull request on up to the repo | |
#cultivated from instructions at https://kodi.wiki/view/HOW-TO:Create_add-on_PRs_using_Git_Subtree_Merging and modified | |
## ARGS pass in file to source other args as -f or --filename ## | |
ADDON_CHECKER_VERSION=0.0.14 | |
KODI_FORK=https://github.com/robweber/repo-scripts.git | |
KODI_REPO_BRANCH=jarvis | |
ADDON_URL=https://github.com/robweber/xbmcbackup.git | |
ADDON_BRANCH=master |