日常小知识点记录(自用)

本文阅读量 Posted by Kird on 2019-10-08
小知识点,小技巧,记录待查
  1. 使用awk中的匹配代替grep:
    cat test |awk '!/aaa/ {print $0}'
    cat test |awk ‘/aaa/ {print $0}’

  2. curl 指host且不忽略证书校验使用https访问:
    curl -sv --resolve baidu.com:443:39.156.69.79 https://baidu.com

  3. CA root证书列表:
    https://curl.haxx.se/ca/cacert.pem
    MAC 查看当前系统根证书:file:///System/Library/Security/Certificates.bundle/Contents/Resources/TrustStore.html

  4. nginx set_unescape_uri指令:对编码的url进行解码

1
2
3
4
5
6
7
8
9
location /test {  
set_unescape_uri $name $arg_name;
set_unescape_uri $class $arg_class;
echo "name: $name";
echo "class: $class";
}
curl 'http://localhost:8080/test?name=hello%20world&class=9'
name: hello world
class: 9

5.nginx配置sub_filter不生效,增加proxy_set_header Accept-Encoding "";

  1. 抓取https流量,mac wireshark启动命令:
    开启chrome:
    sudo /Applications/Google\ Chrome.app/Contents/MacOS/Google\ Chrome --ssl-key-log-file=/Users/mac/sslkeylogfile/keylogfile.log --ignore-certificate-errors


支付宝打赏 微信打赏

赞赏支持一下