Monday, April 26, 2010

Uninstall ruby gems by version

# Find out the directory where the gem is installed
gem list -d

# run the following command
sudo gem uninstall --install-dir=

# Follow prompts.

Wednesday, April 21, 2010

Uninstall Mysql from Snow Leopard

Depending on your mysql installation directories [mine is /usr/local/mysql]:

1. sudo rm /usr/local/mysql
2. sudo rm -rf /usr/local/mysql*
3. sudo rm -rf /Library/StartupItems/MySQLCOM
4. sudo rm -rf /Library/PreferencePanes/My*
5. (Edit /etc/hostconfig) sudo vi /etc/hostconfig (Remove line MYSQLCOM=-YES)
6. sudo rm -rf /Library/Receipts/mysql*
7. sudo rm -rf /Library/Receipts/MySQL*
8. sudo rm -rf /var/db/receipts/com.mysql.*

SVN ignore files from command line OSX/Unix

You may need need to set an editor of choice before you can do this.

run the "export SVN_EDITOR=vim" on the command line or put the command in your .bash_profile or equivalent system file.

To actually ignore the "ignorable_file" in a directory do the following.

1. cd the_dir_that_contains_the_file_to_be_ignored
2. svn propedit svn:ignore . # opens vim in my case since this is my editor of choice. See above
3. add the filename of the file to be ignored (ignorable_file in this case) in the open svn properties file.
4. save the file and exit.
5. svn propget svn:ignore . # So you can see the properties
6. svn status --no-ignore # You should see an 'I' next to the ignored files
7. svn commit -m "comment goes here"

Tuesday, April 20, 2010

Update iPhone OS to OS 4 Beta For Mac Users

This is actually quite simple.

1. Make sure that the new OS version is compatible with your iPhone/iPod Touch by reading the FAQs and other goodies on the apple dev sites.
2. Download the Beta if you have a developers account.
3. Extract it to a directory of your choice.
4. Open iTunes and plug your phone/ipod touch in to your usb port on your computer.
5. Make sure you back up your iPhone.
6. Hold down the ALT key on your keyboard and click restore in itunes.
7. A dialog pops up. Navigate to the directory where the new image that you wish to install is and select it.
8. Confirm that you want to update and away you go.
9. When update is complete do a restore from your last backup which will copy all your content back to your iPhone.
10. WARNING: The pre-release softwares are only meant for testing and development. So UPDATE AT YOUR OWN RISK.

Wednesday, April 7, 2010

Itunes iPhoto Sync doesn't work

I have been syncing photos from iPhoto onto my 3GS 32GB iPhone and my wifes 16GB iPhones, using iTunes, for a while now. All of a sudden I was getting the following message pop up at the end of the sync and no photos had sync'd

[The iPod "name" cannot be synced. The required file cannot be found]

Short of trying almost everything to fix this I finally came across the solution.

1. Open up finder and navigate to the "iPhoto Library" package
2. Right click and choose "show package contents"
3. Delete the ipod cache folders

It seems that they had become corrupt and this was causing the issue.

Now all syncs fine again.

Update: another issue with photos not syncing is that they are removed by default if you are syncing video/audio etc, that is larger than the capacity of free memory left on the device.

Mac OSX Screen Capture

You never really think about capturing an image of the screen or part of it until you actually have to do it. With Windows it was simple since there is a button in most cases on the keyboard to do this. With Mac OSX it is also easy you just need to know the shortcuts.

All files saved by default to the Desktop as .PNG files otherwise they are stored in the clipboard

Capture the entire desktop
Command-Shift-3

Copy the entire desktop (to the clipboard)
Command-Control-Shift-3

Capture a portion of the desktop
Command-Shift-4
Control-Command-Shift-4 (capture to clipboard)
(Drag the cross-hair cursor that appears around the area you wish to capture)

Capture a specific application window
Command-Shift-4, then Spacebar
Control-Command-Shift-4, then Spacebar (capture to clipboard)

Using the bundled Mac OS X Grab Utility
Applications > Utilities > Grab
(Useful if you need to include a cursor or a menu in your screen shot, or if you want to save your screen shot to TIFF format)

Include a cursor
Go to Grab Preferences and select the cursor icon you wish to have in your screen shot.
Capture Types from Capture Menu (or keyboard shortcut):
  • Selection (Shift-Command-A) [Cursor not included in capture]
  • Window (Shift-Command-W)
  • Screen (Command-Z)
  • Timed Screen (Shift-Command-Z) [An instruction window will appear that allows you to prepare your screen for capture. When ready, press the "Start Timer" button and you will have ten seconds before the screen is captured. This allows you to open menus and sub-menus, if necessary]