Skip to content

Instantly share code, notes, and snippets.

@stevenctl
stevenctl / readme.md
Last active July 2, 2024 15:45
Static PROXY Waypoint

PROXY Protocol Waypoint

This sample demonstrates a non-Istio waypoint defined using static Envoy config.

  1. Create a kind cluster
kind create cluster
@stevenctl
stevenctl / bot.py
Created March 21, 2019 06:16
Python Selenium Reusable Browser Session
# Sometimes I have some tedious thing to do like data entry
# Sometimes I script that tedious thing using selenium
# Sometimes I have to login to something to enter that data
# This allows you to rerun your script using the same session
from selenium import webdriver
from selenium.webdriver.chrome.options import Options
import os
SELENIUM_SESSION_FILE = './selenium_session'
@stevenctl
stevenctl / fix_mixamo_root.py
Created November 25, 2023 23:50
Fix Mixamo Root Bone
import bpy
bl_info = {
"name": "Mixamo Root Fixer",
"description": "Moves location xz from mixamo hips to root bone",
"author": "Steven Landow",
"version": (1, 0),
"blender": (3, 6, 0),
"category": "Animation",
@stevenctl
stevenctl / heightmap_world_uv.gdshader
Created July 26, 2023 07:34
Got a combo heightmap (deep PoM) and world UV situtation working
shader_type spatial;
render_mode unshaded;
uniform float uvScale = 1.0;
uniform float blendSharpness;
uniform sampler2D textureMap : source_color;
uniform sampler2D normalMap : hint_normal;
uniform float normalScale = 1.0;
package crdclient
func TestGenMergePatch(t *testing.T) {
existing := &clientnetworkingv1alpha3.WorkloadEntry{
ObjectMeta: metav1.ObjectMeta{
Name: "foo-we",
Namespace: "ns",
Labels: map[string]string{
"oldlabel": "oldvalue",
},
# $ limactl shell docker docker run -it -v $HOME:$HOME --rm alpine
# To run `docker` on the host (assumes docker-cli is installed):
# $ export DOCKER_HOST=$(limactl list docker --format 'unix://{{.Dir}}/sock/docker.sock')
# $ docker ...
# This example requires Lima v0.8.0 or later
images:
- location: "https://cloud-images.ubuntu.com/releases/22.04/release/ubuntu-22.04-server-cloudimg-arm64.img"
arch: "aarch64"
@stevenctl
stevenctl / delve-pilot.md
Last active January 20, 2023 20:07
Debugging Pilot in K8S

Debugging Pilot with Delve

First build pilot with GCFLAGS="all=-n -l":

GCFLAGS="all=-N -l" HUB=docker.io/slandow TAG=slandow BUILD_IN_CONTAINER=1 make docker.pilot

Then we can wrap that image in one that includes delve:

@stevenctl
stevenctl / index.html
Last active October 16, 2022 18:37
autumn palette
<html>
<div style="height: 100%; align-items: stretch; display: flex; flex-direction: column-reverse;">
<div onclick="copyColor(this)" class="hoverable my_black" style="flex: 1; "></div>
<div onclick="copyColor(this)" class="hoverable my_gray0" style="flex: 1; "></div>
<div onclick="copyColor(this)" class="hoverable my_gray1" style="flex: 1; "></div>
<div onclick="copyColor(this)" class="hoverable my_gray2" style="flex: 1; "></div>
<div onclick="copyColor(this)" class="hoverable my_gray3" style="flex: 1; "></div>
<div onclick="copyColor(this)" class="hoverable my_gray4" style="flex: 1; "></div>
<div onclick="copyColor(this)" class="hoverable my_gray5" style="flex: 1; "></div>
@stevenctl
stevenctl / README.md
Last active October 10, 2022 06:14
Socket Encoding

Allows encoding a small image with a limited number of colors into an integer.

The bit-width of a pixel in the image is ceil(log2(n_colors)).

The bit-width of a socket image int is pixel-bit-width * size^2)

This python implementation doesn't concern itself with what the bit-width of the entire integer is. Real implementations care. This is determined by the image size. I'm assuming all images are square. When I say the size is "4" I really mean "4x4"). An image with size 4 with 4 possible colors would have 16 pixels and each pixel requires 2 bytes. This means we need a 32 bit int to hold our image,

@stevenctl
stevenctl / kind-cluster.yaml
Created September 1, 2022 19:20
istio kind setup
kind: Cluster
apiVersion: kind.x-k8s.io/v1alpha4
name: istio-localdev
containerdConfigPatches:
- |-
[plugins."io.containerd.grpc.v1.cri".registry.mirrors."localhost:5000"]
endpoint = ["http://kind-registry:5000"]
nodes:
- role: control-plane
- role: worker