Skip to content

Instantly share code, notes, and snippets.

@KuRRe8
KuRRe8 / term_img.md
Last active March 11, 2026 02: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 / 1.md
Created October 31, 2025 03:31

硬盘和文件系统

硬盘访问逻辑与基本概念

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

快速要点

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

@KuRRe8
KuRRe8 / 1.md
Last active January 22, 2026 06:25
网络相关

常见保留网段分类如下:

一、私有地址(RFC1918)

  • 10.0.0.0/8
  • 172.16.0.0/12
  • 192.168.0.0/16 用途:局域网、VPN、NAT。

二、环回与本地链路

@KuRRe8
KuRRe8 / 0_RL.md
Last active September 25, 2025 04:40
强化学习个人笔记

强化学习

强化学习(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 October 30, 2025 13:45
windows related knowledge
@KuRRe8
KuRRe8 / Flip7CardCounter.md
Last active November 28, 2025 21:04
Flip 7 card counter on BoardGameArena

Flip 7

A simple game that highly relies on luck.

Card counter

This is a script for TamperMonkey on Chrome/Edge.

Try to read TamperMonkey docs to know how to run it.