Skip to content

Instantly share code, notes, and snippets.

@mcastelino
mcastelino / README.md
Created December 13, 2021 20:48 — forked from smoser/README.md
qemu to linux mapping of smbios / dmi information

Mappings for DMI/SMBIOS to Linux and dmidecode

Information can be put into dmi tables via some qemu-system hosts (x86_64 and aarch64). That information is exposed in Linux under /sys/class/dmi/id and can be read with dmidecode. The names are very annoyingly inconsistent. The point of this doc is to map them.

Mappings

Example qemu cmdline:

qemu-system-x86_64 -smbios type=<type>,field=value[,...]

qemu-system-x86_64 -smbios type=0,vendor=superco,version=1.2.3
@mcastelino
mcastelino / .gitignore
Created May 21, 2021 16:49 — forked from smoser/.gitignore
cloud-init ubuntu nocloud example with network config
*.img
*.raw
@mcastelino
mcastelino / acyclic_generic.go
Last active March 31, 2021 03:37
Golang Generics Acyclic Function Graph
package main
import (
"fmt"
)
// Data that flows through the processing pipeline
type Data[T any] struct {
Type string
Path string
@mcastelino
mcastelino / acyclic.go
Last active March 30, 2021 23:28
Golang: Create a Acyclic function graph
package main
import (
"fmt"
)
// Data that flows through the processing pipeline
type Data struct {
Type string
Data string
@mcastelino
mcastelino / jmx-exporter-kafka.md
Created January 31, 2021 20:42
Setting up JMX Exporter to Get critical Java Metrics - Kafka
@mcastelino
mcastelino / prom_relabel.md
Created December 14, 2020 21:50
Kubernetes Pod Monitors & Re-Labeling

Kubernetes Pod Monitors & Re-Labeling

The Prometheus operator offers a simple method to scrape metrics from any Pod. However in many cases the Pod itself is not what you are monitoring but the Pod is used to expose metrics that relate to the Node. In such cases what the user cares about is the Node on which the Pod runs and not the Pod itself.

By default when using PodMonitor all the time series data will have the instance set to the Pod's name. Also the Pod or the Daemon set that the Pod was part of may be deleted, redeployed multiple times over the lifetime of the node. This means that the user will need to perform the mapping between the Pod and the Node on which it run.

However Prometheus allows the instance name (among other labels) to be relabeled in a very simple manner as shown below.

apiVersion: monitoring.coreos.com/v1
@mcastelino
mcastelino / el.yml
Created December 5, 2020 00:31
Simple Elastic Search docker compose
version: '2.2'
services:
es01:
image: docker.elastic.co/elasticsearch/elasticsearch:7.9.1
container_name: es01
environment:
- node.name=es01
- cluster.name=es-docker-cluster
- cluster.initial_master_nodes=es01
- bootstrap.memory_lock=true
@mcastelino
mcastelino / prometheus_fluentd_pod_monitor.md
Created February 3, 2020 23:33
Prometheus - POD Monitor for Fluentd
---
apiVersion: monitoring.coreos.com/v1
kind: PodMonitor
metadata:
  name: fluentd-es
  labels:
    k8s-app: fluentd-es
spec:
 selector:
@mcastelino
mcastelino / pi-hole-unifi-cloud-key.md
Last active September 24, 2022 07:33
How to upgrade Unifi Cloud Key 2 Firmware with Pi Hole

Last verified with

    Pi-hole v5.1.2 Web Interface v5.1.1 FTL v5.2
    Cloud Key firmware UCKG2.apq8053.v1.1.13.818cc5f.200430.0938

Instructions

  • Change all your networks to use 1.1.1.1 or some other upstream DNS so that you still have DNS resolution working once the firmware upgrade completes
    • Alternately, setup all your networks to have a secondary upstream DNS. While not ideal, will help with a seamless update process
  • Upgrade the firmware on the cloud-key
@mcastelino
mcastelino / fc_ci_kata.md
Last active July 10, 2019 17:50
Running firecracker CI
export KATA_DEV_MODE="false"
export KATA_HYPERVISOR="firecracker"
export CI="true"
export CI_JOB="FIRECRACKER"
export RUNTIME="kata-runtime"
export PATH=${GOPATH}/bin:${PATH}
DEBUG=true .ci/setup.sh
sudo -E PATH=$PATH make docker