Skip to content

Instantly share code, notes, and snippets.

View tigattack's full-sized avatar

tigattack tigattack

View GitHub Profile
@tigattack
tigattack / _README.md
Created January 15, 2025 17:10
Find anomalous movements between consecutive geopoints in Dawarich

Dawarich Geopoint Anomaly Detection

Overview

This script identifies anomalous movements between geopoints retrieved from the Dawarich API.

Anomalous movements are detected by comparing the speed and distance between consecutive points against configurable thresholds. If the speed exceeds the threshold or the speed is incalculable (infinite or -1) and the distance between points exceeds the distance threshold, the movement is flagged as anomalous.

The script supports retrieving points for specific years, months, or all time. It can output the results in either JSON or plaintext format.

Requirements

@tigattack
tigattack / config.local.js
Last active March 16, 2025 22:55
scanservjs Paperless-ngx recipe. Thanks to @chkpwd for initial version & bulk of the work on this.
const options = { paths: ['/usr/lib/scanservjs'] };
const fs = require(require.resolve('fs', options));
const { Blob } = require(require.resolve('buffer'), options);
const PAPERLESS_DELETE_AFTER_UPLOAD = process.env.PAPERLESS_DELETE_AFTER_UPLOAD || false
// Must be tag ID, not name.
const PAPERLESS_DOCUMENT_TAG_IDS = process.env.PAPERLESS_DOCUMENT_TAG_IDS || null
module.exports = {
afterConfig(config) {
@tigattack
tigattack / _README.md
Last active March 26, 2025 16:42
Scripts to aid in power management of CUPS printers

CUPS Printer Power Helper Scripts

There are two scripts here which can aid in managing the physical power state of a CUPS printer in Home Assistant.

See here for usage: https://github.com/tigattack/docker-cups-canon-airprint

printer_idle.py

This script POST's the idle status of your printer(s) to the defined webhook URL. It is designed to be run by a scheduler (such as cron or a basic loop & sleep in a bash script).