撰于 阅读 18

WSL 备忘

宿主机访问不到 WSLDocker 的端口, 比如 3006 / 6379

关闭 WSL 防火墙:

ufw disable


间隔一段时间后, 第一个请求响应慢

关闭: fastcgi_buffering

server {
    ...
    location ~ \.php$ {
        ...
        fastcgi_buffering off;
        ...
    }
}


.wslconfig 配置

该配置是 WSL 的全局配置 -> 官方文档

推荐配置:

[wsl2]
networkingMode=mirrored # 开启镜像网络
dnsTunneling=true # 开启 DNS Tunneling
firewall=false #  Windows 防火墙
autoProxy=true # 自动同步代理

[experimental]
hostAddressLoopback=true

常用软件 (Ubuntu)

zsh

apt install zsh

oh-my-zsh

安装

# curl
sh -c "$(curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"

# wget
sh -c "$(wget https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh -O -)"

主题: powerlevel10k

项目地址

git clone --depth=1 https://github.com/romkatv/powerlevel10k.git ${ZSH_CUSTOM:-$HOME/.oh-my-zsh/custom}/themes/powerlevel10k

执行 source ~/.zshrc 触发主题配置

插件: zsh-autosuggestions

项目地址

git clone https://github.com/zsh-users/zsh-autosuggestions ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-autosuggestions

插件: zsh-syntax-highlighting

项目地址

git clone https://github.com/zsh-users/zsh-syntax-highlighting.git ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-syntax-highlighting

修改配置

plugins=( git z zsh-syntax-highlighting zsh-autosuggestions)

nvm

# curl
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.40.1/install.sh | bash

# wget
wget -qO- https://raw.githubusercontent.com/nvm-sh/nvm/v0.40.1/install.sh | bash

vim

vimrc

eza

项目地址

sudo apt update
sudo apt install -y gpg

sudo mkdir -p /etc/apt/keyrings
wget -qO- https://raw.githubusercontent.com/eza-community/eza/main/deb.asc | sudo gpg --dearmor -o /etc/apt/keyrings/gierens.gpg
echo "deb [signed-by=/etc/apt/keyrings/gierens.gpg] http://deb.gierens.de stable main" | sudo tee /etc/apt/sources.list.d/gierens.list
sudo chmod 644 /etc/apt/keyrings/gierens.gpg /etc/apt/sources.list.d/gierens.list
sudo apt update
sudo apt install -y eza

配置

alias ls="eza --time-style '+%Y-%m-%d %H:%M' -g --icons=always"
alias ll="ls -la"