Skip to content

Instantly share code, notes, and snippets.

@KuRRe8
KuRRe8 / signal.md
Created March 31, 2026 05:31
Linux related knowledge

Signal

信号机制是Linux系统下进程间通信IPC的一种简单方式,本质是软件中断。(其他IPC还有管道,消息,共享内存,套接字)。 在C语境通过<signal.h>使用,在shell中通过kill或者快捷键发送信号。

大部分shell会在内部实现kill而不调用外部的/usr/bin/kill,这样的好处是Linux系统资源占满无法新建文件描述符时候,依旧能执行kill。

通过kill -l可以查看所有的信号。

终端控制类信号

@KuRRe8
KuRRe8 / term_img.md
Last active March 13, 2026 03:05
Terminal and Shell related.

Show image in modern Terminal

As we known, Terminal has the ability to show image file. The typical protocals are iTerm2, sixel, kitty, etc. But there are also terminals which could only handle ASCII art pics(gnome-terminal, Terminal.app on Mac and the native tty on Ubuntu Server). Here is a good reference for the platform-capable protocal.

Thanks to yazi, I've written a script to detect different terminals and invoke proper image function tool.

Code

show_company_logo() {
@KuRRe8
KuRRe8 / blk.md
Last active April 1, 2026 02:58
File System

硬盘和文件系统

硬盘访问逻辑与基本概念

下面概括机械硬盘/SSD在操作系统视角下的寻址与I/O基本面,便于后续讨论文件系统、分区和性能优化。

快速要点

统一寻址:现代系统用 LBA(Logical Block Addressing)按块编号访问,不再用CHS。 基本单元:逻辑扇区通常为 512B(或4K);物理扇区常见为 4K(Advanced Format)。 对齐很关键:分区与文件系统数据结构应按 4K(甚至1MB)对齐,避免读-改-写(RMW)罚时。 顺序优于随机:磁盘顺序访问远快于随机;队列与调度可缓解随机I/O开销。

@KuRRe8
KuRRe8 / 1.md
Last active April 7, 2026 09:18
网络相关

常见保留网段分类如下:

一、私有地址(RFC1918)

  • 10.0.0.0/8 A类,一般来说公司学校内网使用10段地址,可以容纳2^24地址1600万个
  • 172.16.0.0/12 B类,100万个
  • 192.168.0.0/16 C类,家庭使用,6.5万个,家庭路由器一般用24位掩码,也就是只有254个可用地址 用途:局域网、VPN、NAT。

二、环回与本地链路

@KuRRe8
KuRRe8 / 0_RL.md
Last active April 24, 2026 03:31
强化学习个人笔记

强化学习

强化学习(Reinforcement Learning, RL)是一种机器学习方法。它通过智能体(agent)在环境(environment)中采取动作(action),接收环境反馈的奖励(reward),并根据长期累计回报(return)来学习最优策略(policy)。

核心要素:

  • 状态(state, s):环境当前的描述。
  • 动作(action, a):智能体可选择的行为。
  • 奖励(reward, r):环境对动作的即时反馈。
  • 策略(policy, π):从状态到动作的映射。
@KuRRe8
KuRRe8 / ability.png
Last active June 17, 2025 06:31
Preferred os ide framework
ability.png
@KuRRe8
KuRRe8 / text.gif
Last active June 18, 2025 07:27
Welcome to my repo
text.gif
@KuRRe8
KuRRe8 / languages.gif
Last active June 17, 2025 06:30
Preferred languages
languages.gif
@KuRRe8
KuRRe8 / 00_intro.md
Last active June 4, 2025 21:57
common uv project files

UV

UV now is the popular python project manager.

Here I upload some common pyproject.toml files for quick reference/ copy/ init proj.

You need rename them back to pyproject.toml and use uv sync.

@KuRRe8
KuRRe8 / 00_intro.md
Last active April 21, 2026 02:07
windows related knowledge