0%

1
2
3
4
5
6
7
8
9
10
11
12
13
14
➜  bang-api git:(p1w37) git cherry-pick 3e785fc8c072e46660c2194a6c5006e93309f08f
Auto-merging app/services/batch/copy_project.go
[p1w37 957e05d996] fix #328031 并发复制项目uuid重复的问题
Date: Mon Aug 22 15:49:05 2022 +0800
1 file changed, 4 insertions(+), 1 deletion(-)
➜ bang-api git:(p1w37) git checkout hotfix_320269
Switched to branch 'hotfix_320269'
Your branch is up to date with 'origin/hotfix_320269'.
➜ bang-api git:(hotfix_320269) git log
➜ bang-api git:(hotfix_320269) git checkout p1w37
Switched to branch 'p1w37'
Your branch is ahead of 'origin/p1w37' by 1 commit.
(use "git push" to publish your local commits)
➜ bang-api git:(p1w37) git cherry-pick -n -e cce2d9d6579a734a7f644ea811c1636a9d03a199..0c2a52efdc4bc2ca8f0c051208e68831388e197e

1
2
3
4
5
6
7
8
9
10
11
12
13
14
➜  P1038 git:(master) go mod tidy                                                                    
go: github.com/xhs/canal@v0.0.0-20220414041559-999a49d06083: reading https://goproxy.cn/github.com/xhs/canal/@v/v0.0.0-20220414041559-999a49d06083.mod: 404 Not Found
server response:
not found: github.com/xhs/canal@v0.0.0-20220414041559-999a49d06083: invalid version: git ls-remote -q origin in /tmp/gopath/pkg/mod/cache/vcs/58038aa5791c26db501ba0c05ac1e67495df9d5cb445d748f40ccd12746af405: exit status 128:
fatal: could not read Username for 'https://github.com': terminal prompts disabled
Confirm the import path was entered correctly.
If this is a private repository, see https://golang.org/doc/faq#git_https for additional information.
go: downloading github.com/xhs/canal v0.0.0-20220414041559-999a49d06083
go: github.com/xhs/canal@v0.0.0-20220414041559-999a49d06083: reading https://goproxy.cn/github.com/xhs/canal/@v/v0.0.0-20220414041559-999a49d06083.mod: 404 Not Found
server response:
not found: github.com/xhs/canal@v0.0.0-20220414041559-999a49d06083: invalid version: git ls-remote -q origin in /tmp/gopath/pkg/mod/cache/vcs/58038aa5791c26db501ba0c05ac1e67495df9d5cb445d748f40ccd12746af405: exit status 128:
fatal: could not read Username for 'https://github.com': terminal prompts disabled
Confirm the import path was entered correctly.
If this is a private repository, see https://golang.org/doc/faq#git_https for additional information.

访问的地址感觉不对,带着代理的地址

1
https://goproxy.cn/github.com/xhs/canal/@v/v0.0.0-20220414041559-999a49d06083.mod

去掉了依然访问不到
修改 go 环境变量,把代理去掉
go env -w GOPROXY=""
问题解决

mb4是指most byte 4,即用4个字节来存字符
utf8在MySQL的实现里是用3个字节,无法支持emoji字符
参考
https://www.jianshu.com/p/2b8629af8000?u_atoken=edb621fc-3ed8-4abd-ad79-83120b8274f3&u_asession=01imGGZau59hUSA0lzJEfQGqUMfYLIHz0KsTbBTrFDVl0zDlhCSl0_GGrcqHADYKDkX0KNBwm7Lovlpxjd_P_q4JsKWYrT3W_NKPr8w6oU7K--ZZ5hTiDSZi2tREAmAWXlyuYfe7vWV-zsHJifFo5DumBkFo3NEHBv0PZUm6pbxQU&u_asig=058un4ynxXv3LVdcU4rcDeWLjjymFr2iVA3r4usPGEL2q1zg6_AaOC5kGurmR1VLUp5jMCoTeR2-93EFJtTFiYUf4wL9lwYbUZFoLO7eJ2A0RoAEyfnUh57misSICd6yqtxl9tSUnXLsI2NKVKGUFTfoDM42Tcgs8fGclWLop1Aw79JS7q8ZD7Xtz2Ly-b0kmuyAKRFSVJkkdwVUnyHAIJzfhu2lmqe57tmDa0VKuaDrDCfz6P6mNqjVXschHU8u5pfqft3yiexPr1Pj5ASov3mu3h9VXwMyh6PgyDIVSG1W_7Z-QUHDbMSTmHz3apT0KvSbYsM8OpgUlCxiCwc8zrjusj9HUqniv2DJuZJhi8CttOrXF14p9fXI8ocDy-BddWmWspDxyAEEo4kbsryBKb9Q&u_aref=7NVuBAugN7f7QVDLT9QF500sVQM%3D

