Linux 配置虚拟内存
This bash script creates and activates a swap file on a Linux system. It defaults to a 4GB swap file (/usr/swap/swapfile), but this size can be adjusted via a command-line argument. The script uses `dd` to create the file, `mkswap` to format it, and `swapon` to activate it. While the script includes commented-out lines for setting the swap file to activate on boot via `/etc/fstab`, this feature is not enabled by default. The script also displays the size of the created swap file using `du`.
tomcat 配置https 双向认证
This article details setting up HTTPS with two-way authentication for Tomcat using Java. It provides Linux and Windows scripts for generating server and client certificates using keytool. The process involves creating a server keystore, a client keystore and certificate, and importing the client certificate into the server keystore. Tomcat configuration involves modifying `server.xml` to enable HTTPS with `clientAuth="true"` and optionally configuring `web.xml` for HTTP to HTTPS redirection. Finally, the article explains client-side certificate installation and troubleshooting, specifically addressing "Invalid keystore format" errors by ensuring consistent Java versions between certificate generation and Tomcat.