這是本文件的舊版!
目錄表
Mac OS X
Screenshot 畫面截圖
- 全螢幕:⌘ + ⇧ + 3 (command + shift + 3)
- 自行選擇區域:⌘ + ⇧ + 4 (command + shift + 4)
- 特定視窗:⌘ + ⇧ + 4 → Space (Command + Shift + 4 放開後 空白鍵)
加上 control 鍵則直接複製到剪貼簿。
複製光碟成 iso
查看光碟資訊與掛載資訊
$ drutil status
Vendor Product Rev
MATSHITA DVD-R UJ-868 KB19
Type: DVD+R Name: /dev/disk1
Sessions: 1 Tracks: 1
Overwritable: 00:00:00 blocks: 0 / 0.00MB / 0.00MiB
Space Free: 00:00:00 blocks: 0 / 0.00MB / 0.00MiB
Space Used: 426:04:28 blocks: 1917328 / 3.93GB / 3.66GiB
Writability:
Book Type: DVD-ROM (v1)
Media ID: CMC MAG E01
將光碟卸載
$ diskutil unmountDisk /dev/disk1 Unmount of all volumes on disk1 was successful
複製光碟檔案至 iso
$ dd if=/dev/disk1 of=file.iso bs=2048
Mavericks(10.9) 掛載 NTFS 硬碟
Ref: http://coolestguidesontheplanet.com/how-to-write-to-a-ntfs-drive-from-os-x-mavericks/
1. Remove fuse4x if exist
brew remove fuse4x
2. Install ntfs-3g
brew install ntfs-3g
3. Exchange mount_ntfs
sudo mv /sbin/mount_ntfs /sbin/mount_ntfs.orig sudo ln -s /usr/local/Cellar/ntfs-3g/2014.2.15/sbin/mount_ntfs /sbin/mount_ntfs
4. Install osxfuse
brew install osxfuse
5. Install osxfuse kernel instructions
sudo /bin/cp -RfX /usr/local/Cellar/osxfuse/2.6.4/Library/Filesystems/osxfusefs.fs /Library/Filesystems sudo chmod +s /Library/Filesystems/osxfusefs.fs/Support/load_osxfusefs
Ignore the warning dialog.
Mountain Lion 掛載 NTFS 硬碟
Ref: http://prateekvjoshi.com/2013/04/21/ntfs-write-support-on-os-x-mountain-lion/
- Uninstall other 3rd-party NTFS software, like Paragon, Tuxera or NTFS-3G.
- Edit /etc/fstab (you can do this with “sudo vi /etc/fstab”)
- Add the following line:
LABEL=”VOLUME_NAME_WITHOUT_QUOTES” none ntfs rw,auto,nobrowse - Quit your editor
- Unmount and re-mount the disk
- Open Terminal and type “open /Volumes/THE_NAME_OF_YOUR_VOLUME” (without the quotes)
- The Finder pops up automatically and you can see your disk listed there
Lion 掛載 NTFS 硬碟
Ref: NTFS-3G in Mac OS X Lion (10.7) with read-write support
下載 MacFUSE 64-bit 以及 NTFS-3G stable 並安裝。
「15秒問題」可以透過 Workaround for NTFS-3G and Lion's CoreFoundation bug 解決,不過需要有 gcc (XCode) 自行編譯。
但是在系統更新後,可能需要重新覆蓋。
另外文章內有提到可以拿舊版 Snow Leopard 裡面的 NTFS 來用,但是可能會導致硬碟分割區整個爛掉,不建議使用。
讓終端機 ls 有顏色
Ref: http://howardxu-blog.logdown.com/posts/18879-mac-ls
- 用文字編輯器打開 ~/.bash_profile
- 加入 export CLICOLOR='true' (讓 ls 顯示顏色)
- 加入 export LSCOLORS=“gxfxcxdxcxegedabagacad” (設定不同種檔案的顏色,可以自定)
剪貼簿
將檔案的內容複製到剪貼簿中
$ pbcopy < file
將剪貼簿的內容印到螢幕上
$ pbpaste
睡眠方式設定
在 MacOS 中將螢幕上蓋闔起來後統稱為睡眠,睡眠有三種模式:
- 0 : suspend to RAM (Windows 中的待命)
- 3 : suspend to RAM + Disk (安全睡眠)
- 5 : suspend to Disk (Windows 中的休眠)
若要把所有狀態改成 suspend to Disk:
sudo pmset -a hibernatemode 5
- -b 代表只套用到電池設定
- -c 代表只套用到外接電源
- -a 代表套用到所有電源設定
防止出現.DS_Store 檔案
defaults write com.apple.desktopservices DSDontWriteNetworkStores -bool TRUE
恢復原本設定:
defaults delete com.apple.desktopservices DSDontWriteNetworkStores
批次刪除已存在的.DS_Store
sudo find . -name ".DS_Store" -depth -exec rm {} \;
用 MacBook 分享無線網路給 iPhone
http://funiphone.pixnet.net/blog/post/27893659
「系統偏好設定」→「共享」→「共享連線來源」選擇上網的有線或無線網卡,「對使用以下傳輸埠的電腦」為要連上來上網的有線或無線網卡。
「啟用加密保護(使用WEP)」。
鍵盤快速鍵
- fn + F8:顯示所有虛擬桌面
- fn + F9:列出所有視窗(與F3同)
- fn + F11:顯示桌面
- fn + F12:顯示桌面小工具(與F4同)
- control + 1 ~ 4:切換虛擬桌面(左上、右上、左下、右下)
- command + control + option + 8:將螢幕改成負片
- control + Eject:關機選項
- control + shift + Eject:關閉螢幕
- control + option + esc:強制結束程式
irssi
切換 channel:esc → 數字鍵
捲動頁面:fn + shift + 上下鍵
滑鼠手勢
兩指上下左右:捲動頁面
三指上下:頁首、頁尾
三指左右:上一頁、下一頁
四指向下:列出所有視窗
四指向上:顯示桌面
四指左右:選擇視窗(與command + tab相同)
安裝
hostname
修改主機名稱
scutil --set HostName [new hostname]
man scutil 也可查詢其他修改,如 ComputerName(GUI 用)及 LocalHostName (Bonjour用)。
系統字體
http://www.goston.net/2013/10/25/4208/
改用 Noto Sans 字體:https://gist.github.com/littlebtc/ecfbcb69bbde917593e4
軟體
基礎
Homebrew
Install
ruby -e "$(curl -fsSL https://raw.github.com/Homebrew/homebrew/go/install)"
Install Software
brew install wget
Update
brew update brew update --force brew outdated brew upgrade
MacPorts
MacPorts: http://www.macports.org/
說明文件:http://guide.macports.org/
手動安裝 MacPorts,也可直接透過包好的映像檔安裝。
# cd /tmp && mkdir ports && cd ports # svn checkout http://svn.macports.org/repository/macports/trunk # cd trunk/base # ./configure && make install && make distclean
增加環境參數,在家目錄中修改 .profile 檔,加入
export PATH=/opt/local/bin:/opt/local/sbin:$PATH export MANPATH=/opt/local/share/man:$MANPATH
更新套件庫
# port -v selfupdate
搜尋套件
# port search [name]
安裝套件
# port install [name]
瀏覽器
Opera for Mac OS X:http://www.opera.com/download/
Google Chrome for Mac Develop Version:http://www.google.com/chrome/intl/en/eula_dev.html?dl=mac
CrossOver Chromium:http://www.codeweavers.com/services/ports/chromium/
影音播放
Perian: http://www.perian.org/
