账号
新建有 root 权限的普通账户
BASH
# 用 root 账号操作
adduser <username>
usermod -aG sudo <username> # 将用户添加到 sudo 组
# 配置免密码 sudo
visudo
# 文件末尾追加
<username> ALL=(ALL) NOPASSWD:ALLzsh
先装字体
BASH
# Mac 自带,无需安装
sudo apt install zsh
sudo chsh -s /usr/bin/zsh $USER
# 无需初始化配置,后续在 Powerlevel10k 后配置
# oh-my-zsh,一个 zsh 的配置框架
sh -c "$(curl -fsSL https://raw.github.com/robbyrussell/oh-my-zsh/master/tools/install.sh)"
# Powerlevel10k,一个 oh-my-zsh 的主题
git clone --depth=1 https://github.com/romkatv/powerlevel10k.git ${ZSH_CUSTOM:-$HOME/.oh-my-zsh/custom}/themes/powerlevel10k
echo 'source ${ZSH_CUSTOM:-$HOME/.oh-my-zsh/custom}/themes/powerlevel10k/powerlevel10k.zsh-theme' >>~/.zshrc
# 重启 Shell 进入配置插件
BASH
git clone https://github.com/zsh-users/zsh-autosuggestions ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-autosuggestions
git clone https://github.com/zsh-users/zsh-syntax-highlighting.git ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-syntax-highlighting
# 在 ~/.zshrc 中启用插件
plugins=(git sudo z zsh-autosuggestions zsh-syntax-highlighting)Vim
安装 nvim
MacOS
BASH
brew install neovim
# vim ~/.zshrc
alias vim="nvim"Ubuntu
BASH
curl -LO https://github.com/neovim/neovim/releases/latest/download/nvim-linux-x86_64.tar.gz
# 树莓派是 Arm
curl -LO https://github.com/neovim/neovim/releases/latest/download/nvim-linux-arm64.tar.gz
sudo rm -rf /opt/nvim
sudo tar -C /opt -xzf nvim-linux-x86_64.tar.gz
# vim ~/.zshrc
export PATH="$PATH:/opt/nvim-linux-x86_64/bin"
alias vim="nvim"
# sudo nvim
sudo ln -s /opt/nvim-linux-x86_64/bin/nvim /usr/local/bin/nvimBASH
# required
mv ~/.config/nvim{,.bak}
git clone https://github.com/LazyVim/starter ~/.config/nvim
rm -rf ~/.config/nvim/.git
vim # 启动后会自动进行一系列下载安装其他命令行工具
bat:增强版 cat
BASH
# macOS
brew install bat
alias cat="bat -pp"
# Linux
sudo apt install bat
alias cat='batcat -pp'
alias bat='batcat'eza:增强版 ls
- exa 的社区维护分支
BASH
# macOS
brew install eza
# Linux
sudo apt install eza
alias ls='eza --color=always --icons'
alias ll='eza -la --color=always --icons --git'
alias la='eza -la --color=always --icons --git'
alias lt='eza --tree --color=always --icons'
alias tree='eza --tree --color=always --icons --level=3'
alias ltree='eza -Tla --color=always --icons --git --level=2 --git-repos'
alias bigtree='eza -Tla --total-size --sort=size --color=always --icons --level=2'ncdu:交互式磁盘空间分析,增强版 du
- 📊 以交互式界面展示目录和文件占用空间
- 🔍 快速定位大文件/目录
- 🗑️ 支持直接删除文件/目录
BASH
# macOS
brew install ncdu
# Linux
sudo apt install ncdu
cd /path/to/dir
ncdu # 使用方向键浏览,按 d 删除选中项duf:美观的 df
- 🌈 彩色表格显示所有挂载点
- 📏 支持按列排序
- 🖥 自动适应终端宽度和主题
BASH
# macOS
brew install duf
dufbtop:增强版 top
BASH
brew install btoptldr:省去冗长的 man 文档
BASH
brew install tldr
# example
tldr tarSSH Key
客户端生成 SSH Key
BASH
# Windows PowerShell
ssh-keygen -t ed25519 -C "razer-wsl" -f $env:USERPROFILE\.ssh\id_ed25519_razer_wsl
# Ubuntu & MacOS
sh-keygen -t ed25519 -C "razer-wsl" -f ~/.ssh/id_ed25519_razer_wsl
cat ~/.ssh/id_ed25519_razer_wsl.pubPython
装个 uv 就完事儿了
BASH
curl -LsSf https://astral.sh/uv/install.sh | sh如果想随时启动一个 python 交互式视窗(REPL)可以 uv run python
Samba
树莓派配置 PLEX 服务器 & SMB
安装 plex server,官网下载 Arm64 安装包
BASH
sudo dpkg -i plexmediaserver_1.41.7.9823-59f304c16_arm64.deb安装配置 SMB
BASH
sudo apt install samba samba-common-bin
sudo mkdir -p /media/plex
sudo chown isumi:isumi /media/plex
sudo vim /etc/samba/smb.confSMB 配置文件末尾追加,可以额外设置共享 home
PLAINTEXT
[homes]
comment = Home Directories
browseable = no
# By default, the home directories are exported read-only. Change the
# next parameter to 'no' if you want to be able to write to them.
read only = no
# File creation mask is set to 0700 for security reasons. If you want to
# create files with group=rw permissions, set next parameter to 0775.
create mask = 0775
# Directory creation mask is set to 0700 for security reasons. If you want to
# create dirs. with group=rw permissions, set next parameter to 0775.
directory mask = 0775
# By default, \\server\username shares can be connected to by anyone
# with access to the samba server.
# The following parameter makes sure that only "username" can connect
# to \\server\username
# This might need tweaking when using external authentication schemes
valid users = %S
[plex]
comment = Plex Media
path = /media/plex
browseable = yes
writeable = yes
only guest = no
create mask = 0777
directory mask = 0777
public = no
valid users = isumi建立 SMB 账号,启动 SMB 服务
BASH
# isumi 是 Linux 已有的用户名
sudo smbpasswd -a isumi
sudo systemctl restart smbd
sudo systemctl enable smbd访问 \\IP\plex 即可

