nginx

nginx请求域名转发

server {
    listen 80;
    ## 请求的域名
    server_name aa.com;
    proxy_buffer_size 1024k;
    proxy_buffers 16 1024k;
    proxy_busy_buffers_size 2048k;
    proxy_temp_file_write_size 2048k;
    location / {
      ## 实际请求的域名
      proxy_pass bb.com;
    }
}

ssl证书更换

  • 进腾讯云ssl证书控制台下载nginx证书
  • 进入ssl目录替换证书文件(具体ssl目录看nginx配置的ssl路径)
  • nginx -s reload

linux

杀掉端口占用进程

netstat -tunlp | grep 端口号 # 查询占用的端口的进程id
kill -9 进程id

服务器时间校准

ntpdate cn.pool.ntp.org

markdown

  • 顺序图
  • 使用 emoji里的Unicode编码,将U+换成&#x并在尾部追加;即可

vim

  • yy:复制行
  • p:档期位置粘贴
  • u:撤销
  • set nu:显示行号
  • set nonu:隐藏行号

mac

杀掉端口占用进程

lsof -i :5000 # 查询占用的端口的进程id

kill -9 进程id

查找某个文件是否在运行及进程

ps aux | grep 文件名

JetBrains无限重置脚本

下载地址

试用期已过,无法安装脚本的解决方法

  • 软件有一个文件夹控制用户的试用,进入该目录
系统路径
windows%userprofile%/AppData/Roaming/JetBrains/产品名版本号
Mac~/Library/ApplicationSupport/JetBrains/产品名版本号
linux~/.config/JetBrains/产品名版本号
  • 删除试用的授权目录eval

  • 重新打开JetBrains软件,试用即可

homebrew

安装

/bin/zsh -c "$(curl -fsSL https://gitee.com/cunkai/HomebrewCN/raw/master/Homebrew.sh)"

卸载

/bin/zsh -c "$(curl -fsSL https://gitee.com/cunkai/HomebrewCN/raw/master/HomebrewUninstall.sh)"

git

git淘宝下载镜像

windows安装git时,国内下载过慢。可以使用下面的淘宝镜像下载。

https://registry.npmmirror.com/binary.html?path=git-for-windows/

已有项目推送到空仓库

cd 项目
//新版git init默认初始化为main,可以使用-b 指定分支
git init [-b 分支名]
git add .
git commit -m "first commit"
git remote add origin 仓库地址
git push -u origin "master"

清除git缓存

gitignore新增然后不生效时,需清除git缓存

git rm -r --cached . 

git报错对应处理方法

fatal: could not read Username for xxx: Device not configured

在对应仓库下执行

git config --global credential.helper store

煎和熬都是变美味的方式,加油也是