开发环境与部署笔记
Mac
Git
查看 ts 文件增删记录
1
2date="2025-04-29";authorName=$(git config user.name);git log --all --author=${authorName} --since="${date} 00:00:00" --until="${date} 23:59:59" --pretty=tformat: --numstat | awk '$3 ~ /\.ts$/ { add += $1; subs += $2; loc += $1 - $2 } END { printf "added lines: %s, removed lines: %s, total lines: %s\n", add, subs, loc }'
查看所有提交记录
1
date="2025-02-20";authorName=$(git config user.name);git log --source --all --author="${authorName}" --since="${date}" --until="${date} 23:59:59" --oneline --graph --decorate
System
- 查看应用内存使用
1
ps -axo rss,comm | grep 'Google Chrome' | awk '{sum+=$1} END {print sum/1024 " MB"}'
Ruby
rvm 安装 ruby 报错。
1
2
3
4
5
6
7
8
9
10
11brew install ruby
// 查看自己安装的是哪个版本
rvm mount /usr/local/Cellar/ruby/3.4.2
// mount 命令好像会让你自己起名,没起直接用默认的了。
// rvm list 查看名字
rvm use ext-ruby-3.4.2-rd2930f8e7a --default
// use 后环境可能有问题,重登 shell ruby 依然使用的系统 ruby,直接重装 rvm
rvm get stable --auto-dotfilesrvm 安装警告,乱七八糟的问题。
1
2
3
4// 直接重装
rvm implode
\curl -sSL https://get.rvm.io | bash
source ~/.rvm/scripts/rvm
Ubuntu
Certbot
- 自动部署,添加nginx配置
1
2sudo apt install certbot python3-certbot-nginx -y
sudo certbot --nginx -d {url} - 只生成证书
1
sudo certbot certonly --standalone -d dice.dogeggs.cn
Windows
Deploy
Error: listen EACCES: permission denied 0.0.0.0:xxxx
检查端口是否被占用:
1
netstat -ano | findstr "xxxx"
重启 winnat:
1
2net stop winnat
net start winnat