Skip to content

Instantly share code, notes, and snippets.

diff --git a/nixos/modules/system/etc/build-composefs-dump.py b/nixos/modules/system/etc/build-composefs-dump.py
index fe739a621ec4..42287ea35842 100644
--- a/nixos/modules/system/etc/build-composefs-dump.py
+++ b/nixos/modules/system/etc/build-composefs-dump.py
@@ -1,5 +1,3 @@
-#!/usr/bin/env python3
-
"""Build a composefs dump from a Json config
See the man page of composefs-dump for details about the format:
// This code was autogenerated with `dbus-codegen-rust `, see https://github.com/diwic/dbus-rs
use dbus as dbus;
#[allow(unused_imports)]
use dbus::arg;
use dbus::blocking;
pub trait OrgFreedesktopDBusPeer {
fn ping(&self) -> Result<(), dbus::Error>;
fn get_machine_id(&self) -> Result<String, dbus::Error>;
}
@Mic92
Mic92 / configuration.nix
Last active September 19, 2024 11:28
simpleUefiSystemdBoot
{ config, lib, pkgs, modulesPath, ... }:
{ imports =
[ ./hardware-configuration.nix
<nixpkgs/nixos/modules/testing/test-instrumentation.nix>
];
networking.hostName = "thatworked";
documentation.enable = false;
package main
import (
"encoding/json"
"fmt"
"go/ast"
"go/parser"
"go/token"
"log"
"os"
#!/usr/bin/env bash
set -xeuo pipefail
SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
# shellcheck disable=SC1090
source "$SCRIPT_DIR/env.sh"
: "${host:?}"
: "${ssh_user:=root}"
9 1 0x01 147 39984 2088515013 55466767689355
name type data
hits 4 227098528
iohits 4 162963
misses 4 1148629
demand_data_hits 4 48027529
demand_data_iohits 4 659
demand_data_misses 4 267582
demand_metadata_hits 4 178122149
demand_metadata_iohits 4 4992
# Containers
General introduction to containers/namespaces/cgroups (40min): https://www.youtube.com/watch?v=GMs3kLteZvk
Slides: https://github.com/ls1-adv-sys-prog-course/docs/blob/main/slides/01-containers.pdf
Assignment explained (10min): https://www.youtube.com/watch?v=INyb4Rj073U
## Intro
@Mic92
Mic92 / 0_usage.md
Last active March 8, 2024 13:43
Disko impure image script example

First generate the image script:

$ nix build .#nixosConfigurations.myhost.config.system.build.diskoImagesScript

Next we build the image:

$ sudo ./result --build-memory 2048
@Mic92
Mic92 / scrape-prs.py
Created October 22, 2023 05:57
Scrape all nixpkgs pull requests
#!/usr/bin/env python3
import http.client
import json
import os
import time
import urllib.parse
import urllib.request
from pathlib import Path
from typing import Any