Skip to content

Instantly share code, notes, and snippets.

@ahue
ahue / zh_sync.sh
Last active January 5, 2022 20:33
obsidian sync script
#!/data/data/com.termux/files/usr/bin/bash
# ^^^^^^^^^^^^^^^ This says find the first instance of a sh (shell)
# binary and use that shell to execute these commands.
# There is little to no complexity here and no bashisms so it
# should work just fine on most systems and instances of shells
# (bash, zsh, sh, etc.)
# original from: https://gist.githubusercontent.com/lucidhacker/0d6ea6308997921a5f810be10a48a498/raw/386fd5c640282daeaa3c9c5b7f4e875511c2946c/zk_sync.sh
# modified according to: https://lucidhacker.substack.com/p/setting-up-git-syncing-for-obsidian
cd ~/storage/shared/documents/my-vault
git pull --rebase
git add --all
git commit -m "mobile update $(date)"
git push origin main
@ahue
ahue / fix-docker-machine-time-sync.ps1
Created March 29, 2022 20:18
fix-docker-machine-time-sync.ps1
$vm = Get-VM -Name DockerDesktopVM
$feature = "Zeitsynchronisierung"
Disable-VMIntegrationService -vm $vm -Name $feature
Enable-VMIntegrationService -vm $vm -Name $feature
@ahue
ahue / obsidian.sh
Created April 10, 2022 12:49
Obsidian pull-push script for Android
#!/data/data/com.termux/files/usr/bin/bash
cd ~/storage/shared/documents/my-vault
git add --all
git commit -m "mobile update $(date)"
git pull --rebase
git push origin main
@ahue
ahue / license-plate-regex.md
Created April 22, 2022 12:02
License Plate Regex

Only guarantees structural compliance to definition

Germany

[A-ZÄÜÖ]{2,3}[ -][A-ZÄÜÖ]{1,2}[ -]\d{1,4}

Source

@ahue
ahue / ha-shelly-plus1-button-actions.yaml
Last active October 24, 2024 05:05
Home Assistant Shelly Plus 1 Button Actions Blueprint
blueprint:
name: Shelly Plus 1 Button actions
description: |
This blueprint is for the Shelly PLus 1 setup as button. It is for general
use.
Note: Best set the `Input/Output settings` to `Detached - Input is separated/not changing state of the output/relay` on the Shelly: `http:/<shelly-ip>/#/input/0/settings/io-settings`.
In case you still want to control the primary output directly from the Shelly, create a local action: `http:/<shelly-ip>/#/input/0/create-action`.
domain: automation
input:
@ahue
ahue / trace script.cover_open_close_duplicate 2025-01-05T10_55_51.170362+00_00.json
Created January 5, 2025 11:02
trace script.cover_open_close_duplicate 2025-01-05T10_55_51.170362+00_00
{
"trace": {
"last_step": "sequence/0",
"run_id": "7ed63d28d91f10de3817de1695fb27e1",
"state": "stopped",
"script_execution": "error",
"timestamp": {
"start": "2025-01-05T10:55:51.170362+00:00",
"finish": "2025-01-05T10:55:51.173932+00:00"
},