2016年1月30日 星期六

如何清空OSX DNS Cache / How to flush DNS cache

OSX下如何清空DNS快取

打開終端機程式 open terminal.app and type follow command
輸入

方法一/method1:
sudo dscacheutil -flushcache

方法二/method2:
sudo killall -HUP mDNSResponder

2016年1月26日 星期二

使用 Disk Maker X製作 OSX 開機隨身碟

使用 Disk Maker X製作  OSX 開機隨身碟

OSX 提供的開機隨身碟製作工具需要輸入很多指令,對於有終端機命令列恐懼症的一般使用者而言可以算是一種惡夢

而Disk Marker X是一套可以簡化製作開機隨身碟的程式

官方網站 : diskmakerx.com

OSX 建立可開機媒體 /OSX Create USB bootable installer

OSX 建立可開機媒體

MAC OSX 從10.9 Mavericks 開始支援建立USB開機碟

首先先從APP 下載OSX  / Download OSX from APP Store

媒體建立工具 / command name is
createinstallmedia

位於 /Applications/Install OS X El Capitan.app/Contents/Resources
/Applications/Install\ OS\ X\ El\ Capitan.app/Contents/Resources/

語法
--volume
要建立的磁碟路徑
--applicationpath
OSX來源路徑


範例:在終端機程式中
輸入
sudo /Applications/Install OS X El Capitan.app/Contents/Resources/ createinstallmedia --volume /Volumes/隨身碟名稱 --applicationpath /Applications/Install\ OS\ X\ El\ Capitan.app

Sample Screen
sudo /Applications/Install OS X El 
./createinstallmedia --volume /Volumes/SP_16G_Slim --applicationpath /Applications/Install\ OS\ X\ El\ Capitan.app
Ready to start.
To continue we need to erase the disk at /Volumes/SP_16G_Slim.
If you wish to continue type (Y) then press return: Y
Erasing Disk: 0%... 10%... 20%... 30%...100%...
Copying installer files to disk...
Copy complete.
Making disk bootable...
Copying boot files...
Copy complete.
Done.

2016年1月25日 星期一

如何載入及卸載OSX核心延伸模組/How to load /unload kernel extension(kext)

如何載入及卸載 OSX 核心延伸模組/ How to load /unload kernel extension(kext)

打開終端機視窗 open termial.app and type follow command

載入/Load
sudo kextload /Library/Extensions/[xxxxxx.kext]

或是使用APP的 bundle identifier / load  kext by bundle identifier
sudo kextload -b com.hardware.driver

卸載/Unload
sudo kextunload /Library/Extensions/[xxxxxx.kext]

或是使用APP的 bundle identifier /Unload kext by bundle identifier
sudo kextunload -b com.hardware.driver

查看已經載入的核心延伸模組 / List kext loaded and grep for hardware.driver
sudo kextstats |grep com.hardware.driver

或是使用系統資訊工具

關閉 核心延伸模組簽章檢查/ disable kext signing check


關閉 核心延伸模組簽章檢查
disable kext signing check

OSX 10.11 El Captian

第三方硬體可能因為驅動程式更新較慢導致無法正常驅動,這時候需要跳過或停用檢查
sometime we need to skip signing check due to third party driver not signed for newer osx

com.apple.kextd[50]: ERROR: invalid signature for com.asix.driver.ax88179-178a, will not load 


在終端機視窗輸入
open terminal.app and type follow command
sudo nvram boot-args="kext-dev-mode=1 rootless=0"

OSX El Captian 10.11 關閉 System Integrity Protection(SIP)

OSX El Captian 關閉System Integrity Protection(SIP)

首先進入OSX Recovery
boot into Recovery

打開終端機視窗輸入
open termminal.app and type follow command
csrutil disable

Warning: NO recommand disable SIP
注意:除非特殊需求,正常使用者不需關閉SIP

OSX如何進入回復模式/HOW to get into OSX Recovery mode


MAC OSX how to get into recovery mode
方法一:如果回復磁區還在 / Method 1:works for recovery partition exist!
1.重新開機 
reboot
2.按住option(alt)(開機管理程式) 
press option(alt) (Startup Manager)
3.選recovery開機 
Choose recovery partition to boot


方法二: 開機直接進入Recovery / Method 2:reboot to Recovery mode
1.重新開機
reboot
2.按住Command + R
Press Command + R 


方法三: 如果回復磁區壞掉或不見了 / Method 3:Works for recovery partition is gone or broken
1.重新開機
reboot
2.按住Command + option(alt) + R
Press Command + option(alt) + R to into (Internet Recovery)
3.需要可以存取網路
Internet connection is need