Skip to content

Instantly share code, notes, and snippets.

View liginity's full-sized avatar

liginity liginity

  • China
View GitHub Profile
@liginity
liginity / AGENTS.md
Created June 18, 2026 13:15
learn something about grub finding grub.cfg during boot with ai agent

GRUB2 Bootloader

This is the GRUB 2 bootloader (v2.14), maintained by the Free Software Foundation.

Architecture: how grub.cfg is discovered

The boot sequence for finding grub.cfg:

  1. grub_main() (grub-core/kern/main.c:304) — kernel entry
  2. grub_machine_init() — platform init (console, memory, disks)
@liginity
liginity / gradient-descent-on-linear-mapping.py
Last active July 3, 2023 01:58
use pytorch functionality to realize gradient descent on linear mapping (or linear regression).
"""use pytorch in this example.
input: dimension = (16,)
output: dimension = (4,)
matrix of linear mapping: dimension = (16, 4)
"""
import torch
from torch import nn