Skip to content

Instantly share code, notes, and snippets.


Hans Kristian Flaatten Starefossen

View GitHub Profile
max-rocket-internet /
Last active Jun 23, 2022
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) /
oliveratgithub / emojis.json
Last active Jul 3, 2022
Emoji-list with emojis, names, shortcodes, unicode and html entities [massive list]
View emojis.json
"emojis": [
{"emoji": "👩‍👩‍👧‍👧", "name": "family: woman, woman, girl, girl", "shortname": ":woman_woman_girl_girl:", "unicode": "1F469 200D 1F469 200D 1F467 200D 1F467", "html": "👩‍👩‍👧‍👧", "category": "People & Body (family)", "order": ""},
{"emoji": "👩‍👩‍👧‍👦", "name": "family: woman, woman, girl, boy", "shortname": ":woman_woman_girl_boy:", "unicode": "1F469 200D 1F469 200D 1F467 200D 1F466", "html": "👩‍👩‍👧‍👦", "category": "People & Body (family)", "order": ""},
{"emoji": "👩‍👩‍👦‍👦", "name": "family: woman, woman, boy, boy", "shortname": ":woman_woman_boy_boy:", "unicode": "1F469 200D 1F469 200D 1F466 200D 1F466", "html": "👩‍👩‍👦‍👦", "category": "People & Body (family)", "order": ""},
{"emoji": "👨‍👩‍👧‍👧", "name": "family: man, woman, girl, girl", "shortname": ":man_woman_girl_girl:", "unicode": "1F468 200D 1F469 200D 1F467 200D 1F467", "html": "👨‍👩&z
ssplatt / kube-proxy-amd64.yml
Created Dec 5, 2017
mixed arch (arm and amd64, raspberry pi and pc) kubernetes cluster kube-proxy daemonset configs
View kube-proxy-amd64.yml
apiVersion: extensions/v1beta1
kind: DaemonSet
creationTimestamp: null
generation: 1
k8s-app: kube-proxy-amd64
name: kube-proxy-amd64
selfLink: /apis/extensions/v1beta1/namespaces/kube-system/daemonsets/kube-proxy-amd64
namespace: kube-system
EnzoMartin / Dockerfile
Last active Nov 10, 2021
Building & using Node Alpine docker image
View Dockerfile
# Runtime image
# Following
FROM node:7.7-alpine
# Add tini
RUN apk add --no-cache tini
ENTRYPOINT ["/sbin/tini", "--"]
WORKDIR /usr/src/app/
View kubernetes deployment
set -e
# Those should be JENKINS vars
# Template can be copied from deploy.tmp.yaml to update jenkins var
iler / Dockerfile
Last active Aug 2, 2019
Nginx + ngx_pagespeed on Alpine Linux
View Dockerfile
FROM alpine:3.3
RUN build_pkgs="build-base linux-headers openssl-dev pcre-dev wget zlib-dev subversion git patch bash gperf python" && \
runtime_pkgs="ca-certificates openssl pcre zlib" && \
apk --no-cache --update add ${build_pkgs} ${runtime_pkgs} && \
mkdir -p /tmp/src/mod_pagespeed/src && \
cd /tmp/src && \

Processing JSON using jq

jq is useful to slice, filter, map and transform structured json data.

Installing jq

On Mac OS

brew install jq

bastman /
Created Mar 31, 2016
docker cleanup guide: containers, images, volumes, networks

Docker - How to cleanup (unused) resources

Once in a while, you may need to cleanup resources (containers, volumes, images, networks) ...

delete volumes

// see:

$ docker volume rm $(docker volume ls -qf dangling=true)

$ docker volume ls -qf dangling=true | xargs -r docker volume rm

gomfunkel /
Last active Jan 4, 2022
Elgato Eve HomeKit Services & Characteristics

Elgato Eve HomeKit Services & Characteristics

A work in progress collection of proprietary and as of yet undocumented HomeKit characteristics and their UUIDs used by Elgato Eve.

This list is not including all Eve accessories available and some services and characteristics still make no sense to me. If you have anything to contribute, please leave a comment. There is no guarantee that the information listed below is correct.

Elgato Eve Energy (Firmware Revision 1.3.1;466)

Service - Characteristic UUID R W Type Description
0XDE57 /
Last active Jun 27, 2022
Firefox about:config privacy settings


about:config settings to harden the Firefox browser. Privacy and performance enhancements.
To change these settings type 'about:config' in the url bar. Then search the setting you would like to change and modify the value. Some settings may break certain websites from functioning and rendering normally. Some settings may also make firefox unstable.

I am not liable for any damages/loss of data.

Not all these changes are necessary and will be dependent upon your usage and hardware. Do some research on settings if you don't understand what they do. These settings are best combined with your standard privacy extensions (HTTPS Everywhere, NoScript/Request Policy, uBlock origin, agent spoofing, Privacy Badger etc), and all plugins set to "Ask To Activate".