<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Null Disquisition &#187; Mac</title>
	<atom:link href="http://mumrah.net/topics/computing/mac-os-x/feed/" rel="self" type="application/rss+xml" />
	<link>http://mumrah.net</link>
	<description>Python, AWS, Grad School, and your face</description>
	<lastBuildDate>Fri, 05 Mar 2010 00:23:23 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>1080p content on your PS3</title>
		<link>http://mumrah.net/2010/02/1080p-content-on-your-ps3/</link>
		<comments>http://mumrah.net/2010/02/1080p-content-on-your-ps3/#comments</comments>
		<pubDate>Mon, 08 Feb 2010 04:31:03 +0000</pubDate>
		<dc:creator>david</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[Mac]]></category>

		<guid isPermaLink="false">http://mumrah.net/?p=350</guid>
		<description><![CDATA[New toys bring new adventures. My awesome wife got me a PS3 for my birthday recently and I&#8217;ve been tinkering around with getting some non-Bluray HD content to play on it. My initial attempts to stream stuff over my network proved unsatisfying. Since the PS3 is only capable of 802.11g, I gave up on the [...]]]></description>
			<content:encoded><![CDATA[<p>New toys bring new adventures. My awesome wife got me a PS3 for my birthday recently and I&#8217;ve been tinkering around with getting some non-Bluray HD content to play on it. My initial attempts to stream stuff over my network proved unsatisfying. Since the PS3 is only capable of 802.11g, I gave up on the high bitrate stuff (it&#8217;s perfectly capable of DVD quality content (1.5~2.5 Mb/s).</p>

<p>Software used (on Mac OS X 10.5):</p>

<ul>
<li><a href="http://www.smlabs.net/tsmuxer_en.html" title="tsMuxer website">tsMuxer</a></li>
<li>Disk Utility</li>
<li>newfs_udf</li>
<li>hdiutil</li>
</ul>

<p>Hardware used:</p>

<ul>
<li>Macbook Pro</li>
<li>Blank CD/DVD Media</li>
<li>PS3</li>
</ul>

<p>Files used:
* MKV file with AC3 audio stream and H264 video stream</p>

<p>Attempt 1 (<strong>successful</strong>): Load the MKV with tsMuxerGUI, select M2TS muxing. If the video profile is above 4.1, lower it to 4.1 (as the PS3 cannot support higher than an H264 level 4.1). Generate the m2ts and meta file, burn them both to a CD/DVD. This will be readable by the PS3 as a data disk &#8211; it will not autoplay, but you can access it and play it. To me, this is not an ideal solution as it does not support menus, chapters, or seeking.</p>

<p>Attempt 2 (<strong>unsuccessful</strong>): Same deal as before, but select &#8220;AVCHD disk&#8221;. This option will create a BD friendly file structure (folders named BDMV and CERTIFICATE). The trick here is to burn the disk as UDF 2.5 (this is not super easy on OS X or Linux). I wasted many CDs trying to regular ISO9660. Following the instructions <a href="http://www.videohelp.com/forum/archive/how-to-burn-avchd-on-dvd-r-in-high-definition-for-br-set-top-playback-t350375.html" title="about halfway down">here</a>, you must create the image and format it as UDF 2.5.</p>

<pre><code>dd if=/dev/zero of=myfile.img bs=1k count=716800
newfs_udf -r 2.5 myfile.img -v volume_label
hdiutil mount -nobrowse myfile.img
cp -R /path/to/avcdh-files/ /Volume/volume_label/
hdiutil unmount /Volume/volume_label
</code></pre>

<p><br/>
In plain-speak, create an empty (large) image, format it to UDF 2.5, mount it, copy the BD-compatible files into the volume, and unmount. You then use Disk Utility to burn the resulting image. No success here, but at this point I was so close, I could taste it.</p>

<p>Attempt 3 (<strong>successful</strong>): <em>Identical</em> procedure as Attempt 2, with one important exception &#8211; the image you create with <code>dd</code> must be sized in even increments of 1GB &#8211; that is, count==N&#42;1024&#42;1024.</p>

<p>A few things to try next:</p>

<ul>
<li>Menus</li>
<li>DTS audio stream</li>
<li>Subtitles</li>
</ul>

<p>Anyone wanting to test this out with a super high quality 1080p rip, I recommend <a href="http://www.bigbuckbunny.org/index.php/download/" title="Big Buck Bunny - Open Movie Project">Big Buck Bunny</a>. You&#8217;ll need Handbrake to convert it to a compatible container format if you download the AVI (tsMuxer doesn&#8217;t like AVIs).</p>
]]></content:encoded>
			<wfw:commentRss>http://mumrah.net/2010/02/1080p-content-on-your-ps3/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Time Machine In Your Pocket &#8211; Addendum</title>
		<link>http://mumrah.net/2009/06/time-machine-in-your-pocket-addendum/</link>
		<comments>http://mumrah.net/2009/06/time-machine-in-your-pocket-addendum/#comments</comments>
		<pubDate>Mon, 08 Jun 2009 13:29:50 +0000</pubDate>
		<dc:creator>david</dc:creator>
				<category><![CDATA[Mac]]></category>
		<category><![CDATA[os x]]></category>
		<category><![CDATA[rsync]]></category>

		<guid isPermaLink="false">http://mumrah.net/?p=145</guid>
		<description><![CDATA[Addendum to two previoius posts.

The other day, I noticed my 8GB USB volume that I use for temporary incremental backups was quite full. Curious, since the folders I back up to that volume do not total but 200MB or so, and rsync was supposed to be doing incremental backups (link-dest ftw).

After a little searching around, [...]]]></description>
			<content:encoded><![CDATA[<p>Addendum to two <a href="http://mumrah.net/2008/12/time-machine-in-your-pocket/" title="Part 1" target="_self">previoius<a> <a href="http://mumrah.net/2009/03/timemachine-in-your-pocket-part-2/" title="Part 2" target="_self">posts</a>.</p>

<p>The other day, I noticed my 8GB USB volume that I use for temporary incremental backups was quite full. Curious, since the folders I back up to that volume do not total but 200MB or so, and rsync was supposed to be doing incremental backups (link-dest ftw).</p>

<p>After a little searching around, I found someone who had a similar problem (and a solution). When you format a volume with OS X it will, by default, ignore file ownership (the linked article explores why this is perhaps). This proves to be a problem for rsync which considers file permissions and ownership as part of the file stat (as it should). Luckily the fix is easy &#8211; &#8220;Get Info&#8221; for the volume in question, then at the bottom unselect &#8220;Ignore ownership on this volume&#8221;</p>

<div style="text-align: center;"><img class="aligncenter" title="rsync ownership fix" src="http://mumrah-dot-net.s3.amazonaws.com/rsync-ownership-fix.png" alt="Uncheck Ignore ownership ..." width="238" height="49" /></div>

<p><br/></p>

<p>You will probably want to delete any backups that have been created (since they won&#8217;t have the correct file ownership). Source: <a href="http://terminalapp.net/backups-rsync-and-link-dest-not-working/">Terminalapp.net</a></p>
]]></content:encoded>
			<wfw:commentRss>http://mumrah.net/2009/06/time-machine-in-your-pocket-addendum/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Managing multiple AWS accounts</title>
		<link>http://mumrah.net/2009/05/managing-multiple-aws-accounts/</link>
		<comments>http://mumrah.net/2009/05/managing-multiple-aws-accounts/#comments</comments>
		<pubDate>Tue, 12 May 2009 02:41:53 +0000</pubDate>
		<dc:creator>david</dc:creator>
				<category><![CDATA[Amazon Web Services]]></category>
		<category><![CDATA[Mac]]></category>
		<category><![CDATA[aws]]></category>
		<category><![CDATA[ec2]]></category>

		<guid isPermaLink="false">http://mumrah.net/?p=113</guid>
		<description><![CDATA[ On my personal computer, I have three sets of x509 certificates/private keys. This makes using the EC2-API-tools quite the hassle. Echoes of EC2_CERT and EC2_PRIVATE_KEY haunt my dreams.

So, like you do with these sort of things, I wrote a bash script to work some magic.



    #!/bin/bash
    echo "Choose [...]]]></description>
			<content:encoded><![CDATA[<p><a style="clear:both;" href="http://mumrah-dot-net.s3.amazonaws.com/ec2-account.jpg"><img class="s3-img alignright" style="border: 0pt none;" src="http://mumrah-dot-net.s3.amazonaws.com/ec2-account.jpg" border="0" alt="ec2-account.jpg" width="283" height="188" /></a> On my personal computer, I have three sets of x509 certificates/private keys. This makes using the EC2-API-tools quite the hassle. Echoes of EC2_CERT and EC2_PRIVATE_KEY haunt my dreams.
<br/><br/>
So, like you do with these sort of things, I wrote a bash script to work some magic.
<br/></p>

<p><pre name="code">
    #!/bin/bash
    echo "Choose Account:"
    read account
    base=<code>grep $account ~/.ec2/README -i | awk '{print $1}'</code>
    if [ ! -n "$base" ]; then
        echo "Sorry, that account does not exist"
        return
    fi
    declare -x EC2_CERT="~/.ec2/cert-$base.pem"
    declare -x EC2_PRIVATE_KEY="~/.ec2/pk-$base.pem"
    echo "EC2 environment updated"
</pre></p>

<p>Requires that you your private keys/certs in ~/.ec2, and they are named cert-{something}.pem and pk-{something}.pem. Also, you need a README file in ~/.ec2 that looks like
<pre name="code">
    something account1
    something-else account2
</pre><br/>
I setup an alias so I just run &#8220;ec2-account personal&#8221; to switch to my personal credentials, and &#8220;ec2-account work&#8221; to switch to my work account.</p>

<p>-David</p>
]]></content:encoded>
			<wfw:commentRss>http://mumrah.net/2009/05/managing-multiple-aws-accounts/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Time Machine In Your Pocket &#8211; Part 2</title>
		<link>http://mumrah.net/2009/03/timemachine-in-your-pocket-part-2/</link>
		<comments>http://mumrah.net/2009/03/timemachine-in-your-pocket-part-2/#comments</comments>
		<pubDate>Sat, 28 Mar 2009 20:46:07 +0000</pubDate>
		<dc:creator>david</dc:creator>
				<category><![CDATA[Mac]]></category>
		<category><![CDATA[backup]]></category>
		<category><![CDATA[mac]]></category>
		<category><![CDATA[rsync]]></category>
		<category><![CDATA[timemachine]]></category>

		<guid isPermaLink="false">http://mumrah.net/?p=54</guid>
		<description><![CDATA[After a little tinkering here, a little tinkering there, I&#8217;ve finally settled on a good solution for my portable backup drive (8GB usb thumb drive). As outlined in my previous post, I wanted a portable backup solution that could do incremental backups (like Apple&#8217;s TimeMachine does). I looked, of course, to the wonderful unix utility [...]]]></description>
			<content:encoded><![CDATA[<p>After a little tinkering here, a little tinkering there, I&#8217;ve finally settled on a good solution for my portable backup drive (8GB usb thumb drive). As outlined <a title="Time Machine In Your Pocket" target="_self" href="http://mumrah.net/2008/12/time-machine-in-your-pocket/">in my previous post</a>, I wanted a portable backup solution that could do incremental backups (like Apple&#8217;s TimeMachine does). I looked, of course, to the wonderful unix utility <a title="Rsync wiki page" target="_blank" href="http://en.wikipedia.org/wiki/Rsync">rsync</a>. Here&#8217;s my latest version.</p>

<blockquote><br/><pre><code>#!/bin/bash -x

DEST="/Volumes/PNY8GB/Backups"
LATEST="Latest"
EXCLUDES_FILE="$HOME/.rsyncexcludes"
FILES_FROM="$HOME/.rsyncfiles"
RSYNC="/usr/bin/rsync --max-size 10m"

# Make sure user is root
if (( `id -u` != 0 )); then
    { echo "Sorry, must be root. Exiting..."; exit; }
fi;

# Make sure backup device is attached
! test -d "$DEST" &#038;&#038; echo "Please mount the backup drive!" &#038;&#038; exit

# Run rsync
DATE=`date "+%Y-%m-%d-%H%M%S"`
n=`$RSYNC -r -a -x -S -R --stats --delete --link-dest=$DEST/$LATEST \
 --exclude-from $EXCLUDES_FILE --files-from $FILES_FROM $* $HOME \
 $DEST/$DATE | sed -n 's/Number of files transferred: \([^0]\)/\1/p'`

# Update 'Latest' link
rm $DEST/$LATEST
ln -s $DEST/$DATE $DEST/$LATEST

# Send a growl notification
if [ $n ]
then
    /usr/local/bin/growlnotify -m 'rsync complete,
number of files: '$n
fi</code></pre></blockquote>

<p><br/></p>

<p>By using &ndash;&ndash;exlude-from and &ndash;&ndash;files-from, you get more fine grained control of what gets backed up. My Code folder is ~1GB, and my School folder is about 3GB. When I exclude all of my compiled code, data files, images, .git and .svn folders, and other various annoying swap files my base backup footprint is less than 500MB (for both Code and School).</p>

<p>Here&#8217;s my excludes file &#8211; it&#8217;s just one line per exclude filter</p>

<blockquote><pre><code>*.sql
*.bak
*.swp
.svn
*.pyc
*.log
*.tar.gz
*.dvi
*.o
*.out
*.d
*.tmp
.git</code></pre></blockquote>

<p><br/></p>

<p>Similarly, the files-from file is one file path per line (remember the trailing slash!). An important note (found in the rsync manual) is that when you specify &ndash;&ndash;files-from, -r is no longer implied with -a. So make sure to add -r to your argument list.</p>

<p>And yet again, I leave the scheduling to you.</p>

<p>-David</p>
]]></content:encoded>
			<wfw:commentRss>http://mumrah.net/2009/03/timemachine-in-your-pocket-part-2/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Time Machine in your pocket</title>
		<link>http://mumrah.net/2008/12/time-machine-in-your-pocket/</link>
		<comments>http://mumrah.net/2008/12/time-machine-in-your-pocket/#comments</comments>
		<pubDate>Sun, 21 Dec 2008 22:01:01 +0000</pubDate>
		<dc:creator>david</dc:creator>
				<category><![CDATA[Mac]]></category>
		<category><![CDATA[backups]]></category>
		<category><![CDATA[os x]]></category>
		<category><![CDATA[rsync]]></category>

		<guid isPermaLink="false">http://mumrah.net/?p=45</guid>
		<description><![CDATA[A close friend of mine was recently subject of home invasion. Aside from the regular pickings (TV, computers) he had his external harddrives stolen. I could only imagine how that felt &#8211; just that extra twist of the dagger in your chest. After hearing about this, I reevaluated my personal backup proceedures &#8211; specifically, how [...]]]></description>
			<content:encoded><![CDATA[<p>A close friend of mine was recently subject of home invasion. Aside from the regular pickings (TV, computers) he had his external harddrives stolen. I could only imagine how that felt &#8211; just that extra twist of the dagger in your chest. After hearing about this, I reevaluated my personal backup proceedures &#8211; specifically, how could one avoid loosing everything if something like this happens.</p>

<p>I&#8217;ve been using Time Machine on my MacBook Pro for the past several months. TM is certainly a great program, but we all know it has certain shortcomings. One of those being the lack of a whitelist (you can only blacklist directories from the backup schedule). Say for instance, I only want to backup a single directory (like all of my code). This is effectively impossible with Time Machine.</p>

<p>So until Apple gets their shit together, we Unix folk have rsync. Michael over at IMHO has a great <a href="http://blog.interlinked.org/tutorials/rsync_time_machine.html">writeup on how to acheive incremental backups in a Time Machine</a> fashion using rsync and cron. I threw together the following script to add in a little OS X sexiness and so that it uses a USB thumb drive.</p>

<blockquote>
<br/><pre>#!/bin/bash
if [ -d /Volumes/PNY8GB ]
then
    HOME=/Volumes/PNY8GB/Backups.backupdb/TM
    date=`date "+%Y-%m-%d-%H%M%S"`
    n=`rsync --stats -aR --exclude "*.swp" --exclude "*.bak" --exclude "*.pyc"
--exclude "*~" --exclude ".svn" --delete-excluded --link-dest=$HOME/Latest
/Users/davidarthur/Code/Loud3r $HOME/$date |
sed -n 's/Number of files transferred: \([^0]\)/\1/p'`
    rm $HOME/Latest
    ln -s $date $HOME/Latest
else
    exit
fi
if [ $n ]
then
    /usr/local/bin/growlnotify -m 'rsync complete,
number of files: '$n &amp;&gt; /dev/null
fi</pre>
</blockquote>

<p><br/>
This first looks for the target thumb drive (PNY8GB in my case), then runs the rsync command, and finally pops up a nice little growl notification showing how many files were backed up. For non-OS X people, just ignore the growlnotify part.</p>

<blockquote><br/>
<pre>#!/bin/bash
if [ -d /Volumes/PNY8GB ]
then
    HOME=/Volumes/PNY8GB/Backups.backupdb/TM
    date=`date "+%Y-%m-%d-%H%M%S"`
    rsync --stats -aR --exclude "*.swp" --exclude "*.bak" --exclude "*.pyc"
--exclude "*~" --exclude ".svn" --delete-excluded --link-dest=$HOME/Latest
/Users/davidarthur/Code/Loud3r $HOME/$date
    rm $HOME/Latest
    ln -s $date $HOME/Latest
else
    exit
fi</pre>
</blockquote>

<p><br/>
I&#8217;m still working on getting the directory structure to match Time Machine&#8217;s so I can actually use Time Machine to explore/restore files from the backups.</p>

<p>This gives me a little piece of mind, and hopefully will you too.</p>

<p>-David</p>

<p>Edit: OS X has some issues with preserving permissions and ownerships with HFS+ volumes &#8211; so the incremental part doesn&#8217;t really work. Should work on other *nix systems though.</p>

<p>2nd Edit: Got it working finally. Here is my complete script (running every 15mins). N.B. must be run by root (so put it in root&#8217;s crontab).</p>

<blockquote><br/><pre>#!/bin/bash -x

DEST="/Volumes/PNY8GB/Backups"
LATEST="Latest"
EXCLUDES_FILE="/Users/davidarthur/.rsyncexcludes"
RSYNC="/usr/bin/rsync "

# Make sure user is root
if (( `id -u` != 0 )); then
    { echo "Sorry, must be root. Exiting..."; exit; }
fi;

# Make sure backup device is attached
! test -d "$DEST" &amp;&amp; echo "Please mount the backup drive!" &amp;&amp; exit

# Run rsync
DATE=`date "+%Y-%m-%d-%H%M%S"`
n=`$RSYNC -a -x -S --stats --delete --link-dest=$DEST/$LATEST \
    --exclude-from $EXCLUDES_FILE $* /Users/davidarthur/Code/Loud3r $DEST/$DATE
| sed -n 's/Number of files transferred: \([^0]\)/\1/p'`
# Update 'Latest' link
rm $DEST/$LATEST
ln -s $DEST/$DATE $DEST/$LATEST

# Send a growl notification
if [ $n ]
then
    /usr/local/bin/growlnotify -m 'rsync complete,
number of files: '$n &amp;&gt; /dev/null
fi</pre></blockquote>

<p><br/></p>
]]></content:encoded>
			<wfw:commentRss>http://mumrah.net/2008/12/time-machine-in-your-pocket/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>
<!-- WP Super Cache is installed but broken. The path to wp-cache-phase1.php in wp-content/advanced-cache.php must be fixed! -->