Showing posts from March, 2012

XCode - Remove Local Git Repository

If you create a XCode project with "create local Git repository" check, your project will be locally versioned.

But, it does not seem to have an easy way to remove it afterward. Why you want to do it? It may because

1. You want your project to recognize remote SVN/Git repository setting.
2. Double click on xcodeproject so that XCode organizer automatically recognize your current SVN/Git setting

Below may help you in removing local Git repository completely in your project.

1. Go to the root of your project folder. Usually, it is the folder that contains the .xcodeproject file
2. Remove the .git folder. It is hidden. You can use

rm -rf .git

3. Open your project. It should open XCode IDE.
4. Look at the top right corner of the XCode IDE. Open Organizer

5. At Organizer, navigate to Repository

6. Remove all existing/related repository for your project by clicking on the project and click on the - sign on bottom left of Organizer

7. Now, navigate to Projects
8. Remove all exitin…

Linux - cannot restore segment prot after reloc: Permission denied

I encounter this during my installation of Postgres to CentOS 5.8 - cannot restore segment prot after reloc: Permission denied

This error could happen on any package installation.

SELinux (Security Enchance Linux) provide access control security feature in Linux. See

Disabling it actually is bad. However, it provides a quick fix to my issues.

You can temporarily or permanent disable SELinux

Temporarily Disable

To disable

/usr/sbin/setenforce 0
To enable

/usr/sbin/setenforce 1
This is temporary SELinux turn off, thus, you do not need to reboot the system.

Permanent Disable

Edit /etc/selinux/config

vi /etc/selinux/config
You will see the following

# This file controls the state of SELinux on the system.
# SELINUX= can take one of these three values:
#       enforcing - SELinux security policy is enforced.
#       permissive - SELinux prints warnings instead of enforcing.
#       disabled - SELinux is fully disabled.


Mac OS - Outlook search return no result

Outlook for Mac uses Spotlight for searching. However, my Outlook refuse to search when I try my keyword in the search box.

Here is the official response from MS

But the problem is, I don't have any mail category in System Preference -> Spotlight -> Search Result

So, my solution is as follow

1. Go to System Preference -> Spotlight -> Privacy
2. Click on + to add a Privacy
3. At the open dialog, select Macintosh HD and click choose
4. Click ok if the system ask for confirmation on selection Macintosh HD for privacy
5. You should see Macintosh HD appear on the Privacy box
6. Close Spotlight
7. Reopen Spotlight
8. Go to Privacy, select Macintosh HD and click on -
9. Now, Spotlight should be re-indexing the machine and Outlook should be searchable after the re-indexing.

MEncoder - Encoding with subtitle for PS3 playback

I have to admit that PS3 is very fussy on the playback format. Even encoding with H.264 and AAC in a MP4 container does not always work due to problem such as profile, encoding parameters, etc...

So, the best playback format for PS3 is xvid with mp3 in avi container.

Below is a sample command to encode a file to a xvid with mp3 in avi container with MEncoder

mencoder.exe "input.mp4" -o "output.avi" -oac mp3lame -ovc xvid -xvidencopts fixed_quant=4 -sub ""
-o --> define a output file

-oac --> output audio codec. mp3lame is the encoder name for mp3

-ovc --> output video codec. xvid is the encoder name for xvid

-xvidencopts --> xvid encoder options. You must define it. The simplest setting is to define fixed_quant level.

fixed_quant define the quality level for the output codec. It ranges from 1 to 31 with 1 is the best. Under my testing 4 is a good setting that provide high quality video with smaller file size. 1, 2 and 3 does not prov…

VirtualBox - Reusing VDI Harddisk

There are a few techniques to reuse old VirtualBox setting in a new Windows/Mac/Linux machine.

1. Some posts says just copy the VirtualBox setting to a new machine. Adjust the UUID in the xml file so that the new VirtualBox. I never try it because it looks tedious and setting of UUID may not be trival. Also, what if there is a change of hardware such as change of machine?

2. In VirtualBox, they provide an option to Export an Appliance. Well, it does work for single standalone appliance. But, I have a shared vdi and 3 different OS VM using it. That causes an issue during my import because of my shared vdi.

3. My current way of doing. Copy the vdi and manually setup the VM environment. This way, although manual, but at least, the change in hardware and VM setting such as UUID is handled by VirtualBox

The following steps work for me when I reuse a Windows VirtualBox VDI harddisk file in Mac OS X VirtualBox

1. Download and install VirtualBox
2. Create a new VM by clicking the New button.…