Skip to content

Instantly share code, notes, and snippets.

View introt's full-sized avatar

introt

View GitHub Profile
@introt
introt / timely_rename.py
Last active January 15, 2022 17:53
Add event summaries to ISO 8601 -like filenames from an ICS calendar
#!/usr/bin/env python3
"""
timely_rename.py
Prepend ISO 8601 -like filenames
with event summaries from an ICS calendar
(c) 2021 introt
License: Apache 2.0
@introt
introt / coauthor.py
Last active December 4, 2022 22:20
"Co-authored-by" lines from usernames and issue/PR urls using GitHub REST API
#!/usr/bin/env python3
"""
coauthor.py - credit GitHub users easily
Supports both issue and pull request urls
in addition to GitHub usernames.
Use directly in vim: ":r ! coauthor.py introt" or ":r ! coauthor.py https://github.com/user/repo/pull/1"".
@introt
introt / htmlimageinliner.py
Created December 24, 2022 07:54
Zim plugin to inline images in HTML files
# Copyright 2022 introt <introt@koti.fimnet.fi>
# based on windowtitleeditor.py and Zim Desktop Wiki code released under GPLv2
import base64
from pathlib import PurePath
from zim.formats.html import Dumper, html_encode
@introt
introt / gist:32a3a193d49b3ddf3b4da3ab83eaec31
Created October 15, 2023 13:55
Manually restore HomeAssistant Core backup
1. Extract the backup .tar file
2. Extract the homeassistant.tar within
3. mv data ~homeassistant/.homeassistant
@introt
introt / resetpass.sh
Created October 15, 2023 14:07
Reset HomeAssistant Core password
# modified from https://www.home-assistant.io/docs/locked_out/
# with additional info from https://community.home-assistant.io/t/password-lost/66288/14
# inside the venv:
# list users
hass --script auth --config ~/.homeassistant list
USER=the first line of output
read PASS # new password
# set the new password
hass --script auth --config ~/.homeassistant change_password "$USER" "$PASS"
@introt
introt / sensor-light.yaml
Created March 9, 2024 14:57 — forked from Blackshome/sensor-light.yaml
Home Assistant Sensor Light that can be used in Blueprints
blueprint:
name: Sensor Light
description: >
# 💡 Sensor Light
**Version: 6.3**
Your lighting experience, your way - take control and customize it to perfection! 💡✨