Skip to content

Instantly share code, notes, and snippets.

@jenting
jenting / admin.yaml
Created May 20, 2024 22:20
Kubeadm ClusterRole
aggregationRule:
clusterRoleSelectors:
- matchLabels:
rbac.authorization.k8s.io/aggregate-to-admin: "true"
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
annotations:
rbac.authorization.kubernetes.io/autoupdate: "true"
labels:
@c9s
c9s / .env.local
Last active March 6, 2023 13:37
BBGO 之 MAX 交易所網格設定指南
# API Key 可以在以下頁面建立:
# https://max.maicoin.com/api_tokens/new
#
MAX_API_KEY=
MAX_API_SECRET=
@AlexCzar
AlexCzar / dropdown_tabbed_alacrity.sh
Last active July 22, 2021 17:04
Tabbed DropDown Alacritty for X11
#!/bin/sh
# Author: https://github.com/AlexCzar
# License: Apache 2.0
# This script can be used as a launcher for alacritty-inside-tabbed
# It monitors window manager events and when detects that tabbed has
# lost focus, script will minimize tabbed.
# If alacritty-in-tabbed is not running, it will launch it, if it is
# running but isn't focused, script will give it focus, if it is running
# and is focused, script will minimize it.
@fl64
fl64 / main.go
Created December 24, 2020 07:18
golang prometheus exporter example
package main
import (
"github.com/prometheus/client_golang/prometheus"
"github.com/prometheus/client_golang/prometheus/promhttp"
"log"
"math/rand"
"net/http"
"time"
@williamdes
williamdes / ACME-SH-docker-compose.md
Last active August 26, 2024 14:23 — forked from Dreamacro/ACMESH.md
acme.sh using docker-compose

How to use

$ docker compose -f acmesh.yaml up -d

.env

ACME_HOME_DIR=./acme.sh
@paskal
paskal / Readme.md
Last active June 17, 2024 09:09
How to set up the Percona Monitoring and Management (PMM) v2 with docker-compose

Set up PMM Server v2

Let's start by creating entry for server in docker-compose.yaml:

version: '2'
# version 2 of docker-compose is not "old" version, it's the actual version,
# see below for explanation:
# https://stackoverflow.com/a/53636006/961092
services:
@fernandoaleman
fernandoaleman / mysql2-catalina.md
Last active July 11, 2023 02:11
Install mysql2 on MacOS Catalina

Problem

Installing mysql2 gem errors on MacOS Catalina with MySQL 5.7.

Solution

Make sure openssl is installed on Mac via Homebrew.

brew install openssl
@prasathmani
prasathmani / GoDaddy-acme.sh
Created February 16, 2020 13:33
LetsEncrypt SSL cert on GoDaddy Shared Hosting using acme.sh
pre required SSH access
## Download and install acme.sh
acme.sh is a full implementation of a LetsEncrypt client but that doesn't depend on Python/pip/virtualenv/etc, and that doesn't require root -- exactly what we need, since we don't have root an a shared GoDaddy server, and we can't install new software outside of our home directory.
`curl https://get.acme.sh | sh`
Now log out and SSH back in so acme.sh's install is complete in every way (include the Bash alias).
##Get GoDaddy API Key
Visit `https://developer.godaddy.com/keys/`
@max-rocket-internet
max-rocket-internet / prom-k8s-request-limits.md
Last active March 30, 2025 02:08
How to display Kubernetes request and limit in Grafana / Prometheus properly

CPU: percentage of limit

A lot of people land when trying to find out how to calculate CPU usage metric correctly in prometheus, myself included! So I'll post what I eventually ended up using as I think it's still a little difficult trying to tie together all the snippets of info here and elsewhere.

This is specific to k8s and containers that have CPU limits set.

To show CPU usage as a percentage of the limit given to the container, this is the Prometheus query we used to create nice graphs in Grafana:

sum(rate(container_cpu_usage_seconds_total{name!~".*prometheus.*", image!="", container_name!="POD"}[5m])) by (pod_name, container_name) /
@onlyphantom
onlyphantom / docker-volumes.md
Last active January 23, 2025 17:01
Demystifying Docker Volumes for Mac and PC Users

Demystifying Docker Volumes for Mac and PC Users

  1. Docker runs on a Linux kernel

Docker can be confusing to PC and Windows users because many tutorials on that topic assume you're using a Linux machine.

As a Linux user, you learn that Volumes are stored in a part of the host filesystem managed by Docker, and that is /var/lib/docker/volumes. When you're running Docker on a Windows or Mac OS machine, you will read the same documentation and instructions but feel frustrated as that path don't exist on your system. This simple note is my answer to that.

When you use Docker on a Windows PC, you're typically doing one of these two things:

  • Run Linux containers in a full Linux VM (what Docker typically does today)