Skip to content

Commit

Permalink
feat: more update
Browse files Browse the repository at this point in the history
  • Loading branch information
zhanghuid committed Aug 12, 2024
1 parent f6149f1 commit 2463b8c
Show file tree
Hide file tree
Showing 7 changed files with 71 additions and 12 deletions.
12 changes: 7 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,8 @@ Huid Quick Reference
## 服务端
[mysql](./docs/software/backend/mysql.md)<!--rehype:style=background: rgb(200 0 0);-->
[redis](./docs/software/backend/redis.md)<!--rehype:style=background: rgb(200 138 13);-->
[nginx](./docs/software/backend/nginx.md)<!--rehype:style=background: rgb(200 138 13);-->
[nginx](./docs/software/backend/nginx.md)<!--rehype:style=background: rgb(200 138 13);-->
[mitmproxy](./docs/software/backend/mitmproxy.md)<!--rehype:style=background: rgb(200 138 15);-->
<!--rehype:class=home-card-->

## 前端
Expand All @@ -51,13 +52,14 @@ Huid Quick Reference

# 实践
---
## git
[GIT 备忘](./docs/practice/git.md)
## 文章
[git-实践](./docs/practice/git-实践.md)
<!--rehype:style=padding: 15px 10px;border: 1px solid-->
[CURL 备忘](./docs/practice/curl.md)
[CURL-实践](./docs/practice/CURL-实践.md)
<!--rehype:style=padding: 15px 10px;border: 1px solid;border-top: none;-->
[Linux - dd 备忘](./docs/practice/linux-dd.md)
[Linux-dd-实践](./docs/practice/Linux-dd-实践.md)
<!--rehype:style=padding: 15px 10px;border: 1px solid;border-top: none;-->
<!--rehype:class=home-card-->


<!--rehype:ignore:start-->
Expand Down
4 changes: 4 additions & 0 deletions docs/lang/linux/ps.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
ps
===

这是开始使用 PS 命令快速参考备忘单,可以帮助用户更高效地浏览网页

入门
----
## 查看 进程运行 时长

```bash
Expand Down
11 changes: 7 additions & 4 deletions docs/practice/curl.md → docs/practice/CURL-实践.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@
CURL 备忘
curl 的具体实践
===

计算请求时的各个响应时间
---
curl 的具体实践

入门
----

## 查看 进程运行 时长

<!--rehype:body-class=cols-1-->
### curl
```bash preview
curl -o /dev/null -s -w \
Expand Down
File renamed without changes.
File renamed without changes.
50 changes: 50 additions & 0 deletions docs/software/backend/mitmproxy.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
mitmproxy
===

## MacOS 安装
```bash
brew install --cask mitmproxy --verbose
```

## 证书
```
~/.mitmproxy/
```

## 例子
```python

# -*- coding:utf-8 -*-

from mitmproxy import ctx
# from save_mongo import save_task
import json

def response(flow):
"""获取粉丝数据"""
print("debug------")
urls = [
"xxx/use",
"/yyyy",
"/eeee",
"/ddd",
"/cccc",
]

for u in urls:
if u in flow.request.url:
# 修复状态码
if flow.response.status_code == 400:
flow.response.status_code = 200

# 修复 JSON 结构
data = {
"code": 200,
"message": "success"
}

# 返回修复后的响应
flow.response.content = json.dumps(data).encode('utf-8')
return response

```
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,12 @@
"docs/*.md": "markdownlint --fix"
},
"devDependencies": {
"huid-reference-cli": "^0.0.5",
"husky": "^9.0.0",
"lint-staged": "^15.0.0",
"prettier": "^3.0.0",
"huid-reference-cli": "0.0.1",
"markdownlint": "^0.33.0",
"markdownlint-cli": "^0.39.0"
"markdownlint-cli": "^0.39.0",
"prettier": "^3.0.0"
},
"engines": {
"node": ">=16.0.0"
Expand Down

0 comments on commit 2463b8c

Please sign in to comment.