Skip to content

Instantly share code, notes, and snippets.

View proffalken's full-sized avatar

Matthew Macdonald-Wallace proffalken

View GitHub Profile
@proffalken
proffalken / api-deployment.yaml
Created April 29, 2024 14:38
Launch Bar Assistant on k3s
apiVersion: apps/v1
kind: Deployment
metadata:
annotations:
homepage.description: Drinks!
homepage.group: Organisation
homepage.href: https://drinks.my.domain/
homepage.name: Drinks
traefik.enable: "true"
traefik.http.routers.drinks-api.entrypoints: websecure
@proffalken
proffalken / config.alloy
Last active April 12, 2024 08:06
Basic config for Grafana Alloy
// Sample config for Alloy that collects metrics, logs, and traces
// and forwards them to Grafana Cloud using the Grafana Cloud OTEL
// endpoint
//
// For a full configuration reference, see https://grafana.com/docs/alloy
logging {
level = "debug"
}
prometheus.exporter.unix "default" {
@proffalken
proffalken / m5stick-c.yaml
Created December 9, 2023 10:11
m5stick esphome config
esphome:
name: m5stick
friendly_name: m5stick
esp32:
board: m5stick-c
framework:
type: arduino
# Enable logging
---
apiVersion: apps/v1
kind: Deployment
metadata:
creationTimestamp: null
labels:
io.kompose.service: octoprint-server
app: octoprint-server
name: octoprint-server
namespace: default
@proffalken
proffalken / octoprint-deployment.yaml
Last active September 13, 2023 13:35
Octoprint on k8s
apiVersion: apps/v1
kind: Deployment
metadata:
creationTimestamp: null
labels:
io.kompose.service: octoprint-server
name: octoprint-server
namespace: default
spec:
replicas: 1
@proffalken
proffalken / import_schedule.py
Created April 11, 2022 08:20
Import the schedule data from Network Rail
#!/usr/bin/env python
import sentry_sdk
import json
import os
import requests
import sys
from sqlalchemy import create_engine
from sqlalchemy.orm import sessionmaker
job "platform-jobs" {
datacenters = ["dc1"]
# system job, runs on all nodes
type = "system"
update {
min_healthy_time = "10s"
healthy_deadline = "5m"
progress_deadline = "10m"
auto_revert = true
}
@proffalken
proffalken / docker-loki.json
Created December 27, 2021 07:47
Vector, Loki, and Prometheus
// Be sure to follow the instructions at
// https://grafana.com/docs/loki/latest/clients/docker-driver/
// otherwise this will not work!
//
// Also, remember to remove these comments because JSON doesn't support them!
{
"data-root": "/mnt/docker",
"metrics-addr" : "10.231.1.21:9323",
"experimental" : true,
export OTEL_PYTHON_LOG_CORRELATION="true"
export OTEL_RESOURCE_ATTRIBUTES="service.name=otlptest, environment=test"
export OTEL_TRACES_EXPORTER="otlphttp"
export OTEL_EXPORTER_OTLP_ENDPOINT="https://otlphttp"
export OTEL_PYTHON_DJANGO_INSTRUMENT="True"
metadata {
definition (name: "OctoPrint", namespace: "OctoPrint", author: "MC", importUrl: "https://raw.githubusercontent.com/mikec85/hubitatdrivers/master/octoprint/OctoPrint.groovy") {
capability "Initialize"
capability "Switch"
capability "PresenceSensor"
attribute "state", "enum", ["Operational", "Printing", "Pausing","Paused", "Cancelling", "Error", "Offline"]
attribute "completion", "string"
attribute "printTimeLeft", "string"