<?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>chrisstreeter.com &#187; software</title>
	<atom:link href="http://www.chrisstreeter.com/archive/category/software/feed" rel="self" type="application/rss+xml" />
	<link>http://www.chrisstreeter.com</link>
	<description>Chris Streeter&#039;s location on the Internet.</description>
	<lastBuildDate>Tue, 20 Sep 2011 15:53:39 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3</generator>
		<item>
		<title>Homebrew Package Update Notifications via Growl</title>
		<link>http://www.chrisstreeter.com/archive/2011/09/821/homebrew-package-update-notifications-via-growl</link>
		<comments>http://www.chrisstreeter.com/archive/2011/09/821/homebrew-package-update-notifications-via-growl#comments</comments>
		<pubDate>Tue, 20 Sep 2011 15:53:39 +0000</pubDate>
		<dc:creator>streeter</dc:creator>
				<category><![CDATA[software]]></category>
		<category><![CDATA[bash]]></category>
		<category><![CDATA[cron]]></category>
		<category><![CDATA[github]]></category>
		<category><![CDATA[growl]]></category>
		<category><![CDATA[homebrew]]></category>
		<category><![CDATA[lion]]></category>
		<category><![CDATA[macos]]></category>
		<category><![CDATA[macosx]]></category>
		<category><![CDATA[macports]]></category>
		<category><![CDATA[script]]></category>
		<category><![CDATA[updater]]></category>

		<guid isPermaLink="false">http://www.chrisstreeter.com/?p=821</guid>
		<description><![CDATA[Over the weekend, I finally upgraded my system to Mac OS Lion. I also took the opportunity to do a completely fresh install of my system, doing a final TimeMachine backup before erasing the hard drive and then installing Lion &#8230; <a href="http://www.chrisstreeter.com/archive/2011/09/821/homebrew-package-update-notifications-via-growl">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Over the weekend, I finally upgraded my system to Mac OS Lion. I also took the opportunity to do a completely fresh install of my system, doing a <a title="World Backup Day: How I Backup" href="http://www.chrisstreeter.com/archive/2011/03/807/world-backup-day-how-i-backup">final TimeMachine backup</a> before erasing the hard drive and then installing Lion off a USB thumb drive.</p>
<p>I have long used <a href="http://www.macports.org/">MacPorts</a> as my open source package manager, but I&#8217;ve had issues recently with certain ports not being updated or being out of date. So I was really interested in <a title="Homebrew" href="http://mxcl.github.com/homebrew/" target="_blank">Homebrew</a>.  The fact that it is all on github, open and actively developed really appealed to me. After getting it up and running, I wanted to port my <a title="MacPort Package Update Notifications via Growl" href="http://www.chrisstreeter.com/archive/2011/01/800/macport-package-update-notifications-via-growl" target="_blank">package update notifier</a> to use Homebrew. Doing so was really quite easy. Here&#8217;s what I came up with, which is also in <a title="brew-update-notifier" href="https://github.com/streeter/dotfiles/blob/master/bin/brew-update-notifier" target="_blank">my dotfiles on github</a>. <span id="more-821"></span></p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #666666; font-style: italic;">#!/bin/bash</span>
<span style="color: #666666; font-style: italic;">#</span>
<span style="color: #666666; font-style: italic;"># Notify of Homebrew updates via Growl on Mac OS X</span>
<span style="color: #666666; font-style: italic;">#</span>
<span style="color: #666666; font-style: italic;"># Author: Chris Streeter http://www.chrisstreeter.com</span>
<span style="color: #666666; font-style: italic;"># Requires: Growl Notify Extra to be installed. Install with</span>
<span style="color: #666666; font-style: italic;">#   brew install growlnotify</span>
&nbsp;
<span style="color: #007800;">TERM_APP</span>=<span style="color: #ff0000;">'/Applications/Terminal.app'</span>
<span style="color: #007800;">BREW_EXEC</span>=<span style="color: #ff0000;">'/usr/local/bin/brew'</span>
<span style="color: #007800;">GROWL_NOTIFY</span>=<span style="color: #ff0000;">'/usr/local/bin/growlnotify'</span>
<span style="color: #007800;">GROWL_TITLE</span>=<span style="color: #ff0000;">&quot;Homebrew Update(s) Available&quot;</span>
<span style="color: #007800;">GROWL_ARGS</span>=<span style="color: #ff0000;">&quot;-n 'Homebrew' -d <span style="color: #007800;">$GROWL_NOTIFY</span> -a <span style="color: #007800;">$BREW_EXEC</span>&quot;</span>
&nbsp;
<span style="color: #007800;">$BREW_EXEC</span> update <span style="color: #000000;">2</span><span style="color: #000000; font-weight: bold;">&amp;</span>gt;<span style="color: #000000; font-weight: bold;">&amp;</span>amp;<span style="color: #000000;">1</span> <span style="color: #000000; font-weight: bold;">&amp;</span>gt; <span style="color: #000000; font-weight: bold;">/</span>dev<span style="color: #000000; font-weight: bold;">/</span>null
<span style="color: #007800;">outdated</span>=<span style="color: #000000; font-weight: bold;">`</span><span style="color: #007800;">$BREW_EXEC</span> outdated <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #c20cb9; font-weight: bold;">tr</span> <span style="color: #ff0000;">' '</span> <span style="color: #ff0000;">'\n'</span><span style="color: #000000; font-weight: bold;">`</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">if</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span> <span style="color: #660033;">-z</span> <span style="color: #ff0000;">&quot;<span style="color: #007800;">$outdated</span>&quot;</span> <span style="color: #7a0874; font-weight: bold;">&#93;</span> ; <span style="color: #000000; font-weight: bold;">then</span>
    <span style="color: #000000; font-weight: bold;">if</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span> <span style="color: #660033;">-e</span> <span style="color: #007800;">$GROWL_NOTIFY</span> <span style="color: #7a0874; font-weight: bold;">&#93;</span>; <span style="color: #000000; font-weight: bold;">then</span>
        <span style="color: #666666; font-style: italic;"># No updates available</span>
        <span style="color: #007800;">$GROWL_NOTIFY</span> <span style="color: #007800;">$GROWL_ARGS</span> <span style="color: #660033;">-m</span> <span style="color: #ff0000;">''</span> <span style="color: #660033;">-t</span> <span style="color: #ff0000;">&quot;No Homebrew Updates Available&quot;</span>
    <span style="color: #000000; font-weight: bold;">fi</span>
<span style="color: #000000; font-weight: bold;">else</span>
    <span style="color: #666666; font-style: italic;"># We've got an outdated formula or two</span>
&nbsp;
    <span style="color: #666666; font-style: italic;"># Nofity via growl</span>
    <span style="color: #000000; font-weight: bold;">if</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span> <span style="color: #660033;">-e</span> <span style="color: #007800;">$GROWL_NOTIFY</span> <span style="color: #7a0874; font-weight: bold;">&#93;</span>; <span style="color: #000000; font-weight: bold;">then</span>
        <span style="color: #007800;">lc</span>=$<span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #000000; font-weight: bold;">`</span><span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;<span style="color: #007800;">$outdated</span>&quot;</span> <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #c20cb9; font-weight: bold;">wc</span> -l<span style="color: #000000; font-weight: bold;">`</span><span style="color: #7a0874; font-weight: bold;">&#41;</span><span style="color: #7a0874; font-weight: bold;">&#41;</span>
        <span style="color: #007800;">outdated</span>=<span style="color: #000000; font-weight: bold;">`</span><span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;<span style="color: #007800;">$outdated</span>&quot;</span> <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #c20cb9; font-weight: bold;">tail</span> -<span style="color: #007800;">$lc</span><span style="color: #000000; font-weight: bold;">`</span>
        <span style="color: #007800;">message</span>=<span style="color: #000000; font-weight: bold;">`</span><span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;<span style="color: #007800;">$outdated</span>&quot;</span> <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #c20cb9; font-weight: bold;">head</span> -<span style="color: #000000;">5</span><span style="color: #000000; font-weight: bold;">`</span>
        <span style="color: #000000; font-weight: bold;">if</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span> <span style="color: #ff0000;">&quot;<span style="color: #007800;">$outdated</span>&quot;</span> <span style="color: #000000; font-weight: bold;">!</span>= <span style="color: #ff0000;">&quot;<span style="color: #007800;">$message</span>&quot;</span> <span style="color: #7a0874; font-weight: bold;">&#93;</span>; <span style="color: #000000; font-weight: bold;">then</span>
            <span style="color: #007800;">message</span>=<span style="color: #ff0000;">&quot;Some of the outdated formulae are:
<span style="color: #007800;">$message</span>&quot;</span>
        <span style="color: #000000; font-weight: bold;">else</span>
            <span style="color: #007800;">message</span>=<span style="color: #ff0000;">&quot;The following formulae are outdated:
<span style="color: #007800;">$message</span>&quot;</span>
        <span style="color: #000000; font-weight: bold;">fi</span>
        <span style="color: #666666; font-style: italic;"># Send to growlnotify</span>
        <span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;<span style="color: #007800;">$message</span>&quot;</span> <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #007800;">$GROWL_NOTIFY</span> <span style="color: #007800;">$GROWL_ARGS</span> <span style="color: #660033;">-s</span> <span style="color: #660033;">-t</span> <span style="color: #007800;">$GROWL_TITLE</span>
    <span style="color: #000000; font-weight: bold;">fi</span>
<span style="color: #000000; font-weight: bold;">fi</span></pre></div></div>

<p>Assuming the script is at <code>~/bin/brew-update-notifier</code>, you can install the script to a crontab by running <code>sudo crontab -e</code>, then adding the line <code>0 12 * * * /Users/&lt;username&gt;/bin/brew-update-notifier</code> to the end of the file (substituting <code>&lt;username&gt;</code> for your username, or wherever you&#8217;ve put the script). I&#8217;ve chosen to run the script every day at noon because my computer is likely to be on and connected to a network.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.chrisstreeter.com/archive/2011/09/821/homebrew-package-update-notifications-via-growl/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>World Backup Day: How I Backup</title>
		<link>http://www.chrisstreeter.com/archive/2011/03/807/world-backup-day-how-i-backup</link>
		<comments>http://www.chrisstreeter.com/archive/2011/03/807/world-backup-day-how-i-backup#comments</comments>
		<pubDate>Fri, 01 Apr 2011 05:20:42 +0000</pubDate>
		<dc:creator>streeter</dc:creator>
				<category><![CDATA[software]]></category>
		<category><![CDATA[backup]]></category>
		<category><![CDATA[crashplan]]></category>
		<category><![CDATA[macosx]]></category>
		<category><![CDATA[time machine]]></category>
		<category><![CDATA[world backup day]]></category>

		<guid isPermaLink="false">http://www.chrisstreeter.com/?p=807</guid>
		<description><![CDATA[Today was World Backup Day, and, in the footsteps of Ars, decided I&#8217;d detail my current backup strategy. I first started backing up regularly after an incident back in college. One day the hard drive in my laptop began making &#8230; <a href="http://www.chrisstreeter.com/archive/2011/03/807/world-backup-day-how-i-backup">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Today was World Backup Day, and, in <a href="http://arstechnica.com/gadgets/news/2011/03/world-backup-day-what-are-you-doing-to-make-sure-youre-covered.ars">the footsteps of Ars</a>, decided I&#8217;d detail my current backup strategy. I first started backing up regularly after an incident back in college. One day the hard drive in my laptop began making <a href="http://datacent.com.nyud.net:8090/hard_drive_sounds.php">the telltale sounds</a> of imminent failure. Then the computer stopped booting. And I hadn&#8217;t backed up the drive in several weeks, which would have caused me to lose a bunch of data. I ordered a new drive, and just before I was about to install it, I was luckily able to boot my laptop and then copy the data off of it, losing nothing. Since then, I&#8217;ve been an big advocate of backups.</p>
<p>My primary computer is a Macbook Pro. Since it is also the computer that all my <a href="http://chrisstreeter.com/photos">photos</a> and important data is on, I don&#8217;t want to lose any of it. Every day I make sure to plug in my 1 TB external hard drive that Time Machine mirrors the contents of drive to. So at all times, I&#8217;ve got a backup of my drive and a history of the files. I also have another external drive that I keep at my parent&#8217;s house in their safe that is filled with Time Machine backups. So if my house blows up, I have something to fall back on. The problem with that disk though is that it is several months out of date. And that sucks because my data changes all the time.</p>
<p>But thats not all for my laptop. I also make use of <a href="http://www.crashplan.com/">CrashPlan</a>. At home, I also have a Linux box with a 4 hard drives in a RAID 5 setup, so if one drive dies, I don&#8217;t lose any data, I can just replace the drive. So I have CrashPlan backup my laptop to my Linux box onto it&#8217;s RAID storage, and this can happen anywhere my laptop has Internet access. Currently, CrashPlan is configured to run every night.</p>
<p>My email is hosted <a href="http://gmail.com">in the cloud</a>, but I still run hourly backups onto the RAID storage in my <a href="http://www.chrisstreeter.com/archive/2009/04/305/gmail-imap-backup-with-mbsync-on-ubuntu/">linux box using mbsync</a>. I also run backups of my Google Docs every day using <a href="http://code.google.com/p/gdatacopier/">gdatacopier</a> (again, saving to my Linux box).</p>
<p><span id="more-807"></span></p>
<p>I used to also have Mozy, but decided to scale back costs for a while. Though I would really like to use it again. For some important things, I&#8217;ll stick them on Dropbox, which maintains a backup copy in the cloud. However, storage on Dropbox is much more limited than something like Mozy.</p>
<p>Right now, one single point of failure is my Linux box. The drives are getting old and should be replaced soon (the MTTF is way overdue) and I&#8217;m relying too much on them these days. And I really should have a standby drive in the array in case of multiple disk failures. The plus side is that there really isn&#8217;t anything on that computer that is not somewhere else, or I can&#8217;t redownload. But it would be a huge hassle.</p>
<p>I&#8217;ve really tried to create a good, easy solution for backups without any single point of failure. Though there are definitely several areas that I need to improve on. You never need the backup until you need it. And at that point, if you don&#8217;t have the backup, you may find you&#8217;ve lost years of irreplaceable memories. I know that to me, my photos are irreplaceable. I also have all the documents I created from sixth grade all the way through college. And if I lost those, there&#8217;s no bringing them back (there&#8217;s just no way to recreate the awesome resume I wrote in sixth grade &#8211; &#8220;Expected graduation from Middle School, 1998&#8243;, &#8220;experience with many tools and their uses&#8221;, &#8220;fast runner&#8221; &#8211; classic).</p>
<p>If you own a Mac, there is no excuse, just buy a cheap external hard drive and plug it in and use Time Machine. Windows users should just buy a Mac. Linux users&#8230; well, write some perl script that rsync&#8217;s your files somewhere and put it in cron or write some other solution (I mean really, you&#8217;re using Linux, you should be able to figure something out). Or look at CrashPlan. Hopefully, if you aren&#8217;t backing up your files, you&#8217;ll start.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.chrisstreeter.com/archive/2011/03/807/world-backup-day-how-i-backup/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>MacPort Package Update Notifications via Growl</title>
		<link>http://www.chrisstreeter.com/archive/2011/01/800/macport-package-update-notifications-via-growl</link>
		<comments>http://www.chrisstreeter.com/archive/2011/01/800/macport-package-update-notifications-via-growl#comments</comments>
		<pubDate>Sun, 23 Jan 2011 17:30:39 +0000</pubDate>
		<dc:creator>streeter</dc:creator>
				<category><![CDATA[software]]></category>
		<category><![CDATA[bash]]></category>
		<category><![CDATA[cron]]></category>
		<category><![CDATA[github]]></category>
		<category><![CDATA[growl]]></category>
		<category><![CDATA[macos]]></category>
		<category><![CDATA[macosx]]></category>
		<category><![CDATA[macports]]></category>
		<category><![CDATA[script]]></category>
		<category><![CDATA[updater]]></category>

		<guid isPermaLink="false">http://www.chrisstreeter.com/?p=800</guid>
		<description><![CDATA[I wrote a quick little script this morning to notify myself of updates to MacPorts via the Mac OS X notification app Growl.  The script is a bash script that is designed to run as root from a cronjob (as &#8230; <a href="http://www.chrisstreeter.com/archive/2011/01/800/macport-package-update-notifications-via-growl">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>I wrote a quick little script this morning to notify myself of updates to <a href="http://www.macports.org/">MacPorts</a> via the Mac OS X notification app <a href="http://growl.info/">Growl</a>.  The script is a bash script that is designed to run as root from a cronjob (as the <code>port sync</code> command requires root permissions). You can find the script committed in my <a href="https://github.com/streeter/dotfiles/">dotfiles repository on github</a>.  For convenience, I pasted the script below, though <a href="https://github.com/streeter/dotfiles/blob/master/bin/port-update-notifier">the copy on github</a> will always be the most up-to-date copy.<br />
<span id="more-800"></span></p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #666666; font-style: italic;">#!/bin/bash</span>
<span style="color: #666666; font-style: italic;">#</span>
<span style="color: #666666; font-style: italic;"># Notify of MacPort updates via Growl on Mac OS X</span>
<span style="color: #666666; font-style: italic;">#</span>
<span style="color: #666666; font-style: italic;"># Author: Chris Streeter http://www.chrisstreeter.com</span>
<span style="color: #666666; font-style: italic;"># Requires: Growl Notify Extra to be installed (but fails gracefully). Info</span>
<span style="color: #666666; font-style: italic;">#       about how to get the extra is at http://growl.info/extras.php</span>
&nbsp;
<span style="color: #007800;">TERM_APP</span>=<span style="color: #ff0000;">'/Applications/Terminal.app'</span>
<span style="color: #007800;">PORT_EXEC</span>=<span style="color: #ff0000;">'/opt/local/bin/port'</span>
<span style="color: #007800;">GROWL_NOTIFY</span>=<span style="color: #ff0000;">'/usr/local/bin/growlnotify'</span>
<span style="color: #007800;">GROWL_TITLE</span>=<span style="color: #ff0000;">&quot;MacPort Update(s) Available&quot;</span>
<span style="color: #007800;">GROWL_ARGS</span>=<span style="color: #ff0000;">&quot;-n 'MacPorts' -d <span style="color: #007800;">$GROWL_NOTIFY</span> -a <span style="color: #007800;">$PORT_EXEC</span>&quot;</span>
&nbsp;
<span style="color: #007800;">$PORT_EXEC</span> <span style="color: #c20cb9; font-weight: bold;">sync</span> <span style="color: #000000;">2</span><span style="color: #000000; font-weight: bold;">&amp;</span>gt;<span style="color: #000000; font-weight: bold;">&amp;</span>amp;<span style="color: #000000;">1</span> <span style="color: #000000; font-weight: bold;">&amp;</span>gt; <span style="color: #000000; font-weight: bold;">/</span>dev<span style="color: #000000; font-weight: bold;">/</span>null
<span style="color: #007800;">outdated</span>=<span style="color: #000000; font-weight: bold;">`</span><span style="color: #007800;">$PORT_EXEC</span> outdated<span style="color: #000000; font-weight: bold;">`</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">if</span> <span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #007800;">$outdated</span> <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #c20cb9; font-weight: bold;">grep</span> <span style="color: #660033;">-q</span> <span style="color: #ff0000;">'No installed ports are outdated.'</span> ; <span style="color: #000000; font-weight: bold;">then</span>
    <span style="color: #000000; font-weight: bold;">if</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span> <span style="color: #660033;">-e</span> <span style="color: #007800;">$GROWL_NOTIFY</span> <span style="color: #7a0874; font-weight: bold;">&#93;</span>; <span style="color: #000000; font-weight: bold;">then</span>
        <span style="color: #666666; font-style: italic;"># No updates available</span>
        <span style="color: #007800;">$GROWL_NOTIFY</span> <span style="color: #007800;">$GROWL_ARGS</span> <span style="color: #660033;">-m</span> <span style="color: #ff0000;">''</span> <span style="color: #660033;">-t</span> <span style="color: #ff0000;">&quot;No MacPort Updates Available&quot;</span>
    <span style="color: #000000; font-weight: bold;">fi</span>
<span style="color: #000000; font-weight: bold;">else</span>
    <span style="color: #666666; font-style: italic;"># We've got an outdated port or two</span>
&nbsp;
    <span style="color: #666666; font-style: italic;"># Nofity via growl</span>
    <span style="color: #000000; font-weight: bold;">if</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span> <span style="color: #660033;">-e</span> <span style="color: #007800;">$GROWL_NOTIFY</span> <span style="color: #7a0874; font-weight: bold;">&#93;</span>; <span style="color: #000000; font-weight: bold;">then</span>
        <span style="color: #007800;">lc</span>=$<span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #000000; font-weight: bold;">`</span><span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;<span style="color: #007800;">$outdated</span>&quot;</span> <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #c20cb9; font-weight: bold;">wc</span> -l<span style="color: #000000; font-weight: bold;">`</span> - <span style="color: #000000;">1</span><span style="color: #7a0874; font-weight: bold;">&#41;</span><span style="color: #7a0874; font-weight: bold;">&#41;</span>
        <span style="color: #007800;">outdated</span>=<span style="color: #000000; font-weight: bold;">`</span><span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;<span style="color: #007800;">$outdated</span>&quot;</span> <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #c20cb9; font-weight: bold;">tail</span> -<span style="color: #007800;">$lc</span> <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #c20cb9; font-weight: bold;">cut</span> <span style="color: #660033;">-d</span> <span style="color: #ff0000;">&quot; &quot;</span> <span style="color: #660033;">-f</span> <span style="color: #000000;">1</span><span style="color: #000000; font-weight: bold;">`</span>
        <span style="color: #007800;">message</span>=<span style="color: #000000; font-weight: bold;">`</span><span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;<span style="color: #007800;">$outdated</span>&quot;</span> <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #c20cb9; font-weight: bold;">head</span> -<span style="color: #000000;">5</span><span style="color: #000000; font-weight: bold;">`</span>
        <span style="color: #000000; font-weight: bold;">if</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span> <span style="color: #ff0000;">&quot;<span style="color: #007800;">$outdated</span>&quot;</span> <span style="color: #000000; font-weight: bold;">!</span>= <span style="color: #ff0000;">&quot;<span style="color: #007800;">$message</span>&quot;</span> <span style="color: #7a0874; font-weight: bold;">&#93;</span>; <span style="color: #000000; font-weight: bold;">then</span>
            <span style="color: #007800;">message</span>=<span style="color: #ff0000;">&quot;Some of the outdated packages are:
<span style="color: #007800;">$message</span>&quot;</span>
        <span style="color: #000000; font-weight: bold;">else</span>
            <span style="color: #007800;">message</span>=<span style="color: #ff0000;">&quot;The following packages are outdated:
<span style="color: #007800;">$message</span>&quot;</span>
        <span style="color: #000000; font-weight: bold;">fi</span>
        <span style="color: #666666; font-style: italic;"># Send to growlnotify</span>
        <span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;<span style="color: #007800;">$message</span>&quot;</span> <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #007800;">$GROWL_NOTIFY</span> <span style="color: #007800;">$GROWL_ARGS</span> <span style="color: #660033;">-s</span> <span style="color: #660033;">-t</span> <span style="color: #007800;">$GROWL_TITLE</span>
    <span style="color: #000000; font-weight: bold;">fi</span>
<span style="color: #000000; font-weight: bold;">fi</span></pre></div></div>

<p>Assuming the script is at <code>~/bin/port-update-notifier</code>, you can install the script to a crontab by running <code>sudo crontab -e</code>, then adding the line <code>0 12 * * * /Users/&lt;username&gt;/bin/port-update-notifier</code> to the end of the file (substituting <code>&lt;username&gt;</code> for your username, or wherever you&#8217;ve put the script). I&#8217;ve chosen to run the script every day at noon because my computer is likely to be on and connected to a network.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.chrisstreeter.com/archive/2011/01/800/macport-package-update-notifications-via-growl/feed</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>GCalendar Reminders</title>
		<link>http://www.chrisstreeter.com/archive/2010/01/451/gcalendar-reminders</link>
		<comments>http://www.chrisstreeter.com/archive/2010/01/451/gcalendar-reminders#comments</comments>
		<pubDate>Sun, 17 Jan 2010 19:30:11 +0000</pubDate>
		<dc:creator>streeter</dc:creator>
				<category><![CDATA[google app engine]]></category>
		<category><![CDATA[site]]></category>
		<category><![CDATA[software]]></category>
		<category><![CDATA[technology]]></category>
		<category><![CDATA[birthdays]]></category>
		<category><![CDATA[calendar]]></category>
		<category><![CDATA[google calendar]]></category>

		<guid isPermaLink="false">http://www.chrisstreeter.com/?p=451</guid>
		<description><![CDATA[Google recently added the ability to create a birthday calendar. However, Google didn&#8217;t give one the ability to send reminders for the events on that calendar. This is the same thing that Apple has done for years with their Address &#8230; <a href="http://www.chrisstreeter.com/archive/2010/01/451/gcalendar-reminders">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Google recently added the ability to create a <a href="http://googlesystem.blogspot.com/2009/07/birthday-calendar-for-google-contacts.html" target="_blank">birthday calendar</a>. However, Google didn&#8217;t give one the ability to send reminders for the events on that calendar. This is the same thing that Apple has done for years with their <a href="http://discussions.apple.com/thread.jspa?threadID=1613442" target="_blank">Address Book and iCal</a> integration. And I hate missing someone&#8217;s birthday when I don&#8217;t happen to look at my calendar that day.</p>
<p>I saw this as an opportunity for improvement. I also saw this an opportunity to learn about <a href="https://appengine.google.com/">Google App Engine</a>. So I wrote a python application that lets you schedule email reminders for the Contacts Birthday Calendar. In addition, you can select a specific hour in a specific time-zone to send the reminders at as well. The application use&#8217;s the Google App Engine user authentication and the Google Data <a href="http://code.google.com/apis/accounts/docs/AuthSub.html" target="_blank">AuthSub</a> permission request API to get upcoming events for display and email reminders.</p>
<p>This gave me some good experience with Google App Engine&#8217;s scheduled tasks and Task Queues, as well as a chance to hone up on my Python. Without further ado, I present <a title="GCalendar Reminders" href="http://gcalendar-reminders.appspot.com/" target="_blank">GCalendar Reminders</a>. Feel free to use it to send yourself emails using the security of Google App Engine.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.chrisstreeter.com/archive/2010/01/451/gcalendar-reminders/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Benchmarking Redis and PRedis</title>
		<link>http://www.chrisstreeter.com/archive/2010/01/434/benchmarking-redis-and-predis</link>
		<comments>http://www.chrisstreeter.com/archive/2010/01/434/benchmarking-redis-and-predis#comments</comments>
		<pubDate>Sat, 16 Jan 2010 06:51:37 +0000</pubDate>
		<dc:creator>streeter</dc:creator>
				<category><![CDATA[benchmarking]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[redis]]></category>
		<category><![CDATA[software]]></category>
		<category><![CDATA[technology]]></category>
		<category><![CDATA[predis]]></category>

		<guid isPermaLink="false">http://www.chrisstreeter.com/?p=434</guid>
		<description><![CDATA[At work, I recently was tasked with looking into some NoSQL solutions for upcoming projects. For various reasons, I focused on the open source Redis project. Redis looks to be adding new features quickly and seemed to be a great &#8230; <a href="http://www.chrisstreeter.com/archive/2010/01/434/benchmarking-redis-and-predis">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>At work, I recently was tasked with looking into some <a href="http://en.wikipedia.org/wiki/NoSQL" target="_blank">NoSQL</a> solutions for upcoming projects. For various reasons, I focused on the <a title="Redis" href="http://code.google.com/p/redis/" target="_blank">open source Redis</a> project. Redis looks to be adding new features quickly and seemed to be a great potential solution.</p>
<p>I then started looking into PHP clients as our current environment is mostly PHP. We require that the client support <a href="http://en.wikipedia.org/wiki/Consistent_hashing" target="_blank">consistent hashing</a>, and, from a quick search, a couple turned up. <a title="PRedis" href="http://github.com/nrk/predis/" target="_blank">PRedis</a> seemed to offer the most potential, and after some quick tests, also seemed to offer the greatest performance. So I set up a more elaborate benchmark of the the client and server package.</p>
<p>My test setup involved using 5 servers with between 2 and 5 enabled at a time on the clients (ie. I disabled up to 3 of the servers in the client configurations). For performance, I configured the servers to never write to disk, though periodically syncing to disk should not cause too much of a performance loss. In fact performance was most greatly affected by forcing an fsync after every write. I then had 9 other client boxes running the same code base, with all 9 enabled for each test.</p>
<p>Each client would start a master PHP process that forked 20, 30 or 40 child processes to simulate greater and greater load. Each forked PHP process then did 10,000 SETs on random keys with 4 byte payloads (early tests showed that payload size didn&#8217;t drastically affect the results). I was using the <a href="http://github.com/nrk/predis/tree/php5.2_backport" target="_blank">PHP 4.2.6 branch of the PRedis client</a>, and had optimized it a bit so that it did fewer counts of the consistent hash array. I made the optimizations based on some results after profiling the code. I then had the master PHP process on each box repeat the test 5 times to help to average the test results.</p>
<p>I used dsh to start the test simultaneously on all the clients, timing how long it took the dsh process to start and finish executing. This was the amount of time it took to execute (5 repeats) * (9 client boxes) * (20, 30 or 40 client processes / box) * (10,000 requests) = X total requests. I then graphed the results below.</p>
<div id="attachment_441" class="wp-caption aligncenter" style="width: 483px"><a href="http://www.chrisstreeter.com/wp-content/uploads/2010/01/redis.png"><img class="size-full wp-image-441 " title="Graphing Requests / Second With Redis and PRedis" src="http://www.chrisstreeter.com/wp-content/uploads/2010/01/redis.png" alt="Graphing Requests / Second With Redis and PRedis" width="473" height="267" /></a><p class="wp-caption-text">Graphing Requests / Second With Redis and PRedis</p></div>
<p>This ended up showing that with 9 clients, going up to 4 servers was the point of diminishing returns. Adding the fifth server (with that client box count) did not increase throughput, but rather, the throughput went down. The reason for this is most likely a combination of network interface contention on each client and higher overhead from consistent hashing. So with 9 clients, I found that the sweet spot, with my setup, was 4 servers. By adding more clients, along with more servers, the throughput would increase, instead of the decrease I was starting to see.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.chrisstreeter.com/archive/2010/01/434/benchmarking-redis-and-predis/feed</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>GMail IMAP Backup With mbsync on Ubuntu</title>
		<link>http://www.chrisstreeter.com/archive/2009/04/305/gmail-imap-backup-with-mbsync-on-ubuntu</link>
		<comments>http://www.chrisstreeter.com/archive/2009/04/305/gmail-imap-backup-with-mbsync-on-ubuntu#comments</comments>
		<pubDate>Fri, 01 May 2009 07:56:06 +0000</pubDate>
		<dc:creator>streeter</dc:creator>
				<category><![CDATA[linux]]></category>
		<category><![CDATA[personal]]></category>
		<category><![CDATA[software]]></category>
		<category><![CDATA[technology]]></category>
		<category><![CDATA[ubuntu]]></category>
		<category><![CDATA[isync]]></category>
		<category><![CDATA[mbsync]]></category>

		<guid isPermaLink="false">http://www.chrisstreeter.com/?p=305</guid>
		<description><![CDATA[Well, it sure has been a while since my last post on here. So I thought I&#8217;d kick it off with a discussion of how I went about getting my email backed up. First, a description of my situation. I &#8230; <a href="http://www.chrisstreeter.com/archive/2009/04/305/gmail-imap-backup-with-mbsync-on-ubuntu">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Well, it sure has been a while since my last post on here. So I thought I&#8217;d kick it off with a discussion of how I went about getting my email backed up.</p>
<p>First, a description of my situation. I run all my email through GMail. I enjoy the interface and the fact that it is a cloud service; I can access my email seamlessly on my phone, my home computer, my work computer, some other computer, etc. However, I don&#8217;t want to lose all that information. Google is great, but who is to say that something terrible won&#8217;t happen and some (or all) of my mail is lost? So I wanted to setup some sort of backup. And then once I got that setup, make it automated.</p>
<p>At home, I run an <a href="http://www.ubuntu.com/">Ubuntu</a> box, that I just upgraded to 9.04, <a href="http://www.ubuntu.com/news/ubuntu-9.04-desktop">Jaunty Jackalope</a>. This machine primarily serves as a media box, hosting video that <a href="http://pytivo.armooo.net/">streams to my Tivo</a> off the 1.5TB RAID 5 array. I also use it as a <a href="http://www.kremalicious.com/2008/06/ubuntu-as-mac-file-server-and-time-machine-volume/">network mounted TimeMachine</a> box as well. Since I have extra storage on it, I figured I&#8217;d get something to sync my mail over IMAP periodically, and then I have a nice little backup.</p>
<p>After some searching, I came across <a href="http://el-tramo.be/blog/gmail-mbsync">two</a> <a href="http://blog.rectalogic.com/2007/11/automated-gmail-backup-via-imap.html">sites</a> that had instructions using the utility <a href="http://isync.sourceforge.net/mbsync.html">mbsync</a> (<a href="http://isync.sourceforge.net/">formerly isync</a>). I found that following the instructions worked pretty well, though I had to customize the patch provided to get it to work with the version provided by Ubuntu.  And then I thought I&#8217;d detail my steps here for others to see.<br />
<span id="more-305"></span></p>
<ol>
<li>First, enable IMAP in your GMail account.</li>
<li>Install the dependencies for mbsync:
<pre><code>sudo apt-get install libc6 libdb4.8 libdb-dev libdb4.8-dev libssl0.9.8 libssl-dev</code></pre>
</li>
<li>Get the source for mbsync on Ubuntu with:
<pre><code>sudo apt-get source isync</code></pre>
<p>This will download the source for mbsync and create a directory (in your current directory) named isync-1.0.4 (Yes, I know it is called isync. That is a legacy name).</li>
<li>Now the normal mbsync install works just fine. However, it doesn&#8217;t support recursive directories. I use GMail labels setup to provide a hierarchy using forward slashes. It turns out that the fix to get mbsync to support directories like this is really easy to do and someone went through the trouble to get it to work. However, it doesn&#8217;t quite work on the version of the code packaged with Ubuntu. So I had to modify the patch a bit. The patch I created can be found <a href="http://www.chrisstreeter.com/wp-content/uploads/2009/04/recursive_imap_ubuntu.patch">here</a>.  Download it and put it somewhere on your system. To apply the patch, change directories into the isync-1.0.4 directory that was just downloaded and run:
<pre><code>patch -p1 &lt; /path/to/patch/file/recursive_imap_ubuntu.patch</code></pre>
<p>Once you&#8217;ve patched the directory, configure (<code>./configure</code>), build (<code>make</code>) and install (<code>sudo make install</code>).</li>
<li>Now you should have an executable <code>mbsync</code> in your path. So it is time to start preparing to do the initial sync. Choose a place to store your backups. I chose
<pre><code>/export/backups/mail/</code></pre>
</li>
<li>We want to connect to Google securely which means you&#8217;ll need the latest SSL certificates. To get those, use the openssl client on your machine. Run:
<pre><code>openssl s_client -connect imap.gmail.com:993 -showcerts</code></pre>
<p>which should show two blocks of</p>
<pre><code>-----BEGIN CERTIFICATE-----
...
-----END CERTIFICATE-----</code></pre>
<p>in the output. You&#8217;ll want to take each block (including the BEGIN/END CERTIFICATE lines), and put each of them into their own file. I put the first one in a file <code>gmail.crt</code> and the second one in the file <code>google.crt</code> (since the first signs imap.gmail.com which is signed by Google Internet Authority, the second certificate).</li>
<li>The second certificate, the one for the Google Internet Authority, is signed by Equifax. So we&#8217;ll need Equifax&#8217;s certificate also. An as it turns out, Ubuntu has a copy of Equifax&#8217;s certificate already sitting in the repositories. Just run
<pre><code>sudo apt-get install ca-certificates</code></pre>
<p>to get the latest CA certificates. After installing the CAs, Equifax&#8217;s CA sits at <code>/usr/share/ca-certificates/mozilla/Equifax_Secure_CA.crt</code>, which we&#8217;ll need in the configuration file in the next step.</li>
<li>Now we can write the configuration file we are going to use. Here is a copy of mine:
<pre><code>IMAPAccount gmail
Host imap.gmail.com
User <em>yourusername@gmail.com</em>
UseIMAPS yes
CertificateFile /export/backups/mail/gmail.crt
CertificateFile /export/backups/mail/google.crt
CertificateFile /usr/share/ca-certificates/mozilla/Equifax_Secure_CA.crt&nbsp;

IMAPStore gmail-remote
Account gmail

MaildirStore gmail-local
Path /export/backups/mail/gmail/
Inbox /export/backups/mail/gmail/Inbox

</code></pre>
<pre><code>Channel gmail
Master :gmail-remote:
Slave :gmail-local:
# Exclude everything under the internal [Gmail] folder, except the interesting folders
Patterns * ![Gmail]* "[Gmail]/Sent Mail" "[Gmail]/Starred" "[Gmail]/All Mail"
Create Slave
Sync Pull
SyncState *</code></pre>
<p>Check out the Patterns line. That is where you would include or exclude various labels. All lables are stored at the root of the hierarchy, with the special directory [Gmail] having things like &#8216;Sent Mail&#8217;, &#8216;Spam&#8217;, &#8216;Starred&#8217;, etc in it. I wanted to exclude all the items in the [Gmail] directory except for the ones listed. The &#8216;*&#8217; at the beginning includes all other labels. You will also want to change the Path and Inbox lines to point to your mail location, as well as the first two CertificateFile lines. Also, be sure to enter your actual GMail login on the User line. Now save this file somewhere. Note: saving it as ~/.mbsyncrc will cause it to be automatically loaded when mbsync is run, meaning you don&#8217;t need to specify which config file with the -c option.</li>
<li>Now go ahead and test it out by listing the labels in your account with the command <code>mbsync -l -c /path/to/the/configfile.rc gmail</code>. Running it will look like this and ask you for your password:
<pre><code>[streeter@scout]:~$ mbsync -l -c ~/.mbsyncrc gmail
Reading configuration file /home/streeter/.mbsyncrc
Resolving imap.gmail.com... ok
Connecting to 209.85.199.109:993... ok
Connection is now encrypted
Logging in...
Password (<em>yourusername@gmail.com</em>@imap.gmail.com):
Channel gmail
lists/code
bills
archive/cron
archive/classes
archive/work
[Gmail]/Starred
[Gmail]/Sent Mail
[Gmail]/All Mail
INBOX
@followup
[streeter@scout]:~$</code></pre>
<p>If you see something like this, then it worked! Now just go ahead and start your first mail download with <code>mbsync -c /path/to/the/configfile.rc gmail</code> And then you get to wait while it finishes which can take a while depending on how much mail you have.</li>
</ol>
<p>You can go an extra step and save your password in the file. If you add the line <code>Pass <em>yourpasswordhere</em></code> right after the User line, you won&#8217;t be asked for your password and can then setup a cronjob to automatically keep mail locally on a schedule. However, your password for your Google Account then is stored in cleartext on your machine. So only do this is you absolutely know what you are doing and who can access the machine.</p>
<p>Hopefully this becomes useful for people.</p>
<p><strong>Update 4/18/2011:</strong></p>
<p>I just updated the directions slightly for Ubuntu 10.10 Maverick Meerkat. For Maverick, I had to also install <code>libssl-dev</code> to get it to work with recursive directories.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.chrisstreeter.com/archive/2009/04/305/gmail-imap-backup-with-mbsync-on-ubuntu/feed</wfw:commentRss>
		<slash:comments>21</slash:comments>
		</item>
	</channel>
</rss>

