Make phone call with Iphone API

November 30th, 2009 No comments

NSURL *phoneNumberURL = [NSURL URLWithString:@"tel:8005551234"];
[[UIApplication sharedApplication] openURL:phoneNumberURL];

[Slashdot] [Digg] [Reddit] [del.icio.us] [Facebook] [Technorati] [Google] [StumbleUpon]
Categories: XCode / C Tags:

Mac SAY voices

November 27th, 2009 No comments

Female Voices
Agnes
Kathy
Princess
Vicki
Victoria

Male Voices
Bruce
Fred
Junior
Ralph

Novelty
Albert
Bad News
Bahh
Bells
Boing
Bubbles
Cellos
Deranged
“Good News”
Hysterical ”
“Pipe Organ”
Trinoids
Whisper
Zarvox

[Slashdot] [Digg] [Reddit] [del.icio.us] [Facebook] [Technorati] [Google] [StumbleUpon]
Categories: Uncategorized Tags:

Unpack TAR/BZ2

November 26th, 2009 No comments

tar -jxvf filename.tar.bz2

[Slashdot] [Digg] [Reddit] [del.icio.us] [Facebook] [Technorati] [Google] [StumbleUpon]
Categories: Uncategorized Tags:

URL escaping in Javascript

November 16th, 2009 No comments

Though normally you can use the escape function for this, note to full URL encode an actual URL, use encodeURIComponent instead … saves a lot of headaches when deailing with ajax ….

[Slashdot] [Digg] [Reddit] [del.icio.us] [Facebook] [Technorati] [Google] [StumbleUpon]
Categories: Javascript Tags:

mySQL backup script

November 16th, 2009 No comments

This backup is listed on the mySQL site somewhere. Backs up a DB broken down into individual tables. Great if you have large data sets. This one also purges the files after 7 days ( does leave the directories behind though )

#setup
suffix=`date +%Y%m%d`
dest=/mirror/mysql/SQL01
cmd='/usr/bin/mysqldump'

databases=(`echo 'show databases;' | mysql -h SQL01 -u root | grep -v ^Database$`)

for d in "${databases[@]}"; do
if [[ $d != 'tmp' && $d != 'test' ]]
then
echo "DATABASE ${d}"
s="use ${d}; show tables;"
tables=(`echo ${s} | mysql -h SQL01 -u root | grep -v '^Tables_in_'`)
for t in "${tables[@]}"; do
if [[ $t != 'tbl_parameter' && $t != 'tbl_session' ]]
then
echo " TABLE ${t}"
path="${dest}/${suffix}/${d}"
mkdir -p ${path}
${cmd} --user=root --host SQL01 --quick --add-drop-table --all ${d} ${t} | bzip2 -c > ${path}/${t}.sql.bz2
fi
done
fi
done

# delete old dumps (retain 5 days)
find ${dest} -mtime +10 -exec rm {} \;

find /mirror -depth -type d -empty -print0 |xargs -0 rmdir

[Slashdot] [Digg] [Reddit] [del.icio.us] [Facebook] [Technorati] [Google] [StumbleUpon]
Categories: MySQL Tags: