Skip to content

Instantly share code, notes, and snippets.

@HackToHell
HackToHell / datawritten.sh
Created March 19, 2017 13:58
Script to get the amount of data written to the Samsung EVO 850 SSD
sudo smartctl -A /dev/sdb | awk '/^241/ { print "TBW: "($10 * 512) * 1.0e-12, "TB" } '
@HackToHell
HackToHell / Gopkg.lock
Created October 23, 2017 17:29
k8s errors
# This file is autogenerated, do not edit; changes may be undone by the next 'dep ensure'.
[[projects]]
name = "github.com/PuerkitoBio/purell"
packages = ["."]
revision = "0bcb03f4b4d0a9428594752bd2a3b9aa0a9d4bd4"
version = "v1.1.0"
[[projects]]
@HackToHell
HackToHell / main.py
Created May 1, 2019 12:20
Simple Mi Air Purifier 2 prometheus exporter
import os
from prometheus_client.core import GaugeMetricFamily, REGISTRY
from miio.airpurifier import AirPurifier
from prometheus_client.metrics_core import CounterMetricFamily
from prometheus_client.twisted import MetricsResource
from twisted.web.server import Site
from twisted.web.resource import Resource
from twisted.internet import reactor
@HackToHell
HackToHell / main.go
Created May 20, 2024 21:15
Split each block of terraform hcl2 into individual files
package main
import (
"flag"
"fmt"
"github.com/hashicorp/hcl/v2"
"os"
"path/filepath"
"github.com/hashicorp/hcl/v2/hclwrite"