构建 Linux 内核

内核

准备环境

1
2
3
# apt update
# apt upgrade
# apt install build-essential linux-headers-$(uname -r) libncurses5-dev flex bison libssl-dev bc libelf-dev python3 dwarves

下载内核源码

1
2
3
# wget https://cdn.kernel.org/pub/linux/kernel/v6.x/linux-6.8.4.tar.xz
# tar -xvf linux-6.8.4.tar.xz
# cd linux-6.8.4/

编译内核

1
2
3
# cp /boot/config-`uname -r` .config
# make menuconfig
# make -j4 // 多线程编译

Read More

使用 Docker Compose 运行一个 GPU 环境

安装 Docker

参考 Docker 安装

安装 Docker 显卡驱动

参考 Nvidia 安装

Docker Compose

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
---
services:
code-server:
image: lscr.io/linuxserver/code-server:latest
container_name: code-server
environment:
- PUID=0
- PGID=0
- PASSWORD=<YOUR_PASSWORD>
- SUDO_PASSWORD=<YOUR_SUDO_PASSWORD>
- DEFAULT_WORKSPACE=/root/
volumes:
- /config:/config
- /root:/root
ports:
- 8443:8443
restart: unless-stopped
deploy:
resources:
reservations:
devices:
- driver: nvidia
count: 1
capabilities: [gpu]

ubuntu 22.04 设置 DNS

  1. 修改 /etc/resolvconf/resolv.conf.d/head
1
2
3
4
5
6
7
vim /etc/resolvconf/resolv.conf.d/head

# Dynamic resolv.conf(5) file for glibc resolver(3) generated by resolvconf(8)
# DO NOT EDIT THIS FILE BY HAND -- YOUR CHANGES WILL BE OVERWRITTEN
# 127.0.0.53 is the systemd-resolved stub resolver.
# run "systemd-resolve --status" to see details about the actual nameservers.
nameserver 114.114.114.114

Read More

Tab Sync Pro 无法登录

https://chrome.google.com/webstore/detail/jdlfehkflgfmniokcligbfdjobgapehn

点击插件,然后Debug,会发现发送一个 Account 请求,但是没有携带 Bearer Token,所以无法登录。根据请求的发起地方,设置一个断点。

1
2
3
4
5
6
7
8
async function Q(t, e) {
const s = new URLSearchParams(e);
return (await fetch(`${F}/api/${t}` + (s ? `?${s}` : ""), {
headers: {
Authorization: `Bearer ${K}`
}
})).json()
}

设置一个断点,等一会就好,应该是没有等待拿到值。

Read More