Empty a trash on mac like super users do …

I’m a nerd. So I want to find a way to empty the trash by terminal. I found this:

sudo rm -Rf ~/.Trash/*

It works perfect. All files are removed. Earlier I had a few flies that stop me from having an empty trash 🙂

+1 for command line 🙂

How to upgrade SVN on a mac

Mac OS X 10.5 comes with an outdated svn version, I think it’s 1.4. For work, I need to update this to 1.6.

To check the current version, open the terminal and type:

svn -help

The version number is located on the first line.

To upgrade, download a binary package from: http://subversion.tigris.org/getting.html#osx

Then add this to .profile or .bash_profile:

vi ~/.profile

export PATH=/usr/local/bin:$PATH

Try to check for the version again. If it still uses the same version, try source command

source .profile

Plain text editor for Mac OS X

On Windows, I love using notepad. However, in Mac OS X Leopard, they came up with rich text editor for TextEdit. It looks really cool when being able to see the color, HTML, etc. Sadly, in practical, it is very annoying for me for coding. For example, <html> tag becomes &lt;html&gt;, etc.

So, I decided to disable the rich text format function in TextEdit.

This is how I did it:

1. Open TextEdit > Preferences

2. Under “New Document” I selected Plain Text as format.

3. Under “Open and Save” I select first 2 boxes, to ignore rich text commands in both HTML and RTF files.

Note that “GOD [see comment below]” pressing cmd + shift + t switches between paintext and richtext mode. Thank you 🙂

SVN Commit Failed

Today when I tried to commit from Terminal, I have got this message:

“svn: None of the environment variables SVN_EDITOR, VISUAL or EDITOR is set, and no ‘editor-cmd’ run-time configuration option was found”

But svn checkout, status and update are working. I did some research and found that I can get around this by using -m parameter

svn ci -m “message”

And again, it works.

Installing UTF-X on a Mac

This is a record of my first attempt to install UTF-X, XSLT Unit testing framework, on Mac OS X. This is a link to UTF-X’s project page: http://utf-x.sourceforge.net/

Note that the steps are based on RUBRIC’s documentation.

1. Installing JDK from http://java.sun.com

2. Installing apache ant from http://ant.apache.org/

2.1 Download and Unzip to a directory, say ~/ant/

2.2 Add ant/bin to System Path

2.2.1 vi .profile then add “EXPORT PATH=$PATH:/path/to/ant/bin”

2.3 Create a new system variable “ANT_HOME” with a value “/path/to/ant”

2.3.1 vi .profile then add “EXPORT ANT_HOME=/path/to/ant”

2.4 Create a new system variable “JAVA_HOME” with a value “/path/to/java” for example “/Library/Java/Home”

2.4.1 vi .profile and add “EXPORT JAVA_HOME=/Library/Java/Home”

2.5 run source .profile to use those variables

3. Installing UTF-X

3.1 Download and Unzip to a directory, say ~/utf-x

3.2 Compile UTF-X samples by running “ant samples” via Terminal

Ahh it works.