2022年6月24日 星期五

PDF compress in Linux with gs

gs -sDEVICE=pdfwrite -dCompatibilityLevel=1.4 -dPDFSETTINGS=/prepress -dNOPAUSE -dQUIET -dBATCH -sOutputFile=output-ebook.pdf input.pdf
基本上這樣就可以把 PDF 檔壓到很小

-dPDFSETTINGS=/screen 可以壓到最小,但解析度很差

需要 ghostscript 套件

ref. PDF compress in Linux with command line utilities

DNS negative cache

在查詢一個域名時,若當資料不存在,會出現 NXDOMAIN DNS 也會 cache 這個查不到的結果,其預設的 TTL 跟 DNS 及 Zone 的 SOA TTL 有關 例如 BIND 的 max-ncache-ttl 預設是 10800 秒 當 SOA 中的 TTL 小於 ...