Wednesday, November 13, 2013

UNIX find command to open permissions

Thanks to:
http://www.giannistsakiris.com/index.php/2008/12/20/unix-how-to-find-files-that-do-not-match-a-pattern-or-other-criteria/

and:
http://stackoverflow.com/questions/5119946/find-exec-with-multiple-commands

Using find we can query a storage volume and open permissions (or change permissions to other permissions) to ease permissions issues in a heterogeneous environment.

The "old" way to open all the permissions in the volume /media/volB is to run a chmod recursively on all the files in the directory:
chmod -R 777 /media/volB

This will touch each file and update its "Change" time.  That can cause issues if you are relying on that  for knowing when to archive files.

In steps using find to find everything that is not 777 permissions:
find /media/volB ! -perm 777
(The ! means "not")

adding the part that will change the permissions on the resulting files found:
find /media/volB ! -perm 777 -exec chmod 777 {} \;

done

Tuesday, November 5, 2013

Accessing your iCloud Photostream on a Mac

From http://benward.me/blog/tumblr-22113784911

Accessing your iCloud Photostream on a Mac


iCloud's Photostream feature is neat. All the photographs and screen grabs I take with my iPhone or iPad are shared between the devices automatically. But getting to them on the Mac is more complicated, and if you're approaching it from a pure product perspective it appears that you have no choice but to use iPhoto or Aperture to get to the images on a Mac. Turns out this isn't true. Hunting for options, I found a Mac OSX Hints thread about finding the underlying iCloud sync location on disc, and automatically copying the files elsewhere so you can use them in Finder, or import into some other app. Read that thread if you like, but the most useful comment is the last one, by Joh:
Just use a saved search in Finder
A few nice ideas here, but the most simple way to get easily at your Photo Stream without iPhoto is to create a smart folder (saved search) in Finder with kind JPEG in the assets/sub folder. Easily accessible from the side bar, with preview icons and everything. You can even set sorting order and display type there and it will stick.
To extrapolate that into a handy step-by-step, here's how to get your Photostream in Finder:
  1. Open Finder, hit ⌘⇧G, or hit Go: Go To Folder…
  2. Enter ~/Library/Application Support/iLifeAssetManagement/assets/sub. Hit Enter.
  1. Now that you're in the right place, hit ⌘F to open the search interface. You don't need to enter a search term.
  2. Make sure that the search is focused on “sub”, and not “This Mac”, and then in the first Smart Search option, from the three drop-downs choose Kind is Image JPEG.
  3. Now you're seeing all your Photostream photos.
  4. Hit Save in the search interface, save the search as a Smart Folder in your Pictures directory, or wherever you like. You can now use this folder to access Photostream without importing into iPhoto first, and can use it to import into other apps such as Lightroom.
You can repeat the process, but choose a file type of PNG instead of JPEG, and create an equivalent Smart Folder for iOS screen grabs.