Friday, December 19, 2008

Apache log in terminal

The location of the log is in : /var/log/apache2
Then use sudo tail -f error.log
Simple right?

Friday, December 05, 2008

Change terminal title on Mac Leopard

The leopard ships with tabbing feature for terminal, which is cool. However, the problem with that is you can not change the title at all. I found a little shell script may do the trick froom http://pseudogreen.org/blog/set_tab_names_in_leopard_terminal.html, here is the snippy of the function:


function set_window_and_tab_title
{
local title="$1"
if [[ -z "$title" ]]; then
title="root"
fi

local tmpdir=~/Library/Caches/${FUNCNAME}_temp
local cmdfile="$tmpdir/$title"

# Set window title
echo -n -e "\e]0;${title}\a"

# Set tab title
if [[ -n ${CURRENT_TAB_TITLE_PID:+1} ]]; then
kill $CURRENT_TAB_TITLE_PID
fi
mkdir -p $tmpdir
ln /bin/sleep "$cmdfile"
"$cmdfile" 10 &
CURRENT_TAB_TITLE_PID=$(jobs -x echo %+)
disown %+
kill -STOP $CURRENT_TAB_TITLE_PID
command rm -f "$cmdfile"
}