first commit
This commit is contained in:
14
.memo/fish-keybindings
Normal file
14
.memo/fish-keybindings
Normal file
@@ -0,0 +1,14 @@
|
||||
C a 移动行首
|
||||
C e 移动行末
|
||||
|
||||
C f 字符前移
|
||||
C b 字符后移
|
||||
A f 单词前移
|
||||
A b 单词后移
|
||||
|
||||
C u 从光标位置到行首删除
|
||||
C k 从光标位置到行末删除
|
||||
|
||||
A c 大小写切换
|
||||
|
||||
A s sudo
|
||||
17
.memo/git-msg
Normal file
17
.memo/git-msg
Normal file
@@ -0,0 +1,17 @@
|
||||
✨ feat: ✨ 新功能
|
||||
🐛 fix: 🐛 修复 bug
|
||||
📝 docs: 📝 文档更新
|
||||
🎨 style: 🎨 代码格式(不影响功能)
|
||||
♻️ refactor: ♻️ 代码重构
|
||||
🚀 perf: 🚀 性能优化
|
||||
✅ test: ✅ 添加测试
|
||||
🔧 chore: 🔧 杂务(构建过程或辅助工具的变动)
|
||||
🔒 security: 🔒 安全性改进
|
||||
⬆️ upgrade: ⬆️ 升级依赖
|
||||
⬇️ downgrade: ⬇️ 降级依赖
|
||||
🚨 lint: 🚨 修复 linter 警告
|
||||
💄 ui: 💄 更新 UI 和样式文件
|
||||
🚧 wip: 🚧 工作进行中
|
||||
🔥 remove: 🔥 删除代码或文件
|
||||
🔀 merge: 🔀 合并分支
|
||||
🔖 release: 🔖 发布/版本标签
|
||||
40
.memo/hyprland-ricing
Normal file
40
.memo/hyprland-ricing
Normal file
@@ -0,0 +1,40 @@
|
||||
安装的东西:
|
||||
|
||||
hyprland
|
||||
hyprpaper
|
||||
hypridle
|
||||
hyprlock
|
||||
hyprshot
|
||||
hyprland-plugin-hyprexpo # 类似监控室老大爷视角 :/
|
||||
|
||||
xdg-desktop-portal-hyprland
|
||||
xdg-desktop-portal-gnome
|
||||
xdg-desktop-portal-gtk
|
||||
|
||||
mako # notification daemon
|
||||
gnome-keyring
|
||||
wl-clipboard
|
||||
network-manager-applet # nm-applet
|
||||
slurp # region selector
|
||||
wf-recorder # screen recorder
|
||||
brightnessctl
|
||||
|
||||
waybar
|
||||
wlogout
|
||||
fuzzel
|
||||
hyprpicker
|
||||
cliphist
|
||||
blueman # bluetooth GUI & applet
|
||||
pavucontrol
|
||||
easyeffects
|
||||
nautilus # dolphin doesn't look nice in Hyprland
|
||||
gnome-text-editor # neither does kwrite, even with Kvantum
|
||||
btop # system monitor
|
||||
|
||||
ttf-font-awesome
|
||||
nwg-look # theme of GTK apps
|
||||
catppuccin-gtk-theme-mocha # theme of GTK apps
|
||||
polkit-gnome
|
||||
|
||||
kitty # normal terminal
|
||||
ghostty # floating terminal, for btop for example
|
||||
3
.memo/nvidia-prime-offload
Normal file
3
.memo/nvidia-prime-offload
Normal file
@@ -0,0 +1,3 @@
|
||||
__NV_PRIME_RENDER_OFFLOAD=1
|
||||
__GLX_VENDOR_LIBRARY_NAME=nvidia
|
||||
__VK_LAYER_NV_optimus=NVIDIA_only
|
||||
32
.memo/shell.md
Normal file
32
.memo/shell.md
Normal file
@@ -0,0 +1,32 @@
|
||||
## 登陆 shell
|
||||
|
||||
登陆 shell 是指用户通过终端登录系统时启动的 shell,通常是用户登录时执行的第一个 shell,可以通过`grep "^$(whoami):" /etc/passwd`查看。
|
||||
|
||||
登陆 shell 为 bash 时,在登陆时会检索
|
||||
|
||||
- `/etc/profile`
|
||||
|
||||
并加载,并会加载以下第一个存在的用户配置文件:
|
||||
|
||||
- `~/.bash_profile`
|
||||
- `~/.bash_login`
|
||||
- `~/.profile`
|
||||
|
||||
所有全局环境变量以及其他非交互配置(如 ssh-agent)都可以写进这些文件。
|
||||
|
||||
## 非登陆 shell
|
||||
|
||||
非登陆 shell 是指用户在已经登录的情况下启动的 shell,通常是通过终端仿真器或其他方式打开的 shell。
|
||||
|
||||
非登陆 shell 为 bash 时,会先加载`/etc/bash.bashrc`,然后加载用户的`~/.bashrc`文件。
|
||||
|
||||
对于非登陆 shell 为 fish 的情况,则会先加载`/etc/fish/conf.d`以及`/etc/fish/config.fish`,
|
||||
然后加载用户的`~/.config/fish/conf.d`以及`~/.config/fish/config.fish`。
|
||||
|
||||
非登陆 shell 会继承登陆 shell 的环境变量,但不会加载登陆 shell 的配置文件。
|
||||
|
||||
## 当前做法
|
||||
|
||||
桌面端将登陆 shell 设置为 bash,对于终端模拟器显式指定 shell 为 fish,并禁用 conf.d 目录下的配置文件。
|
||||
|
||||
服务器端同样将登陆 shell 设置为 bash,并在.bashrc 中启动 fish,同样不使用 conf.d 目录下的配置文件。
|
||||
52
.memo/swapfile-btrfs.md
Normal file
52
.memo/swapfile-btrfs.md
Normal file
@@ -0,0 +1,52 @@
|
||||
在 btrfs 分区下使用 swapfile 创建虚拟内存:
|
||||
|
||||
1. 创建 swap 子卷 (假定已经挂载到 /mnt):
|
||||
|
||||
```bash
|
||||
btrfs subvolume create /mnt/@swap
|
||||
```
|
||||
|
||||
2. 创建 swap 文件:
|
||||
|
||||
```bash
|
||||
touch /mnt/@swap/swapfile
|
||||
```
|
||||
|
||||
3. 设置 COW 禁用属性:
|
||||
|
||||
```bash
|
||||
chattr +C /mnt/@swap/swapfile
|
||||
```
|
||||
|
||||
4. 设置 swap 文件大小(例如 16GB):
|
||||
|
||||
```bash
|
||||
dd if=/dev/zero of=/mnt/@swap/swapfile bs=1M count=16384 oflag=direct
|
||||
# 可检查属性,确保有 C:
|
||||
lsattr /mnt/@swap/swapfile
|
||||
```
|
||||
|
||||
5. 设置 swap 文件权限:
|
||||
|
||||
```bash
|
||||
chmod 600 /mnt/@swap/swapfile
|
||||
```
|
||||
|
||||
6. 启用 swap 文件:
|
||||
|
||||
```bash
|
||||
mkswap /mnt/@swap/swapfile
|
||||
swapon /mnt/@swap/swapfile
|
||||
# 可检查 swap 状态
|
||||
swapon --show
|
||||
```
|
||||
|
||||
7. 修改 `/etc/fstab` 以自动挂载 swap 文件:
|
||||
|
||||
```conf
|
||||
# Btrfs @swap subvolume
|
||||
UUID={btrfs-uuid} /swap btrfs subvol=@swap,defaults,noatime 0 0
|
||||
|
||||
# Swap file
|
||||
/swap/swapfile none swap sw 0 0
|
||||
```
|
||||
33
.memo/tailscale-nfs
Normal file
33
.memo/tailscale-nfs
Normal file
@@ -0,0 +1,33 @@
|
||||
1. tailscale
|
||||
|
||||
Tailscale 基于 WireGuard 实现 NAT 穿透。
|
||||
|
||||
安装:
|
||||
1) General: curl -fsSL https://tailscale.com/install.sh | sh
|
||||
2) Archlinux: yay -S tailscale
|
||||
|
||||
安装后:
|
||||
1) systemctl 启动 tailscaled 服务;
|
||||
2) sudo tailscale up 启动 tailscale;
|
||||
3) sudo tailscale status 查看状态 / 网站 https://login.tailscale.com/admin/machines。
|
||||
|
||||
|
||||
2. nfs
|
||||
|
||||
NFS 允许将文件系统挂载到远程主机上。
|
||||
|
||||
安装:
|
||||
1) 服务端: nfs-utils (Archlinux)
|
||||
2) 客户端: nfs-common (ubuntu)
|
||||
|
||||
安装后:
|
||||
1) 服务端:
|
||||
a)echo "/path/to/share *(rw,no_subtree_check,async)" | sudo tee -a /etc/exports
|
||||
b) systemctl 启动 nfs-server 服务
|
||||
2) 客户端
|
||||
a) sudo mount -t nfs -o vers=4,noatime,async 100.x.y.z:/path/to/share /path/to/mount
|
||||
|
||||
|
||||
3. 解除
|
||||
1) umount即可;
|
||||
2) sudo tailscale down 关闭 tailscale。
|
||||
Reference in New Issue
Block a user