Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!

Remotely connect to a Mac via SSH using iCloud's network Network
If you're running two Macs with iCloud support (Lion or Mountain Lion), then you can use iCloud's network to remote SSH back into your home computer no matter where you are with just a few commands in Terminal.

The process is explained by the One Thing Well blog, but you need to set up a few things before you get started. First, you need to make sure Back to My Mac is enabled in iCloud (System Preferences > iCloud > Back to My Mac). Next, you need to set up your home computer for sharing if it isn't already. Head to System Preferences > Sharing and turn on at least File Sharing and Remote Login. With everything set, you can now remotely log in to your home computer using iCloud's network wherever you have internet access.

To start with, you need to do is find your Back to My Mac account number. In Terminal (Applications > Utilities), type:
dns-sd -E
The final nine digit number is your Back to My Mac account number. Next, it's time to SSH into your other machine:
 ssh -2 -6 username@computer-name.[account number] 
If you don't know your username or computer name, head to System Preferences > Sharing on the destination computer and click on Remote Login. Your Computer name is listed at the top (if it's multiple words use the address with the dashes). Your username is listed on the line below Remote Login right before the @ symbol. You will need to do this before you try to SSH into your computer when you're away.

With that, you should have access to your Mac no matter where you are. Head over to One Thing Well for a few more tricks and shortcuts for using the iCloud network to remote SSH.

