顯示具有 Mac 標籤的文章。 顯示所有文章
顯示具有 Mac 標籤的文章。 顯示所有文章

2016年11月10日 星期四

Log of cron actions on OS X

Much easier to simply add the following to /etc/syslog.conf :
cron.*      /var/log/cron.log
Then restart syslog
sudo launchctl unload /System/Library/LaunchDaemons/com.apple.syslogd.plist

sudo launchctl load /System/Library/LaunchDaemons/com.apple.syslogd.plist

from : http://superuser.com/questions/134864/log-of-cron-actions-on-os-x

2016年10月22日 星期六

Set crontab in OSX


143down voteaccepted
Just follow these steps:
  1. In Terminal: crontab -e.
  2. Press i to go into vim's insert mode.
  3. Type your cron job, for example:
    30 * * * * /usr/bin/curl --silent --compressed http://example.com/crawlink.php
    
  4. Press Esc to exit vim's insert mode.
  5. Type ZZ to exit vim (must be capital letters). 
  6. You should see the following message: crontab: installing new crontab. You can verify the crontab file by using crontab -l.
Note however that this might not work depending on the content of your ~/.vimrc file.

from : http://stackoverflow.com/questions/15395479/why-ive-got-no-crontab-entry-on-os-x-when-using-vim

2016年10月9日 星期日

Upgrade to PHP 7 or 7.1 on macOS Sierra or on OSX 10.6 – 10.11

macOS Sierra ships with PHP 5.6, OSX 10.11 El Capitan with PHP 5.5.x and OSX 10.8 Mountain Lion ships with PHP version 5.3, there is an easy upgrade method to either the newer stable version 5.6 or an older stable PHP version or even the latest PHP version 7.
The latest PHP version in this guide is from this PHP Packaged site  which is being maintained for OSX and is known as a reliable source.

Download and Install to PHP 7.0

Open Terminal and run…
curl -s http://php-osx.liip.ch/install.sh | bash -s 7.0
or for 7.1
curl -s http://php-osx.liip.ch/install.sh | bash -s 7.1
You get a warning error for if the php is a newer version
As this is quite new, there may be issues still. Your mileage may vary.

The version is filed in /usr/local/php5 – Test the php version by creating a php file named phpinfo.phpin your web root with the single function:

Browse to that file and see the version displayed.
php7-osx

If instead you just want to update to the latest 5.6 PHP…
Open the Terminal and issue one command –
curl -s http://php-osx.liip.ch/install.sh | bash -s 5.6

That’s it! One line command in the terminal, this will download and install PHP5.6 in:
/usr/local/php5/

Apache Configuration

For either PHP version install 7 or 5.6, the install script will also disable the previous PHP5.5 if it was enabled in the Apache configuration file /etc/apache2/httpd.conf . The new  version is enabled in Apache right off the bat, the new install will comment out the older PHP module.
#LoadModule php5_module libexec/apache2/libphp5.so
It will load the new PHP version via the /etc/apache2/other/+php-osx.conf file.
So to reverse the behaviour uncomment the older PHP module in httpd.conf and remove the new config in other.
ln -s /usr/local/php5/bin/php /usr/bin/php

from : https://coolestguidesontheplanet.com/upgrade-php-on-osx/

2016年10月7日 星期五

Mac OSX - Path id_rsa.pub of root

/private/var/root/.ssh/id_rsa.pub

2012年3月10日 星期六

How to delete all .svn folder in Linux / Mac?


find ./ -name ".svn" | xargs rm -Rf

2012年3月9日 星期五

Mac 更換資料夾圖示的方法

最近想把 Mac 裡一些常用的資料夾換個圖示,找到的步驟如下:

選取資料夾,開啟該資料夾的「簡介」視窗。
將下載好的 .icns 圖示檔拉到「簡介」視窗最上方的小圖示上,就可以換掉原有圖示了。
我照了這個方法作,不過從網路上下載的 .icns 圖示檔,有些拉上去後可以成功更換資料夾圖示,有些卻不行。研究了半天也搞不清楚為什麼有些成功有些不行。後來找到了另外一個換圖示的方法,不僅更簡單,而且除了 .icns 檔案外,也適用於任何圖檔。方法如下:

