Skip to content

Instantly share code, notes, and snippets.

@shrinandj
shrinandj / kubelet_instructions.txt
Created September 15, 2020 23:51
How to build Kubelet on OSX
# Based on https://docs.microsoft.com/en-us/virtualization/windowscontainers/kubernetes/compiling-kubernetes-binaries
$ go get -d k8s.io/kubernetes
$ cd $GOPATH/src/k8s.io/kubernetes
$ KUBE_BUILD_PLATFORMS=linux/amd64 build/run.sh make WHAT=cmd/kubelet
# The kubelet binary should be available in the _output directory.
$ file ./_output/dockerized/bin/linux/amd64/kubelet
./_output/dockerized/bin/linux/amd64/kubelet: ELF 64-bit LSB executable, x86-64, version 1 (SYSV), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, for GNU/Linux 3.2.0, Go BuildID=685tDE6b18t59NTs0Yvu/HaVZXqeIaIeCf2bjNCsn/l-M8UipSPrDcTHDIc19W/70m-t0L12ydwEeqbR2Qc, BuildID[sha1]=bcacb0edf6ee068f1a53aa537550be33386b779b, not stripped
@shrinandj
shrinandj / vol_driver
Created July 17, 2017 17:41
Kubernetes v1.6 flex volume driver
#!/bin/bash
# Copyright 2015 The Kubernetes Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
@shrinandj
shrinandj / shattered_check.py
Last active February 23, 2017 23:56
Python script to verify #shattered
#!/usr/bin/python2.7
import urllib2
import hashlib
# Get shattered-1
response = urllib2.urlopen('https://shattered.it/static/shattered-1.pdf')
shattered_1 = response.read()
# Get shattered-2
@shrinandj
shrinandj / BaseHttpCommandExecutorServiceIntegrationTest
Last active August 29, 2015 14:04
Test Multiple HTTP connections
@Test
public void testDelete() throws Exception {
int numRequests = 4000;
MockWebServer server = new MockWebServer();
server.useHttps(sslContext.getSocketFactory(), false);
server.play();
server.setDispatcher(new GlobalChecksRequestDispatcher());
for (int i = 0; i < numRequests; i++) {
server.enqueue(new MockResponse().setResponseCode(204));
}