Skip to content

Instantly share code, notes, and snippets.

View jsturtevant's full-sized avatar
💻
right clicking and viewing the source

James Sturtevant jsturtevant

💻
right clicking and viewing the source
View GitHub Profile
@jsturtevant
jsturtevant / launch.json
Last active April 18, 2023 16:17
rust debugging configurations
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"name": "(skeleton) Launch",
"type": "cppvsdbg",
"request": "launch",
func windowsCpuAndMemoryStats(stats *types.Metric) (*runtime.WindowsContainerStats, error) {
var cs runtime.WindowsContainerStats
if stats != nil {
s, err := typeurl.UnmarshalAny(stats.Data)
if err != nil {
return nil, fmt.Errorf("failed to extract container metrics: %w", err)
}
wstats := s.(*wstats.Statistics).GetWindows()
if wstats == nil {
return nil, fmt.Errorf("windows stats is empty")
var td TrustDomain
func BenchmarkGetTrustDomains(b *testing.B) {
m := &Manager{
signingIssuer: &issuer{TrustDomain: "cluster.local"},
validatingIssuer: &issuer{TrustDomain: "cluster.local"},
}
var t TrustDomain
b.ReportAllocs()
for n := 0; n < b.N; n++ {

apiVersion: v1 kind: Pod metadata: name: hostdir-linux spec: containers:

  • name: test image: radial/busyboxplus:curl command:
  • sleep

after installing wireshark

mkdir -force C:\tools\wireshark New-Item -ItemType SymbolicLink -Path "c:\tools\wireshark\wireshark" -Target "C:\Program Files\Wireshark\wireshark.exe"

in wsl

export PATH="$PATH:/mnt/c/tools/wireshark"

@jsturtevant
jsturtevant / certificates.md
Last active August 25, 2022 21:10
spiffe-spire research