用「預覽程式」開啟你要用來當資料夾圖示的 .icns 檔,或其他圖檔。當然,尺寸最好是 512x512。
開啟後,依序按下⌘A(全選),⌘C(複製)。
然後選取想要更換圖示的資料夾,開啟該資料夾的「簡介」視窗。
點選「簡介」視窗最上方的小圖示,按下⌘V(貼上),大功告成!
這個方法除了資料夾外,也可以用來更改磁碟映像檔的圖示。

reference : http://coder.aqualuna.me/2012/02/mac.html

2011年9月23日 星期五

Mac — Adding Hex Color Picker to Color Picker

I’ve actually been launching Photoshop here and there to get my color picker (ridiculous, I know), or if I manage to remember, preview + color picker.
It’s time to set up a real hex color picker.
First, let’s make the color picker an executable app.
Push CMD + Space, and run AppleScript Editor

In the window that appears, type in “choose color”.

Save it as an app in the “file format” field, and name it what you’d like.

Now I’d go ahead and give it the icon of the Digital Color Meter and throw it on the dock:


Install HexColorPicker
Download file at http://wafflesoftware.net/hexpicker/
and move the HexColorPicker.colorPicker to your ~/Library/ColorPickers

You’re done — start the app and look at your shiny new tab on the right.


reference : http://yuji.wordpress.com/2010/08/01/mac-adding-hex-color-picker-to-color-picker/

2011年7月13日 星期三

Mac OSX Zend Studio 8 newline problem

Situation:
I use Zend Studio8 in mac os,
when I use source->format

the newline will change to \r\n,
After submit to P4.

My colleagues open the file in windows platform,
There will appear the extra newline.

Solution:
Preference -> General -> Workspace -> New text file line delimeter
choose Other -> Unix

2011年5月24日 星期二

OS X 10.6 & PC 共用的檔案格式

Mac 和 PC 要共用,最佳解法是使用 extfs.
extfs 是目前多數 linux 使用的檔案系統,完全的公開技術.
在各種平台,都有免費且完整的支援工具..
macos 用的http://sourceforge.net/projects/ext2fsx/
windows 用的http://sourceforge.net/projects/ext2fsd/

OS X 10.6 雪豹下使用 NTFS 內建或外部 USB 隨身碟

剛使用 MacBook 的時候,最不能讓我適應的是外部存檔這件事了。不管是使用網路空間還是外部硬碟,都是困難重重。好像非得要用MobileMe 才可以輕易的把檔案在不同裝置裡傳來傳去。接上原來在 PC 上使用的 NTFS 格式 USB 硬碟,檔案可以輕易的讀出,可是不能寫入。好一陣子,我都是用 FTP 在儲存我的檔案。可是我還是覺得麻煩。經過一陣子的搜尋後,終於找到幾個好用的辦法了。

在 OS X 下使用NTFS 硬碟讀寫有好幾種方式,可以修該 fstab,使用 MacFUSE + NTFS-3G 或使用付費軟體。這幾個方法我都試過了,都不錯。可是最近 google 到了一個新方法,我個人非常喜歡,因為不用下載新軟體,直接使用雪豹的程式就可以了。不過這個進階設定直接修改雪豹的 NTFS 驅動方法,風險還是有的,修改前請先有心理準備。



警告: 本文件說明了如何通過在終端機應用程式中輸入指令來修改權限設定。 不熟悉 Terminal 和 UNIX 式環境的使用者應小心進行作業。 輸入不正確的指令可能會導致資料流失及/或系統軟體無法使用。 不當修改權限可能會降低系統的安全性及/或造成私密資料外洩。


原理:

