Bash


11
Mar 12

Using both Pow and Apache on OSX Lion

I have written previously about using Pow for Ruby/Rails development. Pow is great if you are purely developing in Ruby, however I’ve recently found myself needing to edit a WordPress site.

Pow intercepts requests to port 80 by default meaning that no requests can make it through to the default Apache installation on OSX. I’ve found the best way around this is to disable Pow whenever developing in PHP. The powder gem handles this nicely, so:

gem install powder

Now you can now disable Pow with the following, therefore letting requests through to Apache (assuming you have it enabled):

powder down

And once you’re done with the PHP development, enable it again with:

powder up

As a side note, I usually leave Apache disabled by default i.e. uncheck “Web Sharing” within the “Sharing” section of System Preferences until I am going to be doing some PHP development.

Hope this saves someone some time figuring out how to disable/enable Pow.


4
Jan 12

Naming your Terminal tabs in OSX Lion

If you find yourself in the Terminal app with a bunch of tabs open, the default name of “bash” isn’t very useful when navigating between them. You can change the tab name via the UI by right clicking the tab, then clicking “Inspect Tab” and changing the window or tab names but this is somewhat long winded.

Below are a couple of bash functions I have in my “.profile” file to make this easier:

function tabname {
  printf "\e]1;$1\a"
}
 
function winname {
  printf "\e]2;$1\a"
}

Now you can easily name your tabs or windows with the following:

# Rename tab
tabname "Funky Tab"
 
# Rename window
winname "Funky Window"

Thanks to Bubu and Chris Page on the SuperUser site for the right codes.