Skip to content

Instantly share code, notes, and snippets.

View proffalken's full-sized avatar

Matthew Macdonald-Wallace proffalken

View GitHub Profile
@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"
@proffalken
proffalken / whitelist.txt
Last active April 2, 2020 09:27
whitelist
.google.com
gist.github.com
www.bbc.co.uk