雪豹的 NTFS 驅動程式在 /sbin/ 下面,檔案名稱是 mount_ntfs。這個驅動程式原本就可以把 NTFS 硬碟裝在 OS X 的檔案系統下面,可讀可寫。可是雪豹的出廠設定只讓 NTFS 硬碟可以讀,但不能寫。我們只要修改這個設定,把參數加上“讀寫”就好了。

因為硬碟檢測是自動的,OS X 偵測到 NTFS 硬碟,就會直接調用這個程式。我們只要寫一個小小的銜接程式(mddleware),加入我們要的參數,就大功告成了。

動工修改:

因為要直接修改雪豹,我們必須開啓終端機,使用系統管理員的權限做修改。建議先開啓 time machine 備份資料,萬一修改有問題還有機會回復。

(以下修改都在終端機裡面進行)

[補充] 如果你是使用系統管理員帳戶登入的話就可以直接從 STEP 1 開始。如果你現在登入的不是系統管理員,先在終端機裡變更身分,就可以順利進行。Stanly 提供另一個啓用 root 帳號的方法也可以。記得全部做完以後再把 root 帳號關起來就是了。參考:啓用和停用 root 帳號

變更使用者身分:假設管理員帳號名稱為 vincent,在終端機裡打入 su vincent (按 return),系統會問你密碼。輸入密碼後你的身分就變成管理員 vincent 了。進行 STEP 1-》

=================================================

[Stanley補充] 開啟root權限 (如果你從Step 1開始做發現有問題不能繼續時,請照這裡步驟先開啟root帳號,再從頭來過)

在終端機裡輸入 sudo passwd root (然後按下enter)

會跳出請你輸入password,請先輸入你這個原本帳號的密碼

然後會請你重新設定root帳號密碼,並在輸入一次確認



接著,在終端機裡輸入 su (然後按下enter)

然後輸入剛剛重新設定的root密碼就可以以root權限使用終端機



=================================================



STEP 1. 保存並更名原有驅動程式

打入 sudo mv /sbin/mount_ntfs /sbin/mount_ntfs.orig




系統會問你管理員密碼,輸入管理員密碼。



[重要補充] 檢查 mount_ntfs 是否已更名

(在終端機裡面)打入 ls /sbin/mount* (按 return)

系統會列出 /sbin 下面以 mount 開頭的所有檔案。檢查看看 mount_ntfs.orig 在不在,如果不在,檢查一下出了甚麼問題,不要直接往下做。如果沒有順利保存原有程式,你可能連讀取資料的機會都沒了。





STEP 2. 製作銜接程式(mddleware)。

(進階使用者:直接使用你熟悉的編輯軟體製作以下內容的檔案, 檔案名稱為 mount_ntfs (一律小寫),放在 /sbin 目錄下。跳到 STEP 3)

銜接程式內容只有兩行:



#!/bin/sh
/sbin/mount_ntfs.orig -o rw "$@"





詳細步驟(在終端機裡面進行):

開啓編輯器,打入 nano /sbin/mount_ntfs (然後按下enter)



輸入程式碼



按 Control -O 儲存檔案,再按 Control -X 離開編輯器



STEP 3. 授與銜接程式適當權限

在終端機中打入

sudo chown root:wheel /sbin/mount_ntfs (然後按下enter)

sudo chmod 755 /sbin/mount_ntfs (然後按下enter)




大功告成!!



****還原步驟*****

如果有任何理由想要還原上述變更的話,只要打入 sudo mv /sbin/mount_ntfs.orig /sbin/mount_ntfs 把原來的檔還原就好了。





**注意事項:網路上有相同的方法,而且程式檔案已經做好,可以免費下載。但為了電腦安全,建議不要下載不明軟體,還是自己花點時間,敲敲鍵盤吧!

reference : http://www.macuknow.com/node/6718

2011年4月24日 星期日

Failed: There was a problem authoring the DVD

solution:
Burn -> Preferences -> Video -> DVD -> NTSC

2010年11月5日 星期五

Setting a permanent host name in Mac OS X

sudo vi /etc/hostconfig:

HOSTNAME=yourhostname.com

$ sudo scutil --set HostName yourhostname.com

