Copying iCloud PhotoStream photos to a directory.

A while ago I stopped using either Aperture or iPhoto to manage my photos and switched to Lightroom. Pretty much the only downside of switching was the lack of PhotoStream import. This lead to me having a bit of a poke around on the filesystem and see where the Apple products were getting the photos from.

It turns out that once you have installed either Aperture or iPhoto the iCloud system preference lets you enable PhotoStream support. What this actually happens in the background is some system service is enabled which downloads the photos into a directory under ~/Library.  I intended to keep Aperture installed, so I figured I could just write a short bit of code to walk this directory, pulling out photos and putting them into a directory of my choosing.

I’ve put the script up on git hub, which you can find here. Feel free to copy it and use it, drop me a line if you have any issues.

Mac OSX Split files greater then 2Gb

Just discovered that split (version 1.6) on Mac OS X Version 10.4.8 (PPC) does not handle files greater than 2Gb.

I’ve found two work arounds to this problem, the first is the one I typically do, but it requires darwin ports to be installed, I happen to have this installed everywhere anyway.

Darwin Ports

Simply ‘port install coreutils’:

% port search coreutils
coreutils                      sysutils/coreutils 5.97         GNU File, Shell, and Text utilities
% sudo port install coreutils
--->  Fetching coreutils
--->  Attempting to fetch coreutils-5.97.tar.bz2 from
--->  Verifying checksum(s) for coreutils
--->  Extracting coreutils
--->  Configuring coreutils
--->  Building coreutils with target all
--->  Staging coreutils into destroot
--->  Installing coreutils 5.97_0
--->  Activating coreutils 5.97_0
--->  Cleaning coreutils

Thats it, the only caveat is the new GNU split is named gsplit. So remember to type that when you want to split files over 2Gb!

Compile from source

The second method was found here. I like to keep things in my own logbook so I’ve put a copy of the instructions below

  1. Download the latest NetBSD split source from here
  2. Add the following somewhere near the top:
  3. Compile with either:

    For your architecture:

    cc -Os -o split split.c

    Or a Universal binary:

    cc -Os -isysroot /Developer/SDKs/MacOSX10.4u.sdk -arch i386 -arch ppc -o split split.c
  4. Copy the binary in place:
    $ sudo mv /usr/bin/split /usr/bin/
    $ sudo cp split /usr/bin/split
    $ sudo chmod ugo-w /usr/bin/split
    $ sudo chmod ugo+rx /usr/bin/split
    $ sudo chown root:wheel /usr/bin/split

Adjusting prefs from the command line

To adjust the various system preferences from the command line you need the systemsetup utility which ships with OSX Server although I’ve found some versions of OS X client have it installed in /System/Library/CoreServices/RemoteManagement/ On my G5 with Tiger (10.4.8) installed I used systemsetup-tiger and on my iMac (Intel) that was missing so I used systemsetup-panther which also worked.

You can adjust all sorts of things with the tool -help shows you all the options, I wanted to adjust sleep times. Below is an example session, showing the settings before and after I had made the change

# ./systemsetup-panther -getsleep
Sleep: Computer sleeps after 10 minutes
Sleep: Display sleeps after 10 minutes
Sleep: Disk sleeps after 10 minutes
# sudo ./systemsetup-panther -setcomputersleep 60
setcomputersleep: 60
# ./systemsetup-panther -getsleep
Sleep: Computer sleeps after 60 minutes
Sleep: Display sleeps after 10 minutes
Sleep: Disk sleeps after 10 minutes

Mac OSX ntp

If you want to sync to a time server other than the default apple provided ones you can enter the address into the box in the ‘Date & Time’ preference pane. To enter multiple servers seperate them with spaces as show in the image below. All this actually does is write the information out to /etc/ntp.conf and restarts the ntp daemon. Remember that the file will get overwritten when you access the preference pane though.


Configuring multiple DNS domains

Okay suppose you are on a corporate LAN and VPN’d into some other private network. You want DNS to resolve the local intranet, but also resolve your VPN’d LAN. If you VPN’d LAN domain is then create;


and in this file;


Then run:

sudo kill -HUP `cat /var/run/`