<?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/"
	xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
	>

<channel>
	<title>Musings of a CS Undergrad</title>
	<atom:link href="http://zwass.wordpress.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://zwass.wordpress.com</link>
	<description>The Thoughts of Zachary Wasserman</description>
	<lastBuildDate>Tue, 07 Feb 2012 04:25:16 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
<cloud domain='zwass.wordpress.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://s2.wp.com/i/buttonw-com.png</url>
		<title>Musings of a CS Undergrad</title>
		<link>http://zwass.wordpress.com</link>
	</image>
	<atom:link rel="search" type="application/opensearchdescription+xml" href="http://zwass.wordpress.com/osd.xml" title="Musings of a CS Undergrad" />
	<atom:link rel='hub' href='http://zwass.wordpress.com/?pushpress=hub'/>
		<item>
		<title>Emacs Send to Email Command</title>
		<link>http://zwass.wordpress.com/2012/02/06/emacs-send-to-email-command/</link>
		<comments>http://zwass.wordpress.com/2012/02/06/emacs-send-to-email-command/#comments</comments>
		<pubDate>Tue, 07 Feb 2012 04:14:03 +0000</pubDate>
		<dc:creator>Zachary Wasserman</dc:creator>
				<category><![CDATA[Emacs]]></category>
		<category><![CDATA[emacs]]></category>

		<guid isPermaLink="false">http://zwass.wordpress.com/?p=86</guid>
		<description><![CDATA[I&#8217;ve been using Emacs for nearly all my editing for a couple years now, and I&#8217;m getting more hungry for highly personalized customizations. I often need to email files I&#8217;m working on, so I wrote up this little command (Throw &#8230; <a href="http://zwass.wordpress.com/2012/02/06/emacs-send-to-email-command/">Continue reading <span class="meta-nav">&#8594;</span></a><img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=zwass.wordpress.com&amp;blog=21270059&amp;post=86&amp;subd=zwass&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve been using Emacs for nearly all my editing for a couple years now, and I&#8217;m getting more hungry for highly personalized customizations. I often need to email files I&#8217;m working on, so I wrote up this little command (Throw it in your <code>.emacs</code>):</p>
<pre>(defun mail-current-buffer ()
  "Send the current buffer to email (for Mac)"
  (interactive)
  (shell-command (format "open -a Sparrow %s" (buffer-file-name))))
(define-key global-map "\C-cm" 'mail-current-buffer)</pre>
<p>This opens a new message with the file in the current buffer attached. If you use another mail app, replace Sparrow with its name. The last line binds the function to <code>C-c C-m</code>. Really, this will open the current buffer in any application you choose to put in that command besides Sparrow, so perhaps you have some other handy ideas?</p>
<p>I guess the next step is just doing my email <em>in </em>Emacs.</p>
<br />Filed under: <a href='http://zwass.wordpress.com/category/emacs/'>Emacs</a>  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/zwass.wordpress.com/86/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/zwass.wordpress.com/86/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/zwass.wordpress.com/86/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/zwass.wordpress.com/86/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/zwass.wordpress.com/86/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/zwass.wordpress.com/86/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/zwass.wordpress.com/86/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/zwass.wordpress.com/86/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/zwass.wordpress.com/86/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/zwass.wordpress.com/86/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/zwass.wordpress.com/86/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/zwass.wordpress.com/86/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/zwass.wordpress.com/86/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/zwass.wordpress.com/86/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=zwass.wordpress.com&amp;blog=21270059&amp;post=86&amp;subd=zwass&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://zwass.wordpress.com/2012/02/06/emacs-send-to-email-command/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/33800dc7f40b28f182ad2b085de5daa9?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">zacharywasserman</media:title>
		</media:content>
	</item>
		<item>
		<title>BlogTuner: Download + Add + Tag MP3s</title>
		<link>http://zwass.wordpress.com/2011/08/22/blogtuner-download-add-tag-mp3s/</link>
		<comments>http://zwass.wordpress.com/2011/08/22/blogtuner-download-add-tag-mp3s/#comments</comments>
		<pubDate>Mon, 22 Aug 2011 20:05:02 +0000</pubDate>
		<dc:creator>Zachary Wasserman</dc:creator>
				<category><![CDATA[Music]]></category>
		<category><![CDATA[Software]]></category>

		<guid isPermaLink="false">http://zwass.wordpress.com/?p=75</guid>
		<description><![CDATA[Discovering music through blogs is one of my favorite internet pastimes. I&#8217;ve built a tool for Mac OSX that makes it easier to bring music from blogs into your iTunes library. BlogTuner is a super quick and easy way to add &#8230; <a href="http://zwass.wordpress.com/2011/08/22/blogtuner-download-add-tag-mp3s/">Continue reading <span class="meta-nav">&#8594;</span></a><img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=zwass.wordpress.com&amp;blog=21270059&amp;post=75&amp;subd=zwass&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Discovering music through blogs is one of my favorite internet pastimes. I&#8217;ve built a tool for Mac OSX that makes it easier to bring music from blogs into your iTunes library.</p>
<p><a title="Download BlogTuner" href="http://bit.ly/blogtuner" target="_blank">BlogTuner</a> is a super quick and easy way to add songs found online to iTunes, as well as to keep track of where those songs came from. Suggested workflow is as follows:</p>
<p>0. Install by double clicking the .zip file to unzip. Drag the application to your &#8220;Applications&#8221; folder, and then to your Dock so that the icon is easily accessible.</p>
<p>1. Go out, browse for music, and find a song you love.</p>
<p>2. Click and drag the link to that song into the BlogTuner icon in your Dock:<br />
<img class="alignnone size-full wp-image-76" title="BlogTuner Click and Drag" src="http://zwass.files.wordpress.com/2011/08/ds.jpg?w=640" alt="Click and Drag the Link"   /><br />
(Example from <a title="The Music Ninja" href="http://themusicninja.com" target="_blank">The Music Ninja</a>)<br />
<img class="alignnone size-full wp-image-77" title="BlogTuner Drop" src="http://zwass.files.wordpress.com/2011/08/ab.jpg?w=640" alt="Drop on the BlogTuner Icon"   /></p>
<p>3. The song is automatically downloaded, added to iTunes, and the site you retrieved it from is added to the &#8220;Comments&#8221; metadata. A <a href="http://growl.info/" target="_blank">Growl</a> notification pops up when the import is complete.</p>
<p>4. If you&#8217;d like, you can use the metadata to create Smart Playlists for any blog. This is how the setup would look for The Music Ninja:<br />
<a href="http://zwass.files.wordpress.com/2011/08/screen-shot-2011-08-22-at-aug-22-1-56-17-am.png"><img class="alignnone size-full wp-image-79" title="BlogTuner Smart Playlist Setup" src="http://zwass.files.wordpress.com/2011/08/screen-shot-2011-08-22-at-aug-22-1-56-17-am.png?w=640&#038;h=195" alt="BlogTuner Smart Playlist Setup" width="640" height="195" /></a></p>
<p><a title="Download BlogTuner" href="http://bit.ly/blogtuner" target="_blank">Click here</a> to download BlogTuner from my Dropbox.</p>
<p>(Need I say it? This software runs well to the best of my knowledge but I offer absolutely NO warranty.)</p>
<p>Is this useful? Have you found any bugs? Would you be willing to make a Dock icon for BlogTuner? Drop me a line in the comments below.</p>
<br />Filed under: <a href='http://zwass.wordpress.com/category/music-2/'>Music</a>, <a href='http://zwass.wordpress.com/category/software/'>Software</a>  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/zwass.wordpress.com/75/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/zwass.wordpress.com/75/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/zwass.wordpress.com/75/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/zwass.wordpress.com/75/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/zwass.wordpress.com/75/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/zwass.wordpress.com/75/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/zwass.wordpress.com/75/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/zwass.wordpress.com/75/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/zwass.wordpress.com/75/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/zwass.wordpress.com/75/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/zwass.wordpress.com/75/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/zwass.wordpress.com/75/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/zwass.wordpress.com/75/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/zwass.wordpress.com/75/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=zwass.wordpress.com&amp;blog=21270059&amp;post=75&amp;subd=zwass&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://zwass.wordpress.com/2011/08/22/blogtuner-download-add-tag-mp3s/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/33800dc7f40b28f182ad2b085de5daa9?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">zacharywasserman</media:title>
		</media:content>

		<media:content url="http://zwass.files.wordpress.com/2011/08/ds.jpg" medium="image">
			<media:title type="html">BlogTuner Click and Drag</media:title>
		</media:content>

		<media:content url="http://zwass.files.wordpress.com/2011/08/ab.jpg" medium="image">
			<media:title type="html">BlogTuner Drop</media:title>
		</media:content>

		<media:content url="http://zwass.files.wordpress.com/2011/08/screen-shot-2011-08-22-at-aug-22-1-56-17-am.png" medium="image">
			<media:title type="html">BlogTuner Smart Playlist Setup</media:title>
		</media:content>
	</item>
		<item>
		<title>Installing Emacs MMM-Mako Mode</title>
		<link>http://zwass.wordpress.com/2011/07/01/installing-emacs-mmm-mako-mode/</link>
		<comments>http://zwass.wordpress.com/2011/07/01/installing-emacs-mmm-mako-mode/#comments</comments>
		<pubDate>Fri, 01 Jul 2011 04:00:40 +0000</pubDate>
		<dc:creator>Zachary Wasserman</dc:creator>
				<category><![CDATA[Emacs]]></category>
		<category><![CDATA[emacs]]></category>
		<category><![CDATA[mako]]></category>
		<category><![CDATA[mmm]]></category>
		<category><![CDATA[mmm-mako]]></category>

		<guid isPermaLink="false">http://zwass.wordpress.com/?p=71</guid>
		<description><![CDATA[For my job at Hulu this summer, I&#8217;ve been developing a RESTful web service and web based frontend using CherryPy and Mako Templates. Since Mako uses a mix of its own syntax, HTML and Python, syntax highlighting won&#8217;t work out &#8230; <a href="http://zwass.wordpress.com/2011/07/01/installing-emacs-mmm-mako-mode/">Continue reading <span class="meta-nav">&#8594;</span></a><img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=zwass.wordpress.com&amp;blog=21270059&amp;post=71&amp;subd=zwass&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>For my job at Hulu this summer, I&#8217;ve been developing a RESTful web service and web based frontend using <a href="http://www.cherrypy.org/">CherryPy</a> and <a href="www.makotemplates.org/">Mako Templates</a>. Since Mako uses a mix of its own syntax, HTML and Python, syntax highlighting won&#8217;t work out of the box in Emacs. Enter <a href="http://mmm-mode.sourceforge.net/">MMM (Multiple Major Mode) Mode</a>, which allows for multiple Emacs major modes within one buffer, and <a href="https://bitbucket.org/pjenvey/mmm-mako/overview">MMM-Mako Mode</a> which provides support for Mako files using MMM. Getting these set up was somewhat problematic, so I&#8217;m going to document the process for anyone else trying to get these working.</p>
<p>(I assume python-mode is already working)</p>
<ol>
<li>Download and untar MMM Mode from <a href="http://sourceforge.net/projects/mmm-mode/files/">http://sourceforge.net/projects/mmm-mode/files/</a>. I&#8217;m using version 0.4.8.</li>
<li>Make and install MMM Mode. You need to specify where your Emacs is installed. I use <a href="http://emacsformacosx.com/">Gnu Emacs 23</a>, which I have installed in the <code>/Applications</code> directory.
<pre>EMACS='/Applications/Emacs.app/Contents/MacOS/Emacs'
./configure
make
sudo make install</pre>
<p>The elisp files were installed to <code>/usr/local/share/emacs/site-lisp</code> in my case. You may need to add this directory to the Emacs load path. You will also need to tell Emacs to load the module. I added this to my .emacs:</p>
<pre>(add-to-list 'load-path "/usr/local/share/emacs/site-lisp")
(require 'mmm-auto)
(setq mmm-global-mode 'maybe)</pre>
<p>Make sure it installed correctly by opening up Emacs and typing <code>M-x mmm-mode</code> to turn on MMM-Mode.</li>
<li>Now you&#8217;ll want to download MMM-Mako from <a href="https://bitbucket.org/pjenvey/mmm-mako/downloads">https://bitbucket.org/pjenvey/mmm-mako/downloads</a>. Follow instructions as in the README, pointing Emacs to the <code>mmm-mako.el</code> file. I added to my <code>.emacs</code>:
<pre>(add-to-list 'auto-mode-alist '("\\.mako\\'" . html-mode))
(mmm-add-mode-ext-class 'html-mode "\\.mako\\'" 'mako)</pre>
</li>
<li>At this point, everything is configured for MMM-Mako, and opening a <code>.mako</code>file should enable MMM-Mode. If you open a file with both Python and HTML, however, you will probably see an error:
<pre>mmm-format-string: Wrong type argument: stringp, (sgml-xml-mode "XHTML" "HTML")</pre>
<p>A <a href="http://sourceforge.net/tracker/index.php?func=detail&amp;aid=2901780&amp;group_id=8658&amp;atid=108658">bug report</a> explains why this is happening in Emacs 23 and offers a fix. Find the <code>mmm-utils.el</code> file from your MMM-Mode installation and apply the <a href="http://sourceforge.net/tracker/download.php?group_id=8658&amp;atid=108658&amp;file_id=351974&amp;aid=2901780">patch</a> from the bug report, or edit it by hand.</p>
<pre>sudo patch /usr/local/share/emacs/site-lisp/mmm-utils.el fix_mmm-format-string.diff</pre>
<p>You&#8217;ll want to byte-compile the modified file, so open up Emacs again and type <code>M-x byte-compile-file</code> and provide it with the location of your <code>mmm-utils.el</code> file. You may need to do this with root privileges depending on where you installed the MMM-Mode files.</li>
</ol>
<p>At this point you should have a fully functioning MMM-Mako Mode.</p>
<p>All the additions to my <code>.emacs</code> file:</p>
<pre>(add-to-list 'load-path "/usr/local/share/emacs/site-lisp")
(require 'mmm-auto)
(setq mmm-global-mode 'maybe)
(load "src/mmm-mako.el")
(add-to-list 'auto-mode-alist '("\\.mako\\'" . html-mode))
(mmm-add-mode-ext-class 'html-mode "\\.mako\\'" 'mako)</pre>
<br />Filed under: <a href='http://zwass.wordpress.com/category/emacs/'>Emacs</a>  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/zwass.wordpress.com/71/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/zwass.wordpress.com/71/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/zwass.wordpress.com/71/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/zwass.wordpress.com/71/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/zwass.wordpress.com/71/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/zwass.wordpress.com/71/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/zwass.wordpress.com/71/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/zwass.wordpress.com/71/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/zwass.wordpress.com/71/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/zwass.wordpress.com/71/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/zwass.wordpress.com/71/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/zwass.wordpress.com/71/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/zwass.wordpress.com/71/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/zwass.wordpress.com/71/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=zwass.wordpress.com&amp;blog=21270059&amp;post=71&amp;subd=zwass&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://zwass.wordpress.com/2011/07/01/installing-emacs-mmm-mako-mode/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/33800dc7f40b28f182ad2b085de5daa9?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">zacharywasserman</media:title>
		</media:content>
	</item>
		<item>
		<title>Why Turntable.fm Rocks the Decks</title>
		<link>http://zwass.wordpress.com/2011/06/27/why-turntable-fm-rocks-the-decks/</link>
		<comments>http://zwass.wordpress.com/2011/06/27/why-turntable-fm-rocks-the-decks/#comments</comments>
		<pubDate>Mon, 27 Jun 2011 04:30:24 +0000</pubDate>
		<dc:creator>Zachary Wasserman</dc:creator>
				<category><![CDATA[Music]]></category>
		<category><![CDATA[Startups]]></category>
		<category><![CDATA[music]]></category>
		<category><![CDATA[startups]]></category>
		<category><![CDATA[turntable.fm]]></category>

		<guid isPermaLink="false">http://zwass.wordpress.com/?p=65</guid>
		<description><![CDATA[The 21st century&#8217;s response to the mixtape, Turntable.fm brings music to our virtual social lives. Didn&#8217;t Myspace already do this? Well, no. At least not nearly as well as Turntable is poised to. So what&#8217;s so great about Turntable? In &#8230; <a href="http://zwass.wordpress.com/2011/06/27/why-turntable-fm-rocks-the-decks/">Continue reading <span class="meta-nav">&#8594;</span></a><img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=zwass.wordpress.com&amp;blog=21270059&amp;post=65&amp;subd=zwass&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>The 21st century&#8217;s response to the mixtape, Turntable.fm brings music to our virtual social lives. Didn&#8217;t Myspace already do this? Well, no. At least not nearly as well as Turntable is poised to.</p>
<p>So what&#8217;s so great about Turntable? In an age in which our social proof is displayed in a virtual world, Turntable.fm provides a truly social outlet for sharing musical interests. Though not required, most users actively engage in the scene of the (usually themed) &#8220;room&#8221; they are in. Hate the song that&#8217;s playing? Hit the &#8220;Lame&#8221; button and if others agree with you, the song will be skipped. Love it? &#8220;Awesome&#8221; will set your avatar&#8217;s head bobbing and give points to the DJ.</p>
<p>I had a blast just bouncing around the rooms meeting new people, but the true value of Turntable.fm will be leveraged in our existing social connections. This is currently implemented by requiring that one of your Facebook friends is using Turntable before you can make an account. Though surely helpful in avoiding the problems of scale that plague pivoting startups, this requirement encourages an organic growth in user base. When you bring up the room list, friends&#8217; Facebook profile photos show up indicating their presence. &#8220;Fan&#8221; them and Turntable will email you whenever they step up to DJ. What better way to judge someone&#8217;s musical tastes than to see what they play to the public, and how it&#8217;s received? A recent night showed a &#8220;Google NYC&#8221; room ostensibly filled with Googlers DJing for each other in the office.</p>
<p>Turntable.fm would do well to exploit the social and game mechanics they have integrated to increase the quality of the musical programming. Currently the only benefit of points seems to be new avatars, but I could see the point system extending throughout the experience. Imagine when high scoring DJs score spots in busier rooms and those who receive bad scores are kicked out of the DJ booth. The current system provides little consistency as an empty seat goes to the quickest clicker.</p>
<p>There is a distinct lack of diversity in the musical tastes on offer. Of the current top 15 rooms by population, one third are &#8220;indie&#8221; themed and another third focus on electronic music. Some songs (RJD2&#8242;s excellent Ghostwriter, for instance) play over and over. The musical diversity will surely increase as Turntable&#8217;s population does, but it will be essential that the company helps expose that diversity through the interface. As the number of rooms explodes, Turntable&#8217;s developers must deliver an effective interface for browsing the choices. With only 30 rooms holding 10 people or more about a month after launch, finding a good place to hang out is easy. How will we navigate when this number is in the thousands?</p>
<p>I expect Turntable to be one of the most successful startups of 2011. Find me there DJing as PastaMasta.</p>
<br />Filed under: <a href='http://zwass.wordpress.com/category/music-2/'>Music</a>, <a href='http://zwass.wordpress.com/category/startups/'>Startups</a>  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/zwass.wordpress.com/65/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/zwass.wordpress.com/65/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/zwass.wordpress.com/65/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/zwass.wordpress.com/65/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/zwass.wordpress.com/65/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/zwass.wordpress.com/65/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/zwass.wordpress.com/65/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/zwass.wordpress.com/65/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/zwass.wordpress.com/65/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/zwass.wordpress.com/65/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/zwass.wordpress.com/65/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/zwass.wordpress.com/65/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/zwass.wordpress.com/65/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/zwass.wordpress.com/65/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=zwass.wordpress.com&amp;blog=21270059&amp;post=65&amp;subd=zwass&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://zwass.wordpress.com/2011/06/27/why-turntable-fm-rocks-the-decks/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/33800dc7f40b28f182ad2b085de5daa9?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">zacharywasserman</media:title>
		</media:content>
	</item>
		<item>
		<title>Exploring Caches and Spatial Locality with C</title>
		<link>http://zwass.wordpress.com/2011/04/28/exploring-caches-and-spatial-locality-with-c/</link>
		<comments>http://zwass.wordpress.com/2011/04/28/exploring-caches-and-spatial-locality-with-c/#comments</comments>
		<pubDate>Thu, 28 Apr 2011 16:43:47 +0000</pubDate>
		<dc:creator>Zachary Wasserman</dc:creator>
				<category><![CDATA[C Programming]]></category>
		<category><![CDATA[Hardware]]></category>

		<guid isPermaLink="false">http://zwass.wordpress.com/?p=56</guid>
		<description><![CDATA[Could a simple change in the layout of a data structure in memory result in a 20% reduction in performance? Recently in my Digital Systems Organization and Design class, we have been discussing data caches in modern processors. As a &#8230; <a href="http://zwass.wordpress.com/2011/04/28/exploring-caches-and-spatial-locality-with-c/">Continue reading <span class="meta-nav">&#8594;</span></a><img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=zwass.wordpress.com&amp;blog=21270059&amp;post=56&amp;subd=zwass&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Could a simple change in the layout of a data structure in memory result in a 20% reduction in performance? Recently in my Digital Systems Organization and Design class, we have been discussing data caches in modern processors. As a toy example of the ability to explicitly prefetch data into the cache, Professor <a href="http://www.cis.upenn.edu/~milom/">Milo Martin</a> presented this C code which performs a depth-first traversal of a binary tree, adding the values at every node:<br />
(Full source available at <a href="https://gist.github.com/946002">https://gist.github.com/946002</a> &#8212; Fork it! Modify it! Let me know!)</p>
<pre>int tree_add(treenode* t){
  if(t == NULL) return 0;
  __builtin_prefetch(t-&gt;left);
  __builtin_prefetch(t-&gt;right);
  return t-&gt;value + tree_add(t-&gt;right) + tree_add(t-&gt;left);
}</pre>
<p>Needing an exercise in C, and curious about the effects of explicit prefetching, I decided to test this out. First I generated a tree in a depth-first fashion to try the algorithm on:</p>
<pre>treenode* buildtree(int height){
  if(h &lt; 0) return NULL;
  treenode* t = malloc(sizeof(treenode));
  if(t == NULL){
    printf("Could not allocate memory");
    exit(1);
  }
  t-&gt;value = rand() % 10;
  --height;
  t-&gt;right = buildtree(height);
  t-&gt;left = buildtree(height);
  return t;
}</pre>
<p>When I tested 10,000 runs of the <code>tree_add</code> algorithm on a tree of height 20 (2,097,151 nodes) with and without the explicit <code>__builtin_prefetch</code> function, I found nearly zero difference (372.257728 seconds without prefetching vs. 372.901536 seconds with prefetching). Professor Martin suggested this might be an artifact of the fact that I was generating the tree in depth-first fashion. So I generated a breadth-first tree:</p>
<pre>treenode* newnode(){
  treenode* t = malloc(sizeof(treenode));
  if(t == NULL){
    printf("Could not allocate memory");
    exit(1);
  }
  t-&gt;value = rand() % 10;
  t-&gt;left = NULL;
  t-&gt;right = NULL;
  return t;
}

treenode* buildtreeBFS(int height){
  if(height &lt; 0) return NULL;
   treenode* t = newnode();
   list* l = malloc(sizeof(list));
   if(l == NULL){
     printf("Could not allocate memory");
     exit(1);
   }
   addfront(l, t);
   int nodes = pow(2, height+1) - 2;
   printf("%d\n", nodes);
   while(nodes &gt; 0){
    treenode* node = removeback(l);
    node-&gt;left = newnode();
    node-&gt;right = newnode();
    addfront(l, node-&gt;left);
    addfront(l, node-&gt;right);
    nodes -= 2;
  }

  while(removeback(l) != NULL); //clear out the list
  free(l);

  return t;
}</pre>
<p>This is where things get surprising. Running the inorder traversal on the breadth-first generated tree takes significantly longer than on the depth-first tree! Again, the explicit prefetching seems to have little effect (446.019808 seconds without prefetching vs. 447.025984 seconds with prefetching). We take 20% longer to perform the <code>tree_add</code> function on the breadth-first tree than we did with the depth-first tree. Though these are functionally the same data structure, I hypothesize that their layout in memory, along with the effects of <a href="http://en.wikipedia.org/wiki/Locality_of_reference">spatial locality</a> on caching data, accounts for the performance difference.</p>
<p>Since modern computers use cache blocks that can hold many of our <code>treenode</code> structs, if we are accessing nodes that are lined up sequentially in memory, we will have far fewer cache misses as we traverse the tree. When we generated the tree in the same depth-first order as we later traversed it in, we exploited this locality by accessing sequentially allocated heap locations. Using the breadth-first tree, we jumped around through addresses in the heap, likely incurring a much higher cost for memory accesses.</p>
<p>I find it fascinating that in a realistic scenario we see such a large performance difference using data structures with so many apparent similarities. It really proves the usefulness of hardware classes even for someone who never intends to design computer hardware. Thank you Professor Martin!</p>
<br />Filed under: <a href='http://zwass.wordpress.com/category/c-programming/'>C Programming</a>, <a href='http://zwass.wordpress.com/category/hardware/'>Hardware</a>  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/zwass.wordpress.com/56/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/zwass.wordpress.com/56/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/zwass.wordpress.com/56/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/zwass.wordpress.com/56/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/zwass.wordpress.com/56/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/zwass.wordpress.com/56/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/zwass.wordpress.com/56/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/zwass.wordpress.com/56/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/zwass.wordpress.com/56/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/zwass.wordpress.com/56/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/zwass.wordpress.com/56/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/zwass.wordpress.com/56/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/zwass.wordpress.com/56/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/zwass.wordpress.com/56/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=zwass.wordpress.com&amp;blog=21270059&amp;post=56&amp;subd=zwass&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://zwass.wordpress.com/2011/04/28/exploring-caches-and-spatial-locality-with-c/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/33800dc7f40b28f182ad2b085de5daa9?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">zacharywasserman</media:title>
		</media:content>
	</item>
		<item>
		<title>iPhone Tracking: Who Cares? You Should.</title>
		<link>http://zwass.wordpress.com/2011/04/22/iphone-tracking-who-cares-you-should/</link>
		<comments>http://zwass.wordpress.com/2011/04/22/iphone-tracking-who-cares-you-should/#comments</comments>
		<pubDate>Fri, 22 Apr 2011 20:02:39 +0000</pubDate>
		<dc:creator>Zachary Wasserman</dc:creator>
				<category><![CDATA[iPhone]]></category>
		<category><![CDATA[Privacy]]></category>

		<guid isPermaLink="false">http://zwass.wordpress.com/?p=49</guid>
		<description><![CDATA[The tech community has sounded the alarm in the last couple days that our iPhones have been storing years worth of information on our whereabouts, down to an alarming level of detail. Surely this has been known by some for &#8230; <a href="http://zwass.wordpress.com/2011/04/22/iphone-tracking-who-cares-you-should/">Continue reading <span class="meta-nav">&#8594;</span></a><img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=zwass.wordpress.com&amp;blog=21270059&amp;post=49&amp;subd=zwass&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>The tech community has sounded the alarm in the last couple days that our iPhones have been storing years worth of information on our whereabouts, down to an alarming level of detail. Surely this has been known by some for quite a while, but a <a href="http://petewarden.github.com/iPhoneTracker/">beautifully presented application</a> by Alasdair Allen and Pete Warden brought the issue to the public in the last week (A hacker friend of mine suggested that this and other non-technical presentations of known exploits &#8212; see <a href="http://codebutler.com/firesheep">Firesheep</a> &#8212; only appear once the exploits are no longer economically viable).</p>
<p>I downloaded the application to try it out, and sure enough, without even touching my Unix shell, I had a precise mapping of my whereabouts over the last year. Certainly it isn&#8217;t a huge shock that in the 21st century our locations are being tracked, but we shouldn&#8217;t take these revelations too lightly. David Pogue, a New York Times blogger, <a href="http://pogue.blogs.nytimes.com/2011/04/21/your-iphone-is-tracking-you-so-what/">ridicules</a> those who suggest that we should be concerned by this news. But I think Mr. Pogue is missing some of the broader implications of the release.</p>
<p>Cell phone privacy has become a major issue in 21st century privacy law. We are far from having clear definitions of how information stored on our phones can and cannot be used by the government. <a href="http://articles.sfgate.com/2011-01-04/bay-area/26357969_1_cell-phones-searches-police-department">Just this year</a>, the California Supreme Court ruled warrantless searches of cell phones to be legal. This is where things get scary. In their <a href="http://www.courtinfo.ca.gov/opinions/documents/S166600.PDF">decision</a>, the court grants &#8220;carte blanche&#8221; for an officer to look through <em>any</em> data in a cell phone confiscated during an arrest, according to the dissenting opinion of Justice Kathryn Werdegar. We now know that this data can hold years worth of information about our whereabouts. If that is not a unreasonable search, I don&#8217;t know what is.</p>
<p>Given these circumstances, the public must be as informed as possible as to the information we may be carrying, and how it can be used against us. To opponents of privacy like Mr. Pogue I ask: Why shouldn&#8217;t we hold our devices to higher standards? I hope our courts can recognize the increasing importance of cell phone privacy, and support those rights as the Ohio Supreme Court did <a href="http://www.nytimes.com/2009/12/26/opinion/26sat2.html?_r=2&amp;adxnnl=1&amp;adxnnlx=1261810873-sVGmBHkWduJvGowqvAkrFA">in 2009</a>. Beyond that, Apple, RIM, Google: You owe us all an explanation as to why our devices store our location data indefinitely.</p>
<br />Filed under: <a href='http://zwass.wordpress.com/category/iphone/'>iPhone</a>, <a href='http://zwass.wordpress.com/category/privacy/'>Privacy</a>  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/zwass.wordpress.com/49/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/zwass.wordpress.com/49/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/zwass.wordpress.com/49/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/zwass.wordpress.com/49/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/zwass.wordpress.com/49/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/zwass.wordpress.com/49/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/zwass.wordpress.com/49/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/zwass.wordpress.com/49/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/zwass.wordpress.com/49/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/zwass.wordpress.com/49/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/zwass.wordpress.com/49/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/zwass.wordpress.com/49/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/zwass.wordpress.com/49/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/zwass.wordpress.com/49/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=zwass.wordpress.com&amp;blog=21270059&amp;post=49&amp;subd=zwass&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://zwass.wordpress.com/2011/04/22/iphone-tracking-who-cares-you-should/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/33800dc7f40b28f182ad2b085de5daa9?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">zacharywasserman</media:title>
		</media:content>
	</item>
		<item>
		<title>The Go Command</title>
		<link>http://zwass.wordpress.com/2011/03/16/the-go-command/</link>
		<comments>http://zwass.wordpress.com/2011/03/16/the-go-command/#comments</comments>
		<pubDate>Wed, 16 Mar 2011 05:01:17 +0000</pubDate>
		<dc:creator>Zachary Wasserman</dc:creator>
				<category><![CDATA[Shell Scripting]]></category>

		<guid isPermaLink="false">http://zwass.wordpress.com/?p=36</guid>
		<description><![CDATA[Alexey Komissarouk requested a modification to the cl command that opens the argument in the default text editor if it&#8217;s a file. The go command will open the file in the editor defined by the EDITOR environment variable. Place this &#8230; <a href="http://zwass.wordpress.com/2011/03/16/the-go-command/">Continue reading <span class="meta-nav">&#8594;</span></a><img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=zwass.wordpress.com&amp;blog=21270059&amp;post=36&amp;subd=zwass&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p><a href="http://alexeymk.com/" target="_blank">Alexey Komissarouk</a> requested a modification to the <code>cl</code> command that opens the argument in the default text editor if it&#8217;s a file. The <code>go</code> command will open the file in the editor defined by the <code>EDITOR</code> environment variable.<br />
Place this in your <code>.bashrc</code>, <code>.bash_profile</code> or analogous file:</p>
<pre>go()
{
if [ -f "$1" ]
then
    $EDITOR "$1"
else
    cd "$1" &amp;&amp; ls
fi
}</pre>
<p>If you have not defined the default editor, perhaps you&#8217;d like to try emacs, my chosen editor. Add this to the <code>.bashrc</code> or <code>.bash_profile</code> as well:</p>
<pre>export EDITOR=emacs</pre>
<br />Filed under: <a href='http://zwass.wordpress.com/category/shell-scripting/'>Shell Scripting</a>  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/zwass.wordpress.com/36/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/zwass.wordpress.com/36/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/zwass.wordpress.com/36/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/zwass.wordpress.com/36/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/zwass.wordpress.com/36/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/zwass.wordpress.com/36/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/zwass.wordpress.com/36/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/zwass.wordpress.com/36/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/zwass.wordpress.com/36/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/zwass.wordpress.com/36/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/zwass.wordpress.com/36/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/zwass.wordpress.com/36/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/zwass.wordpress.com/36/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/zwass.wordpress.com/36/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=zwass.wordpress.com&amp;blog=21270059&amp;post=36&amp;subd=zwass&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://zwass.wordpress.com/2011/03/16/the-go-command/feed/</wfw:commentRss>
		<slash:comments>11</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/33800dc7f40b28f182ad2b085de5daa9?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">zacharywasserman</media:title>
		</media:content>
	</item>
		<item>
		<title>Combining cd and ls Into One Command</title>
		<link>http://zwass.wordpress.com/2011/03/16/combining-cd-and-ls-into-one-command/</link>
		<comments>http://zwass.wordpress.com/2011/03/16/combining-cd-and-ls-into-one-command/#comments</comments>
		<pubDate>Wed, 16 Mar 2011 04:14:52 +0000</pubDate>
		<dc:creator>Zachary Wasserman</dc:creator>
				<category><![CDATA[Shell Scripting]]></category>
		<category><![CDATA[cd]]></category>
		<category><![CDATA[ls]]></category>
		<category><![CDATA[Shell Script]]></category>

		<guid isPermaLink="false">http://zwass.wordpress.com/?p=18</guid>
		<description><![CDATA[Andrew Braunstein and I were discussing how one might add a shell command to change a directory and list it using one command. I&#8217;m sure anyone who uses the shell is familiar with cd followed immediately by ls. A search &#8230; <a href="http://zwass.wordpress.com/2011/03/16/combining-cd-and-ls-into-one-command/">Continue reading <span class="meta-nav">&#8594;</span></a><img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=zwass.wordpress.com&amp;blog=21270059&amp;post=18&amp;subd=zwass&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p><a href="http://terminaljunkie.wordpress.com/" target="_blank">Andrew Braunstein</a> and I were discussing how one might add a shell command to change a directory and list it using one command. I&#8217;m sure anyone who uses the shell is familiar with <code>cd</code> followed immediately by <code>ls</code>.</p>
<p>A search found <a href="http://www.unix.com/shell-programming-scripting/16318-cd-then-ls-l.html">this discussion</a> on the Unix.com forums. The suggestion was to add the following shell function to the .bashrc or .bash_profile:</p>
<pre>cl()
{
if [ -d "$1" ]; then
cd "$1"
ls
fi
}</pre>
<p>This works reasonably well, but I had a couple of complaints:</p>
<ol>
<li>Because the function does nothing if the argument is not a directory, when we try to <code>cl aDirectoryThatDoesNotExist</code>, there is no indication of the error. The shell just prints a new prompt.</li>
<li>Also due to the check that the argument is a directory, we cannot use the default functionality of <code>cd</code> with no argument that returns us to the home directory.</li>
</ol>
<p>My proposed solution is this:</p>
<pre>cl()
{
cd $1 &amp;&amp; ls
}</pre>
<p>Here we take advantage of the exit code produced by the <code>cd</code> command to ensure that the directory change was successful before we <code>ls</code>. If <code>cd</code> exits with an error, the boolean &#8220;and&#8221; is already false, and the <code>ls</code> is not executed. All we see is the error message, and we remain in the same directory. This behavior seems ideal. Additionally, calling <code>cl</code> with no arguments changes to, and lists the home directory as expected.</p>
<div id="attachment_21" class="wp-caption alignnone" style="width: 395px"><a href="http://zwass.files.wordpress.com/2011/03/screen-shot-2011-03-15-at-mar-15-11-58-45-pm.png"><img class="size-full wp-image-21" title="cl in action" src="http://zwass.files.wordpress.com/2011/03/screen-shot-2011-03-15-at-mar-15-11-58-45-pm.png?w=640" alt="cl in action"   /></a><p class="wp-caption-text">cl in action</p></div>
<br />Filed under: <a href='http://zwass.wordpress.com/category/shell-scripting/'>Shell Scripting</a>  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/zwass.wordpress.com/18/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/zwass.wordpress.com/18/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/zwass.wordpress.com/18/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/zwass.wordpress.com/18/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/zwass.wordpress.com/18/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/zwass.wordpress.com/18/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/zwass.wordpress.com/18/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/zwass.wordpress.com/18/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/zwass.wordpress.com/18/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/zwass.wordpress.com/18/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/zwass.wordpress.com/18/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/zwass.wordpress.com/18/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/zwass.wordpress.com/18/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/zwass.wordpress.com/18/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=zwass.wordpress.com&amp;blog=21270059&amp;post=18&amp;subd=zwass&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://zwass.wordpress.com/2011/03/16/combining-cd-and-ls-into-one-command/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/33800dc7f40b28f182ad2b085de5daa9?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">zacharywasserman</media:title>
		</media:content>

		<media:content url="http://zwass.files.wordpress.com/2011/03/screen-shot-2011-03-15-at-mar-15-11-58-45-pm.png" medium="image">
			<media:title type="html">cl in action</media:title>
		</media:content>
	</item>
		<item>
		<title>Automatic SOCKS Proxy for a Domestic IP Address</title>
		<link>http://zwass.wordpress.com/2011/03/15/automatic-socks-proxy-for-a-domestic-ip-address/</link>
		<comments>http://zwass.wordpress.com/2011/03/15/automatic-socks-proxy-for-a-domestic-ip-address/#comments</comments>
		<pubDate>Wed, 16 Mar 2011 03:15:49 +0000</pubDate>
		<dc:creator>Zachary Wasserman</dc:creator>
				<category><![CDATA[Shell Scripting]]></category>
		<category><![CDATA[Hulu]]></category>
		<category><![CDATA[IP]]></category>
		<category><![CDATA[Mac]]></category>
		<category><![CDATA[Netflix]]></category>
		<category><![CDATA[Proxy]]></category>
		<category><![CDATA[Rhapsody]]></category>
		<category><![CDATA[Shell Script]]></category>
		<category><![CDATA[SOCKS]]></category>
		<category><![CDATA[SSH]]></category>

		<guid isPermaLink="false">http://zwass.wordpress.com/?p=3</guid>
		<description><![CDATA[While enjoying a relaxing spring break in Jamaica, I was attempting to read through the monster that is Gödel, Escher, Bach: The Eternal Golden Braid. Hofstadter inspired me to check out the music of Bach, so I logged into my &#8230; <a href="http://zwass.wordpress.com/2011/03/15/automatic-socks-proxy-for-a-domestic-ip-address/">Continue reading <span class="meta-nav">&#8594;</span></a><img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=zwass.wordpress.com&amp;blog=21270059&amp;post=3&amp;subd=zwass&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>While enjoying a relaxing spring break in Jamaica, I was attempting to read through the monster that is <em>Gödel, Escher, Bach: The Eternal Golden Braid</em>. Hofstadter inspired me to check out the music of Bach, so I logged into my Rhapsody account. All good. But when I attempted to play the songs I received the message, &#8220;This content not available in your country.&#8221; That&#8217;s interesting, since I&#8217;m a US based subscriber to Rhapsody. The problem was that the request was coming from a Jamaican IP Address.</p>
<p>Of course, there is a way around this. SSH into a machine in the US and create a SOCKS proxy so that the web requests are coming from the US-based IP. But this was inconvenient to do every time I wanted to listen, so I made a shell script to automatically create the SSH connection, change my Mac&#8217;s system proxy to this, and undo all the changes when quit.</p>
<p>Running this script will require an <a href="http://www.petefreitag.com/item/532.cfm" target="_blank">SSH public key pair</a> be created so that the remote machine can be connected to without a password. Edit the script to include the correct user and host names. This will only work on a Mac. It also assumes that you are getting internet through the Airport. If you are getting internet through ethernet change <code>Airport</code> on line 2 to <code>Ethernet</code>. Any suggestions on how to find which device is providing internet in the script to do this automatically?</p>
<pre>trap "{ networksetup -setsocksfirewallproxystate Airport off; }" INT
networksetup -setsocksfirewallproxy Airport localhost 3333
ssh -ND 3333 USERNAME@HOSTNAME</pre>
<p>This can be run directly from the command line, but I enclosed it in an Automator workflow so that I could launch it through LaunchBar as though it were an application. When the script is closed it should turn off the proxy and restore the previous IP.</p>
<p>I suspect this method should work for any site that restricts content by IP address. Netflix, Hulu and Youtube users will likely find this useful.</p>
<br />Filed under: <a href='http://zwass.wordpress.com/category/shell-scripting/'>Shell Scripting</a>  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/zwass.wordpress.com/3/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/zwass.wordpress.com/3/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/zwass.wordpress.com/3/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/zwass.wordpress.com/3/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/zwass.wordpress.com/3/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/zwass.wordpress.com/3/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/zwass.wordpress.com/3/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/zwass.wordpress.com/3/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/zwass.wordpress.com/3/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/zwass.wordpress.com/3/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/zwass.wordpress.com/3/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/zwass.wordpress.com/3/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/zwass.wordpress.com/3/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/zwass.wordpress.com/3/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=zwass.wordpress.com&amp;blog=21270059&amp;post=3&amp;subd=zwass&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://zwass.wordpress.com/2011/03/15/automatic-socks-proxy-for-a-domestic-ip-address/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/33800dc7f40b28f182ad2b085de5daa9?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">zacharywasserman</media:title>
		</media:content>
	</item>
	</channel>
</rss>
