iNet: A 'Pretty' Network Sniffer




Apple may have done something unintentionally when they launched their free iCloud service. iCloud automatically synchronizes files between devices using the same iCloud account. The only problem is knowing where to put files and how to get to them once you do. On your Mac it's simple. Just locate your ~/Library/Mobile Documents folder. Remember, the ~/Library folder is hidden by default in Lion. (See previous post) So, in Finder simply navigate to your ~/Library folder and drag the /Mobile Documents folder to the sidebar.
Now, any files you save to the Mobile Documents folder will be synchronized to all devices using your iCloud account similar to the way Dropbox works. Accessing these files on your Mac is the same as files in any other folder. This applies to any type of file, not just iWork documents.
I haven't figured out how to make these files available to iOS devices yet and there's no way I can see to even save iWork documents from your Mac and make them visible on your iPad or iPhone. When you save iWork documents on an iOS device, Apple formats the documents entirely differently than in OS X. If you've done so, just have a peek into the ~/Library/Mobile Documents folder. There's a separate folder created for each iWork app and each document is saved as a folder containing a .plist file, a .db file and a .jpg preview. There's some voodoo going on here that I haven't figured out yet. Sufice it to say that saving a .pages document to this folder gets you nothing on your iOS device. I would expect Apple to make this process seamless across all of its devices at some point, but it ain't there yet.
So, if you want to share documents between Macs and have them sync automatically then the /Mobile Documents folder is there for your exploitation.
One annoying new "feature" of OS X 10.7 is the invisibility of the user Library folder. Apple decided it didn't want the average user snooping about in there so it made the folder invisible by default. OK, I get it. But there's some really useful stuff in there that we gearheads might want to tweak. Here's an AppleScript that will toggle the "~/Library" folder's visibility.
tell application "System Events" set libvis to (get visible of folder "~/Library") end tell if libvis = false then --~/Library is currently invisible tell application "System Events" to set visible of folder "~/Library/" to true else --~/Library is visible tell application "System Events" to set visible of folder "~/Library/" to false end if
You can run this straight from the AppleScript editor or save it as an application (as I did) and drag it into the Finder's toolbar to keep it handy. Do whatever you like.
Have you ever used the Finder to navigate through several layers of folders to find a file you need to modify only to discover you need root privileges to complete the task? When that happens you have two choices: 1) You can open a terminal window and "cd" to the path of the folder in question or, 2) You can drag the folder from the Finder to the Terminal icon in the Dock while holding down <command-option> then use "sudo" to elevate your privileges. There's a free Rosetta app that opens a terminal window in the Finder's current folder, but alas, it (like all Rosetta apps) no workie in Lion. Here's a tip I found at Macworld.com to create a permanent tool in OS X Lion to do just that.
First launch the AppleScript Editor from your /Applications/Utilities folder and paste the following text into the edit window:
on run
tell application "Finder"
try
activate
set frontWin to folder of front window as string
set frontWinPath to (get POSIX path of frontWin)
tell application "Terminal"
activate
do script with command "cd \"" & frontWinPath & "\""
end tell
on error error_message
beep
display dialog error_message buttons¬
{"OK"} default button 1
end try
end tell
end run
Next, save the file as an application. (I named mine "TerminalRightHere", saved it in the /Applications/Utilities folder, but you can call it anything and put it anywhere you like) Then, in Finder, simply drag your newly-created app up to the Finder's toolbar. It will stick and will be in every new Finder window until you (<command>)drag it out. Now, clicking on the new app in the Finder toolbar will open a terminal window at the current Finder location. Cool. Many thanks, Macworld!