Archive for the ‘OSX’ Category

MySQL: Installing and starting MySQL On Mac

Sunday, June 30th, 2013
  1. Download latest native Package (i.e. .dmg) here: MySQL Download
  2. See installation doc (install MySQL and the startup items

Startup Items Info from doc

The Startup Item for MySQL is installed into /Library/StartupItems/MySQLCOM. The Startup Item installation adds a variable MYSQLCOM=-YES- to the system configuration file /etc/hostconfig. If you want to disable the automatic startup of MySQL, change this variable to MYSQLCOM=-NO-.


shell> sudo /Library/StartupItems/MySQLCOM/MySQLCOM start


shell> sudo /Library/StartupItems/MySQLCOM/MySQLCOM stop

See source

Mac: Limit TimeMachine backup interval

Tuesday, August 14th, 2012
sudo defaults write /System/Library/LaunchDaemons/ StartInterval -int nnn

Where nnn is in second (e.g., 18000 for 5 hours) . Set to 3600 to reset default.


OSX: How to edit/flush the hosts on Mac

Sunday, August 14th, 2011

Edit the hosts file

sudo vi /etc/hosts

Flush dns

dscacheutil -flushcache 


OSX: How to trim a AVCHD, AVCLite (MTS or M2TS) on Mac without loss (i.e. rewrap vs transcoding)

Saturday, January 1st, 2011

It can be tricky, especially on Mac, to trim AVCHD videos (.MTS or .M2TS) without transcoding the videos. Most tools, such as Adobe Premiere, Adobe Media Encoder, Apple Final Cut Pro, and most sharewares, will require to convert before trimming, which is a slow and loss-full process.

On Windows, Canon provides a tool to directly trim .M2TS files without any re-encoding. However, on Mac it is more tricky, and I had to do some digging and spend some $ to accomplish about the same thing.

After much research, I found a way with two softwares:

  1. ClipWrap ($50): This allow you to convert your .MTS to .MOV without any re-encoding (just a “rewrap” as it is called). In short, it’s super fast (almost as fast a coping the file), completely loss-less, and you can play the new .MOV file with Quicktime.
  2. MPEG Streamclip (fully free): This free software allow to open video files (.mov, .mp4), trim them, and just save them (without transcoding). Make sure to use the “Save As,” as the “Export…” will do the transcoding. I wish it would support AVCHD format so that we would not need ClipWrap.
Anyway, it interesting that despite the perception that Mac is more for Media friendly, such basic tasks require so much work (and research). Also, iMovie ’11 AVCHD support is very poor, as you cannot just drag and drop them in the tool and require an import (i.e. transcoding). Luckily, I am using Adobe Premiere CS5, which works seemlessly.
Hope this help. Feel free to add comment or email me if you have any comment or suggestion.

OSX: Managing multiple iPhoto Library

Tuesday, December 21st, 2010

OSX: Mac Color Picker as an App and HTML HEXA color extension

Friday, September 10th, 2010
  • Start AppleScript Editor (Applications -> AppleScript Editor)
  • Enter text “choose color” in the script
  • Save file as “” (select “Application” as file format)
  • Installa HexColorPicker from LuckySoftware
  • Double click on the
Source: Mac OS Hints – Make the OS X Color Picker into an Application
Note: while this is a nice little trick, go to Utilities > DigitalColor Meter (very cool tool which makes this little trick useless)

OSX: Install mysql on Mac

Wednesday, September 8th, 2010

1) Download and install the .dmg image

2) Fix the permission

sudo chgrp -R mysql /usr/local/mysql

You might need to do the following:

sudo chown -Rf :mysql /usr/local/mysql-5.1.50-osx10.6-x86_64/

This will set the _mysql group owner for all the subfolders of mysql

3) Start the MYSQL

sudo /usr/local/mysql/bin/mysqld_safe --user=mysql &

4) Create the supersecure root password

/usr/local/mysql/bin/mysqladmin -u root password supersecurepassword

5) symlink mysql

sudo ln -s /usr/local/mysql/bin/mysql /usr/bin/mysql

6) login via mysql

msyql -u root -p

7) Download and install Sequel Pro (the SQLyog for Mac)

OSX: Set Mac hostname (i.e. avoid perforce workspace issues)

Tuesday, August 17th, 2010

To set the hostname of your Mac, do:

sudo scutil --set HostName myhostname.local

To check your hostname:


Source: Change the hostname in a Mac

This is particularly useful when using perforce from different location. Perforce link a hostname to a workspace, and OSX seems to take the hostname based on the network (in some occasions). So, you can end up with an error like:
Client ‘jeremy_MBPro_4′ can only be used from host ‘’.

OSX: Add autocomplete for git on Mac

Tuesday, August 17th, 2010

in the home folder (~), edit (or create) the .profile file with the following

# Set git autocompletion and PS1 integration
if [ -f /usr/local/git/contrib/completion/git-completion.bash ]; then
  . /usr/local/git/contrib/completion/git-completion.bash

if [ -f /opt/local/etc/bash_completion ]; then
    . /opt/local/etc/bash_completion


Source GIT Autocomplettion and enhancement

OSX: Mac keyboard Shortcuts

Monday, August 16th, 2010
  • Shift + CMD + / : Show application help menu with search for all the application menu.

Source: – simple keyboard shortcuts

Apple keyboard knowledge base