Skip to content

Instantly share code, notes, and snippets.

@ampaze
ampaze / plausible-matomo-import-events.sql
Created February 5, 2024 08:07
How to import Matomo tracking data into Plausible Analytics
-- Use at your own risk, I am not responsible if you lose data or break your system!
-- This is based on self hosted Plausible v2.0.0 and self hosted Matomo 5.0.1
-- EXPORT from Matomo MySQL
-- Best to start screen before running the export
-- mysql -u <user> -p <db> < plausible-matomo-import-events.sql > plausible-matomo-import-events.tsv
-- IMPORT into clickhouse
-- Again best to use screen
-- cat plausible-matomo-import-events.tsv | docker exec -i plausible-analytics-plausible_events_db-1 clickhouse-client -q "INSERT INTO plausible_events_db.events_v2 FORMAT TabSeparatedWithNames"
@ampaze
ampaze / 999-passthrough-formats.rules
Created June 11, 2023 14:47
EDID based passthrough formats for Vero / Kodi
# /etc/udev/rules.d/999-passthrough-formats.rules
KERNEL=="hdmi_audio", ACTION=="change", ATTR{state}=="HDMI=1", RUN+="/bin/bash -c '/home/osmc/.kodi/userdata/passthrough-format-from-edid.sh %p >> /var/log/edit_passthrough_detection_errors.log 2>&1'"
@ampaze
ampaze / cross-compile-wireguard-kernel-module-qnap-arm.md
Created January 28, 2023 11:25
How to cross compile the WireGuard® kernel module for QNAP® Arm® devices

How to cross compile the WireGuard® kernel module for QNAP® Arm® devices

Prerequisites

Information about your QNAP device

SSH into your QNAP device and run

echo Model: $(getsysinfo model)
@ampaze
ampaze / osmc-environment.md
Created January 18, 2023 10:55
How to set environment variables (for example no_proxy) for Kodi in OSMC (Open Source Media Center)

As Kodi is called with sudo -u osmc environment variables are not retained and as a result not available in Kodi.

The easiest way I have found to set environment variables like for example no_proxy is to add them to /etc/environment and then configure sudo to include /etc/environment on every invocation.

You need SSH access to the device

ssh osmc@device

sudo sh -c 'echo "Defaults env_file=/etc/environment" &gt; /etc/sudoers.d/osmc-environment'
@ampaze
ampaze / brotli-nginx-info.txt
Last active September 16, 2023 19:12
Serve static brotli compressed files on nginx without ngx_brotli
For this to work, you need to precompress your files:
> brotli -q 11 file.css file.cssbr
The file extensions needs to end with br without any delimiter, this is to make the nginx config less cumbersome.