-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathtools.txt
60 lines (43 loc) · 2.34 KB
/
tools.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
this doc record some useful tools to trace problem or optimize performance
#No.1 dropwatch
用来查看机器丢包信息,辅助定位网络问题
#No.2 qperf
测试机器间TCP/UDP网络性能
#No.3 bloom filter caculator
网上有计算 bloom filter 占用空间的公式
#No.4 OpenSSL 开源tls库
检查证书中的域名:
openssl x509 -in certificate.crt -text -noout
生成自签名证书:
openssl req -x509 -sha256 -nodes -days 365 -newkey rsa:2048 -keyout privateKey.key -out certificate.crt
校验私钥文件正确性
openssl rsa -check -noout -in key.private
校验证书文件中的公钥和私钥是否匹配(适用于自签场景)
ssh-keygen -f oss_test.pem -y > key.pub 注意可能需要输入passphrase
openssl x509 -modulus -noout -in key.pub 注意输出
openssl rsa -modulus -noout -in key.private 查看私钥的module(要和上一条命令输出一致)
#No.5 rpm 解包
rpm2cpio ./xxx.x86_64.rpm | cpio -idmv
rpm -ql [package_name] | head -n 100 可以查看对应包按照目录
rpm -e [package_name] 删除已安装的包
#No.6 tcpdump
抓特定来源的HTTP包 tcpdump -A -s 0 'src example.com and tcp port 80 and (((ip[2:2] - ((ip[0]&0xf)<<2)) - ((tcp[12]&0xf0)>>2)) != 0)'
抓所有HTTP包 tcpdump -A -s 0 'tcp port 80 and (((ip[2:2] - ((ip[0]&0xf)<<2)) - ((tcp[12]&0xf0)>>2)) != 0)'
#No.7 ssh
<1>如果使用ssh登录服务器出现长时间的delay,可以查看/etc/ssh/sshd_config文件中UseDNS是否打开
如果打开,可以考虑关闭
#No.8
在安装了python的机器上,可以使用如下命令行来检查某个json文件格式
python -m json.tool your_json_file
#No.9 curl
curl --local-port 12345 可以指定发出去的数据包的源端口,如果是TCP协议,此时会调用bind来完成地址绑定
#No.10 yum
yum whatprovides */c++config.h -b current 可以查询哪个包提供了对应头文件,便于确定需要安装的包
#No.11 make
make -n 只打印make要执行的命令,但不真正执行
#No.12 configure
开源软件中的configure脚本依赖 config.guess 和 config.sub;这两个文件需要及时更新,尤其是国产化平台
需要对应的更新
#No.13 gtest
gtest测试框架会catch exception,导致core的堆栈和实际调用栈不匹配,可以在UT binary后加 --gtest_catch_exceptions=0
参数来禁用exception catch来观察实际问题调用栈,方便定位问题