Archive for 2009

Things you can do with a dead iMac

I recently had a 20" iMac (Mid-2007 Aluminum) die during a thunder storm. It was six months out of warranty, and an Apple Genius quoted my $953 to repair. Obviously buying a new MAC is more cost effective than fixing this one, so I purchased a new MAC Mini. But what should I do with the dead one? After an hour of tear-down, me and the boys at work found a few entertaining uses...

 


  
  
  
  
  
 


Project Summary:
  • Teardown the iMac (guide)
  • Completely remove ALL internal components
  • Place a solid sheet of white construction paper under glass screen
  • Reassemble chasis
  • Have fun drawing

Thats it! Now its time for you to show everyone what YOU can do with a dead iMac.

P.S. Apple, please revise the iMac to include an external video input. Heck why not add USB-KVM functionality. Think of it as a docking station for your MacBook. I bet most of us would gladly pay for it... just saying.

Manualy Restore iPhone from a Time Machine Backup

For all those people who did a clean install of Snow Leopard and do not want to restore any data from Time Machine, you may find manually recover your iPhone Apps & data a huge time saver over re-downloading everything. Well you are in luck, as the solution is fairly simple.



App Recovery

  1. Navigate to your last Time Machine Backup on your external drive.
  2. Locate you home directory under the users folder from the root.
  3. Apps are stored in ~/Music/iTunes/Mobile Applications. Just drag them into the iTunes window, with Applications selected from the sidebar. On the next iPhone sync, iTunes copied them onto the iPhone.
Data Recovery
  1. Disable automatic syncing in the iTunes preferences under Devices.
  2. Replace ~/Library/Application Support/MobileSync/Backup/abc123 with an older version from Time Machine. Note that abc123 is a very long alphanumeric key identifying to your iPhone -- make sure you get the right one, in case you sync with several phones or iPods.
  3. Plug in the iPhone.
  4. iTunes is going to want to erase and sync your iPhone, it sounds terrifying but do it. It may also complain about replacing user account info... this is okay too.
  5. Control-click (in the iTunes sidebar) on the iPhone and choose Restore from Backup. At the end of the process, your iPhone will automatically restart.

Installing RT 3.6.6 on RHEL 5.1

As of Fedora 6 rt-3.6.3 has been available as an RPM. The Fedora RPM has since been rebuilt for Rhel5 using the rt-3.6.6 source code. This document serves as a guide to the basic install and setup of a new (virgin) instance of RT.


Prerequisites

This document assumes you have basic system admin experience and root access to the server you are installing on. In addition you require...


  • Redhat Enterprise 5 or 5.1 base install

  • yum configured to provide all 'base' packages available on the installation media.




OS Setup


Install Redhat Enterprise 5 with mysql and apache. Also, you will likely need to disable SELinux and any firewall rules. As stated above this guide will assume that all 'base' packages must be available via yum. It is also assumed that this server will not only host the rt web front end, but will also house the rt database using mysql.


Disable SELinux or put it in to permissive mode

setenforce 0

Update your installation with the latest patches

yum update

Install Apache, MySql, & sendmail-cf via yum

yum install httpd
yum install mysql
yum install mysql-server
yum install sendmail-cf


Start the httpd and mysql services


service mysqld start
service httpd start

Make sure the httpd & mysqld service start at boot

chkconfig httpd on
chkconfig mysqld on



RT Installation


With the OS correctly installed and apache & mysql running, we can now install Rt and all of it dependencies. This can be done via two methods supported by this document, yum or rpm.


Download this archive and extract it.

wget http://www.jwhite3.com/files/rt/rt-3.6.6-bundle.tar.gz
tar –zxvf rt-3.6.6-bundle.tar.gz


Setup a local or remote yum repository to serve these packages

vi /etc/yum/repos.d/localrt.repo

[rhel51-rt3]
name=RT 3.6.6 for Red Hat Enterprise Linux 5.1
baseurl=file:///path/to/your/extracted/files
enabled=1
gpgcheck=0

Clean your yum cache, download new repo data, and make sure rt3 exists

yum clean all
yum list rt3


Install rt3 and all dependencies with yum

yum install rt3

On a fresh machine yum will install about 84 total packages...

Dependencies Resolved

