Skip to content

Instantly share code, notes, and snippets.

Matthias Rampke matthiasr

Block or report user

Report or block matthiasr

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View gist:b50bb9fd0146d604bdde01e9de799ce1
$ kubectl --namespace mr-test exec -ti hostname-test bash
root@hostname-test:/# cat /etc/hosts
# Kubernetes-managed hosts file.
127.0.0.1 localhost
::1 localhost ip6-localhost ip6-loopback
fe00::0 ip6-localnet
fe00::0 ip6-mcastprefix
fe00::1 ip6-allnodes
fe00::2 ip6-allrouters
10.128.1.142 hostname-test
@matthiasr
matthiasr / LICENSE.md
Last active Aug 24, 2019
Exporting chef-client metrics to Prometheus
View LICENSE.md

The MIT License (MIT)

Copyright © 2017 SoundCloud Ltd.

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE

@matthiasr
matthiasr / out.txt
Created Oct 13, 2016
Kubernetes file permissions in tarball have changed
View out.txt
% for v in 1.3.5 1.3.6 1.3.7 1.3.8 1.4.0 1.4.1; do echo ========= $v ==========; curl -sSfL "https://github.com/kubernetes/kubernetes/releases/download/v${v}/kubernetes.tar.gz" | tar -O -zxf - kubernetes/server/kubernetes-server-linux-amd64.tar.gz | tar -tvzf -; done
========= 1.3.5 ==========
drwxr-xr-x 0 root root 0 Aug 11 20:35 kubernetes/
-rw-r--r-- 0 root root 3533536 Aug 11 20:35 kubernetes/LICENSES
-rw-r--r-- 0 root root 41933134 Aug 11 20:35 kubernetes/kubernetes-src.tar.gz
drwxr-xr-x 0 root root 0 Aug 11 20:35 kubernetes/server/
drwxr-xr-x 0 root root 0 Aug 11 20:35 kubernetes/server/bin/
-rw-r--r-- 0 root root 33 Aug 11 20:35 kubernetes/server/bin/federation-apiserver.docker_tag
-rw-r--r-- 0 root root 33 Aug 11 20:35 kubernetes/server/bin/federation-controller-manager.docker_tag
-rw-r--r-- 0 root root 104576512 Aug 11 20:35 kubernetes/server/bin/federation-apiserver.tar
View prometheus-1610.sh
#!/bin/sh
set -eufx
tmpdir=$(mktemp -d ./prometheus-1610.XXXX)
cd "${tmpdir}"
cleanup() {
set +e
@matthiasr
matthiasr / Makefile
Created Jan 13, 2016
Extract vendored kubernetes/kubernetes client library dependencies at build time
View Makefile
KUBERNETES_VERSION ?= v1.1.3
KUBERNETES_SOURCE_URL = https://github.com/kubernetes/kubernetes/archive/v$(KUBERNETES_VERSION).tar.gz
LOCAL_SOURCES := $(shell find local -type f)
.PHONY: prepare
prepare: vendor/k8s.io/kubernetes/.available vendor/k8s.io/kubernetes/.lifted_godeps $(LOCAL_SOURCES:local/%=vendor/%)
# Lift a source tree into the vendor tree, skipping Godeps
vendor/%/.available: build/$(KUBERNETES_VERSION)/%/.available
View keybase.md

Keybase proof

I hereby claim:

  • I am matthiasr on github.
  • I am matthiasr (https://keybase.io/matthiasr) on keybase.
  • I have a public key whose fingerprint is F46A 5FAA 9508 311D DBCC 403A 9A7D 111C AE60 D44B

To claim this, I am signing this object:

@matthiasr
matthiasr / gist:5805902
Created Jun 18, 2013
Translate from ss(8) to netstat(8) TCP state names (AWK dictionary)
View gist:5805902
translate["ESTAB"] = "ESTABLISHED";
translate["SYN-SENT"] = "SYN_SENT";
translate["SYN-RECV"] = "SYN_RECV";
translate["FIN-WAIT-1"] = "FIN_WAIT1";
translate["FIN-WAIT-2"] = "FIN_WAIT2";
translate["TIME-WAIT"] = "TIME_WAIT";
translate["UNCONN"] = "CLOSE";
translate["CLOSE-WAIT"] = "CLOSE_WAIT";
translate["LAST-ACK"] = "LAST_ACK";
translate["LISTEN"] = "LISTEN";
@matthiasr
matthiasr / bisect.sh
Created Jun 28, 2012
bisecting curl keepalive problem on DragonFly
View bisect.sh
#!/bin/sh
echo buildconf
./buildconf 2> /dev/null > /dev/null || exit 125
echo configure
./configure 2> /dev/null > /dev/null || exit 125
echo make
make 2> /dev/null > /dev/null || exit 125
echo Attempting to use the curl we just built ...
@matthiasr
matthiasr / bitrig_dmesg.txt
Created Jun 14, 2012
Bitrig bitrig.mr.local 0.1 GENERIC#1 i386
View bitrig_dmesg.txt
Bitrig 0.1-current (GENERIC) #1: Thu Jun 14 04:53:47 CDT 2012
root@i386b0.bitrig.org:/usr/src/sys/arch/i386/compile/GENERIC
master:483814b64bc90c4c8e64665bb1675467f74b6ec3
cpu0: Intel(R) Core(TM)2 Duo CPU L9400 @ 1.86GHz ("GenuineIntel" 686-class) 1.87 GHz
cpu0: FPU,V86,DE,PSE,TSC,MSR,PAE,MCE,CX8,APIC,SEP,MTRR,PGE,MCA,CMOV,PAT,PSE36,CFLUSH,MMX,FXSR,SSE,SSE2,NXE,LONG,SSE3,MWAIT,SSSE3,LAHF
real mem = 267907072 (255MB)
avail mem = 252002304 (240MB)
mainbus0 at root
bios0 at mainbus0: AT/286+ BIOS, date 06/23/99, BIOS32 rev. 0 @ 0xfc000, SMBIOS rev. 2.5 @ 0xe1000 (5 entries)
bios0: vendor innotek GmbH version "VirtualBox" date 12/01/2006
@matthiasr
matthiasr / zombifier.c
Created Apr 17, 2012
shouldn't create zombies
View zombifier.c
#include <stdlib.h>
#include <unistd.h>
#include <signal.h>
int main(int argc, char **argv) {
int pid = 0;
int i;
for( i = 300; i>0; i-- ) {
signal(SIGCHLD, SIG_IGN);
pid = fork();
You can’t perform that action at this time.