2010年11月4日 星期四

Mac OSX fails with "Operation not permitted"

This is because file system is locked
You can solved this problem by run below command.

$ chflags -R nouchg /path/to/nopermitted

補充:
話說,我不小心下了以下的指令
$ chflags -R /path/to/specific

造成/path/to/specific下的所有檔案Operation not permitted

解決方法:
$ ls -lOAe
發現檔案多了以下的uappnd,nodump,opaque property

$ chflags -R noupappnd /path/to/specific/*
$ chflags -R noopaque /path/to/specific/*
$ chflags -R dump /path/to/specific/*

將property取消即可

2010年9月13日 星期一

[小技巧] Mac OS X 內建輸入法碼查找及自建功能

今天小弟無意中發現MAC OS X 於中文輸入狀態下可使用快捷鍵開啟輸入法碼查詢框, 此查詢框可讓使用者即時查詢4種中文輸入法的代碼,包括倉頡、速成、拼音與注音,方法如下:

1.中文輸入狀態下,點選文字框然後同時按下[shift] + [option] + [L] 鍵

2.系統會彈出以下框框,使用者可輸入最多兩個字作查詢

3. 如下圖

另外在同一狀態下同時按下[shift] + [option] + [P] 鍵

即可彈出自創輸入法的教學板面 如下圖:

最後一個設定是小弟自轉用Mac 以後久違已久,一直以為Mac OS 欠逢的功能,就是中文詞語聯想;即輸入一字自動彈出聯想詞。其實使用者於同一狀態下只要同時按下[shift] + [option] + [U] 鍵,再在彈出的設定上勾選show associated words即可,而且功能強大,包括可透過Dictionaries Tab 勾選聯想字來源。

MAC!COOL~


摘自:http://www.macuknow.com/node/6038

2010年9月10日 星期五

如何將ipod的音樂同步到電腦

相信使用過iPod系列產品的玩家們都應該知道,可以透過iTunes可以將電腦內的檔案同步到iPod內,但是一旦電腦發生狀況,裡面的檔案不見了,想要之前的檔案就必須要把iPod的檔案回復,但我們必須要使用一些軟體來幫助我們回復,如:Senuti...也就是本章節要介紹的軟體。

第一步當你下載完成之後,選擇完複製檔案的位置後,記得按下一步continue!

第二步要注意使用Senuti前,請先開啟iTunes連接iPod,確定iPod管理的部份有勾選啟用磁碟功能,以及手動管理音樂。


接著進入Sunuti視窗內,應該就可以瀏覽iPod內所有的檔案,而在檔案旁邊有小藍點的代表您的電腦中已經有相同檔名的檔案了,無需複製造成資源浪費。PS:小編電腦太乾淨,所以沒有藍點出現...


如果要複製內容的話,請選擇音樂或影片後,按下左上方綠色按鈕的Transfer。

複製完畢之後可以開啟iTunes,在"最近加入"的標籤內可以看到剛剛複製過來的檔案。

摘自:http://www.goapple.com.tw/index.php?pa=guide_view&id=193&kid=

2010年8月17日 星期二

多台電腦共享一組鍵盤滑鼠-SynergyKM

假設你的工作桌上有好幾台電腦,好幾個螢幕,但是只有一組鍵盤滑鼠,可是又不想花錢買"KM切換器",Synergy是一套可以用軟體達到共享鍵盤滑鼠的軟體,而這邊介紹給你的SynergyKM是在Mac平台下的圖像介面,讓你使用Synergy起來比較容易。Synergy這套軟體也是免費開源碼的軟體,支援多平台,所以說如果你有一台PC+螢幕、一台Mac+螢幕,只要兩台電腦在同一個網路子網域下,分別裝上windows版的Synergy和Mac版的SynergyKM,一樣也可以共享一組鍵盤滑鼠,相當好用,推薦給你。

2010年8月14日 星期六

Subversion With Mac OS X Tutorial

Subversion is a version control system that allows you to work with other people on a project and switch back easily to every version ever made. It can be used for all kinds of projects like application source code, web sites, even images or just simple text documents. Once you have it all set up and followed all the steps described below, it is easy to handle and a very useful thing – not just for computer geeks.

About This Tuturial
This tutorial explains the basics from installing subversion and getting started to working with other people on the same project. It is written primarly for Mac OS X users, but since Subversion itself works the same on all platforms, most of this tutorial should apply to Linux or Windows users, too.
The Concept of Subversion
Subversion works by setting up a central repository on a server or local computer that every user connects to and downloads a personal working copy from. When changes are made to the working copy, they can be uploaded to the repository. If these changes conflict with changes other people may have uploaded since the last time you updated your working copy, subversion tries to merge these files and solve the conflicts.

Downloading and Installing Subversion
I recommend downloading the Subversion Mac OS X package from Collabnet

Download and run the installer. Note that Subversion itself doesn't feature a graphical user interface, so you won't find any new files in your application directory after installation. Instead it installs some command line commands into the directory /opt/subversion/bin* on your hard drive. *Note: For other Subversion packages this path is usually /usr/local/bin.

To be able to call the Subversion commands from every directory, you must add it to your path. If you don't know what that means, don't worry. Just follow the instructions.

Open the Terminal application. It can be found in the /Applications/Utilities folder. Whenever you see below a line starting with a dollar sign, you should type the text after the dollar sign in your terminal and hit return.

Start by creating a new text file called '.bash_profile', i.e. with the command line text editor pico:

$ pico .bash_profile
Add the following line to the text file:

export PATH=/opt/subversion/bin/:$PATH
Now hit Control-X, then confirm saving the file with 'y', followed by return.

You have just added Subversions's location to your path. Let Terminal read this file to know the path has changed (there's an empty space between the dots):

$ . .bash_profile
Creating a Sample Subversion Project
First we will need to set up a Subversion repository on our local computer. That is the place to store all versions of our project. Now create your repository like this:

$ svnadmin create SVNrep
This will create a repository named 'SVNrep' in your your home directory, although svnadmin won't give you any feedback. If you don't trust me on this, you can check the existence of this folder by typing 'ls' in the terminal or looking for it in the Finder.

Next we create our sample project. Create a new folder and an empty file named 'test.txt' inside this folder:

$ mkdir test
$ touch test/test.txt
Let's import this project into the repository. Type in your terminal, by replacing 'sara' with your own user name:

$ svn import test file:///Users/sara/SVNrep/test -m "Initial import"
This will output:

Adding test.txt
Committed revision 1.
We have just imported the folder 'test' into the repository 'SVNrep'. Each version in the repository is called a "revision" and is identified by a unique number. Always provide a short message ('-m') of the changes you made to the repository like we just did!

Retrieving Files From Subversion
Now we get a copy to work on from the repository. This process is called "check out":

$ svn checkout file:///Users/your_user_name/SVNrep/test test-copy
The output will show all files added ('A') to our working copy:

A test-copy/test.txt
Checked out revision 1.
Change into the working copy directory by typing:

$ cd test-copy
Next check the content of our working copy in the terminal:

$ ls -a1
This will output the directory including hidden files:

.
..
.svn
test.txt
Note the hidden directory '.svn'. This holds some subversion info like the name of the repository, so you don't have to type that in the future. If you would like a copy of your repository without this hidden directory in every folder, you have to export a copy:

$ svn export file:///Users/your_user_name/SVNrep/test test-copy
This copy is now safe to deploy on the web. It is not a working copy though, so you can't commit changes back to the repository from this folder.

Time For Changes
It is time to make some changes to our file and save it back to the repository. Open 'test.txt' from the working copy with your favourite text editor and type "Hello world" or whatever you are up to, then save the file.

You can then query Subversion to find out the differences between the repository and your copy:

$ svn status
This will state that our file has been modified ('M'):

M test.txt
Now we want to update the repository with the changes we made. This process is called "committing":

$ svn commit -m "Added some text"
This will output:

Sending test.txt
Transmitting file data .
Committed revision 2.
Dealing With All These Versions
Let's assume, that someone else working on your project made changes to the repository. You will want to update your local working copy to incorporate the changes:

$ svn update
Because in our example nobody else made changes to the repository, this will do nothing and output:

At revision 2.
To list all revisions in the repository, type:

$ svn log
This will output a list of all revisions with it's messages:

------------------------------------------------------------------------
r2 | sara | 2006-10-08 16:41:46 +0200 (Sun, 08 Oct 2006) | 1 line
Added some text
------------------------------------------------------------------------
r1 | sara | 2006-10-08 16:10:36 +0200 (Sun, 08 Oct 2006) | 1 line
Initial import
------------------------------------------------------------------------
If you would like to see the exact differing lines to a specific revision, i.e. revision 1, just type:

$ svn diff -r 1
The output states that the line "Hello world" has been added ("+"):

Index: test.txt ===================================================================
--- test.txt (revision 1)
+++ test.txt (working copy)
@@ -0,0 +1 @@
+Hello world
Maybe you would then rather like to switch back to an older revision:

$ svn update -r 1
This will update ('U') your copy back to revision 1 and output:

U test.txt
Updated to revision 1.
Note that all commands are used on the whole current working directory. You could also provide a single filename for each of these commands, i.e. 'svn update test.txt'.

Renaming, Adding And Deleting Files From The Repository
Sometimes you may add new files to your working copy.

$ touch test2.txt
They will not be included in the repository though, unless you manually add them to the repository:

$ svn add test2.txt
$ svn commit -m "added new file"
If you later would like to remove a file from the repository, type likewise:

$ svn delete test2.txt
$ svn commit -m "deleted file"
Note that you should never delete or rename files from your working copy without Subversion knowing. You can modify inside your files as much as you like. But if you just rename files or move them to another folder, Subversion will loose track of them. Always use 'svn' commands for those operations.

This is how you move a file accordingly:

$ svn move oldfilename newfilename
$ svn commit -m "moved file"
All of these commands will not only affect the repository, but your working copy as well. So you should never have to delete or rename a file with your Finder.

If you are working alone on a project, this is it! Well, basicly. The next chapter will explain dealing with multiple users.

Working With Other People
To act as if someone else was working on your project, you could now check out a second working copy named i.e. 'test-copy2' into your home directory and make some more changes to it. Then commit it to the repository following the steps from above.

Now think of a possible conflict: two people have downloaded their working copy and started working on the same file. When Sara commits her files before Michael does, Michael will get an error message when committing because his copy is not up to date any more:

$ svn commit -m "Some change by Michael"
Sending test.txt
svn: Commit failed (details follow):
svn: Out of date: '/test/test.txt' in transaction '3-1'
Michael will then first have to update his working copy by typing 'svn update'. This will merge Sara's earlier changes into Michael's working copy, line by line.

Michael can now commit the merged copy to the repository. In some rare cases however, there my be a conflict that Subversion cannot solve itself. It will then create three files in Michael's working copy:

test.txt.mine
test.txt.r2
test.txt.r3
Michael now has to manually put the pieces together in the file 'test.txt', deciding which changes to keep. Only when this is made and the three extra files are deleted, Subversion will allow Michael to commit his files.

Now go play around with it to get used to it. Of course there is more to Subversion. You could type "svn help" in the terminal to list all commands or read the freely available SVNbook at http://svnbook.red-bean.com

Graphical User Interfaces
Many people don't like working with the terminal. They find it complicated to remember the text commands, as opposed to clicking on buttons in applications. There is a couple of free or commercial apps available on the internet, that provide a graphical user interface for Subversion commands. I think it's best practice to learn Subversion from the terminal first, before you use a graphical client, to understand the way subversion works better.

A nice and free GUI for Mac OS X is svnX. To manage your working copies from the same application that you write your code with, the text editor TextMate is a good choice. TextMate includes a Subversion bundle that allows you to easily invoke most Subversion commands from the menu. Only once for setting up the repository and checking out the first working copy, you will have to use the terminal. After that, just press Shift-Control-A to open the Subversion bundle menu.

摘自:http://www.rubyrobot.org/tutorial/subversion-with-mac-os-x

[how-to] Mac上如何安裝 git

方法一(使用macports, 我使用這種方法):
打開終端機:
$ sudo port selfupdate
$ sudo port install git-core +svn

方法二(直接使用 Git for OS X Installer):
http://code.google.com/p/git-osx-installer/

git的更多介紹:
http://ihower.idv.tw/blog/archives/2591

摘自:http://izero.pixnet.net/blog/post/27303111

2010年7月23日 星期五

SPEED UP MAC OS X LEOPARD

After a year and a half of running Mac OS X Leopard things have become extraordinarily slow on my MacBook Pro. After googling how to speed up Mac OS X Leopard I have decided to write my own brief tutorial on a handful of things you can do to effectively increase the performance of OS X. This is meant as a programmer’s quick reference guide so if you are not technically savvy you may want to google “performance tune mac os x” for more verbose explanations.

THE 15 BEST MAC PERFORMANCE TUNING APPLICATIONS AND TIPS

Disable Dashboard Widgets. Each dashboard widget you enable consumes both processing power and valuable memory. To disable widgets and speed up your mac follow these steps:
Open up terminal.app located in Applications > Utilities > Terminal
Copy this, paste it in the terminal and hit enter: defaults write com.apple.dashboard mcx-disabled -boolean YES
Then enter this: killall Dock
That’s it! Dashboard widgets are now disabled
Run the Mac OS X disk repair utility location in Applications > Utilities > Disk Utility and then run repair disk permissions. See this article on the repair functions of the disk utility.
Download and run Monolingual to remove all the additional languages that are built into OS X by default and you are likely to never use. I removed everything except English, Spanish, German and French since those are core languages on websites I sometimes frequent.
Download and run XSlimmer to remove all unnecessary PPC (PowerPC) code from Universal Binaries. Only use this if you are using an Intel based Mac. Additionally it is worthwhile noting that I had problems with Photoshop after slimming the application, so perhaps avoid using XSlimmer on CS3 or CS4.
Download and run OnyX. Run the daily, weekly and monthly scripts. Clear out all log files.
Removing unnecessary login items by going to System Preferences > Accounts > Login Items. Note that in order to actually remove a login item you need to select the item and then hit the minus button at the bottom of the preferences screen.
Even though Mac OS X has a journaled filesystem that should automatically handle defragmentation on the fly, it doesn’t do a great job of keeping the drive from becoming fragmented. iDefrag solves these problems and more, by defragmenting and optimizing your Mac’s filesystem at boot time. All you have to do is restart your computer, run the iDefrag boot DVD and it will defragment the entire hard-drive. I noticed a substantial performance boost (I would say up to around 20%) after using this.
Minimize by using the scale effect by going to System Preferences > Dock and changing the default from the Genie effect to the Scale effect. Also you can uncheck “animate opening applications” to boost performance.
Ensure you have a minimum of 10% disk space available so that OS X can run effectively. If you don’t have this much space free try using GrandPerspective to determine what is using space on your hard drive and what you might be able to delete.
Remove fonts that you don’t use. You can do this by going to the finder and removing fonts from your home folder > library > fonts.
Turn off Universal Access by navigating to System Preferences > Universal Access and turn off anything you’re not using.
Turn off Bluetooth by navigating to to System Preferences > Bluetooth.
Turn off Internet Sharing by navigating to to System Preferences > Sharing > Internet.
Check the Activity Monitor located in Applications > Utilities > Activity Monitor to see if there is anything running that is consuming processing or memory resources. This should go without saying.
On older computers you may notice massive performance issues particularly when Spotlight is running. To avoid these issues disable spotlight from indexing your entire hard-drive. You can do this by navigating to System Preferences > Spotlight and then unticking anything that you don’t want to see in search results. If you hit the Privacy tab you can also remove specific folders. I typically remove the Library folder, and also the System folder.
4 COMMAND LINE PERFORMANCE TUNING TIPS

You can speed up TCP connections by opening the terminal.app and typing pico /etc/sysctl.conf and adding the following lines to the file:
net.inet.tcp.mssdflt=1460
net.inet.tcp.sendspace=262144
net.inet.tcp.recvspace=262144
net.inet.udp.recvspace=74848
net.inet.udp.maxdgram=65535
You can speed up SSH connections by opening the terminal.app and typing pico ~/.ssh_config and adding the following lines to the file:
host *
controlmaster auto
controlpath /tmp/ssh-%r@%h:%p
It should be noted here that this may cause some glitches as I have run into some odd controlmaster errors after implementing this command. You can always try it and remove the code if it gives you problems.
Disable dashboard by opening up the terminal.app and running the command:
defaults write com.apple.dashboard mcx-disabled -boolean YES
and then run killall dock to restart the dock.
To optimize firefox’s tab/bookmarks/cache databases on OSX, close firefox, open terminal.app and run #cd ~/Library/Caches/Firefox/Profiles; for i in */*.sqlite; do sqlite3 $i VACUUM;done; cd ~/Library/Application\ Support/Firefox/Profiles; for i in */*.sqlite; do sqlite3 $i VACUUM;done;
THE MISSING MANUAL ON OS X



David Pogue’s missing manual on Mac OS X also covers maintenance related tasks, and is a great starter for those users who want to learn more on the intricacies of OS X. For those not familiar with using Terminal or the command line there is a really helpful chapter on this in specific.



摘自:http://simplestation.com/locomotion/speed-up-mac-os-x-leopard/

2010年7月17日 星期六

Mac OSX tuning

For testing temporary improvements, you can directly use sysctl in a terminal window: (you have to be root to do that)
$ sudo sysctl -w kern.maxfiles=65536
kern.maxfiles: 12288 -> 65536

$ sudo sysctl -w net.inet.tcp.delayed_ack=0
net.inet.tcp.delayed_ack: 3 -> 0

$ sudo sysctl -w net.inet.tcp.win_scale_factor=8
net.inet.tcp.win_scale_factor: 3 -> 8

$ sudo sysctl -w net.inet.tcp.mssdflt=1440
net.inet.tcp.mssdflt: 512 -> 1440

$ sudo sysctl -w net.inet.udp.recvspace= 147456
net.inet.udp.recvspace: 42080 -> 147456

$ sudo sysctl -w net.inet.udp.maxdgram=57344
net.inet.udp.maxdgram: 9216 -> 57344

$ sudo sysctl -w net.inet.tcp.sendspace= 1048576
net.inet.tcp.sendspace: 65536 -> 1048576

$ sudo sysctl -w net.inet.tcp.recvspace= 1048576
net.inet.tcp.recvspace: 65536 -> 1048576

$ sudo sysctl -w net.local.stream.recvspace=65535
net.local.stream.recvspace: 8192 -> 65535

$ sudo sysctl -w net.local.stream.sendspace=65535
net.local.stream.sendspace: 8192 -> 65535

For permanent changes that last over a reboot, insert the appropriate configurations into Ltt>/etc/sysctl.conf. If this file does not exist must create it. So, for the above, just add the following lines to sysctl.conf:


kern.maxfiles=65536
net.inet.tcp.delayed_ack=0
net.inet.tcp.win_scale_factor=8
net.inet.tcp.mssdflt=1440
net.inet.udp.recvspace=147456
net.inet.udp.maxdgram=57344
net.inet.tcp.sendspace=1048576
net.inet.tcp.recvspace=1048576
net.local.stream.recvspace=65535
net.local.stream.sendspace=65535
Note This only works for OSX 10.3 or later! For earlier versions you need to use /etc/rc where you can enter whole sysctl commands.


參考:
http://kb.pert.geant.net/PERTKB/MacOSXOSSpecific

wibiya widget