====================================================================================
Package Arch Version Repository Size
====================================================================================
Installing:
rt3 noarch 3.6.6-1.el5 rhel51-rt3 1.4 M
Installing for dependencies:
MySQL-zrm noarch 1.2.1-1 rhel51-mysql 136 k
apr i386 1.2.7-11 rhel51-base 123 k
apr-util i386 1.2.7-6 rhel51-base 76 k
git-core i386 1.5.3.6-1.el5 rhel51-EPEL 4.2 M
httpd i386 2.2.3-11.el5 rhel51-base 1.1 M
mod_perl i386 2.0.2-6.3.el5 rhel51-base 4.0 M
mysql i386 5.0.54-1.el5 rhel51-mysql 6.4 M
perl-Apache-DBI noarch 1.06-1.el5.rf rhel51-rt3 49 k
perl-Apache-Session noarch 1.81-2.fc6 rhel51-rt3 104 k
perl-Archive-Tar noarch 1.34-1.fc8 rhel51-rt3 54 k
perl-BSD-Resource i386 1.28-3.fc8 rhel51-rt3 34 k
perl-CSS-Squish noarch 0.07-1.el5.rf rhel51-rt3 14 k

perl-Cache-Cache noarch 1.05-1.fc6 rhel51-rt3 89 k
perl-Cache-Simple-TimedExpiry noarch 0.27-1.fc6 rhel51-rt3 7.7 k
perl-Calendar-Simple noarch 1.17-1.fc6 rhel51-rt3 12 k
perl-Class-Container noarch 0.12-5.fc7 rhel51-rt3 37 k
perl-Class-Data-Inheritable noarch 0.06-2.fc8 rhel51-rt3 8.8 k
perl-Class-MethodMaker i386 2.08-4.fc6 rhel51-rt3 564 k
perl-Class-ReturnValue noarch 0.55-1.fc6 rhel51-rt3 10 k
perl-Clone i386 0.27-1.fc6 rhel51-rt3 14 k
perl-Convert-BinHex noarch 1.119-5.el5 rhel51-EPEL 47 k
perl-DBD-MySQL i386 4.005-2.fc8.1 rhel51-rt3 143 k
perl-DBD-Pg i386 1.49-1.fc6 rhel51-base 114 k
perl-DBI i386 1.58-2.fc8 rhel51-rt3 715 k
perl-DBIx-DBSchema noarch 0.35-1.fc6 rhel51-rt3 70 k
perl-DBIx-SearchBuilder noarch 1.51-1.el5.rf rhel51-rt3 110 k
perl-Devel-StackTrace noarch 1.15-2.fc8 rhel51-rt3 23 k
perl-Digest-HMAC noarch 1.01-16 rhel51-rt3 21 k
perl-Digest-SHA1 i386 2.11-4.fc8 rhel51-rt3 51 k
perl-Exception-Class noarch 1.23-3.fc7 rhel51-rt3 33 k
perl-FCGI i386 0.67-1.2.el5.rf rhel51-rt3 85 k
perl-Font-AFM noarch 1.19-4.fc6 rhel51-rt3 18 k
perl-GD i386 2.35-2.fc6 rhel51-rt3 198 k
perl-GDGraph noarch 1:1.44-1.fc6 rhel51-rt3 133 k
perl-GDTextUtil noarch 0.86-8.fc6 rhel51-rt3 75 k
perl-Git i386 1.5.3.6-1.el5 rhel51-EPEL 21 k
perl-GnuPG-Interface noarch 0.33-8.fc6 rhel51-rt3 79 k
perl-HTML-Format noarch 2.04-6.el5 rhel51-EPEL 40 k
perl-HTML-Mason noarch 1:1.37-1.fc8 rhel51-rt3 481 k
perl-HTML-Scrubber noarch 0.08-4.fc6 rhel51-rt3 22 k
perl-HTML-Tree noarch 1:3.23-2.el5 rhel51-EPEL 207 k
perl-HTTP-Server-Simple noarch 0.27-1.fc6 rhel51-rt3 24 k
perl-HTTP-Server-Simple-Mason noarch 0.09-5.fc6 rhel51-rt3 12 k
perl-Hook-LexWrap noarch 0.20-4.fc6 rhel51-rt3 13 k
perl-IO-Socket-INET6 noarch 2.51-2.fc6 rhel51-base 13 k
perl-IO-Socket-SSL noarch 1.02-1.fc7 rhel51-rt3 50 k
perl-IO-Zlib noarch 1.07-1 rhel51-rt3 16 k
perl-IO-stringy noarch 2.110-5.el5 rhel51-EPEL 70 k
perl-IPC-ShareLite i386 0.09-9.fc7 rhel51-rt3 27 k
perl-Locale-Maketext-Fuzzy noarch 0.10-1.el5 rhel51-EPEL 15 k
perl-Locale-Maketext-Lexicon noarch 0.62-1.fc6 rhel51-rt3 87 k
perl-Log-Dispatch noarch 2.20-1.el5 rhel51-EPEL 77 k
perl-MIME-Lite noarch 3.01-5.fc6 rhel51-rt3 72 k
perl-MIME-tools noarch 5.420-3.el5 rhel51-EPEL 285 k
perl-Mail-GnuPG noarch 0.08-5.fc6 rhel51-rt3 15 k
perl-Mail-Sender noarch 0.8.13-2.fc6 rhel51-rt3 52 k
perl-Mail-Sendmail noarch 0.79-9.fc6 rhel51-rt3 27 k
perl-MailTools noarch 1.77-1.el5 rhel51-EPEL 90 k
perl-Module-Refresh noarch 0.13-1.el5.rf rhel51-rt3 11 k
perl-Module-Versions-Report noarch 1.03-1.el5.rf rhel51-rt3 10 k
perl-Net-DNS i386 0.61-1.fc8 rhel51-rt3 235 k
perl-Net-IP noarch 1.25-4.fc8 rhel51-rt3 32 k
perl-Net-SSLeay i386 1.30-5.fc8.1 rhel51-rt3 196 k
perl-Params-Validate i386 0.88-3.fc8 rhel51-rt3 72 k
perl-Regexp-Common noarch 2.120-5.fc6 rhel51-rt3 181 k
perl-Socket6 i386 0.19-4.fc8.1 rhel51-rt3 22 k
perl-TeX-Hyphen noarch 0.140-5.fc6 rhel51-rt3 34 k
perl-TermReadKey i386 2.21-4 rhel51-rt3 31 k
perl-Text-Autoformat noarch 1.13-5.fc7 rhel51-rt3 30 k
perl-Text-Quoted noarch 2.02-3.fc6 rhel51-rt3 11 k
perl-Text-Reform noarch 1.11-7.fc7 rhel51-rt3 35 k
perl-Text-Template noarch 1.44-4.fc6 rhel51-rt3 61 k
perl-Text-WikiFormat noarch 0.78-1.fc6 rhel51-rt3 35 k
perl-Text-Wrapper noarch 1.01-1.fc6 rhel51-rt3 9.6 k
perl-Time-modules noarch 2003.1126-4.fc8 rhel51-rt3 36 k
perl-TimeDate noarch 1:1.16-5.el5 rhel51-base 32 k
perl-Tree-Simple noarch 1.17-1.fc6 rhel51-rt3 40 k
perl-UNIVERSAL-require noarch 0.11-1.fc6 rhel51-rt3 8.5 k
perl-Want i386 0.15-1.fc6 rhel51-rt3 29 k
perl-XML-Parser i386 2.35-1.el5.rf rhel51-rt3 314 k
perl-XML-Simple noarch 2.14-4.fc6 rhel51-base 68 k
postgresql-libs i386 8.1.9-1.el5 rhel51-base 196 k
spamassassin i386 3.1.9-1.el5 rhel51-base 921 k