刚开始按下alt+单击是选中的,用起来很难受
修改路径:Code > 首选项 > 设置 > Multi Cursor Modifier
之前一直以为是在键盘快捷方式那里,找来找去找不到

1
2
3
4
5
6
# 查看端口占用情况
sudo lsof -i :3306

# 启动服务
brew services restart mysql@5.7

遇到的问题

1
2
3
4
5
6
7
8
9
10
11
Warning: your HOMEBREW_PREFIX is set to /usr/local but HOMEBREW_CELLAR is set
to /opt/homebrew/Cellar. Your current HOMEBREW_CELLAR location will stop
you being able to use all the binary packages (bottles) Homebrew provides. We
recommend you move your HOMEBREW_CELLAR to /usr/local/Cellar which will get you
access to all bottles."
Error: Cannot install in Homebrew on ARM processor in Intel default prefix (/usr/local)!
Please create a new installation in /opt/homebrew using one of the
"Alternative Installs" from:
https://docs.brew.sh/Installation
You can migrate your previously installed formula list with:
brew bundle dump

无法安装软件了
那为何之前又能安装MySQL、Redis呢?

1
2
3
Error: Failed to link all completions, docs and manpages:
Permission denied @ dir_s_mkdir - /usr/local/etc
Failed during: /opt/homebrew/bin/brew update --force --quiet

卸载

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

重新安装

1
2
3
arch -x86_64 /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)"
# 此时是安装到了/usr/local下,把它们移动到/opt/homebrew
sudo mv /usr/local/* /opt/homebrew/

brew install nginx安装,发现可以了

反思

嗯,遇到阻塞,冷静,查清楚问题本质
脑子不清晰的时候不要钻牛角尖

参考

https://stackoverflow.com/questions/64963370/error-cannot-install-in-homebrew-on-arm-processor-in-intel-default-prefix-usr

ABAC 的主要组成部分

在 ABAC 中,一个操作是否被允许是基于对象、资源、操作和环境信息共同动态计算决定的。

对象:对象是当前请求访问资源的用户。用户的属性包括ID,个人资源,角色,部门和组织成员身份等;
资源:资源是当前访问用户要访问的资产或对象(例如文件,数据,服务器,甚至API)。资源属性包含文件的创建日期,文件所有者,文件名和类型以及数据敏感性等等;
操作:操作是用户试图对资源进行的操作。常见的操作包括“读取”,“写入”,“编辑”,“复制”和“删除”;
环境:环境是每个访问请求的上下文。环境属性包含访问尝试的时间和位置,对象的设备,通信协议和加密强度等。

ABAC 如何使用属性动态计算出决策结果

在 ABAC 的决策语句的执行过程中,决策引擎会根据定义好的决策语句,结合对象、资源、操作、环境等因素动态计算出决策结果。

每当发生访问请求时,ABAC 决策系统都会分析属性值是否与已建立的策略匹配。如果有匹配的策略,访问请求就会被通过。

例如,策略「当一个文档的所属部门跟用户的部门相同时,用户可以访问这个文档」会被以下属性匹配:

对象(用户)的部门 = 资源的所属部门;
资源 = “文档”;
操作 = “访问”;
策略「早上九点前禁止 A 部门的人访问B系统;」会被以下属性匹配:

对象的部门 = A 部门;
资源 = “B 系统”;
操作 = “访问”;
环境 = “时间是早上 9 点”。

摘录自

https://docs.authing.cn/v2/guides/access-control/abac.html