Turn of spotlight and mds from scanning your external hdd

Quite often when having problem ejecting the external hard disk from my Mac OS X. I’m getting error saying that there the hard disk is being used.

So to check which process is using the volume with this command.

$sudo lsof | grep /Volumes/1TB\ Toshiba

Then I found out that a lot of the process was from mds and ms_store. These were from spotlight. So the next thing is to exclude this volume from spotlight, by adding it into the System Preferences > Spotlight > Privacy 

Then next, manually turn off from terminal.

$mdutil -i off /Volumes/1TB\ Toshiba


Fixing Postgres connection issue on Mac with Rails

When doing using rails on Mac which require Postgres, an error appeared which showing connection problem.

could not connect to server: No such file or directory
Is the server running locally and accepting
connections on Unix domain socket “/var/pgsql_socket/.s.PGSQL.5432”?

to fix this just add“export PGHOST=localhost” to your bashrc or zshrc

pg_config missing?

Use below command to find the pg_config

$sudo find / -name pg_config

Then run below command for installation of pg gem on Mac

$gem install pg — –with-pg-config=/Applications/Postgres.app/Contents/Versions/9.4/bin/pg_config

Vmware installation problem for MSI ” failed

To solve the msi installation when install the tools-linux, tools-freebsd and etc. Just skip it first by clicking the OK button. Then later go to cmd and something like VMware-xxxx.exe /x

if you have come into an error showing that EULAS_AGREED = 1 then during the installation, type  VMware-xxxx.exe /x EULAS_AGREED=1 to get through it.

If earlier you have installed, also type the same command and choose uninstall when it pop up for selection and type of the above command.

ACL x+ problem

When I woke up this morning, and started to notice some strange behaviour appear on the Mac. Certain applications couldn’t delete things while some was having some problem showing some saving issue.

After some investigation, I found that my folders and files attribute came with a rwxr-xr-x+. Normally would be just rwxr-xr-x. So the + sign means there was additional attributes added to the files/folders. To remove it use the command “sudo chmod -R -N ./*”. -R is for recursive. -N is to remove the ACL attributes.

However, this doesn’t fully resolve my problem, because the chmod has no effect to symbolic links.

Update: By using Finder, click right the folder and choose Get Info. Then unlock the folder, you will be prompted for admin password. Then choose “Apply to enclosed items”. But beware this will make all the files and folders you have to the same privilege.