Skip to content

Instantly share code, notes, and snippets.

View markusthoemmes's full-sized avatar

Markus Thömmes markusthoemmes

View GitHub Profile
@markusthoemmes
markusthoemmes / Hello.kt
Created June 3, 2017 12:51
A Kotlin based action for OpenWhisk
import com.google.gson.JsonObject
import com.github.salomonbrys.kotson.*
fun main(args : JsonObject): JsonObject {
val name = args["name"].string
return jsonObject(
"message" to "Hello $name!"
)
}
@markusthoemmes
markusthoemmes / Hello.kt
Created June 3, 2017 12:52
A Kotlin based action for OpenWhisk
import com.google.gson.JsonObject
fun main(args : JsonObject): JsonObject {
val name = args["name"].asString
val response = JsonObject()
response.addProperty("message", "Hello $name!")
return response
}
@markusthoemmes
markusthoemmes / build.groovy
Last active June 3, 2017 12:53
A gradle script to build Kotlin based projects.
buildscript {
ext.kotlin_version = '1.1.2-2'
repositories {
mavenCentral()
}
dependencies {
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
}
}
@markusthoemmes
markusthoemmes / .gitconfig
Last active August 20, 2018 19:56
Mac Setup
[user]
name = Markus Thömmes
email = [email protected]
[push]
default = matching
[alias]
pr = "!sh -c \"git fetch upstream pull/$1/head:pr-$1\" -"
update-fork = "!sh -c \"git fetch upstream; git rebase upstream/master; git push origin master\" -"
[core]
excludesfile = ~/.gitignore
@markusthoemmes
markusthoemmes / repro.yaml
Last active January 11, 2019 10:09
Istio graceful shutdown reproducer
apiVersion: v1
kind: Service
metadata:
name: test-service
spec:
ports:
- port: 8080
name: http
selector:
app: test

Profiling Knative Serving

Knative Serving allows for collecting runtime profiling data expected by the pprof visualization tool. Profiling data is available for the autoscaler, activator, controller, webhook and for the queue-proxy container which is injected into the user application pod. When enabled Knative serves profiling data on the default port 8008 through a web server.

Steps to get profiling data:

kind: ConfigMap
apiVersion: v1
metadata:
name: serverless-operator
data:
customResourceDefinitions: |-
- apiVersion: apiextensions.k8s.io/v1beta1
kind: CustomResourceDefinition
metadata:
@markusthoemmes
markusthoemmes / README.md
Last active April 16, 2020 10:08
HTTPS Proxy testing with mitmproxy

HTTPS Proxy testing with mitmproxy

Basic functionality test

  1. Get a machine to run mitmproxy. Anything that can get an IP will work.
  2. Download mitmproxy: wget https://snapshots.mitmproxy.org/5.0.1/mitmproxy-5.0.1-linux.tar.gz
  3. Unpack: tar -xf mitmproxy-5.0.1-linux.tar.gz
  4. Just run mitmproxy: ./mitmproxy --set block_global=false. Disabling block_global is important to allow any traffic.
  5. Get the relevant certificate: cat ~/.mitmproxy/mitmproxy-ca-cert.pem
  6. Try out it works: curl --proxy $IP:8080 --cacert mitmproxy-ca-cert.pem https://www.canihazip.com/s
@markusthoemmes
markusthoemmes / spoof.go
Created April 20, 2020 12:23
Basic Golang example for host spoofing on HTTP requests.
package main
import (
"context"
"fmt"
"io/ioutil"
"net"
"net/http"
)

Knative Serving release v0.15.0

Meta

Serving release artifact deprecations

serving.yaml and serving-cert-manager.yaml will be shipped for the last time in this release. They have been broken out into separate artifacts. Please refer to the current installation docs for guidance on how to install Knative Serving and its optional components.

Minimum supported Kubernetes version bumped to 1.16

As per the Kubernetes minimum version principle - our current minimum supported Kubernetes version is now 1.16.