Skip to content

Instantly share code, notes, and snippets.

View darox's full-sized avatar
🏠
Working from home

Dario Mader darox

🏠
Working from home
View GitHub Profile
@darox
darox / main.go
Last active December 19, 2023 13:01
Golang DPI
package main
import "fmt"
type Cleaner struct {
cleaningMethod string
tools []string
}
type CoffeeMachine struct {
@darox
darox / gist:1efb30a59cbebab3bdb06c8b56899baf
Created March 27, 2023 18:08
single-value-home-assistant
let widget = await createWidget();
if (!config.runsInWidget) {
await widget.presentSmall();
}
Script.setWidget(widget);
Script.complete();
ssh -p 53871 -i ~/.lima/_config/user -o NoHostAuthenticationForLocalhost=yes 127.0.0.1
@darox
darox / gist:1d49d2d7d59d9c5f1893ab16425e65b4
Created August 22, 2022 13:28
Kubernetes Certificate Expiry Check
#!/bin/bash
users=()
certs=()
for user in $(kubectl config view --raw --output json | jq -r '.users[] | "\(.name)"'); do
users+=($user)
done
for cert in $(kubectl config view --raw --output json | jq -r '.users[] | "\(.user."client-certificate-data")"'); do
certs+=($cert)
@darox
darox / gamer-pc-grafana-prometheus-dashboard
Last active December 31, 2020 12:38
This Grafana dashboard visualizes data from prometheus time series db which scrapes windows and nvidia gpu exporter on Windows. https://imgur.com/gallery/hQPJV93
{
"annotations": {
"list": [
{
"builtIn": 1,
"datasource": "-- Grafana --",
"enable": true,
"hide": true,
"iconColor": "rgba(0, 211, 255, 1)",
"name": "Annotations & Alerts",
#Written by Dario Mader
#Github https://github.com/darox
#Date: 22.08.2020
version: '3.8'
services:
grafana:
image: "grafana/grafana"
volumes:
- type: bind
server:
http_listen_port: 9080
grpc_listen_port: 0
# Positions
positions:
filename: /tmp/positions.yaml
# Loki Server URL
clients:
[Unit]
Description=Promtail service
After=network.target
[Service]
Type=simple
ExecStart=/usr/local/bin/promtail/promtail -config.file /usr/local/bin/promtail/config.yaml
[Install]
WantedBy=multi-user.target
auth_enabled: false
server:
http_listen_port: 3100
ingester:
lifecycler:
address: 127.0.0.1
ring:
kvstore:
store: inmemory
replication_factor: 1
hostname: server1.com
loglevel: warn
url: http://server1.com
logfile: /var/log/cloudflared.log