Skip to content

Instantly share code, notes, and snippets.

View adampetrovic's full-sized avatar
😀

Adam Petrovic adampetrovic

😀
View GitHub Profile
@adampetrovic
adampetrovic / nuc 11
Last active November 18, 2021 20:30
EDIT: Now fixed with the latest Plex Server v1.25.0.5246 -- i7-1165G7 TigerLake GT2 [Iris Xe Graphics] segfault using lxc and passthrough GPU on proxmox 7. The following happens after about 10 minutes of transcoding on a plex server running in a docker container within LXC. See https://forums.plex.tv/t/anyone-have-been-able-to-hw-transcode-on-an…
[ 8238.497867] i915 0000:00:02.0: [drm] Resetting vcs1 for preemption time out
[ 8238.504252] i915 0000:00:02.0: [drm] GPU HANG: ecode 12:4:4ab6fff5, in Plex Transcoder [224824]
[ 8239.165883] i915 0000:00:02.0: [drm] Resetting vecs0 for preemption time out
[ 8239.166591] i915 0000:00:02.0: [drm] *ERROR* vecs0 reset request timed out: {request: 00000001, RESET_CTL: 00000001}
[ 8239.167282] i915 0000:00:02.0: [drm] GPU HANG: ecode 12:8:2cffbffd, in Plex Transcoder [227665]
[ 8241.565903] i915 0000:00:02.0: [drm] Resetting vcs0 for preemption time out
[ 8241.566619] i915 0000:00:02.0: [drm] *ERROR* vcs0 reset request timed out: {request: 00000001, RESET_CTL: 00000001}
[ 8241.567338] i915 0000:00:02.0: [drm] GPU HANG: ecode 12:4:2ffffffd, in Plex Transcoder [227668]
[ 8249.855124] i915 0000:00:02.0: [drm] GPU HANG: ecode 12:4:4ab6fff5, in Plex Transcoder [224824]
[ 8249.956638] i915 0000:00:02.0: [drm] Resetting vcs1 for stopped heartbeat on vcs1
@adampetrovic
adampetrovic / query.flux.go
Last active June 17, 2022 05:34
InfluxDB (Flux): Calculating power cost from iotawatt using a time of use tariff and daily supply charge
import "date"
import "timezone"
import "dict"
option location = timezone.location(name: "Australia/Sydney")
tariffs = dict.fromList(pairs: [{key: "peak", value: 0.4070}, {key: "shoulder", value: 0.1815}, {key: "offpeak", value: 0.1540}, {key: "evoffpeak", value: 0.0770}])
dailySupplyCharge = 1.0494
getPrice = (timeVal) => {
hour = date.hour(t: timeVal)
@adampetrovic
adampetrovic / tesla_solar_charging.yaml
Last active December 13, 2022 22:56
Charge Tesla with Excess Solar
sensor:
- platform: statistics
name: "Solar Export Median - 1 minute (internal)"
unique_id: solar_export_median_internal
entity_id: sensor.solarexport
state_characteristic: median
max_age:
minutes: 1
- platform: statistics
name: "Grid Import Median - 1 minute (internal)"
@adampetrovic
adampetrovic / 01-debug.yaml
Last active March 9, 2024 23:04
Example Restic Setup
---
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: "debug"
spec:
accessModes: ["ReadWriteOnce"]
dataSourceRef:
kind: ReplicationDestination
apiGroup: volsync.backube
@adampetrovic
adampetrovic / 00-brewbyweight-update.md
Last active May 2, 2026 12:50
Homebrew by Weight - La Marzocco Linea Micra

⚠️ Update 2025-09-15: La Marzocco API Access Changes

Hi everyone,

With the recent changes La Marzocco has made to their firmware and connectivity, the approach used in this integration is no longer feasible.

Specifically:

  • Local websocket access has been removed.
  • Third-party API integrations are now being actively blocked.
@adampetrovic
adampetrovic / abb-cvc-extract.py
Last active March 25, 2026 08:55
Extract time-series data from Aussie Broadband CVC capacity graph images for InfluxDB ingestion
#!/usr/bin/env python3
"""
Extract time-series data from Aussie Broadband CVC capacity graph images.
Outputs InfluxDB line protocol to stdout.
Usage:
# Extract from a local image
python3 abb_cvc_extract.py /tmp/peakhurst_cvc.png
@adampetrovic
adampetrovic / commbank-actual-export.user.js
Last active March 30, 2026 20:40
Violentmonkey userscript: Export CommBank NetBank transactions (including pending) as JSON for Actual Budget CLI import
// ==UserScript==
// @name CommBank → Actual Budget Export
// @namespace https://github.com/adampetrovic
// @version 2.0.0
// @description Export CommBank NetBank transactions (including pending) as JSON for Actual Budget CLI import
// @author Adam Petrovic
// @match https://www.my.commbank.com.au/netbank/TransactionHistory/*
// @match https://www2.my.commbank.com.au/netbank/TransactionHistory/*
// @grant none
// ==/UserScript==