這才找到 如何讓 Cmd-shift-3 在抓視窗時不抓陰影:
defaults write com.apple.screencapture disable-shadow -bool true
killall SystemUIServer
Best Dialog on Earth
If you’ve put a “Crash” button in your dialog, you’ve failed. Then again, it does make application crashes more like a little minigame… Do I give up and burn it all or do I try to continue and see what this apocalyptic world looks like? (Spoiler: Every time I’ve ever hit “Continue” the app has crashed moments later.)
Worse, if you hit Continue, the resulting .xib may surprise you later in the most unwanted ways imaginable.
This is a note for myself on the issue of extracting audio from different audio/video containers/formats using CLI commands on the Mac. However I thought it might be also useful for readers of #osxchat.
Best-case scenario: it can be played by mplayer, so almost no programs are required to be installed, since we all installed MPlayer OSX Extended. Here is how to do it in a bash script:#!/bin/bash
mplayer="/Applications/MPlayer OSX Extended.app/\
Contents/Resources/Binaries/mpextended.mpBinaries/\
Contents/mpextended.mpBinaries/Contents/MacOS/mplayer"
cd ~/Downloads/ for myfile in *.flv *.avi; do
myfn=${myfile%\.*}
"$mplayer" -vo null -ao pcm:file=${myfn}.wav $myfile
done
macport 裡面的 policykit 在安裝時會加入 polkituser 這 user,但解除安裝時並不會移除他。但只要不移除,process list 就會多一個 mdworker 佔去 6MB 左右的記憶體。由於 ~polkituser 目錄為 /dev/null,我猜測這只是在白做工。因此決定移除。
在 Leopard / Snow Leopard 移除 user 與 group 的方式為:
dscl -rm /Users/polkituser
dscl -rm /Groups/polkituser
Evernote 會寫好玩的 Log Message,但那個 INSERT-HANG-DETECTED 看來則十分可怖:
Feb 8 13:30:24 yra Safari[942]: Evernote Safari Clipper Plugin version 70149 at your service! Feb 8 13:30:24 yra Safari[942]: EVERNOTE: This is where I try to get the Safari toolbar button inserted. Feb 8 13:30:24 yra Safari[942]: EVERNOTE: Have we already done our first time insertion: 1 Feb 8 13:30:24 yra Safari[942]: EVERNOTE: Updating toolbar from prefs. Feb 8 13:30:24 yra Safari[942]: EVERNOTE: Found Safari 4 toolbar prefs Feb 8 13:30:24 yra Safari[942]: EVERNOTE: Safari toolbar items: (\n BackForwardToolbarIdentifier,\n "com.evernote.SafariClipperPlugin.ClipToEvernote",\n InputFieldsToolbarIdentifier\n) Feb 8 13:30:24 yra Safari[942]: EVERNOTE: Found Elephant in Safari toolbar items at index 1 Feb 8 13:30:24 yra Safari[942]: EVERNOTE: Inserting Elephant at index 1 Feb 8 13:30:24 yra Safari[942]: EVERNOTE: Finished toolbar customization. Feb 8 13:30:42 yra Safari[942]: INSERT-HANG-DETECTED: Tx time:15.132826, # of Inserts: 13, # of bytes written: 544723, Did shrink: NO Feb 8 13:30:50 yra Safari[942]: INSERT-HANG-DETECTED: Tx time:3.637967, # of Inserts: 2, # of bytes written: 25916, Did shrink: NO Feb 8 13:30:57 yra Safari[942]: INSERT-HANG-DETECTED: Tx time:4.879544, # of Inserts: 5, # of bytes written: 11255, Did shrink: NO Feb 8 13:31:21 yra Safari[942]: INSERT-HANG-DETECTED: Tx time:3.874133, # of Inserts: 6, # of bytes written: 98498, Did shrink: NO Feb 8 13:40:14 yra Safari[942]: EVERNOTE: The toolbar is changing. Feb 8 13:40:14 yra Safari[942]: EVERNOTE: I'm in the toolbar. Feb 8 13:40:20 yra Safari[942]: INSERT-HANG-DETECTED: Tx time:3.581643, # of Inserts: 5, # of bytes written: 12320, Did shrink: NO Feb 8 13:40:33 yra Safari[942]: INSERT-HANG-DETECTED: Tx time:6.223324, # of Inserts: 9, # of bytes written: 40224, Did shrink: NO