Skip to content

Instantly share code, notes, and snippets.

View jon's full-sized avatar

Jon Olson jon

View GitHub Profile
@jon
jon / bootstrap.sh
Last active June 2, 2024 05:02
Bootstrap Kubernetes-ready Node
#!/bin/bash
set -e
CONTAINERD_VERSION=${CONTAINERD_VERSION:-1.6.32}
RUNC_VERSION=${RUNC_VERSION:-1.1.12}
CNI_PLUGINS_VERSION=${CNI_PLUGINS_VERSION:-1.5.0}
KUBERNETES_VERSION=${KUBERNETES_VERSION:-1.30}
INSTALL_PREFIX=${INSTALL_PREFIX:-/usr/local}
CNI_BIN=${CNI_BIN:-/opt/cni/bin}
ARCH=$(uname -m |sed -e 's/x86_64/amd64/' -e 's/aarch64/arm64/')
@jon
jon / gist:fd018b220921a8f1b48743b0ba2d33c7
Created May 22, 2018 17:37
Kubernetes running a Kata Container on GCE with Nested Virtualization
Name: nginx-untrusted
Namespace: default
Node: kata/10.138.0.2
Start Time: Tue, 22 May 2018 17:29:25 +0000
Labels: <none>
Annotations: io.kubernetes.cri-o.TrustedSandbox=false
io.kubernetes.cri.untrusted-workload=true
kubectl.kubernetes.io/last-applied-configuration={"apiVersion":"v1","kind":"Pod","metadata":{"annotations":{"io.kubernetes.cri-o.TrustedSandbox":"false","io.kubernetes.cri.untrusted-workload":"true"},...
Status: Running
IP: 192.168.86.196
;;; jon-light-theme --- A light theme.
(deftheme jon-light
"Jon's Light Theme")
(custom-theme-set-variables
'jon-light
'(whitespace-space-after-tab-regexp (quote (" +\\( +\\)" . "\\( +\\) +")))
'(whitespace-style
(quote
(face trailing tabs lines-tail empty indentation spaces space-after-tab space-before-tab tab-mark space-mark))))
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>ANSIBlackColor</key>
<data>
YnBsaXN0MDDUAQIDBAUGKyxYJHZlcnNpb25YJG9iamVjdHNZJGFyY2hpdmVyVCR0b3AS
AAGGoKcHCBMZHSQoVSRudWxs1QkKCwwNDg8QERJcTlNDb21wb25lbnRzVU5TUkdCXE5T
Q29sb3JTcGFjZV8QEk5TQ3VzdG9tQ29sb3JTcGFjZVYkY2xhc3NPECkwLjAyNzQ1MDk4
MDM5IDAuMjExNzY0NzA1OSAwLjI1ODgyMzUyOTQgMU8QJzAuMDM5MzgwNzM2NjUgMC4x
@jon
jon / .tmux.conf
Last active September 15, 2019 17:42
set-option -g base-index 1
set-option -g default-terminal screen-256color
set-option -g set-clipboard on
set-option -g mouse on
bind-key -n M-1 select-window -t 1
bind-key -n M-2 select-window -t 2
bind-key -n M-3 select-window -t 3
@jon
jon / Solarized Dark (Sierra).terminal
Created April 22, 2017 17:02
Solarized Dark Theme with sRGB Colors for OS X Sierra
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>ANSIBlackColor</key>
<data>
YnBsaXN0MDDUAQIDBAUGKyxYJHZlcnNpb25YJG9iamVjdHNZJGFyY2hpdmVyVCR0b3AS
AAGGoKcHCBMZHSQoVSRudWxs1QkKCwwNDg8QERJcTlNDb21wb25lbnRzVU5TUkdCXE5T
Q29sb3JTcGFjZV8QEk5TQ3VzdG9tQ29sb3JTcGFjZVYkY2xhc3NPECkwLjAyNzQ1MDk4
MDM5IDAuMjExNzY0NzA1OSAwLjI1ODgyMzUyOTQgMU8QJzAuMDM5MzgwNzM2NjUgMC4x
import Hypervisor
class X86InitialState {
let registers: Dictionary<hv_x86_reg_t, UInt64> = [
HV_X86_RIP: 0xfff0,
HV_X86_RFLAGS: 0x2,
HV_X86_RAX: 0,
HV_X86_RCX: 0,
HV_X86_RDX: 0xf00,
HV_X86_RBX: 0,
@jon
jon / gist:4229137
Created December 6, 2012 22:39
Just how many UDP packets *can* I send?
#include <stdio.h>
#include <string.h>
#include <signal.h>
#include <netinet/in.h>
#include <sys/socket.h>
#include <sys/types.h>
#include <stdlib.h>
#include <unistd.h>
#include <sys/time.h>
* os-
* `y//`
* `oNy+
* .s:y
* /ooy:
* :oM:o-
* `od`y-
* os`m+:
* //+s.y-
* `/m.`y-
from sys import argv
from math import sqrt
maxval = int(argv.pop())
x = [ True ] * maxval
x[0] = False
for n in xrange(1, int(sqrt(maxval + 1)), 2):
if x[n - 1]:
m = n ** 2