Hunter的大杂烩 技术学习笔记

2021-09-16

通过setup.py 传递编译参数给 gcc

Filed under: 技术话题 — hunter @ 10:42 pm

参考:https://docs.python.org/zh-cn/3.10/distutils/configfile.html

https://www.pythonf.cn/read/168890

编译 M2Crypto时遇到 openssl 头文件找不到,可以用setup.py 的build_ext模式,将额外参数传递给swig(或gcc)

python setup.py build_ext -I/d/soft/msys64/mingw64/include –openssl /d/openssl -cmingw32

(more…)

xargs 与 cp 连用

Filed under: 技术话题 — hunter @ 4:01 pm

find《from dir》 -type f -name ‘*.jar’|grep -v ‘/lib/’|grep -v sources|xargs -i cp {} <to dir>

2021-09-09

maven git插件临时屏蔽的方法

Filed under: 技术话题 — hunter @ 4:08 pm

有时从parent处继承的配置中,包括 git-commit-id-plugin ,但实际上不需要或临时想停止用git检查需要编译的代码,可以在项目pom.xml中增加 <skip>true</skip>配置,比如

(more…)

2021-09-03

linux命令行使用json格式化工具

Filed under: 技术话题 — hunter @ 8:27 pm

from https://zhuanlan.zhihu.com/p/77177160


{"word": "hello",
"source": [ {
"firstName": "John",
},
{
"firstName": "Hunter",
},
{
"firstName": "Tony",
}]
}

(more…)

k8s简单脚本

Filed under: 技术话题 — hunter @ 7:37 pm

把常用命令用脚本简化

 
[code]
#!/bin/sh

if [ $# -lt 2 ]; then
echo "USAGE: $0 <logs|pod|search> <podname>"
exit 0
fi

if [ $1 = "search" ];then
kubectl get -n <namespace> -o wide pods|grep $2
elif [ $1 = "pod" ];then
kubectl describe pod -n <namespace> $2
elif [ $1 = "logs" ];then
kubectl logs -n <namespace> -f $2
elif [ $1 = "cmd" ];then
kubectl exec -it -n <namespace> $2 — /bin/bash
elif [ $1 = "restart" ];then
#kubectl get pod $2 -n <namespace> -o yaml |kubectl replace –force -f –
kubectl rollout restart deployment -n <namespace> $2
fi

[/code]

« Newer PostsOlder Posts »

Powered by WordPress