Value | Color |
---|---|
\e[0;30m | Black |
\e[0;31m | Red |
\e[0;32m | Green |
\e[0;33m | Yellow |
\e[0;34m | Blue |
\e[0;35m | Purple |
Discover gists
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import asyncio | |
import os | |
import random | |
import hashlib | |
from datetime import datetime | |
from typing import Dict, List, Type | |
from dotenv import load_dotenv | |
from loguru import logger | |
from pydantic import BaseModel |
This document describes a process to quickly setup a Linux VM for testing or kernel development.
The VM requires no disk image, instead it boots off a directory on the host (using virtiofs). This is:
- more performant (no FS-in-FS overhead)
- more convenient for experiments (both host and guest can modify files concurrently)
- safer (no corruption* in case of kernel panic)
- easier to set up
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
######################### | |
# # | |
# Initializing # | |
# # | |
######################### | |
## | |
# You should add all tools as composer dependencies or change this path |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Install K3S | |
curl -sfL https://get.k3s.io | sh - | |
# Copy k3s config | |
mkdir $HOME/.kube | |
sudo cp /etc/rancher/k3s/k3s.yaml $HOME/.kube/config | |
sudo chmod 644 $HOME/.kube/config | |
# Check K3S | |
kubectl get pods -n kube-system |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- install the two shellscripts into the appropriate places under /etc/initramfs-tools | |
- run update-initramfs | |
- put "overlay=yes" on the kernel command line | |
- reboot | |
With the overlay in place, the real root is mounted readonly on /ro. | |
Only the root fs is changed, other filesystems are mounted normally. | |
Remove "overlay=yes" (or change it to something other than yes) and reboot to go back to readwrite. | |
(This probably means that you want the commandline config to live somewhere other than on the root fs, e.g. under /boot) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import axios, { AxiosError, AxiosResponse } from 'axios'; | |
import token from './somewhere'; | |
interface Todo { | |
id: string; | |
title: string; | |
} | |
interface User { | |
id: string; |
NewerOlder