宿主机访问不到 WSL
内 Docker
的端口, 比如 3006 / 6379
关闭 WSL
防火墙:
ufw disable
间隔一段时间后, 第一个请求响应慢
关闭: fastcgi_buffering
server {
...
location ~ \.php$ {
...
fastcgi_buffering off;
...
}
}
修改 nginx 配置中 worker_connections 的值, 原来10240 改为65535,修改后重启。
events {
worker_connections 65535;
}
.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
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"