[kirkmc adds: I haven't tested this.]
  Post a comment  •  Comments (9)  
  • Currently 2.69 / 5
  You rated: 5 / 5 (26 votes cast)
[31,066 views]  View Printable Version
Auto-delete a DMG file when ejecting a disk image System
While the Mac App Store is great, I still find myself downloading .dmg files and installing plenty of third-party software. I often forget to delete .dmg files after I've installed applications. Here's a script to automatically move the .dmg file to the trash when you eject the disk image.

To use this script, select the mounted volume in the Finder (or in the "Devices" section of the Finder sidebar), and trigger this script via your favorite macro app instead of ejecting the disk image normally.
tell application "Finder"
	set selection_list to selection
	if (count selection_list) < 1 then
		display dialog 
			"Please select a volume mounted from a disk image." with title 
			"No Selection Found" with icon stop 
			buttons ["OK"] default button 1
	end if
	set my_selection to item 1 of selection_list
	set my_kind to kind of my_selection
	set my_name to name of my_selection
	if my_kind is not "Volume" then
		display dialog 
			"Please select a volume mounted from a disk image file." with title 
			"Selection is not a Disk Image" with icon stop 
			buttons ["OK"] default button 1
	end if
	set volume_list to paragraphs of (do shell script "hdiutil info | grep ^/dev/disk | grep -o '/Volumes/.*'")
	set source_list to paragraphs of (do shell script "hdiutil info | grep ^image'-'alias | grep  -o '/.*'")
	set match_found to false
	repeat with v from 1 to (count volume_list)
		if "/Volumes/" & my_name = item v of volume_list then
			set match_found to true
			exit repeat
		end if
	end repeat
	if match_found is not equal to true then
		display dialog 
			"The selected volume does not appear to be a Disk Image." with title 
			"Could not find Disk Image" with icon stop 
			buttons ["OK"] default button 1
		set my_source to POSIX file (item v of source_list) as alias
		move my_source to the trash
		eject my_selection
		--reveal my_source
	end if
end tell
Matt Rajca has a script that does the reverse: ejects a Disk Image volume when you trash the .dmg file.

Could you simply have a search that looks for old .dmg files in your Downloads folder? Yes, though I often forget to open and install .dmg files right away, so I prefer linking the delete action to the eject.

[kirkmc adds: This works for me if I select a volume in a Finder window, but not in the sidebar. This hint was submitted before Mountain Lion, so perhaps there's something that needs to be tweaked for 10.8. I figured it is worth posting so you all can find what to fix; I'll update the script in the hint if someone provides a solution in the comments.]
  Post a comment  •  Comments (11)  
  • Currently 3.00 / 5
  You rated: 3 / 5 (5 votes cast)
[8,980 views]  View Printable Version
How to fix "installed" apps appearing in Mac App Store Update Pane System 10.8
I had many applications show up as "Installed" in the update pane of the Mac App Store even after I had updated them. Apparently, if you have copies of an application on your system, even on a secondary drive, they are discovered by the Mac App Store. This causes a problem if you have a copy an application in the /Applications directory as well as somewhere else on your drive. If you update the application in the /Applications directory but not the other instance then the Mac App store will display the application on the Update Pane, but list it as "installed". Simply deleting the other instance of the application will cause the Mac App Store to refresh it's data and remove the application from the update list.

[kirkmc adds: I was seeing that in the early days of Mountain Lion. After running the updates again, they disappeared; I didn't think to check my backup drive, were I clone my startup volume, to see if those copies of my apps got updated.

I just checked the Mac App Store and found two updates waiting for me. (I thought it was supposed to alert me when there were updates?) I updated one app, quit the Mac App Store, then re-launched it; that app was no longer listed. So this may be a transient problem that Apple has resolved, but I'm publishing it anyway, in case others still see this issue.]
  Post a comment  •  Comments (6)  
  • Currently 3.25 / 5
  You rated: 3 / 5 (4 votes cast)
[32,265 views]  View Printable Version
PDF files with lines & rectangles in Preview work like forms Apps
PDF files with horizontal lines and rectangles, but not created as PDF form files, can be filled in as if they were actual PDF form files. Clicking on a line starts a text field the same width as the line. Clicking on a small rectangle toggles a check mark. Rectangles large enough for text entry are not treated as check boxes, but as text fields the same width as the box. After entering text on a line or in a text box, the text may be moved anywhere on the document and retain the formatting. And unlike PDF form files, text attributes as well as text field widths can be changed at will.

[kirkmc adds: I made a test document with Pages, and it works as described. This is pretty neat. I don't know if this is new in Mountain Lion, or if it existed before.]
  Post a comment  •  Comments (7)  
  • Currently 3.50 / 5
  You rated: 1 / 5 (8 votes cast)
[3,433 views]  View Printable Version
Flush DNS cache in Lion and Mountain Lion Network
I came across this Apple technical note this morning, which describes how to flush the DNS cache on your Mac. We have a hint for 10.5, which is also valid for 10.6, but we're not up to date.

So, as a reminder, to flush the DNS cache in Mac OS X 10.5 and 10.6, run this command in Terminal:
sudo dscacheutil -flushcache 
To do the same in 10.7 and 10.8, run this command:
sudo killall -HUP mDNSResponder 
As Apple points out, you might need to do this in the following situation:

"OS X keeps a local cache of resolved DNS queries for a time defined by the DNS server, but sometimes it may be necessary to reset the cache immediately and re-query a DNS server. For example, you might do this after an entry on the server is changed or a new entry is added."
  Post a comment  •  Comments (8)  
  • Currently 3.85 / 5
  You rated: 5 / 5 (13 votes cast)
[91,396 views]  View Printable Version
Keyboard shortcut for share panels in Mountain Lion System 10.8
To send Messages or tweets via the Share Panel or the Twitter field in the Notification Center, you can use the same keyboard shortcut as in Mail to send e-mails: Command-Shift-D.
  Post a comment  •  Comments (4)  
  • Currently 4.00 / 5
  You rated: 2 / 5 (6 votes cast)
[4,332 views]  View Printable Version
Be notified by Mail only for a specific mailbox System 10.8
Mail notifications, while useful, can be overwhelming. That's why Mail can restrict the notifications (Dock badge and Notification Center) to a specific mailbox or Smart Mailbox.

Notifications restriction is available from Mail's Preferences; however here is a way to change this setting using a script, without going through the GUI.

This is especially useful when used with location-aware apps, such as Marco Polo or ControlPlane: you can automatically be notified of your professional e-mails only when at work, and of your personal emails only when at home, for instance.

I find it especially useful to keep focused and reduce the amount of distracting notifications.

# Configure to enable notifications only in the specified mailbox.
# Notifications include the Dock badge and messages in the Notification Center.
# Usage:
#   restrict-mail-notifications 
# Example:
#   restrict-mail-notifications smartmailbox://f687826d-f4de-4724-9a12-c5794dcdaa32
# Notes:
#   To find the mailbox id you're interested in, look in the file.


if [ ! -n "$mailboxID" ]; then
	echo "Error: "mailboxID" parameter missing."
	echo "Usage: $0 "
	exit -1

# Only display the unread messages count in the Dock for the specified mailbox
defaults write MailDockBadgeMailbox "$mailboxID"

# Only display notifications for incoming messages in the specified mailbox
defaults write MailUserNotificationScope -int '4' # Smart mailboxes
defaults write MailUserNotificationMailbox "$mailboxID"

# Now relaunch for changes to take effect
[kirkmc adds: I haven't tested this.]
  Post a comment  •  Comments (2)  
  • Currently 3.00 / 5
  You rated: 5 / 5 (4 votes cast)
[3,686 views]  View Printable Version
Open a file from within Quick Look with an application other than the default System 10.8
In iOS, whenever you view a document attached to an e-mail, you can click the Share button to send the document to a list of compatible applications, not just the preferred one. The same option is available in Mountain Lion whenever you use Quick Look to view a document.

When you display a document using Quick Look, you can now right-click on the "Open in xxxx" button, and see a list of compatible applications. This makes it easy to open, for example, a spreadsheet or graphic in your application of choice instead of the default application.
  Post a comment  •  Comments (4)  
  • Currently 3.80 / 5
  You rated: 5 / 5 (5 votes cast)
[3,088 views]  View Printable Version
Use any search engine with Safari Apps
Safari lets you choose from three search engines: Google, Yahoo! and Bing. You may want to use a different search engine, and Matt Swain's AnySearch Safari plugin lets you do that. It can also turn off Safari's 6's "omnibar" so it doesn't search, and only functions as an address bar.

As a bonus, his KeySearch extension can expand the use of the omnibar to let you search on many sites, such as Wikipedia, Amazon, IMDb, and any site you wish to search, just by using keywords. For example, you can type "wiki Marcel Proust" to search for the Wikipedia page of that author.
  Post a comment  •  Comments (1)  
  • Currently 4.00 / 5
  You rated: 4 / 5 (8 votes cast)
[9,241 views]  View Printable Version
Burn OS X Mountain Lion installer to single-layer DVD System 10.8
If you've tried burning the Mountain Lion installer to a standard DVD, you've probably noticed that it does not quite fit. Fortunately, there is a way around this.

The problem is that the size of the InstallESD image is fixed at 4.75 GB; slightly larger then a 4.7 GB single-layer DVD. However, the actual contents of the image occupy only 4.38 GB on disk, which will fit on a standard DVD.

In order to cram Mountain Lion onto a standard DVD, we need create a slightly smaller image file of the exact same format, copy the contents over, then burn it to a DVD.

I've written a small script to make this process quick and easy. Simply paste the code below into a plain text document and save it with a file extension of ".sh" To run the script, fire up Terminal and enter "bash /path/to/". When this script finishes, you will have a new, smaller DVD image in your home folder, ready for burning.

NOTE: This script assumes you have the "Install OS X Mountain Lion" application in /Applications. It won't work if it's located elsewhere. You'll also want to make sure you have at least 9 GB of disk space free, as the script temporarily creates two additional copies of the install image.
#! /bin/bash

rm -f /private/tmp/Mountain\ Lion\ DVD\ Image\ read-write.dmg # Remove any old copies of the DVD image before we begin.

echo "Creating DVD Image..."
hdiutil create -size 4.2g -volname "Mac OS X Install ESD" /private/tmp/Mountain\ Lion\ DVD\ Image\ read-write.dmg -fs HFS+ -layout SPUD

# hdiutil attach -nobrowse /Applications/Install\ OS\ X\ Mountain\
hdiutil attach -nobrowse ~/Desktop/InstallESD.dmg 
hdiutil attach -nobrowse /private/tmp/Mountain\ Lion\ DVD\ Image\ read-write.dmg

echo "Copying Mountain Lion to new image..."
cp -pRv /Volumes/Mac\ OS\ X\ Install\ ESD/* /Volumes/Mac\ OS\ X\ Install\ ESD\ 1/

hdiutil detach /Volumes/Mac\ OS\ X\ Install\ ESD\ 1
hdiutil detach /Volumes/Mac\ OS\ X\ Install\ ESD

echo "Converting to read-only..."
hdiutil convert /private/tmp/Mountain\ Lion\ DVD\ Image\ read-write.dmg -format UDZO -o ~/Desktop/Mountain\ Lion\ DVD\ Image.dmg

rm -f /private/tmp/Mountain\ Lion\ DVD\ Image\ read-write.dmg

echo "Image Creation Complete. Please burn '~/Desktop/Mountain Lion DVD Image.dmg' to a DVD using Disk Utility."
open ~/Desktop/
[kirkmc adds: I haven't tested this. Given the cost of USB sticks, and the fact that, if you do want an installer, it's better to have the most recent one, I've gone that route using Lion DiskMaker. Some people may prefer DVDs, but another factor is whether or not your Mac has an internal DVD drive; my Macs - a Mac mini and a MacBook Pro - do not, so USB is easier than using an external drive. Note: I've updated the script in the hint to the last revision below in the comments as of 8/18/12.]
  Post a comment  •  Comments (21)  
  • Currently 4.29 / 5
  You rated: 4 / 5 (7 votes cast)
[45,751 views]  View Printable Version