mac

How to make a terminal alias for Mac OS X

After looking around for how to make an alias for Mac OS X's terminal/shell I ended up cobbling together my solution from a variety of different (mostly unixy-linuxy) places. So in the name of good documentation, here is the magic formula for the next time I need to set up an alias for happier command line hacking:

  1. First we edit/create a profile. For a normal user do:
    pico /etc/profle
    ...or for root/superuser do:
    pico ~/.profile
  2. Add your alias like so to the file:
    alias aliasname='mycommand /path/path'
    (notice no space between equal sign and ')
  3. Save your changes and close the file
  4. Load/reload your profile with:
    . /etc/profile
    ...or for root/superuser do:
    . ~/.profile
  5. If you are using root/sudo you will need to use sudo -i in order to load the profile upon login (more info about this here).
  6. Done.
21 October, 2009

Dev Mashup: Building a dual MySQL 4.1 and MySQL 5 dev environment in OS X 10.5 Leopard (and more)

I've been wanting to upgrade to MySQL 5 for a while now, and after hearing that MySQL 5 is required for Drupal 7 I decided to bump up my upgrade schedule, pronto. If all one wants is MySQL 5 then that is easy enough -- go download MAMP and you're done. But what if you want to be able to dev on MySQL 4 for projects that require it for whatever reason (e.g., clients who are run it and are not willing/able to upgrade MySQL at the moment)?

Well, with not a lot of effort - it very easy to have a PHP 5, PHP 4, MySQL 5, and MySQL 4.1 environment - all sharing the same doc root and servernames (e.g., urls):

Step one:
Configure Apple's native Apache, PHP, and add a free-standing MySQL 4.1 install (since MAMP comes with MySQL 5, right). Here are two good links to get you on your way to doing this:
Install Drupal on Mac OS X 10.5 Leopard
Working with PHP 5 in Mac OS X 10.5 (Leopard)

...if you are migrating a free-standing MySQL install from a previous install you may want to check these articles out (1, 2) as well.

Note: Getting all of this totally set up and working right, including setting up your virtualhosts and /etc/hosts file, before installing MAMP will pay off.

Step two:
Download MAMP and follow the readme.txt instructions and/or use these links to setup the basics:
HowTo: Create a local environment using MAMP
Install a Local Web Server on Mac OSX

Step three:
Now it's time to integrated these two completely separate environments so that you can keep a common doc root, virtualhosts, and urls, and systems tools (we'll get terminal access going for MAMP's MySQL):

We'll make it so that we can keep all of our sites, no matter which enviroment they require, in a common place -- and so that no matter what we're running we will always be able type in "localhost", or and know that it will take us to our doc root (instead of having to remember to type "localhost:8888/" for MAMP:). Relatedly, doing the steps below lets us keep common server names (e.g., 'mysite.local') across environments.

So now:

* Change the docroot in MAMP's httpd.conf (line 368) to:
DocumentRoot "/Library/WebServer/Documents"

15 February, 2008

Komodo IDE and Drupal/PHP development - a combo built upon mutual appreciation

After spending 3 days trying to get Elipse PDT and the Zend debugger working on Mac OS X, my nerves were very frayed, indeed. Apparently, there has been an ongoing problem with the Zend debugger not stopping at breakpoints on Mac Intel machines...something that has plagued Eclipse through 3 different PHP extensions. (don't even get me started on how crazy it is that Eclipse has seen three completely separate PHP plugins within less than a year)

In the end all was not lost. On the contrary, after enough scratching around Google I discovered what I needed to know. Komodo has become the semi-de-facto IDE of choice for many Drupal developers. A fact confirmed for me when I saw many familiar names from the Drupal community on the ActiveState website (itself a Drupal site).

Suffice to say with Komodo I got local and remote debugging up and running within just a couple hours, and it's been a total dream to use.

So now I have a proper debugger, integrated svn, and last but not least, Drupal api code compeletion/documentation is included. And if that's not enough, it uses 100mb+ less memory than Eclipse did.

Komodo is going to set me back a few bucks ($295) after my trial runs out, but even at that price it's a no-brainer for some who makes their living with Drupal and PHP. Kudos to ActiveState on their outreach to the Drupal community.

Some useful links if your interested in checking out Komodo:
Link 1
Link 2
Link 3
Link 4

13 September, 2007
Subscribe to RSS - mac