Skip to content

Instantly share code, notes, and snippets.

View jepio's full-sized avatar
🏠
Working from home

Jeremi Piotrowski jepio

🏠
Working from home
View GitHub Profile
@jepio
jepio / log-1.28
Last active March 8, 2024 11:00
Simple app to exercise AKS CoCo attestation
/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
+ echo /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
+ snpguest report --random /tmp/report.data /tmp/rand.data
+ cat /tmp/rand.data
+ snpguest display report /tmp/report.data
7de7067c4df49b95951aac0e968d861f
6c567ffdc5c00019a28851cb3e52635b
9c7d848fc79e7df29c7f0489d75d2a77
669f65cc9c31a939d7c1f71d1a2804d8
Attestation Report (1184 bytes):
This file has been truncated, but you can view the full file.
@jepio
jepio / deploy-snp-nginx-azure.sh
Last active February 22, 2024 14:34
Kata CoCo SNP on Azure
#!/bin/bash
# run as root
set -xe
systemctl disable --now unattended-upgrades
apt-get update
apt-get install -y apt-transport-https ca-certificates curl
mkdir -p /etc/apt/keyrings
@jepio
jepio / tdp-mmu-issue-repro.sh
Last active May 2, 2023 18:04
Gist to reproduce tdp_mmu root invalidation issue
#!/bin/bash
set -xe
fetch_flatcar ()
{
sudo apt-get update
sudo apt-get install -y qemu-system-x86 lbzip2
local channel=$1;
local version=${2:-current};
@jepio
jepio / stackcollapse-ftrace.py
Created March 8, 2023 13:27
post-process ftrace stacktraces to allow using as input for flamegraph
#!/usr/bin/env python3
import sys
import collections
def convert_stack(stack):
return ";".join(stack[::-1])
def process_file(file):
current_stack = []
for line in file:
@jepio
jepio / repro.sh
Last active December 9, 2022 15:26
nSVM on KVM+hyperv
#!/bin/bash
setup() {
sudo sed -ie 's/# deb-src/deb-src/' /etc/apt/sources.list
sudo apt-get update
sudo apt-get install -y make ccache gcc g++ python-is-python3
sudo apt-get build-dep -y qemu-system
sudo apt-get build-dep -y ovmf
export PATH="/usr/lib/ccache:$PATH"
@jepio
jepio / bisect-1.log
Last active December 9, 2022 11:17
bisect-nsvm-fail.log
git bisect start
# good: [f443e374ae131c168a065ea1748feac6b2e76613] Linux 5.17
git bisect good f443e374ae131c168a065ea1748feac6b2e76613
# bad: [4b0986a3613c92f4ec1bdc7f60ec66fea135991f] Linux 5.18
git bisect bad 4b0986a3613c92f4ec1bdc7f60ec66fea135991f
# bad: [25fd2d41b505d0640bdfe67aa77c549de2d3c18a] selftests: kselftest framework: provide "finished" helper
git bisect bad 25fd2d41b505d0640bdfe67aa77c549de2d3c18a
# good: [b4bc93bd76d4da32600795cd323c971f00a2e788] Merge tag 'arm-drivers-5.18' of git://git.kernel.org/pub/scm/linux/kernel/git/soc/soc
git bisect good b4bc93bd76d4da32600795cd323c971f00a2e788
# good: [9a225f81f540f65225e4b820e303d40d9e747e78] ice: Support GTP-U and GTP-C offload in switchdev
@jepio
jepio / issue-847-repro.sh
Last active November 10, 2022 10:47
issue-847-reproducer
#!/bin/bash
curl -sfL https://get.k3s.io | sh -
while ! sudo kubectl get node ; do
sleep 1
done
cat >manifest.yml <<EOF
apiVersion: apps/v1
kind: Deployment
@jepio
jepio / .dockerignore
Last active October 4, 2022 13:13
Some old stuff, don't know if it's of any use.
fake-sdk
@jepio
jepio / config.json
Last active March 4, 2022 09:52
Flatcar Container Linux config snippet to run container at boot
{"ignition":{"config":{},"security":{"tls":{}},"timeouts":{},"version":"2.3.0"},"networkd":{},"passwd":{},"storage":{},"systemd":{"units":[{"contents":"[Unit]\nAfter=docker.service\nRequires=docker.service\n\n[Service]\nRestart=always\nTimeoutStartSec=0\nExecStartPre=-/usr/bin/docker rm --force nginx\nExecStart=/usr/bin/docker run --rm --pull always --name nginx -p 80:80 nginx\nExecStop=-/usr/bin/docker stop nginx\n\n[Install]\nWantedBy=default.target\n","enabled":true,"name":"container.service"}]}}