创建 512M 内存盘
diskutil erasevolume HFS+ "ramdisk" `hdiutil attach -nomount ram://1165430`
MacPort 更新
sudo port self update sudo port list outdated sudo port upgrade outdated
MacPort 卸载所有过时的版本
sudo port uninstall inactive
强制缓存落盘:
sync && sudo purge
打开 MAS 的更新测试版功能
sudo defaults write /Library/Preferences/com.apple.SoftwareUpdate CatalogURL https://swscan.apple.com/content/catalogs/others/index-10.9seed-10.9-mountainlion-lion-snowleopard- leopard.merged-1.sucatalog.gz
压缩 sparse bundle disk image
hdiutil compact /path/to/xxx.sparsebundle
创建一个简单的 tcp server
$ nc -k -l 4444
重新排序 PDF
mv 2020-03-01\ VOGUE\ JAPAN\ Special.pdf 2020-03-01VOGUEJAPANSpecial.pdf java -jar pdfbox-app-2.0.19.jar PDFSplit 2020-03-01VOGUEJAPANSpecial.pdf java -jar pdfbox-app-2.0.19.jar PDFMerger 2020-03-01VOGUEJAPANSpecial-1.pdf `for i in {215..2}; do echo 2020-03-01VOGUEJAPANSpecial-$i.pdf; done` 2020-03-01VOGUEJAPANSpecial-216.pdf 2020-03-01\ VOGUE\ JAPAN\ Special.pdf rm 2020-03-01VOGUEJAPANSpecial*
清理 apfs 本地快照
sudo tmutil listlocalsnapshots / sudo tmutil thinLocalSnapshots / 10000000000 4Outlook 的资料在这里: ~/Library/Group Containers/UBF8T346G9.Office/Outlook
读写ntfs:编辑/etc/fstab:
LABEL=磁盘标签 none ntfs rw,auto,nobrowse估计也可以通过 blkid看到UUID后,挂载UUID,效果更好
/System/Library/Filesystems/ntfs.fs/Contents/Resources/ntfs.util -k 可以看UUID。
https://wilsonmar.github.io/mac-utilities/
sip 批量转换图片:
for i in ./*.tif ; sips -s format png "$i" --out "${i/tif/png}" && rm "$i"