Let's look at some basic kubectl output options.
Our intention is to list nodes (with their AWS InstanceId) and Pods (sorted by node).
We can start with:
kubectl get no
go_gc_duration_seconds | haproxy_backend_active_servers | |
go_gc_duration_seconds_count | haproxy_backend_backup_servers | |
go_gc_duration_seconds_sum < | |
go_goroutines < | |
go_info < | |
go_memstats_alloc_bytes < | |
go_memstats_alloc_bytes_total < | |
go_memstats_buck_hash_sys_bytes < | |
go_memstats_frees_total < | |
go_memstats_gc_cpu_fraction < |
# HELP haproxy_process_nbthread Configured number of threads. | |
# TYPE haproxy_process_nbthread gauge | |
haproxy_process_nbthread 4 | |
# HELP haproxy_process_nbproc Configured number of processes. | |
# TYPE haproxy_process_nbproc gauge | |
haproxy_process_nbproc 1 | |
# HELP haproxy_process_relative_process_id Relative process id, starting at 1. | |
# TYPE haproxy_process_relative_process_id gauge | |
haproxy_process_relative_process_id 1 | |
# HELP haproxy_process_start_time_seconds Start time in seconds. |
# Dockerfile for ffmpeg with pretty much support for everything as per: | |
# https://trac.ffmpeg.org/wiki/CompilationGuide/Centos | |
# includes codecs with weird licensing like MP3 and AAC. | |
# | |
FROM fedora | |
MAINTAINER Ross Timson <ross@rosstimson.com> | |
# Install build requirements. | |
RUN dnf install -y autoconf automake cmake freetype-devel gcc gcc-c++ git libtool make mercurial nasm pkgconfig zlib-devel |
This simple script will take a picture of a whiteboard and use parts of the ImageMagick library with sane defaults to clean it up tremendously.
The script is here:
#!/bin/bash
convert "$1" -morphology Convolve DoG:15,100,0 -negate -normalize -blur 0x1 -channel RBG -level 60%,91%,0.1 "$2"
// Just before switching jobs: | |
// Add one of these. | |
// Preferably into the same commit where you do a large merge. | |
// | |
// This started as a tweet with a joke of "C++ pro-tip: #define private public", | |
// and then it quickly escalated into more and more evil suggestions. | |
// I've tried to capture interesting suggestions here. | |
// | |
// Contributors: @r2d2rigo, @joeldevahl, @msinilo, @_Humus_, | |
// @YuriyODonnell, @rygorous, @cmuratori, @mike_acton, @grumpygiant, |
My efforts to port http://www.youtube.com/watch?v=f6kdp27TYZs to Clojure.
func boring(msg string) {
for i := 0; ; i++ {
fmt.Println(msg, i)
time.Sleep(time.Second)
}
import unittest | |
import collections | |
tests = collections.defaultdict(list) | |
class BddLoader(object): | |
def loadTestsFromModule(self, module): | |
return unittest.TestSuite(tests[module.__name__]) |
package main | |
import ( | |
"crypto/aes" | |
"crypto/cipher" | |
"fmt" | |
) | |
func EncryptAESCFB(dst, src, key, iv []byte) error { | |
aesBlockEncrypter, err := aes.NewCipher([]byte(key)) |
-- show running queries (pre 9.2) | |
SELECT procpid, age(clock_timestamp(), query_start), usename, current_query | |
FROM pg_stat_activity | |
WHERE current_query != '<IDLE>' AND current_query NOT ILIKE '%pg_stat_activity%' | |
ORDER BY query_start desc; | |
-- show running queries (9.2) | |
SELECT pid, age(clock_timestamp(), query_start), usename, query | |
FROM pg_stat_activity | |
WHERE query != '<IDLE>' AND query NOT ILIKE '%pg_stat_activity%' |