Friday, November 06, 2009

VNC to work machine

I always forget how to do VNC over SSH (despite having a handy alias set up for it...), so here's how to set it up.

  1. run vncon on the host (alias doing what's described on http://www.macosxhints.com/article.php?story=20080318190503111)
  2. run plaguevnc on the laptop to ssh tunnel vnc traffic
  3. connect to localhost:1212 in screen sharing
  4. do stuff... erm...
  5. run vncoff on the host
Ignore http://technotes.twosmallcoins.com/?tag=os-x-screen-sharing which sounds like it does what you want but doesn't...

Thursday, August 27, 2009

rsync a directory to another destination

I wanted to sync up a directory on one machine to another, but I only wanted to transfer missing files (not updated) and to have the transferred files written to another directory (so I could easily find them and perform another action on them). The following mammoth incantation does the job:


rsync --verbose  --progress --ignore-existing --stats --compress 
--rsh=/usr/bin/ssh --size-only --compare-dest='~/Music/iTunes/iTunes\ Music/'
--recursive ~/Music/iTunes/iTunes\ Music/* macmini.local:'~/Desktop/incoming-music'


This makes a bunch of empty directories (those that the --compare-dest contains but we don't write to), cleaning them up is as simple as:

find Desktop/incoming-music/ -type d -print0 | xargs -0 rmdir -p