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
# vim: set ft=python: | |
# see the README at https://gist.github.com/phiresky/4bfcfbbd05b3c2ed8645 | |
# source: https://github.com/mpv-player/mpv/issues/2149 | |
# source: https://github.com/mpv-player/mpv/issues/566 | |
# source: https://github.com/haasn/gentoo-conf/blob/nanodesu/home/nand/.mpv/filters/mvtools.vpy | |
import vapoursynth | |
core = vapoursynth.get_core() |
Prototype code for quickly reading the values of all CPU Performance Monitoring Counters from Lua.
Uses dynasm to generate the routine at runtime based on the capabilities of the running CPU.
dynasm: https://github.com/luapower/dynasm/blob/master/dynasm.md
import "github.com/julienschmidt/httprouter" | |
import "net/http" | |
func doRequest(method, uri string, body *bytes.Buffer, handle httprouter.Handle) (*httptest.ResponseRecorder, error) { | |
resp := httptest.NewRecorder() | |
req, err := http.NewRequest(method, uri, body) | |
if err != nil { | |
return nil, err | |
} |
open Lwt | |
let block_size = 256 * 4096 | |
let ifd = Lwt_unix.stdin | |
let ofd = Lwt_unix.stdout | |
let print spd = | |
try_lwt | |
Lwt_io.eprintf "%s\r" (Speed.to_string spd) | |
with Speed.Undefined -> return_unit |
# Key considerations for algorithm "RSA" ≥ 2048-bit
openssl genrsa -out server.key 2048
# Key considerations for algorithm "ECDSA" ≥ secp384r1
# List ECDSA the supported curves (openssl ecparam -list_curves)
Each of these commands will run an ad hoc http static server in your current (or specified) directory, available at http://localhost:8000. Use this power wisely.
$ python -m SimpleHTTPServer 8000
# | |
# Add Google Analytics tracking code to HTML response | |
# | |
# Usage: | |
# set $tracking_id 'UA-12345678-9'; | |
# include incl/analytics.conf; | |
# | |
# It needs nginx compiled with option --with-http_sub_module. | |
# Uses optimized GA code from: http://mathiasbynens.be/notes/async-analytics-snippet | |
# |
/* | |
* Copyright © 2012 Philipp Eichhorn | |
* | |
* 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: | |
* |