Skip to content

Instantly share code, notes, and snippets.

@ganeshmaharaj
ganeshmaharaj / get-kube-info-with-curl.md
Last active June 15, 2021 20:59
Access Kube API with curl

Containerd runtimes

A runtime in containerd does not stand at the runc level, but at the platform one. There are separate Linux and Windows runtimes, and they register as plugins:

const (
	runtimeName    = "linux"
	configFilename = "config.json"

virtio is a kernel virtual bus. From drivers/virtio/virtio.c:

static struct bus_type virtio_bus = {
	.name  = "virtio",
	.match = virtio_dev_match,
	.dev_groups = virtio_dev_groups,
	.uevent = virtio_uevent,
	.probe = virtio_dev_probe,
	.remove = virtio_dev_remove,
@smoser
smoser / .gitignore
Last active April 1, 2024 07:38
cloud-init ubuntu nocloud example with network config
*.img
*.raw
@devimc
devimc / hotplug.md
Last active April 14, 2021 01:59
Hot plugging devices

Hot plugging devices using ACPI, SHPC and native

This gist is to show different ways to hot plug devices in a Virtual Machine

Set up the environment

Create a device mapper

dd if=/dev/zero of=devmap.img count=1 bs=50M
# Clear Linux install configuration
#
# /dev/sda1 /
# /dev/sda2 /boot
# /dev/sda3 (reserved partition for devicemapper)
#
DEVICE="/dev/sda3"
echo "Stopping docker"
@sameo
sameo / hyper.md
Last active September 6, 2017 18:39

Install

# Tested on Ubuntu 16.04
# Install hyperd, hyperctl, Hyper's kernel and guest image, and their QEMU binary
wget https://hypercontainer-download.s3-us-west-1.amazonaws.com/qemu-hyper/qemu-hyper_2.4.1-1_amd64.deb 
wget https://hypercontainer-download.s3-us-west-1.amazonaws.com/0.8/ubuntu/hypercontainer_0.8.1-1_amd64.deb                   
wget https://hypercontainer-download.s3-us-west-1.amazonaws.com/0.8/ubuntu/hyperstart_0.8.1-1_amd64.deb 

dpkg -i qemu-hyper_2.4.1-1_amd64.deb
@amshinde
amshinde / gist:dfec8265db5571754b4183ed23297f05
Last active August 19, 2022 01:09
Hotplugging cpu, memory and host devices to a running virtual machine with QMP
Hotplugging cpu:
Start QEMU with QMP socket available and with startup amount of CPUs less than maxcpus:
./qemu-system-x86_64 -qmp unix:/tmp/qmp-sock,server,nowait -smp 2,maxcpus=8
Connect to qmp socket and add cpu:
socat /tmp/qmp-sock -
{ "execute": "cpu-add", "arguments": { "id": 2 } }
Hotpluggable Cpu's can be queried as:
@egernst
egernst / k8s-play.md
Last active May 29, 2020 11:53
Clear Containers and CRIO and K8S build up

Get go 1.8.3:

wget https://storage.googleapis.com/golang/go1.8.3.linux-amd64.tar.gz
sudo tar -xvf go1.8.3.linux-amd64.tar.gz -C /usr/local/
mkdir -p $HOME/go/src
export GOPATH=$HOME/go
export PATH=$PATH:/usr/local/go/bin:$GOPATH/bin
go version
@egernst
egernst / cor-sriov-with-cnm-plugin.md
Last active December 8, 2017 23:04
COR edition: SRIO-V with Docker CNM plugin

Using a Docker CNM plugin to play with SRIO-V

This gist describes the setup necessary for testing SRIO-V based connectivity between two physical boxes which are each setup as described here, and directly connected via their respective SRIO-V enabled NICs.

Setup host system's packages

For this scenario, I'm setting up two Ubuntu 16.04 systems which have a SRIO-V enabled interface as well as a second port for accessing the SUT. To setup: