Nginx Notes
概述
正则语法
使用 perl 正则语法
Nginx 三种代理模式
Grep Command Notes
反向查找
- -v
- –invert-match
- ?
- 查找没有被匹配到的内容
pattern 指定 -e pattern
-e pattern
perl 格式 regexp -P
-P
特点:
支持 extended regexp 的全套功能
- eg:
[[:digit:]]+
- eg:
支持类似 python regex 的功能
- eg:
\d+(\.\d+)?G
- eg:
有限制的 perl regexp 功能实现
Python Memory Profile Notes
工具
- 内存分配跟踪 trace memory allocations
- 官方库
- memory_profiler
- 逐行 profile
line-profiler
命令行使用
1 2 3 4 5# 第一步 ---> 生成 profile 结果文件 --> your_script.py.lprof kernprof -l -v your_script.py # 第二步 ---> 格式化展示 python -m line_profiler your_script.py.lprof例子
- 注意:不需要导入 profile 装饰器
ccls Notes
项目设置
使用 compile_commands.json
- 参考
compile_commands.json
产生方法
- cmake
cmake -D 命令
1cmake .. -DCMAKE_EXPORT_COMPILE_COMMANDS=ONCMakeLists.txt
1set(CMAKE_EXPORT_COMPILE_COMMANDS ON)- bear
| |
- ninja
- …
使用
- 链接到当前项目根目录
| |
gcc notes
编译安装
参考
流程
1 2 3 4 5 6 7 8 9 10 11 12 13# 安装依赖 ./contrib/download_prerequisites # 可选是否使用 gcc-multilib sudo apt install gcc-multilib flex # disable multilib ./configure --prefix=/usr/local/gcc --enable-bootstrap --enable-checking=release --enable-languages=c,c++ --disable-multilib # enable multilib ./configure --prefix=/usr/local/gcc --enable-bootstrap --enable-checking=release --enable-languages=c,c++ make -j 8 && sudo make install