Linux_Little_Tricks

Linux Little Tricks data model LLP64 and LP64 搜索引擎小技巧 cats and dogs Result about cats or dogs "cats and dogs" Result about exact term “cats and dogs” cats -dogs Fewer dogs in result cats +dogs More dogs in result cats filetype:pdf PDFs about cats Supported types: pdf, doc(x), xls(x), ppt(x), html * 模糊 .... 范围 intitle:标题 inurl:网址 related:相关类型 define:word etymology:"word," joker site:drive.google.com Proxy Browser: SwitchyOmega gfwlist: https://raw.githubusercontent.com/gfwlist/gfwlist/master/gfwlist.txt Terminal Proxy CapsLock -> Ctrl X11 xev 展示按下按键的信息 pacman -S xorg-xmodmap: xmodmap xmodmap -pke xmodmap -pke > ~/....

ArchLinux_Installation

一. Basic Install 制作启动盘 1. 系统启动方式 输入 ls /sys/firmware/efi/efivars 查看系统的启动方式 如果有输出,则为UEFI启动 2. 网络连接 ip link 查看网卡的名称等信息 有线网络 使用 dhcpcd 进行有线网络连接, 和激活无限网络dhcp功能 无线网络 使用 rfkill(Radio Frequency Kill) 检查 wifi 是否被禁用 $ rfkill list 0: phy0: Wireless LAN Soft blocked: yes // yes 为禁用, no 为未禁用(软件禁用) Hard blocked: yes // yes 为禁用, no 为未禁用(硬件禁用) 如果被禁用使用 rfkill unblock wifi 取消禁用 使用 iwctl 进行无线网络连接 iwctl$ help iwctl$ device list iwctl$ station device(name) scan iwctl$ station device(name) get-networks iwctl$ station device(name) connect SSID(name) 使用 ping archlinux....

阅读 Linux 核心源代码 lib/list_sort.c

Linux 核心代码中,对链表的排序算法是一种归并排序的变种。采用的排序方式为自下而上 的排序,这种方式可以避免 cache thrashing。 合并时机 Linux 中的对归并排序的改进主要是改变了两个链表的合并时机。该算法会有一个 pending 链表用来记录排序好的子链表,且保证每个子链表的长度都为 $2^k$。当 pending 中 即将出现第三个 $2^k$ 长度的链表时,就会合并已存在的两个 $2^k$ 长度的链表使其 变为一个 $2^{k+1}$ 长度的链表,所以在 pending 链表中永远不会存在超过 2 个 长度为 $2^k$ 的链表。 使用一个变量 count 来追踪 pending 中 $2^k$ 长度链表的个数,可以通过 count 中 k+1 k k-1 这 3 个 bits 来确定 pending 中 $2^k$ 长度链表的个数。下表 中的 3 个 bits 分别表示 k+1 k k-1,当 k 为 0 时,认为 -1 bit 为 1。 count $2^k$ 长度链表个数 …000… 0 …001… 0 …010… 0 …011… 1 …100… 1 …101… 2 源码分析 __attribute__((nonnull(2,3))) void list_sort(void *priv, struct list_head *head, list_cmp_func_t cmp) { struct list_head *list = head->next, *pending = NULL; size_t count = 0; /* Count of pending */ if (list == head->prev) /* Zero or one elements */ return; /* Convert to a null-terminated singly-linked list....