Transaction Summary
=====================================================================================
Install 84 Package(s)
Update 0 Package(s)
Remove 0 Package(s)




RT Post Setup


Now that rt is installed you may want to customize your setup. Inorder to do that you will need to know where your files are located. This package changes the file locations from the fedora6 version of rt,and differs greatly from the BP default.
bindir:               /usr/sbin
sysconfdir: /etc/rt3
htmldir: /usr/share/rt3/html
logfiledir: /var/log/rt3
masonstatedir: /var/cache/rt3/mason_data
sessionstatedir: /var/cache/rt3/session_data
customdir: /usr/local/rt3/
custometcdir: /usr/local/rt3/etc
customhtmldir: /usr/local/rt3/html
customlexdir: /usr/local/rt3/po
customlibdir: /usr/local/rt3/lib

Customize /etc/rt3/RT_SiteConfig.pm


You may find a need to change the site configuration of rt from time to time. For example to point rt to a remote database, configure external authentication, or set other configurable options. Below are several options that I like to set, but keep in mind these may differ greatly from a standard configuration.

Set($WebExternalAuth , '1');
Set($WebFallbackToInternalAuth , '1');
Set($OldestTransactionsFirst, 0);
Set($MyTicketsLength, 25);
Set($MyRequestsLength, 25);
Set($WebBaseURL , "http://rt.example.com");
Set($WebPath , "");
Set($WebImagesURL , $WebPath . "/NoAuth/images");
Set($rtname, 'example.com');
Set($DatabaseHost , 'db.example.com');
Set($DatabaseRTHost , 'localhost');
Set($DatabaseUser, 'dbuser');
Set($DatabasePassword , 'dbpassword');
Set($DevelMode, '0');
Set($ShowTransactionImages, 0);
Set($SuppressInlineTextFiles, true);

