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 / minted.py
Last active September 18, 2023 13:58
Pandoc filter to use minted for syntax highlighting
#!/usr/bin/env python3
'''
Filter to wrap Pandoc's CodeBlocks into minted blocks when using latex.
Pandoc's `fence_code_attributes` can be used to provide:
- the language (first class)
- minted's argumentless options (following classes)
- minted's options with arguments (attributes)
'''
@jepio
jepio / ubuntu20-hyperv-enhanced-session.md
Last active September 4, 2023 06:54 — forked from milnak/ubuntu20-hyperv-enhanced-session.md
Verified way of enabling enhanced session in Hyper-V for Ubuntu 20

Setup Hyper-V enhanced session for Ubuntu 20

I couldn't find instructions that were 100% complete, so I put this together.

These instructions worked fine for me. Follow each step carefully.

Download Ubuntu 20.04 desktop

Download Ubuntu Desktop 20.04 LTS from here.

@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 / flatcar-install-k8s.sh
Last active February 6, 2023 03:43
Install k8s on flatcar
#!/bin/bash
set -xe
systemctl enable docker
modprobe br_netfilter
cat <<EOF | tee /etc/modules-load.d/k8s.conf
br_netfilter
EOF
@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