Skip to main content

使用Whistle代理抓取JVM HTTP请求

· One min read
info

注意把以下命令中对应路径替换成自己的:

  • D:\programs\jdk1.8.0_192: JDK 1.8 的安装目录
  • C:\Users\user\Downloads\rootCA.cer: 下载到本地的whistle代理根证书

生成证书

方式一:生成keystore只有whistle根证书

D:\programs\jdk1.8.0_192\jre\bin\keytool.exe -importcert -alias whistle -keystore "C:\Users\user\Downloads\whistle.p12" -file "C:\Users\user\Downloads\rootCA.cer" -storepass whistle -storetype PKCS12 -noprompt

方式二:在JDK默认根证书基础上追加whistle根证书

D:\programs\jdk1.8.0_192\jre\bin\keytool.exe -importkeystore -srckeystore "D:\programs\jdk1.8.0_192\jre\lib\security\cacerts" -srcstoretype JKS -srcstorepass changeit -destkeystore "C:\Users\user\Downloads\whistle.p12" -deststoretype PKCS12 -deststorepass whistle

D:\programs\jdk1.8.0_192\jre\bin\keytool.exe -importcert -alias whistle -keystore "C:\Users\user\Downloads\whistle.p12" -file "C:\Users\user\Downloads\rootCA.cer" -storepass whistle -storetype PKCS12 -noprompt

使用

要使用上述keystore,抓取HTTPS请求,需要设置以下 JVM 启动参数:

-DproxySet=true
-DproxyHost=127.0.0.1
-DproxyPort=8899
-Djavax.net.ssl.trustStore="C:\Users\user\Downloads\whistle.p12"
-Djavax.net.ssl.trustStorePassword=whistle
-Djavax.net.ssl.trustStoreType=PKCS12
-Djavax.net.debug=ssl,handshake

Reference

页面整体颜色切换

· One min read
灰色
html {
filter: grayscale(100%);
}
蓝色
html {
filter: hue-rotate(210deg);
}

Ubuntu Install Docker

· One min read

ref: Install from a package

wget https://download.docker.com/linux/ubuntu/dists/bionic/pool/stable/amd64/containerd.io_1.6.9-1_amd64.deb && \
wget https://download.docker.com/linux/ubuntu/dists/bionic/pool/stable/amd64/docker-ce_24.0.2-1~ubuntu.18.04~bionic_amd64.deb && \
wget https://download.docker.com/linux/ubuntu/dists/bionic/pool/stable/amd64/docker-ce-cli_24.0.2-1~ubuntu.18.04~bionic_amd64.deb && \
wget https://download.docker.com/linux/ubuntu/dists/bionic/pool/stable/amd64/docker-buildx-plugin_0.10.5-1~ubuntu.18.04~bionic_amd64.deb && \
wget https://download.docker.com/linux/ubuntu/dists/bionic/pool/stable/amd64/docker-compose-plugin_2.18.1-1~ubuntu.18.04~bionic_amd64.deb && \
dpkg -i containerd.io_1.6.9-1_amd64.deb \
docker-ce_24.0.2-1~ubuntu.18.04~bionic_amd64.deb \
docker-ce-cli_24.0.2-1~ubuntu.18.04~bionic_amd64.deb \
docker-buildx-plugin_0.10.5-1~ubuntu.18.04~bionic_amd64.deb \
docker-compose-plugin_2.18.1-1~ubuntu.18.04~bionic_amd64.deb

如果安装失败, 执行 apt --fix-broken install

Git 利用 includeIf 配置不同目录不同邮箱身份

· 3 min read
Alan
Maintainer of the Blog

一般个人项目和公司项目要用不用的 user.nameuser.email,一般情况下每次clone新项目,都要在项目根目录执行以下命令设置项目的邮箱账号信息:

git config --local user.name xxxx
git config --local user.email xxxx@yyy.com