Initialize the RT database

Assuming that you will host both the rt web service and the database on the same server (unlike the custom config above) you will need to create a new rt3 database instance. This is done in one simple step from the command line.

rt-setup-databse --action init




Configure sendmail


Symlink rt-mailgate to /etc/smrsh, and create aliases to use RT:

ln -s /opt/rt3/bin/rt-mailgate /etc/smrsh/rt-mailgate

Edit /etc/aliases and add lines:

rt: "|/etc/smrsh/rt-mailgate --queue general --action correspond --url http://your.host.name/"

rt-comment: "|/etc/smrsh/rt-mailgate --queue general --action comment --url http://your.host.name/"

Edit /etc/mail/sendmail.mc and change the line:

DAEMON_OPTIONS(`Port=smtp,Addr=127.0.0.1, Name=MTA')dnl

to read:

dnl DAEMON_OPTIONS(`Port=smtp,Addr=127.0.0.1, Name=MTA')


Add the following lines to your sendmail.mc file, filling in your ISP's mail server (optional):


define(`SMART_HOST',`your.isp.net')dnl
define(`confAUTH_MECHANISMS', `EXTERNAL GSSAPI DIGEST-MD5 CRAM-MD5 LOGIN PLAIN')dnl
FEATURE(`authinfo',`hash /etc/mail/auth/client-info')dnl


Rebuild your sendmail.cf:

m4 /etc/mail/sendmail.mc > /etc/mail/sendmail.cf

Add rt server alias to /etc/mail/local-host-names


rt.example.com

Restart sendmail:

service sendmail restart


Test your new RT instance


Login to your new RT instance and test things out:



Default URL : http://yourdomain.com/rt3/

Default User: root

Default Pass: password


Troubleshooting


Updates to Perl:

Some updated versions of Redhat Enterprise 4 & 5 include perl distributions without support for Scalar::Util::weaken(). Weaken is required for RT to function. The offending versions of Perl install Scalar::Util v1.19. To make everything work with RT again install the previous revision (v1.18).

perl -MCPAN -e 'install "G/GB/GBARR/Scalar-List-Utils-1.18.tar.gz"'


MySQL CLI Notes

I have a hard time remembering this stuff, I'm spoiled by GUI tools. For anyone who needs it I posted some mysql cli stuff here. Nothing new or earth shattering, just notes for the lazy.

-------------------------------------------------------------------------------------

GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' IDENTIFIED BY 'some_pass' WITH GRANT OPTION;

GRANT SELECT ON database.* TO 'user'@'%' IDENTIFIED BY 'password'

SET PASSWORD FOR 'username'@'%' = OLD_PASSWORD('password');

mysqldump -u USER -pPASSWORD DATABASE > filename.sql

mysqldump --user="user" --password="pass" --opt --compact --quick --verbose --host="server.fqdn" --databases MyFavDB --result-file=/root/outfile.sql

mysqldump --opt --extended-insert --single-transaction --create-options --default-character-set=utf8 --user="root" --password="*****" --host="server.fqdn" --databases dbname > "/data/backup.sql"

mysql dbname < filename.sql

Essential Sed one liners

sed (Stream EDitor) refers to a Unix utility for parsing text files and the programming language it uses to apply textual transformations to a sequential stream of data. It reads input files line by line, applying the operation which has been specified via the command line (or a sed script), and then outputs the line. Getting started with sed can be a real pain if you are unfamiliar with perl for regular expressions. Here are a several sed 'one liners' that I use all the time for test file manipulation. More can be found here.







FILE SPACING:



  • Double space a file


  • sed '/^$/d;G'


  • Undo double-spacing (assumes even-numbered lines are always blank)


  • sed 'n;d'






    NUMBERING:



  • Number each line of a file (number on left, right-aligned)


  • sed = filename | sed 'N; s/^/ /; s/ *(.{6,})n/1 /'


  • Number each line of file, but only print numbers if line is not blank


  • sed '/./=' filename | sed '/./N; s/n/ /'


  • Count lines (emulates "wc -l")


  • sed -n '$='






    TEXT CONVERSION AND SUBSTITUTION:



  • Convert DOS newlines (CR/LF) to Unix format.


  • sed 's/.$//'


  • Convert Unix newlines (LF) to DOS format.


  • sed 's/$'"/`echo r`/"


  • Delete leading whitespace (spaces, tabs) from front of each line aligns all text flush left


  • sed 's/^[ t]*//'


  • Delete trailing whitespace (spaces, tabs) from end of each line


  • sed 's/[ t]*$//'


  • Delete BOTH leading and trailing whitespace from each line


  • sed 's/^[ t]*//;s/[ t]*$//'


  • Substitute (find and replace) "foo" with "bar" on each line


  • sed 's/foo/bar/'     # replaces only 1st instance


    sed 's/foo/bar/4'     # replaces only 4th instance


    sed 's/foo/bar/g'     # replaces ALL instances


  • Change "scarlet" or "ruby" or "puce" to "red"


  • sed 's/scarlet/red/g;s/ruby/red/g;s/puce/red/g'






    SELECTIVE PRINTING OF CERTAIN LINES:



  • Print first 10 lines of file (emulates behavior of "head")


  • sed 10q


  • Print first line of file (emulates "head -1")


  • sed q


  • Print the last 10 lines of a file (emulates "tail")


  • sed -e :a -e '$q;N;11,$D;ba'


  • Print the last 2 lines of a file (emulates "tail -2")


  • sed '$!N;$!D'


  • Print the last line of a file (emulates "tail -1")


  • sed -n '$p'


  • Print section of file based on line numbers (lines 8-12, inclusive)


  • sed -n '8,12p'


  • Print only lines which match regular expression (emulates "grep")


  • sed '/regexp/!d'


  • Grep for AAA and BBB and CCC (in any order)


  • sed '/AAA/!d; /BBB/!d; /CCC/!d'


  • Grep for AAA and BBB and CCC (in that order)


  • sed '/AAA.*BBB.*CCC/!d'






    SELECTIVE DELETION OF CERTAIN LINES:



  • Delete duplicate, consecutive lines from a file (emulates "uniq").


  • sed '$!N; /^(.*)n1$/!P; D'


  • Delete duplicate, nonconsecutive lines from a file.


  • sed -n 'G; s/n/&&/; /^([ -~]*n).*n1/d; s/n//; h; P'


  • Delete all lines except duplicate lines (emulates "uniq -d").


  • sed '$!N; s/^(.*)n1$/1/; t; D'


  • Delete the first line of a file


  • sed '1d'


  • Delete the first 10 lines of a file


  • sed '1,10d'


  • Delete the last line of a file


  • sed '$d'


  • Delete the last 2 lines of a file


  • sed 'N;$!P;$!D;$d'


  • Delete the last 10 lines of a file


  • sed -n -e :a -e '1,10!{P;N;D;};N;ba'



  • Delete lines matching pattern


  • sed '/pattern/d'


  • Delete ALL blank lines from a file (same as "grep '.' ")


  • sed '/^$/d'


  • Remove most HTML tags (accommodates multiple-line tags)


  • sed -e :a -e 's/<[^>]*>//g;/


    How to list all installed Perl modules

    I recently found it necessary to list all installed Perl modules on one of my linux servers. I wouldn't have thought that it would be as big a deal as it turned out to be. After two hours or so of testing 20 or so methods Google found for me… I settled on the following.

    From the command line:

    perl -MFile::Find=find -MFile::Spec::Functions -Tlwe 'find { wanted => sub { print canonpath $_ if /.pmz/ }, no_chdir => 1 }, @INC'

    Use network share as Time Machine drive

    Backups are important... I can't say it enough. For us Apple users, Time Machine is surprisingly effective. But what makes it really useful is the hidden ability to backup over to a network share. This is something that should be enabled by default... but then who would buy an Apple Time Capsule *gasp*

    Open a terminal and run:

    defaults write com.apple.systempreferences TMShowUnsupportedNetworkVolumes 1

    Then you can use a Samba or AppleShare (even Netatalk) server share as a time machine backup location. This works perfectly, as Time Machine creates a disk image with an HFS+ filesystem on which to perform backups, and mounts that.

    Convert Apple DMG images to ISO

    I found this out a while ago when looking for info on reading .DMG files on Windows or Linux boxes. Long story short, its a very painful process and not worth the time. Then I found this tip. It creates ISO images from DMG images, so they can be burned elsewhere.

    To convert the file to an ISO image, type the following command at your terminal window:

    hdiutil convert /path/to/filename.dmg -format UDTO -o /path/to/savefile.iso


    Replace /path/to/filename.dmg with the path and name of the existing .DMG file, and replace /path/to/savefile.iso with the desired path and name for the converted image.

    This then creates an ISO image burnable in Nero on Windows, or pretty much anything on Windows that will burn ISOs and same with Linux. Conversion can be slow, but it works.

    Mac OSX Keyboard Shortcuts

    As a Mac user of less than a year I can sympathize with how painful a switch can be. Many of the keyboard shortcuts I lived by under the tyrannical reign of my PC are none existent under Mac OS. But there is hope. With the help of this list of 240 Mac OSX keyboard shortcuts and 7 months of practice, I can once again say... my Keyboard KungFu is strong.

    General Shortcuts

    1 Cmd-C Copy files
    2 Cmd-V Paste files
    3 Option-Drag Copy files to new location
    4 Cmd-Drag Move and auto-align icons
    5 Cmd-Delete Delete
    6 Cmd-Option-Drag Make alias
    7 Cmd-Shift-Delete Empty trash
    8 Cmd-Shift-Option-Delete Empty trash without warning
    9 Tab Select next field
    10 Shift-Tab Select previous field
    11 Return Perform default action
    12 Escape Close dialog box
    13 Page Up Scroll up list
    14 Up Arrow Select item above
    15 Page Down Scroll down list
    16 Down Arrow Select item below
    17 Cmd-Shift-G Open 'Go to Folder' dialog
    18 Cmd-Period[.] Close dialog box

    Exposé, Space, Dashboard and the System

    19 F8 Toggle Space
    20 Shift-F8 Toggle Space in slow motion
    21 F9 Show all open windows
    22 Shift-F9 Show all open windows in slow motion
    23 F10 Show all open windows for an application
    24 Shift-F10 Show all open windows for an application in slow motion
    25 F11 Hide all windows
    26 Shift-F11 Hide all windows in slow motion
    27 F12 Open/close Dashboard
    28 Shift-F12 Slowly open/close Dashboard
    29 Option-Mouse Hover Reveal the close button of widget
    30 Shift-Click Close Button Animate closing widget in slow motion
    31 Cmd-H Hide application
    32 Cmd-Option-H Hide other applications
    33 Cmd-Q Quit application
    34 Cmd-Shift-Q Quit all applications and log out
    35 Cmd-Option-Shift-Q Log out without warning
    36 Cmd-Tab Switch to next application
    37 Cmd-Shift-Tab Switch to previous application
    38 Option-Drag Adjust volume (on sound volume slider)
    39 Cmd-Drag Arrange menu bar items
    40 Option-Click Switch window and hide current window
    41 Control-Click Open contextual menu
    42 Cmd-Control-D See word definition (with mouse hover)

    Issue: Freeze

    43 Cmd-Period[.] Stop process
    44 Cmd-Option-Escape Open Force Quit
    45 Power Key Turn off
    46 Cmd-Option-Shift-Power Key Force shut down
    47 Cmd-Control-Power Key Force restart

    Full Keyboard Access

    48 Control-F1 Turn on/off full keyboard access
    49 Control-F2 Focusing menu bar
    50 Control-F3 Focusing Dock
    51 Control-F4 Move to next window
    52 Control-F5 Move to toolbar
    53 Control-F6 Move to a floating window
    54 Control-F7 Toggle keyboard access mode
    55 Control-F8 Focusing status menu in menu bar
    56 Cmd-Accent[`] Switch to next window within application
    57 Cmd-Shift-Accent[`] Switch to previous window within application
    58 Cmd-Option-Accent[`] Move to sidebar
    59 Cmd-Option-T Toggle on/off character palette

    Finder

    60 Cmd-Click on Title See the path enclosing folders
    61 Cmd-Double-Click (on folder) Open folder in new window
    62 Option-Double-Click (on folder) Open folder in new window and close current window
    63 Cmd-1 Switch to icon view
    64 Cmd-2 Switch to list view
    65 Cmd-Option-Right Arrow Expand folder
    66 Left Arrow Close folder
    67 Cmd-Down Arrow Open selected folder
    68 Cmd-Option-Down Arrow Open selected folder in new window and close current folder
    69 Cmd-Shift-Option-Down Arrow Open selected folder in new window and close current folder in slow motion
    70 Cmd-Up Arrow Show enclosing folder
    71 Cmd-Option-Up Arrow Show enclosing folder and close current folder
    72 Cmd-3 Switch to column view
    73 Cmd-4 Switch to coverflow view
    74 Cmd-Y Toggle Quick Look mode
    75 Cmd-Option-Y Toggle Slideshow mode
    76 Cmd-Shift-H Open home folder
    77 Cmd-Option-Shift-Up Arrow Move focus to Desktop
    78 Cmd-Shift-I Open iDisk
    79 Cmd-Shift-D Open Desktop
    80 Cmd-Shift-C Open Computer area
    81 Cmd-Shift-K Open Network
    82 Cmd-Shift-A Open Applications
    83 Double-Click on Title Minimize window
    84 Cmd-M Minimize window
    85 Option-Click on button Apply action to all windows in active application
    86 Hold-Scroll Bar Scroll quickly

    Search: Spotlight

    87 Cmd-Spacebar Activate/deactivate Spotlight
    88 Cmd-Option-Spacebar Open Spotlight window
    89 Cmd-Return Open the top hit
    90 Cmd-Down Arrow Move to next category
    91 Cmd-Up Arrow Move to previous category
    92 Cmd-Click Open selected item in Finder
    93 Escape Close Spotlight

    Utility: Print Screen

    94 Cmd-Shift-3 Take snapshot of the whole screen
    95 Cmd-Shift-4 Take snapshot of the selected area
    96 Cmd-Shift-4-Spacebar Take picture of a window
    97 Escape Cancel
    98 Hold Spacebar after Drawing the region Move the selected area
    99 Hold Option Resize selected area
    100 Hold Shift Resize selected area horizontally or vertically

    Application: Dock

    101 Drag the separator Resize Dock
    102 Option-Drag Resize Dock to fixed size
    103 Control-Click Show Dock's contextual menu
    104 Control-Click on icon Show item's contextual menu
    105 Cmd-Click Open the icon's enclosing folder
    106 Option-Click Switch to another and hide current application
    107 Cmd-Option-Click Switch to another application and hide all other applications
    108 Cmd-Option-Drop Force application to open files
    109 Cmd-Option-D Hide/unhide Dock

    Preference: Universal Access

    110 Cmd-Option-8 Turn zoom on/off
    111 Cmd-Option-Equal[=] Zoom in
    112 Control-Scroll Up Zoom in
    113 Cmd-Option-Hyphen[-] Zoom out
    114 Control-Scroll Down Zoom out
    115 Cmd-Option-Control-8 Invert color (try this on those iMacs in Apple Store)
    116 Control-Option-Cmd-Comma[,] Reduce contrast
    117 Control-Option-Cmd-Period[.] Increase contrast
    118 Cmd-F5 Toggle VoiceOver
    119 Shift-Shift-Shift-Shift-Shift (5 times) Toggle Sticky Keys
    120 Option-Option-Option-Option-Option (5 times) Toggle mouse keys

    Boot: Start Up

    121 Shift Prevent automatic login
    122 Shift Enter safe mode (hold down after startup tone and release after you see the progress indicator)
    123 Shift Prevent opening Login Items (after login)
    124 C Boot from CD
    125 N Boot from default NetBook disk
    126 T Start up in Target Disk Mode
    127 Option Select startup disk
    128 Cmd-X Start up using Mac OS X
    129 Hold Mouse Button Eject removable discs
    130 Cmd-Option-P-R Reset parameter RAM
    131 Cmd-V Verbose mode (detailed status message)
    132 Cmd-S Single user mode

    Browser: Safari

    133 Cmd-Option-F Move to Google Search Box
    134 Option-Up Arrow Scroll Up
    135 Option-Down Arrow Scroll Down
    136 Cmd-Click Link Open in new tab and stay in current tab
    137 Cmd-Shift-Click Link Open and go to new tab
    138 Cmd-Option-Click Link Open in new window
    139 Option-Click Close Button Close other tabs
    140 Cmd-Shift-] Select next tab
    141 Cmd-Shift-[ Select previous tab
    142 Cmd-Shift-H Go to homepage
    143 Cmd-Shift-K Toggle Block Pop-up Windows
    144 Cmd-Option-E Empty Cache
    145 Cmd-Option-R Reload page without Caching
    146 Cmd-F Search term in webpage
    147 Cmd-M Minimize Safari
    148 Shift-Click Button Animate slow motion effect
    149 Cmd-Plus[+] Increase font size
    150 Cmd-Hyphen[-] Reduce font size
    151 Cmd-0 Original font size

    Music: iTunes

    152 Return/Space Play
    153 Option-Right Arrow Select next album
    154 Option-Left Arrow Select previous album
    155 Cmd-Right Arrow Play next song
    156 Cmd-Left Arrow Play previous song
    157 Option-Click on Shuffle Button Reshuffle
    158 Cmd-Option-Down Arrow Mute
    159 Cmd-E Eject CD
    160 Cmd-T Turn on/off visualizer
    161 Cmd-F Turn on/off full screen mode
    162 Cmd-1 View iTunes window
    163 Cmd-2 View equalizer mode

    Terminal

    164 Double-Click Select word
    165 Triple-Click Select line
    166 Drag item to Terminal Add the complete path to that item
    167 Cmd-N Create new shell window
    168 Cmd-Shift-N Enter new command
    169 Cmd-Shift-K Connect to a server
    170 Cmd-Option-S Save text
    171 Cmd-Option-Shift-S Save selected text
    172 Cmd-I Show terminal inspector
    173 Cmd-T Create new tab
    174 Control-C Break

    Mail: Hello from Cupertino

    175 Cmd-N New message
    176 Cmd-Shift-N Get new mail
    177 Cmd-Option-N Open new viewer window
    178 Cmd-0 Open activity window
    179 Cmd-Shift-Y Add senders to address book
    180 Cmd-E Use selected text to find
    181 Cmd-C while selecting message Copy entire text of a message
    182 Cmd-Click on upper-right corner toolbar button Switch different toolbar display
    183 Cmd-Single Quote['] Increase quote level
    184 Cmd-Option-Single Quote['] Decrease quote level
    185 Cmd-Shift-E Redirect message
    186 Cmd-Shift-F Forward message
    187 Hold Option when deleting message Prevent next message from being automatically marked as read
    188 Cmd-Shift-R Reply to all
    189 Cmd-Shift-B Bounce to sender
    190 Cmd-Shift-T Convert message to rich text or plain text
    191 Cmd-Left Brace[{] Align left
    192 Cmd-Vertical Bar[|] Align center
    193 Cmd-Right Brace[}] Align right
    194 Cmd-Colon[:] Check spelling
    195 Cmd-Semicolon[;] Flag misspelling of selected word

    Front Row

    196 Cmd-Esc Open/close Front Row or return to previous menu
    197 Spacebar, Return Select item in a menu
    198 Up Arrow, Down Arrow Change volume
    199 Right Arrow, Left Arrow Go to next or previous selection

    Address Book

    200 Cmd-1 View card and columns
    201 Cmd-2 View only card
    202 Cmd-3 View directories
    203 Cmd-Right Bracket[']'] Next card
    204 Cmd-Left Bracker['['] Previous card
    205 Cmd-Vertical Line[|] Merge selected cards
    206 Cmd-Backslash[] Set as company card

    Image Editor: Adobe Photoshop

    207 Cmd-Shift-M Edit in ImageReady
    208 Cmd-Option-W Close all
    209 Cmd-Option-S Save as
    210 Cmd-Option-Shift-S Save for Web
    211 Cmd-Option-Shift-I File info
    212 Cmd-Option-P Print with Preview
    213 Cmd-Option-Shift-P Print one copy
    214 Cmd-Shift-F Fade
    215 Cmd-Shift-C Copy merged
    216 Cmd-Shift-V Paste into
    217 Shift-F5 Fill with color
    218 Cmd-Shift-T Transform Again
    219 Cmd-Option-Shift-K Show keyboard shortcuts
    220 Cmd-L Adjust levels
    221 Cmd-M Adjust curves
    222 Cmd-B Adjust color balance
    223 Cmd-U Adjust hue/saturation
    224 Cmd-Option-C Change canvas size
    225 Cmd-Shift-N Create new layer
    226 Cmd-J Layer via copy
    227 Cmd-Shift-J Layer via cut
    228 Cmd-Option-G Create/release clipping mask
    229 Cmd-G Group layers
    230 Cmd-Shift-E Merge visible
    231 Cmd-Shift-I Select inverse
    232 Cmd-Option-A Select all layers
    233 Shift-F6 Select feather (Cmd-Option-D has been assigned to hide Dock)
    234 Cmd-Option-V Filter vanishing point
    235 Cmd-Plus[+] Zoom in
    236 Cmd-0 Fit on screen
    237 Cmd-Option-0 Display actual pixels
    238 Cmd-Single Quote['] Show grid
    239 Cmd-Semicolon[;] Show guides
    240 Cmd-R Show rulers


    See more here