Saturday, July 19, 2008

Tips: Run Linux apps in Mac OSX Seamlessly

I have been using Vmware Fusion to run Ubuntu 8.04 and Windows XP for a while. I really like the idea of Unity while using Windows in Vmware as it seamlessly integrates Windows and Mac OSX apps.


I was a little sad to find out there is no such feature for Linux. Guess what, I was wrong. While I was fiddling with different ssh options, I came across a feature called X11 forwarding. With the use of X11 forwarding, its easy to accomplish the same effect. All you need is just add '-X' option while you ssh and make sure you have a working X11 environment installed in your Leopard.


$ssh -X zaher@172.16.90.128


Its as simple as that. After login, just run any graphical program you want like a native application. You can also disable X11 in your VM since it has the added benefit of using low memory than usual as no X11 us running in your Virtual Machine.


Here is a screenshot of Firefox, Gimp and OpenOffice.Org running from my Ubuntu Hardy Heron in Leopard.



Friday, July 18, 2008

Mission: Recover Disk Space: Part 2

Hmm, the mission is going pretty well, next step download Monolingual. This cool Open Source tool checks your MacOSX system for redundancies like localized documentations, not platform specific apps and gives you a choice to remove them selectively.

I was able to about 2.8 Gigs from my last run, as I only kept English and Bengali localizations and Intel specific installations.

I love the icon of this app very much, :P

Mission: Recover Disk Space: Part 1

This was getting more and more annoying day by day. My hard drive was getting full day by day as i kept installing new apps but somehow the rate of hard drive usage wasn’t matching the applications installed. Something was wrong and something need to be done.


I installed OmniDiskSweeper and gave it run. I noted a folder called /cores which was taking a whooping 5.4Gigs. Suspicious, I looked it up and came to know that this is the folder where my Leopard keeps its memory dump files after any system crash for debugging purposes. Since it didn’t concern me, I just safely deleted these annoying core.xxxxx files to reclaim my precious 5.4 Gigs.

So if you are also running out of space, don’t forget to check that folder.

Thursday, July 03, 2008

Debug PHP scripts in Netbeans IDE

Are you having problems in finding pesky quirks in your PHP scripts and swelling your fingers by writing print_r in almost every lines? This tip is just for you ...


  1. Download and install “Early Access for PHP” bundle of Netbeans from http://download.netbeans.org/netbeans/6.1/final/ .

  2. Download and install an appropriate PHP-Mysql distro. I’m using MAMP in my Mac OS. Another good platform independent option is XAMPP.

  3. Download the appropriate version of xdebug from http://www.xdebug.org/ matching your php version (use phpinfo() in your web server to grab that). In my case there was no Mac OS binary, so I had to download the source. If you are downloading binary package then you can skip to step 7.

  4. Unpack the source and open a terminal in that folder.

  5. Now run [Note: make sure phpize and php-config is in your path]:



$phpize

$./configure --enable-xdebug

$make




  1. A file called xdebug.so (in Linux and Mac OS) or xdebug.dll (Widows) will get created. If you have downloaded binary package, your package will contain this file.

  2. Now copy this file into the extension folder of your server. In my case it was like this



$cp modules/xdebug.so
/Applications/MAMP/bin/php5/lib/php/extensions


  1. Now open your php.ini file and add entries for this new extension


zend_extension = "/Applications/MAMP/bin/php5/lib/php/extensions/xdebug.so"

xdebug.remote_enable=1



  1. Now fire-up Netbeans and create/open your php project. Now insert a breakpoint by clicking anywhere in the left margin, now try to debug the file by selecting debug from context menu. You should see your web browser being fired and probably a blank web page. Now press F7 to step into your code and see it execute step by step. Try adding some watches. As the whole page finishes executing, you get to see the result in your web browser.


Happy Debugging!!!

Update 5 July 2008:
Just found out this link for configuring xdebug with netbeans in Ubunutu 8.04.

Back to Blogging

After a failed attempt last year to get back to blogging, I'm trying it again this year. I really wanted to get back, but got busy will...