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 / README.md
Last active November 12, 2024 18:19
Generate Markdown docs from Ansible argument_specs.yml

This script will generate Markdown sections from the contents of an Ansible role's meta/argument_specs.yml in the following style:

option_name

Type Default
string default value here

@tigattack
tigattack / authentik_gource.sh
Created October 26, 2024 15:27
Generates a Gource visualisation of goauthentik/authentik.
#!/usr/bin/env bash
for i in git gource ffmpeg magick; do
command -v $i >/dev/null 2>&1 || { echo >&2 "Error: $i is not installed. Aborting."; exit 1; }
done
gource_tmpdir=$(mktemp -d)
cd $gource_tmpdir
git clone [email protected]:/goauthentik/authentik.git .
@tigattack
tigattack / authy-to-2fas.py
Created August 8, 2024 09:51
momaek/authy to 2FAS JSON schema converter
"""momaek/authy to 2FAS JSON schema converter"""
import dataclasses
import json
import time
from os.path import expanduser
from urllib.parse import quote
class EnhancedJSONEncoder(json.JSONEncoder):
"""Ansible vault exporter
- Finds all ansible-vault encrypted files and strings in a given path
- Extracts and decrypts each secret
- Writes plaintext secret to a file with the path to secret's the soruce
"""
import re
import os
import subprocess
# Directory to search recursively for vault strings/files
@tigattack
tigattack / flow-http.json
Last active March 4, 2024 23:47
Node-RED flows to send Home Assistant device tracker data to Owntracks via MQTT or HTTP - https://blog.tiga.tech/posts/selfhost-location-history
[
{
"id": "978f06ed.f5189",
"type": "trigger-state",
"z": "90f1f83a.381b38",
"name": "Example Device Tracker",
"server": "4bc0b8a8.1c9238",
"version": 4,
"inputs": 1,
"outputs": 2,
@tigattack
tigattack / gource.conf
Last active August 25, 2023 17:56
tig's Gource config
[display]
fullscreen=true
high-dpi=true
multi-sampling=true
output-framerate=60
output-ppm-stream=-
screen=2
[gource]
auto-skip-seconds=0.1
@tigattack
tigattack / README.md
Last active January 4, 2025 13:17
Autorestic backup reports for Discord

Autorestic Discord Backup Report

  1. Replace your webhook in the WEBHOOK_URL variable.
  2. Optionally set MENTION_ON_FAIL to True and set DISCORD_USER_ID if you wish to be @mentioned when a job fails.
  3. Add the script to the success & failure hooks in Autorestic, like so:
locations:
  my-location:
    from: /data
 to: my-backend
@tigattack
tigattack / Dockerfile
Last active July 19, 2023 09:14
Discord alerts for Raspberry Pi stock in a given region. Gets stock updates from rpilocator.com.
from python:alpine
env PYTHONUNBUFFERED=1
run pip install --no-cache-dir feedparser requests
copy rpilocator-discord.py .
cmd ["python", "/rpilocator-discord.py"]
@tigattack
tigattack / DaysSince.ps1
Last active December 30, 2020 00:00
"Days since last incident" automated meme generator
#######################
## GitHub Configuration
#######################
$githubUser = 'tigattack'
$githubSecret = ''
$gistID = 'e02e7039a07404f9df48e28a4558467c'
$githubURI = "https://api.github.com/user"
$githubGistURI = "https://api.github.com/gists"
##############