Skip to content

Instantly share code, notes, and snippets.

@tomdavidson
tomdavidson / qemu-run.sh
Created April 8, 2025 02:11
Run a vm kata style but with a full kernel.
#!/bin/bash
# qemu-run - A Podman-like interface for QEMU
#
# podman run --rm \
# --runtime=kata \
# -v "$PWD:/mnt/host:Z" \
# alpine sh -c \
# 'ls -la /mnt/host > /mnt/host/ls.txt'
#
# ./qemu-run alpine -v "$PWD:/mnt/host" 'ls -la /mnt/host > /mnt/host/ls.txt'
@tomdavidson
tomdavidson / nspawn-devenv.nix
Created April 10, 2025 01:52
devenv.nix with systemd-nspawn container backed shell
{ pkgs, lib, config, ... }: {
# Basic devenv configuration - add your project packages here
packages = [
pkgs.systemd
pkgs.debootstrap
# Add other packages your project needs
];
# Define container settings with automatic unique naming
env = {
@tomdavidson
tomdavidson / qemu-devenv.nix
Created April 10, 2025 04:49
qemu-devenv.nix
{ pkgs, lib, config, ... }: {
inputs.microvm.url = "github:astro/microvm.nix";
packages = [
pkgs.qemu
pkgs.microvm
pkgs.utillinux # For kvm-ok check
];
env = {
@tomdavidson
tomdavidson / bash-ui.sh
Created February 12, 2026 02:22
Few bash UI functions.
#!/bin/bash
# ============================================
# UI Library - User Interface Functions
# No dependencies - pure output/input
# ============================================
# Color codes
readonly COLOR_RESET='\033[0m'
readonly COLOR_RED='\033[0;31m'