<?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>Robert Harder</title>
	<atom:link href="http://blog.iharder.net/feed/" rel="self" type="application/rss+xml" />
	<link>https://blog.iharder.net</link>
	<description>PhD Student</description>
	<lastBuildDate>Fri, 19 Feb 2010 17:39:55 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>I Use CrashPlan for Live Offsite Backup</title>
		<link>https://blog.iharder.net/2010/02/19/crashplan-for-live-offsite-backup/</link>
		<comments>https://blog.iharder.net/2010/02/19/crashplan-for-live-offsite-backup/#comments</comments>
		<pubDate>Fri, 19 Feb 2010 17:37:12 +0000</pubDate>
		<dc:creator>Robert Harder</dc:creator>
				<category><![CDATA[Utility]]></category>
		<category><![CDATA[backup]]></category>
		<category><![CDATA[security]]></category>

		<guid isPermaLink="false">http://blog.iharder.net/?p=385</guid>
		<description><![CDATA[One of my favorite podcasts SecurityNow had an advertiser that offered an online/offsite backup service and after trying Carbonite, Mozy, JungleDisk, and CrashPlan, I ended up settling with CrashPlan as my favorite to back up my Macs.
Unfortunately this all happened a few months ago, so I don&#8217;t remember all the details about why I liked [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://blog.iharder.net/wp-content/uploads/2010/02/crashplan.png"><img class="alignright size-full wp-image-391" title="crashplan" src="http://blog.iharder.net/wp-content/uploads/2010/02/crashplan.png" alt="" width="118" height="66" /></a>One of my favorite podcasts <a href="http://www.grc.com/securitynow.htm">SecurityNow</a> had an advertiser that offered an online/offsite backup service and after trying Carbonite, Mozy, JungleDisk, and CrashPlan, I ended up settling with <a href="http://crashplan.com/">CrashPlan</a> as my favorite to back up my Macs.</p>
<p>Unfortunately this all happened a few months ago, so I don&#8217;t remember all the details about why I liked or disliked each of the products, but here are some brief thoughts on each one.<br />
<span id="more-385"></span></p>
<h2>JungleDisk <img style="vertical-align: text-bottom;" title="ThumbsUp" src="http://blog.iharder.net/wp-content/uploads/2010/02/NoThumbsUp.png" alt="" width="24" height="24" /></h2>
<p><a href="http://blog.iharder.net/wp-content/uploads/2010/02/logo_jd_selected.gif"><img class="alignright size-full wp-image-388" title="jungledisk" src="http://blog.iharder.net/wp-content/uploads/2010/02/logo_jd_selected.gif" alt="" width="242" height="42" /></a>I had been using <a href="http://www.jungledisk.com/">JungleDisk</a> for a year or so, and I liked that I could be confident that my data was being encrypted on my end and that no one else could decrypt the data. The security was my number one concern.</p>
<p>I didn&#8217;t particularly like the way the tool integrated into my life, but that&#8217;s a preference thing. You may like it just fine. JungleDisk essentially makes available to you a network disk that mirrors whatever you&#8217;ve specified that you want to back up. I did find it convenient when I was on my laptop and wanted to retrieve something from my desktop—I could just retrieve it from the network disk.</p>
<p>JungleDisk the software only cost me $20, but it uses Amazon S3 for the backend storage, so my monthly bill came from Amazon. Eventually it just got too expensive for me. My backups grew to 30GB then 50GB then 80GB, and I could see I would want more backed up in the future. The monthly bill was growing to $20. That&#8217;s when I decided to look elsewhere.</p>
<h2>Carbonite <img style="vertical-align: text-bottom;" title="ThumbsDown" src="http://blog.iharder.net/wp-content/uploads/2010/02/NoThumbsDown.png" alt="" width="24" height="24" /></h2>
<p><a href="http://blog.iharder.net/wp-content/uploads/2010/02/logo_main1.gif"><img class="alignright size-full wp-image-389" title="carbonite" src="http://blog.iharder.net/wp-content/uploads/2010/02/logo_main1.gif" alt="" width="259" height="54" /></a>Because <a href="http://www.carbonite.com/">Carbonite</a> was an advertiser on the podcast, I learned that they offered unlimited backup space for about $5 per month, or so they claimed. I checked out Carbonite. It makes me feel dirty. Everything about their business feels creepy to me, and ultimately they were disqualified because I was not satisfied with their encryption technique which, as I recall, involves them having the ability to decrypt my files.</p>
<h2>Mozy <img style="vertical-align: text-bottom;" title="ThumbsDown" src="http://blog.iharder.net/wp-content/uploads/2010/02/NoThumbsDown.png" alt="" width="24" height="24" /></h2>
<p><a href="http://blog.iharder.net/wp-content/uploads/2010/02/Mozy_logo.png"><img class="alignright size-full wp-image-390" title="mozy" src="http://blog.iharder.net/wp-content/uploads/2010/02/Mozy_logo.png" alt="" width="174" height="47" /></a>I had high hopes for <a href="http://mozy.com/">Mozy</a>, because people seemed to think it was Mac-like. Ha. Mozy was OK, but restoring files was a pain, and again I did not trust their encryption techniques.</p>
<h2>CrashPlan <img style="vertical-align: text-bottom;" title="ThumbsUp" src="http://blog.iharder.net/wp-content/uploads/2010/02/NoThumbsUp.png" alt="" width="24" height="24" /></h2>
<p><a href="http://blog.iharder.net/wp-content/uploads/2010/02/crashplan.png"><img class="alignright size-full wp-image-391" title="crashplan" src="http://blog.iharder.net/wp-content/uploads/2010/02/crashplan.png" alt="" width="196" height="110" /></a>Somehow I stumbled onto <a href="http://crashplan.com/">CrashPlan</a>, which doesn&#8217;t seem to be mentioned as often as Mozy and Carbonite. I use it on several of my computers, and I am paying for the family plan (all my computers, unlimited storage) for about $100 per year. Some things I like about CrashPlan:</p>
<ul>
<li>You can use it for free to back up to your own external drives, other computers, etc, so if you don&#8217;t want to pay for online storage, you can still use it as a nice backup solution locally. Near as I can tell, you could also install this on a friend&#8217;s (or your parents&#8217;) computer and have them backup to your computer for free remotely, if you&#8217;re willing to spare some hard drive space. You could have an arrangement with a friend so that each of you backs up each others&#8217; data (encrypted, of course), so as long as your houses don&#8217;t both burn down simultaneously, you should be OK.</li>
<li>You can encrypt your data locally with locally-controlled keys that cannot be decrypted by anyone else. You have the option to choose to have the keys stored with CrashPlan so that if you forget your password, you can still access your data, but that&#8217;s not what I wanted. How nice of them to offer both services.</li>
<li>Truly unlimited backup space. I found people on various forums complaining with all these services (except JungleDisk/Amazon S3) that &#8220;unlimited&#8221; really meant 50GB or so, but CrashPlan&#8217;s stance is unequivocally, &#8220;Unlimited means Unlimited,&#8221; and I appreciate that.</li>
<li>Easy interface, easy restore.</li>
</ul>
<h2>Conclusion</h2>
<p>That was my adventure, trying all these backup plans. I now use my Macs&#8217; built-in TimeMachine backup for local backup and recovering accidentally-deleted files, and I use CrashPlan to backup offsite.</p>
]]></content:encoded>
			<wfw:commentRss>https://blog.iharder.net/2010/02/19/crashplan-for-live-offsite-backup/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Command Line Capture of Web Pages to PDF, PNG, SVG, etc</title>
		<link>https://blog.iharder.net/2010/01/05/command-line-capture-of-web-pages-to-pdf-png-svg-etc/</link>
		<comments>https://blog.iharder.net/2010/01/05/command-line-capture-of-web-pages-to-pdf-png-svg-etc/#comments</comments>
		<pubDate>Tue, 05 Jan 2010 22:35:59 +0000</pubDate>
		<dc:creator>Robert Harder</dc:creator>
				<category><![CDATA[Utility]]></category>

		<guid isPermaLink="false">http://blog.iharder.net/?p=360</guid>
		<description><![CDATA[If you&#8217;re on a Mac, you probably know that in any application that prints, you can &#8220;print&#8221; to a PDF file &#8212; handy to be sure &#8212; but from the command line, it&#8217;s not so easy. Enter CutyCapt, a cross-platform tool that lets you capture web pages in a variety of formats including SVG, PDF, [...]]]></description>
			<content:encoded><![CDATA[<p>If you&#8217;re on a Mac, you probably know that in any application that prints, you can &#8220;print&#8221; to a PDF file &#8212; handy to be sure &#8212; but from the command line, it&#8217;s not so easy. Enter <a href="http://cutycapt.sourceforge.net/">CutyCapt</a>, a cross-platform tool that lets you capture web pages in a variety of formats including SVG, PDF, PS, PNG, JPEG, TIFF, GIF, and BMP using WebKit as the rendering engine.<br />
<span id="more-360"></span><br />
A windows executable is provided on the website, so I had to download the source and compile it. I won&#8217;t be talking about the compilation process here. You can compile it yourself, if you don&#8217;t trust what I&#8217;m about to offer you, or you can download the file from me. I won&#8217;t be offended if you compile it yourself.</p>
<h2>Download</h2>
<p>Here is what I compiled. I have not packaged it as a PKG file. You&#8217;ll get a generic-looking application (.app) and a symbolic link pointing to the executable within the application. I recommend copying both files to /usr/local/bin, if that is in your PATH, or somewhere else that is accessible.</p>
<p style="font-size: larger; text-align: center;"><a href="http://blog.iharder.net/wp-content/uploads/2010/01/CutyCapt.zip">Download CutyCapt.zip</a></p>
<h2>Usage</h2>
<p>Running CutyCapt without arguments gives us the following options:</p>
<pre>-----------------------------------------------------------------------------
Usage: CutyCapt --url=http://www.example.org/ --out=localfile.png
-----------------------------------------------------------------------------
 --help                         Print this help page and exit
 --url=&lt;url&gt;                    The URL to capture (http:...|file:...|...)
 --out=&lt;path&gt;                   The target file (.png|pdf|ps|svg|jpeg|...)
 --out-format=&lt;f&gt;               Like extension in --out, overrides heuristic
 --min-width=&lt;int&gt;              Minimal width for the image (default: 800)
 --max-wait=&lt;ms&gt;                Don't wait more than (default: 90000, inf: 0)
 --delay=&lt;ms&gt;                   After successful load, wait (default: 0)
 --user-styles=&lt;url&gt;            Location of user style sheet, if any
 --header=&lt;name&gt;:&lt;value&gt;        request header; repeatable; some can't be set
 --method=&lt;get|post|put&gt;        Specifies the request method (default: get)
 --body-string=&lt;string&gt;         Unencoded request body (default: none)
 --body-base64=&lt;base64&gt;         Base64-encoded request body (default: none)
 --app-name=&lt;name&gt;              appName used in User-Agent; default is none
 --app-version=&lt;version&gt;        appVers used in User-Agent; default is none
 --user-agent=&lt;string&gt;          Override the User-Agent header Qt would set
 --javascript=&lt;on|off&gt;          JavaScript execution (default: on)
 --java=&lt;on|off&gt;                Java execution (default: unknown)
 --plugins=&lt;on|off&gt;             Plugin execution (default: unknown)
 --private-browsing=&lt;on|off&gt;    Private browsing (default: unknown)
 --auto-load-images=&lt;on|off&gt;    Automatic image loading (default: on)
 --js-can-open-windows=&lt;on|off&gt; Script can open windows? (default: unknown)
 --js-can-access-clipboard=&lt;on|off&gt; Script clipboard privs (default: unknown)
-----------------------------------------------------------------------------
 &lt;f&gt; is svg,ps,pdf,itext,html,rtree,png,jpeg,mng,tiff,gif,bmp,ppm,xbm,xpm
-----------------------------------------------------------------------------
http://cutycapt.sf.net - (c) 2003-2008 Bjoern Hoehrmann - bjoern@hoehrmann.de</pre>
<p>Based on the example provided, try a simple test:</p>
<pre>$ CutyCapt --url=http://blog.iharder.net --out=blog.png</pre>
<p>I get a nice <strong>long</strong> capture of my blog as a PNG file.</p>
<p><a href="http://blog.iharder.net/wp-content/uploads/2010/01/blog.png"><img class="aligncenter size-full wp-image-374" title="Blog page capture" src="http://blog.iharder.net/wp-content/uploads/2010/01/blog.png" alt="" width="50" height="272" /></a></p>
<p>The program does not seem to work if you use a tilde (~) in the path to represent your home folder.</p>
<p>Enjoy!</p>
]]></content:encoded>
			<wfw:commentRss>https://blog.iharder.net/2010/01/05/command-line-capture-of-web-pages-to-pdf-png-svg-etc/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Jam Resistant Communication Without a Shared Key</title>
		<link>https://blog.iharder.net/2009/12/07/bbc-jam-resistant-communication-without-a-shared-key/</link>
		<comments>https://blog.iharder.net/2009/12/07/bbc-jam-resistant-communication-without-a-shared-key/#comments</comments>
		<pubDate>Mon, 07 Dec 2009 19:42:52 +0000</pubDate>
		<dc:creator>Robert Harder</dc:creator>
				<category><![CDATA[Utility]]></category>
		<category><![CDATA[bbc]]></category>
		<category><![CDATA[codes]]></category>
		<category><![CDATA[jamming]]></category>
		<category><![CDATA[radio]]></category>
		<category><![CDATA[security]]></category>

		<guid isPermaLink="false">http://blog.iharder.net/?p=317</guid>
		<description><![CDATA[Some US Air Force Academy (USAFA) and National Security Agency (NSA) smart guys (Baird, Bahn, and Collins &#8211; BBC) have come up with a way to achieve the kind of jam resistance that shared keys provide (like spread spectrum) but without the need for a shared key. For the crypto guys out there, this would [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://blog.iharder.net/wp-content/uploads/2009/12/bbctree.png"><img class="alignright size-full wp-image-355" title="BBC Decoding Tree" src="http://blog.iharder.net/wp-content/uploads/2009/12/bbctree.png" alt="BBC Decoding Tree" width="224" height="228" /></a>Some <a href="http://www.usafa.edu/df/dfcs/">US Air Force Academy</a> (USAFA) and <a href="http://www.nsa.gov/">National Security Agency</a> (NSA) smart guys (<a href="http://www.leemon.com/">Baird</a>, <a href="http://www.ee-ed.com/bbc/">Bahn</a>, and Collins &#8211; BBC) have come up with a way to achieve the kind of jam resistance that shared keys provide (like spread spectrum) but without the need for a shared key. For the crypto guys out there, this would be analogous to what the Diffie-Hellman key exchange brought to the world of symmetric cryptography. In fact one would probably use such a key exchange over BBC and then revert to traditional jam-resistant communication techniques, just as we do with asymmetric/symmetric crypto. Their ideas extend beyond jam resistance, but that&#8217;s what we&#8217;ll look at here.</p>
<p><span id="more-317"></span>Of course they explain it better than I in two papers and an applet I copied here:</p>
<ul>
<li><a href="http://blog.iharder.net/wp-content/uploads/2009/12/Baird-Jam-Resistant-Communication-Without-Shared-Secrets.pdf">Jam-Resistant Communication Without Shared Secrets Through the Use of Concurrent Codes</a>, Baird, Bahn, Collins.</li>
<li><a href="http://blog.iharder.net/wp-content/uploads/2009/12/Schweitzer-Visually-Understanding-Jam-Resistant-Communication.pdf">Visually Understanding Jam Resistant Communication</a>, Schweitzer, Baird, Bahn</li>
<li><a href="#applet">Visualization Applet further down this page</a></li>
</ul>
<p>Baird has over a dozen papers published on the subject on <a href="http://leemon.com/papers/">his website</a>.</p>
<p>First let&#8217;s understand the kind of attack we&#8217;re fighting. To fight jamming, you want to make your enemy work so hard or expend so many resources that the jamming is ineffective when on or not cost effective to even turn on. We cannot pretend to achieve &#8220;jam proof.&#8221;</p>
<p>Radio jamming adds energy to the spectrum, so a successful jamming adds energy at the specific frequencies that we are trying to read or at the specific moments in time we want to read them. With spread spectrum communication, as one example, successful jamming would require energy to be poured into many, many frequencies on the hope that the particular frequencies specified in the shared key will be covered. This is expensive for a jammer.</p>
<p>Note that a jammer cannot remove energy from the spectrum. This is an additive process, and this will be important.</p>
<h2>Encoding</h2>
<p>To encode a message, we step through the message, hashing each successively-longer piece, and we use the hash value to &#8220;place&#8221; energy in the spectrum. (You can use a time-based pulse method as easily). We scale the hash function (like a modulus operator) to an appropriate width (not discussed here).</p>
<p>Say we&#8217;re passing the (ridiculously-short) four-bit message 1011. We&#8217;ll arbitrarily set our hash width to 50. The hash value  of 1, I&#8217;m making this up, is h(1) = 37. We continue through the message as well as some padding bits on the end which are analogous to a checksum.</p>
<p>h(1) = 37<br />
h(10) = 8<br />
h(101) = 44<br />
h(1011) = 23<br />
h(10110) = 9<br />
h(101100) = 17</p>
<p>We now have an encoded message that will have peaks at the points 8, 9, 17, 23, 37, and 44. Again this could be frequencies, timed pulses, etc. depending on your radio setup.</p>
<p>A jammer comes along but doesn&#8217;t have the energy to jam everything, so he jams points 1-5, 20-29, and 40-49 (for ease of illustration) by turning those points &#8220;on.&#8221;</p>
<h2>Decoding</h2>
<p>The listening end cannot distinguish between the original message and the jamming and so receives &#8220;on&#8221; energy at the points 1-5, 8, 9, 17, 20-29, 37, and 40-49.</p>
<p>We know a message must start with either a zero or a one, so the receiver hashes zero and one to see if their values appear in the received &#8220;on&#8221; list.</p>
<p>h(1) = 37 ON THE LIST<br />
h(0) = 11 NOT ON THE LIST</p>
<p>So far we know the message begins with a one. The second bit must be zero or one.</p>
<p>h(10) = 8 ON THE LIST<br />
h(11) = 28 ON THE LIST</p>
<p>Hmm, both 10 and 11 may be valid messages. We&#8217;ll continue our tree (imagine a tree) and consider adding a zero and one to both 10 and 11. At the end of the four-bit message we know that we add two zeroes, so messages that end with ones can be discarded.</p>
<p>With appropriately chosen hash widths, message lengths, and padding, we&#8217;ve successfully decoded the message, despite the jamming, and we&#8217;ve discovered that we can actually have multiple valid messages overlapping (protection against a sort of &#8220;friendly&#8221; jamming).</p>
<h2><a name="applet"></a>Visualization Applet</h2>
<ol>
<li>Type a short message in the Message box and hit Return.</li>
<li>See the Decoded Message at the bottom.</li>
<li>&#8220;Jam&#8221; the communication channel by drawing all over the message.</li>
<li>See how you can cover up to half the message before the message is degraded.</li>
</ol>
<div style="height: 650px;"><span style="padding: 0 1em; display: inline; position: absolute;"></p>
<p></span></div>
<h2>Conclusion</h2>
<p>This new concurrent coding can provide keyless jam resistance. The papers linked above discuss other uses such as for RFID tags and even document searching. Since this is government-developed technology (and it&#8217;s not classified), it is free for use. Go forth and build more secure radios!</p>
]]></content:encoded>
			<wfw:commentRss>https://blog.iharder.net/2009/12/07/bbc-jam-resistant-communication-without-a-shared-key/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Atlas Shrugged Essay Contest</title>
		<link>https://blog.iharder.net/2009/11/02/atlas-shrugged-essay-contest/</link>
		<comments>https://blog.iharder.net/2009/11/02/atlas-shrugged-essay-contest/#comments</comments>
		<pubDate>Tue, 03 Nov 2009 04:11:57 +0000</pubDate>
		<dc:creator>Robert Harder</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://blog.iharder.net/?p=308</guid>
		<description><![CDATA[Since I&#8217;m a student for a little while again, I posted an essay for this year&#8217;s Atlas Shrugged essay contest. There&#8217;s nothing like writing an essay to really make you feel like a student! [Update: I didn't win. =( ]

Atlas Shrugged Essay Topic #2: In Atlas Shrugged, the heroes want to &#8220;make&#8221; money while the [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://blog.iharder.net/wp-content/uploads/2009/11/atlasshrugged.jpg"><img class="alignright size-full wp-image-313" title="Atlas Shrugged logo" src="http://blog.iharder.net/wp-content/uploads/2009/11/atlasshrugged.jpg" alt="Atlas Shrugged logo" width="90" height="147" /></a>Since I&#8217;m a student for a little while again, I posted an essay for this year&#8217;s <a href="http://www.aynrand.org/">Atlas Shrugged essay contest</a>. There&#8217;s nothing like writing an essay to really make you feel like a student! [Update: I didn't win. =( ]</p>
<p><span id="more-308"></span></p>
<p><em>Atlas Shrugged Essay Topic #2: In Atlas Shrugged, the heroes want to &#8220;make&#8221; money while the villains want, on the surface at least, to &#8220;have&#8221; money. What is the difference between these two views of money? Explain your answer by reference to actual events in the novel.</em></p>
<p>Distinguishing between &#8220;making&#8221; money and &#8220;having&#8221; money is a key insight highlighted by Ayn Rand, however despite the rational selfishness that the main characters put forward, their view of making money necessarily requires the considerations of other people&#8212;that one person&#8217;s new idea has value only if someone else thinks it has value&#8212;whereas the view of having money pits one man against his neighbor where invariably the only way to have is to take. How ironic that the villains in the book who decry selfish ambition are actually embracing the more selfish of the two views of money.</p>
<p>Making money implies that one can increase wealth by work and mental effort. Strictly speaking this is not making money exactly, and Midas Mulligan even reverts to a gold standard for representing money in the Colorado mountains. In this sense the protagonists actually embrace the &#8220;having&#8221; money point of view, but Hank Rearden acknowledges that it is wealth that is made, and that is the meaning taken here. Gold becomes a means for value exchange enabling wealth to be &#8220;made.&#8221;</p>
<p>With the notion that wealth can be made comes hope, opportunity, and achievement. One can think of what no one has done or of doing something better, and this creates a value difference between what is currently available and what one proposes. Despite the main characters&#8217; insistence that they follow a selfish path, their philosophy depends on other people and how one&#8217;s ideas and actions improve the lives of others. Regarding the desparately-needed new rails for the Rio Norte line, Hank tells Dagny Taggart, &#8220;I intend to make you pay for it,&#8221; and Dagny gladly does.</p>
<p>New ideas may also benefit the creator directly. John Galt explains to Dagny that such innovations give the inventor time, not money, and time can be redeemed to pursue what one desires. In this sense time is a sort of gold standard with oneself. One cannot pay oneself with gold for a new idea, but time&#8212;the ultimate limited resource&#8212;can be &#8220;saved&#8221; by innovation.</p>
<p>The value of a new idea is based on the improvement that it provides another person. It is the recognition of one person&#8217;s achievement by another, but it is not a hollow recognition for the benefit of the creator. It is the acknowledgement of one person&#8217;s genuine contribution to another.  Richard Halley&#8217;s fifth concerto, John Galt&#8217;s motor, even Hugh Akston&#8217;s cooking&#8212;these have value because they improve someone else&#8217;s life, not necessarily that of the creator. Without this understanding, Hank&#8217;s wife Lillian cannot appreciate the significance to the world of the first pouring of Rearden Metal. Instead she offers sarcastically, &#8220;Shall we declare it a national holiday, darling?&#8221;</p>
<p>Allowing individuals to develop their ideas may lead to more good ideas, such as when Hank proposes his new bridge structure to Dagny. She asks if he invented the bridge in the last two days, and he replies, &#8220;I `invented&#8217; it long before I had Rearden Metal. I figured it out while I was making steel for bridges. I wanted a metal with which one would be able to do this, among other things.&#8221; His desire to build a better bridge drove him to invent a better metal.</p>
<p>This view of money provides stability and correction because value can be verified, tempered, adjusted not by a single creator but by the people. In its selfishness, it gives power to the consumers to negotiate their futures and demand something better, but these demands come not in the form of declaring a right but proposing a counter-offer: &#8220;We will pay you more money for something better.&#8221; It respects the creator and creates a lasting relationship among people where respect, not force, is the key ingredient. Everyone benefits, and here the best way to maximize the common good and provide a positive future is to allow individuals to achieve and submit their efforts for peer valuation. In contrast when one views money as something to have, then one must necessarily look around for existing wealth and think of ways to get it, for unless more can be made, the only way to get more of something is to take it.</p>
<p>While it is possible to take money peaceably as with the case of selling goods and services, one might start looking enviously at another person with more money and quickly realize that it is much more efficient to take it by force. One might easily justify it as well, assuming that the person with more money must have in turn gotten it by taking it from someone else.</p>
<p>Without the insight to make money, some characters in the book apply their creativity to inventing ways to take money. Inevitably this leads them to force their ideas on others by law, a common theme among people with this view. Balph Eubanks&#8217;s negative view of humanity convinces him that, &#8220;We ought to place a limit upon their material greed,&#8221; and he suggests that no more than 10,000 copies of a book should be permitted to be sold. James Taggart pushes through the Anti-dog-eat-dog Rule in order to remove the &#8220;destructive competition&#8221; of Dan Conway&#8217;s Phoenix-Durango line. Orren Boyle uses Directive 10-289 and blackmail to force Rearden Metal into the government&#8217;s hands.</p>
<p>Even the fair exchange of money can be warped when one has the wrong view. Consider Hank&#8217;s mother and his brother Philip who decide it is not right that Philip exist only on Hank&#8217;s charity. Her solution is to have Hank give Philip a job instead, &#8220;but a nice clean job, of course, with a desk and an office and a decent salary.&#8221; Hank&#8217;s reply: &#8220;But he knows nothing about the steel business!&#8221;</p>
<p>The two views of making money and having money ultimately affect the value you place on other people. If you believe that you can make money, then you inherently acknowledge that other people have value and that your positive impact on their lives is what makes money, but if you believe that money can only be had, then other people become an impediment to your happiness, and you will seek ways to take from them as the &#8220;looters&#8221; in the book often did.</p>
]]></content:encoded>
			<wfw:commentRss>https://blog.iharder.net/2009/11/02/atlas-shrugged-essay-contest/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Create Animated GIFs with Mac OS X Preview.app</title>
		<link>https://blog.iharder.net/2009/10/22/gif-create-animated-gifs-with-mac-os-x-preview-app/</link>
		<comments>https://blog.iharder.net/2009/10/22/gif-create-animated-gifs-with-mac-os-x-preview-app/#comments</comments>
		<pubDate>Thu, 22 Oct 2009 17:51:19 +0000</pubDate>
		<dc:creator>Robert Harder</dc:creator>
				<category><![CDATA[Utility]]></category>
		<category><![CDATA[animation]]></category>
		<category><![CDATA[gif]]></category>
		<category><![CDATA[images]]></category>
		<category><![CDATA[mac]]></category>

		<guid isPermaLink="false">http://blog.iharder.net/?p=277</guid>
		<description><![CDATA[If you open an animated GIF in Mac OS X&#8217;s Preview application, the default application for viewing images and PDFs, you may know that you can see individual frames of the animation, but did you know you can also create animated GIFs with Preview? Here&#8217;s how.


How To
For this example, we will create an animated GIF [...]]]></description>
			<content:encoded><![CDATA[<p style="text-align: left;">If you open an animated GIF in Mac OS X&#8217;s Preview application, the default application for viewing images and PDFs, you may know that you can see individual frames of the animation, but did you know you can also create animated GIFs with Preview? Here&#8217;s how.</p>
<p><a href="http://blog.iharder.net/wp-content/uploads/2009/10/base1.gif"><img src="http://blog.iharder.net/wp-content/uploads/2009/10/base1.gif" alt="All Your Base Are Belong To Us" title="All Your Base Are Belong To Us" width="554" height="282" class="aligncenter size-full wp-image-304" /></a><br />
<span id="more-277"></span></p>
<h2>How To</h2>
<p>For this example, we will create an animated GIF of us typing some text into a text editor. Preview sets the interframe delay to 0.1 seconds, and I have not seen a way to change that. That is a reasonable typing speed for this effect.</p>
<p>Open a text editor such as TextEdit, TextMate, BBEdit, etc. Resize the window so that it&#8217;s a nice, tight size that will look good on a web page.</p>
<p style="text-align: center;"><a href="http://blog.iharder.net/wp-content/uploads/2009/10/1-blank-doc.png"><img class="aligncenter size-full wp-image-285" title="Blank Document" src="http://blog.iharder.net/wp-content/uploads/2009/10/1-blank-doc.png" alt="Blank Document" width="443" height="226" /></a></p>
<p>The first thing you might notice between the screenshot above and the animated GIF at the beginning is that the shadow looks better on this screenshot. That&#8217;s because GIF images can only contain 256 different colors, and that&#8217;s not enough to see the subtle changes in the shadow.</p>
<p>Save this opening shot by typing Command-Shift-4. Release those keys and type Space. Now click on the text editor window. That creates a screen capture of just the window you clicked and saves it to the desktop.</p>
<p>Open that file in Preview. Choose Save As from the File menu. Select GIF as the file type. Name the file something meaningful like animation.gif. You can now delete the original screen capture image so you don&#8217;t accidentally duplicate it during the next steps.</p>
<p style="text-align: center;"><a href="http://blog.iharder.net/wp-content/uploads/2009/10/2-saved-as-gif.png"><img class="aligncenter size-full wp-image-287" title="Saved as GIF" src="http://blog.iharder.net/wp-content/uploads/2009/10/2-saved-as-gif.png" alt="Saved as GIF" width="406" height="277" /></a></p>
<p>We&#8217;ll want to see the sidebar so we can add images to the GIF sequence. Click the Sidebar button in the toolbar.</p>
<p style="text-align: center;"><a href="http://blog.iharder.net/wp-content/uploads/2009/10/3-with-sidebar.png"><img class="aligncenter size-full wp-image-288" title="With Sidebar Showing" src="http://blog.iharder.net/wp-content/uploads/2009/10/3-with-sidebar.png" alt="With Sidebar Showing" width="418" height="277" /></a></p>
<p>Let&#8217;s just add one character &#8216;A&#8217; to the text editor, and add that to the sequence.</p>
<ol>
<li>Type &#8216;A&#8217; in the text editor window.</li>
<li>Type Command-Shift-4.</li>
<li>Type Space.</li>
<li>Click on the text editor window.</li>
<li>Find the captured image on your Desktop, and drag it onto the Preview window, directly over the &#8220;animation.gif&#8221; image in the sidebar.</li>
</ol>
<p style="text-align: center;"><a href="http://blog.iharder.net/wp-content/uploads/2009/10/4-dragging-image-over-first-frame1.png"><img class="aligncenter size-full wp-image-291" title="Dragging Image Over First Frame" src="http://blog.iharder.net/wp-content/uploads/2009/10/4-dragging-image-over-first-frame1.png" alt="Dragging Image Over First Frame" width="398" height="256" /></a></p>
<p>Your Preview window should look something like this now:</p>
<p style="text-align: center;"><a href="http://blog.iharder.net/wp-content/uploads/2009/10/5-after-two-frames.png"><img class="aligncenter size-full wp-image-293" title="After Two Frames" src="http://blog.iharder.net/wp-content/uploads/2009/10/5-after-two-frames.png" alt="After Two Frames" width="418" height="277" /></a></p>
<p>Now let&#8217;s capture several frames at once to speed this along. After each character that we type in the text editor, we&#8217;ll type Command-Shift-4, Space, and click on the text editor window, creating many screenshots saved to the desktop.</p>
<p>Select all of these new screenshots on the desktop, and drag them to the Preview window as shown below so that you tell Preview to add the images to the sequence you began (as opposed to simply opening more files, which it will do if you drag too low on the sidebar).</p>
<p style="text-align: center;"><a href="http://blog.iharder.net/wp-content/uploads/2009/10/6-dragging-several-files.png"><img class="aligncenter size-full wp-image-294" title="Dragging Several Files" src="http://blog.iharder.net/wp-content/uploads/2009/10/6-dragging-several-files.png" alt="Dragging Several Files" width="398" height="264" /></a></p>
<p>You&#8217;ve got it now. Continue with more frames, and save your GIF. Drag the GIF image to Safari or other animated GIF-enabled viewer, and enjoy. Unfortunately I haven&#8217;t found a way to loop the animation in Preview.</p>
]]></content:encoded>
			<wfw:commentRss>https://blog.iharder.net/2009/10/22/gif-create-animated-gifs-with-mac-os-x-preview-app/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Stream iTunes over SSH</title>
		<link>https://blog.iharder.net/2009/09/28/itunes-stream-itunes-over-ssh/</link>
		<comments>https://blog.iharder.net/2009/09/28/itunes-stream-itunes-over-ssh/#comments</comments>
		<pubDate>Mon, 28 Sep 2009 21:08:41 +0000</pubDate>
		<dc:creator>Robert Harder</dc:creator>
				<category><![CDATA[Utility]]></category>
		<category><![CDATA[bonjour]]></category>
		<category><![CDATA[dns]]></category>
		<category><![CDATA[dns-sd]]></category>
		<category><![CDATA[itunes]]></category>
		<category><![CDATA[mdns]]></category>
		<category><![CDATA[ssh]]></category>

		<guid isPermaLink="false">http://blog.iharder.net/?p=257</guid>
		<description><![CDATA[After (mostly unsuccessful) Googling for how to stream iTunes over SSH, I finally tracked down the difficult bits myself and put together a four-line script (five if you count &#8220;shebang&#8221;):
#!/bin/sh
dns-sd -P "Home iTunes" _daap._tcp local 3689 localhost 127.0.0.1 "Arbitrary text record" &#38;
PID=$!
ssh -C -N -L 3689:localhost:3689 myusername@blahblahblah.dyndns.org
kill $PID


Multicast DNS (mDNS) and DNS Service Discovery (DNS-SD) [...]]]></description>
			<content:encoded><![CDATA[<p>After (mostly unsuccessful) Googling for how to stream iTunes over SSH, I finally tracked down the difficult bits myself and put together a four-line script (five if you count &#8220;shebang&#8221;):</p>
<pre>#!/bin/sh
dns-sd -P "Home iTunes" _daap._tcp local 3689 localhost 127.0.0.1 "Arbitrary text record" &amp;
PID=$!
ssh -C -N -L 3689:localhost:3689 myusername@blahblahblah.dyndns.org
kill $PID</pre>
<p style="text-align: center;"><a href="http://blog.iharder.net/wp-content/uploads/2009/09/itunes-sharing.png"><img class="aligncenter size-full wp-image-264" title="itunes-sharing" src="http://blog.iharder.net/wp-content/uploads/2009/09/itunes-sharing.png" alt="itunes-sharing" width="468" height="301" /></a></p>
<p><span id="more-257"></span></p>
<h2>Multicast DNS (mDNS) and DNS Service Discovery (DNS-SD) Test Tool</h2>
<p>We need to trick iTunes into thinking our home computer is on our local network, because if you&#8217;re sitting in Starbucks, then your home computer is <strong>not</strong> on your local network (and if it is, then you need to address your caffeine addiction). For that we use a tool quietly sitting at <tt>/usr/bin/dns-sd</tt> that provides a command line interface to the DNS-SD libraries which is normally accessible to programmers via <tt>/usr/include/dns_sd.h</tt>. Like all good libraries, it helps to have a command line reference tool for scripters, and <tt>dns-sd</tt> works great for us.</p>
<p>iTunes uses Multicast DNS (mDNS) and DNS Service Discovery (DNS-SD) to announce its presence and to look for other iTunes instances. Apple calls this technology Bonjour (formerly Rendezvous), but it is also known as <a href="http://www.zeroconf.org/">Zero Configuration Networking (www.zeroconf.org)</a>.</p>
<p>The <tt>dns-sd</tt> <tt>man</tt> page only gives a few of the many options available. Typing <tt>dns-sd</tt> at the command line shows you more options but without much explanation.</p>
<pre>$ dns-sd
dns-sd -E                  (Enumerate recommended registration domains)
dns-sd -F                      (Enumerate recommended browsing domains)
dns-sd -B        &lt;Type&gt; &lt;Domain&gt;        (Browse for services instances)
dns-sd -L &lt;Name&gt; &lt;Type&gt; &lt;Domain&gt;           (Look up a service instance)
dns-sd -R &lt;Name&gt; &lt;Type&gt; &lt;Domain&gt; &lt;Port&gt; [&lt;TXT&gt;...] (Register a service)
dns-sd -P &lt;Name&gt; &lt;Type&gt; &lt;Domain&gt; &lt;Port&gt; &lt;Host&gt; &lt;IP&gt; [&lt;TXT&gt;...]  (Proxy)
dns-sd -Z        &lt;Type&gt; &lt;Domain&gt;   (Output results in Zone File format)
dns-sd -Q &lt;FQDN&gt; &lt;rrtype&gt; &lt;rrclass&gt; (Generic query for any record type)
dns-sd -C &lt;FQDN&gt; &lt;rrtype&gt; &lt;rrclass&gt;   (Query; reconfirming each result)
dns-sd -X udp/tcp/udptcp &lt;IntPort&gt; &lt;ExtPort&gt; &lt;TTL&gt;   (NAT Port Mapping)
dns-sd -G v4/v6/v4v6 &lt;Hostname&gt;  (Get address information for hostname)
dns-sd -V    (Get version of currently running daemon / system service)
dns-sd -A                      (Test Adding/Updating/Deleting a record)
dns-sd -U                                  (Test updating a TXT record)
dns-sd -N                             (Test adding a large NULL record)
dns-sd -T                            (Test creating a large TXT record)
dns-sd -M      (Test creating a registration with multiple TXT records)
dns-sd -I   (Test registering and then immediately updating TXT record)
dns-sd -S                 (Test multiple operations on a shared socket)</pre>
<p>We&#8217;ll use the Proxy option <tt>-P</tt> to indicate that the service we&#8217;re advertising will be rerouted, in our case through an SSH tunnel.</p>
<pre>dns-sd -P &lt;Name&gt; &lt;Type&gt; &lt;Domain&gt; &lt;Port&gt; &lt;Host&gt; &lt;IP&gt; [&lt;TXT&gt;...]  (Proxy)</pre>
<p>Looking at the relevant line in our script we see how we match up the fields.</p>
<pre>dns-sd -P "Home iTunes" _daap._tcp local 3689 localhost 127.0.0.1 "Arbitrary text record" &amp;
  PID=$!</pre>
<p>The <tt>Name</tt> parameter will show up in iTunes as the name of the iTunes library we&#8217;re sharing. It doesn&#8217;t have to be the actual name of the library, so we&#8217;ll just use <tt>Home iTunes</tt> as a convenient placeholder.</p>
<p>Port 3689 is the port used by iTunes for sharing music.</p>
<p>The &#8220;Arbitrary text record&#8221; is just that—an arbitrary chunk of text that&#8217;s required for <tt>dns-sd</tt> to properly process the command.</p>
<p>The next line of our command, <tt>PID=$!</tt> saves the process id of the command we just executed into a variable <tt>$PID</tt> which we&#8217;ll need in order to neatly shutdown the proxy when our SSH tunnel closes.</p>
<h2>The SSH Tunnel</h2>
<p>We use SSH to connect to our home machine and forward connections from our remote machine&#8217;s port 3689 (in Starbucks) to our home machine&#8217;s port 3689, where you left iTunes up and running before you left this morning (right?).</p>
<pre>ssh -C -N -L 3689:localhost:3689 myusername@blahblahblah.dyndns.org</pre>
<p>The <tt>-C</tt> option turns on compression, which may not do much good for streaming MP3&#8217;s but a) it doesn&#8217;t hurt, and processors are much, much faster than your bandwidth, and b) don&#8217;t forget that you&#8217;ll be receiving a description of your home iTunes library, which is probably a rather sizable XML file.</p>
<p>The <tt>-N</tt> option says we&#8217;re not executing an SSH command but rather just sitting here port forwarding until the connection is broken (like when you leave Starbucks).</p>
<p>The <tt>-L</tt> &#8220;listen&#8221; option is covered extensively in tutorials all over the Internet, but in short it says, &#8220;listen for local connections to port 3689 and forward them to the other end and try connecting to <tt>localhost</tt> on its port 3689.&#8221;</p>
<p>The <tt>myusername@blahblahblah.dyndns.org</tt> portion will be dependent on how you connect to your home computer over SSH. Again, that&#8217;s covered in detail all over the Internet. If you&#8217;re remote computer is secured, you might consider using SSH keys to allow automatic login. Then you can put this script in <tt>~/Library/Scripts</tt> and launch it from the global scripts menu, if you have that activated.</p>
<h2>Cleanup</h2>
<p>When the SSH connection eventually closes, such as when you close your laptop or disconnect from the network, the <tt>ssh</tt> command will exit, and <tt>kill $PID</tt> will run which closes down the <tt>dns-sd</tt> proxy, so you won&#8217;t see it in iTunes anymore.</p>
<h2>Packaging</h2>
<p>I find it helpful to put this script in <tt>~/Library/Scripts</tt> so that I can execute from my global Scripts menu in my menubar, but it&#8217;s up to you how you want to launch it. Good luck.</p>
]]></content:encoded>
			<wfw:commentRss>https://blog.iharder.net/2009/09/28/itunes-stream-itunes-over-ssh/feed/</wfw:commentRss>
		<slash:comments>12</slash:comments>
		</item>
		<item>
		<title>ImageSnap: Capturing a Video Image with QTKit on Snow Leopard</title>
		<link>https://blog.iharder.net/2009/09/14/imagesnap-capturing-a-video-image-with-qtkit-on-snow-leopard/</link>
		<comments>https://blog.iharder.net/2009/09/14/imagesnap-capturing-a-video-image-with-qtkit-on-snow-leopard/#comments</comments>
		<pubDate>Mon, 14 Sep 2009 16:32:28 +0000</pubDate>
		<dc:creator>Robert Harder</dc:creator>
				<category><![CDATA[Utility]]></category>
		<category><![CDATA[capture]]></category>
		<category><![CDATA[isight]]></category>
		<category><![CDATA[objective-c]]></category>
		<category><![CDATA[qtkit]]></category>
		<category><![CDATA[quicktime]]></category>
		<category><![CDATA[video]]></category>

		<guid isPermaLink="false">http://blog.iharder.net/?p=230</guid>
		<description><![CDATA[ImageSnap is a Public Domain command-line tool that lets you capture still images from an iSight or other video source. You might remember Axel Bauer&#8217;s original isightcapture tool (that is no longer supported but still works on most systems). I wanted a similar tool with source available so I could make feature changes or at [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://iharder.sourceforge.net/current/macosx/imagesnap/">ImageSnap</a> is a Public Domain command-line tool that lets you capture still images from an iSight or other video source. You might remember Axel Bauer&#8217;s original <a href="http://www.intergalactic.de/pages/iSight.html">isightcapture</a> tool (that is no longer supported but still works on most systems). I wanted a similar tool with source available so I could make feature changes or at least recompile with Apple&#8217;s ever-changing architectures.</p>
<p>At some point Apple introduced QTKit, a new and oh-so-welcome abstraction bringing QuickTime programming into the 21st century. Nothing against die-hard ANSI C programming, but it fits awkwardly into what are otherwise clean Objective-C Cocoa programs.</p>
<p>Rather than provide a detailed tutorial about using QTKit (sorry if you wanted one), I&#8217;ll just point you to the <a href="http://iharder.sourceforge.net/current/macosx/imagesnap/">ImageSnap</a> code so you can take a look at a few useful things like starting a <tt>QTCaptureSession</tt>, capturing output with <tt>QTCaptureDecompressedVideoOutput</tt>, and saving an <tt>NSImage</tt> to disk.</p>
]]></content:encoded>
			<wfw:commentRss>https://blog.iharder.net/2009/09/14/imagesnap-capturing-a-video-image-with-qtkit-on-snow-leopard/feed/</wfw:commentRss>
		<slash:comments>13</slash:comments>
		</item>
		<item>
		<title>Deleting Flash Cookies Daily Using Snow Leopard&#8217;s Semi-Broken Periodic Scripts</title>
		<link>https://blog.iharder.net/2009/09/08/periodic-deleting-flash-cookies-daily-using-periodic-scripts/</link>
		<comments>https://blog.iharder.net/2009/09/08/periodic-deleting-flash-cookies-daily-using-periodic-scripts/#comments</comments>
		<pubDate>Wed, 09 Sep 2009 05:35:21 +0000</pubDate>
		<dc:creator>Robert Harder</dc:creator>
				<category><![CDATA[Utility]]></category>
		<category><![CDATA[cookies]]></category>
		<category><![CDATA[daily]]></category>
		<category><![CDATA[flash]]></category>
		<category><![CDATA[jobs]]></category>
		<category><![CDATA[maintenance]]></category>
		<category><![CDATA[monthly]]></category>
		<category><![CDATA[periodic]]></category>
		<category><![CDATA[weekly]]></category>

		<guid isPermaLink="false">http://blog.iharder.net/?p=223</guid>
		<description><![CDATA[I was trying to find a convenient way to delete Flash cookies every day and wanted to run two simple lines automatically:
rm -rf /Users/rob/Library/Preferences/Macromedia/Flash\ Player/\#SharedObjects
rm -rf /Users/rob/Library/Preferences/Macromedia/Flash\ Player/macromedia.com/support/flashplayer/sys
There are many ways to do this of course: launchd, cron, at, etc, but I thought it would be most elegant to tie into the Mac&#8217;s periodic maintenance [...]]]></description>
			<content:encoded><![CDATA[<p>I was trying to find a convenient way to delete Flash cookies every day and wanted to run two simple lines automatically:</p>
<pre>rm -rf /Users/rob/Library/Preferences/Macromedia/Flash\ Player/\#SharedObjects
rm -rf /Users/rob/Library/Preferences/Macromedia/Flash\ Player/macromedia.com/support/flashplayer/sys</pre>
<p>There are many ways to do this of course: launchd, cron, at, etc, but I thought it would be most elegant to tie into the Mac&#8217;s <tt>periodic</tt> maintenance scripts, and what a time I had debugging why I couldn&#8217;t get it to work.</p>
<p><span id="more-223"></span></p>
<p>The script at <tt>/etc/periodic/daily/999.local</tt> is supposed to execute all scripts residing in the <tt>$daily_local</tt> variable (set in <tt>/etc/defaults/periodic.conf</tt>) which is <tt>/etc/daily.local</tt> by default, but it doesn&#8217;t, and I had to change a line in <tt>999.local</tt> from this:</p>
<pre>for script in $daily_local</pre>
<p>to this:</p>
<pre>for script in $daily_local/*</pre>
<p>Script junkies can see that the original <tt>for</tt> loop will iterate over exactly one item: the string <tt>/etc/daily.local</tt>.</p>
<p>With the change, I created a directory at <tt>/etc/daily.local</tt> and put a simple script in it.</p>
<pre>$ sudo mkdir /etc/daily.local
$ sudo vi /etc/daily.local/delete_flash_cookies.sh
$ sudo chmod +x /etc/daily.local/delete_flash_cookies.sh</pre>
<p>The script looks like this:</p>
<pre>#!/bin/sh
echo ""
echo "Local Script: Removing Flash Cookies:"
rm -rf /Users/rob/Library/Preferences/Macromedia/Flash\ Player/\#SharedObjects
rm -rf /Users/rob/Library/Preferences/Macromedia/Flash\ Player/macromedia.com/support/flashplayer/sys</pre>
<h2>Summary</h2>
<p>Edit <tt>/etc/periodic/daily/999.local</tt> (and similar scripts for weekly and monthly) to read around line 19:</p>
<pre>for script in $daily_local/*</pre>
<p>Create a directory at <tt>/etc/daily.local</tt>.</p>
<p>Add executable scripts to the <tt>/etc/daily.local</tt> directory.</p>
<p>Enjoy.</p>
]]></content:encoded>
			<wfw:commentRss>https://blog.iharder.net/2009/09/08/periodic-deleting-flash-cookies-daily-using-periodic-scripts/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Two Factor Authentication in Snow Leopard SSH with Perfect Paper Passwords</title>
		<link>https://blog.iharder.net/2009/09/02/ppp-two-factor-authentication-in-snow-leopard-ssh-with-perfect-paper-passwords/</link>
		<comments>https://blog.iharder.net/2009/09/02/ppp-two-factor-authentication-in-snow-leopard-ssh-with-perfect-paper-passwords/#comments</comments>
		<pubDate>Wed, 02 Sep 2009 16:36:48 +0000</pubDate>
		<dc:creator>Robert Harder</dc:creator>
				<category><![CDATA[Utility]]></category>
		<category><![CDATA[authentication]]></category>
		<category><![CDATA[pam]]></category>
		<category><![CDATA[ppp]]></category>
		<category><![CDATA[security]]></category>
		<category><![CDATA[ssh]]></category>
		<category><![CDATA[two factor]]></category>

		<guid isPermaLink="false">http://blog.iharder.net/?p=190</guid>
		<description><![CDATA[If you&#8217;re nobody special like me, you probably &#8220;only&#8221; get a few thousand failed SSH logins to your computer each day. If you run a high profile system, it&#8217;s probably worse. Of course you have a good password for your account (right?), but should someone actually get your password, like with a keystroke logger on [...]]]></description>
			<content:encoded><![CDATA[<p>If you&#8217;re nobody special like me, you probably &#8220;only&#8221; get a few thousand failed SSH logins to your computer each day. If you run a high profile system, it&#8217;s probably worse. Of course you have a good password for your account (right?), but should someone actually get your password, like with a keystroke logger on the remote computer you&#8217;re using to log in, what protection do you have then?</p>
<p>Two factor authentication can increase your security by requiring more than just your password (one factor) to log in. I like using <a href="https://www.grc.com/ppp">Perfect Paper Passwords</a> from Gibson Research Corporation (<a href="http://grc.com/">GRC.com</a>). With this system after entering my username and password (even a wrong password) in an SSH session, I am then prompted for a four-digit passcode that I&#8217;ve previously printed out and stashed in my wallet. Each code is<strong> only used one time</strong>, and protects me even if someone manages to get my password. In the case where attackers are guessing my password, they cannot tell if the password or passcode was guessed incorrectly.</p>
<div id="attachment_193" class="wp-caption aligncenter" style="width: 356px"><a href="http://blog.iharder.net/wp-content/uploads/2009/09/samplepasscard.jpg"><img class="size-full wp-image-193" title="samplepasscard" src="http://blog.iharder.net/wp-content/uploads/2009/09/samplepasscard.jpg" alt="Sample PPP passcard (courtesy grc.com)" width="346" height="228" /></a><p class="wp-caption-text">Sample PPP passcard (courtesy grc.com)</p></div>
<p>There&#8217;s only a little bit of trickery involved to compile it for Mac OS X 10.6 Snow Leopard, and if you had it working before in Leopard, you&#8217;ll need to recompile the PAM module (I know, it&#8217;s like &#8220;ATM machine&#8221;) for 64-bit mode.</p>
<p><span id="more-190"></span></p>
<h2>How Perfect Paper Passwords (PPP) Works</h2>
<p>The principle behind PPP (<a href="https://www.grc.com/ppp">https://www.grc.com/ppp</a>) is simple:</p>
<ol>
<li>Pre-arrange for a list of random passcodes.</li>
<li>When a user authenticates, ask for the next passcode on the list.</li>
<li>If correct, grant access.</li>
<li>Remember where on the list of passcodes we left off.</li>
</ol>
<p>The beauty of this system is that even if someone has your password, they cannot gain access to your system unless they a) also have your one-time passcode list or b) happen to guess the one of 17 million passcodes that is next on the list. You could log in to your computer with a full keyboard logger from the most evil hacking organization you imagine, and they still would not be able to log in without your passcode list (guard your wallet!).</p>
<p>I use PPP in my SSH subsystem, so that this two-factor authentication is enforced on the only service I expose to the Internet. PPP plugs into SSH using the Pluggable Authentication Module (PAM) system.</p>
<h2>The PPP Pluggable Authentication Module (PAM) on Google Code</h2>
<p>The PAM system (<a href="http://en.wikipedia.org/wiki/Pluggable_Authentication_Modules">PAM article on Wikipedia</a>) does what its name suggests: it allows new authentication systems to be plugged in to a service. In this case we&#8217;ll use the <a href="http://code.google.com/p/ppp-pam/">ppp-pam project</a> on Google Code, an open source implementation of the PPP system developed by GRC.</p>
<p>The documentation for the project exists mostly in the form of comments made on the author&#8217;s original &#8220;<a href="http://code.google.com/p/ppp-pam/wiki/Building">Building</a>&#8221; page. Two comments of interest here are these two recommended patches:</p>
<ol>
<li>Don&#8217;t move to the next passcode until the proper one is entered.</li>
<li>Echo the passcodes as they are typed.</li>
</ol>
<p>The first patch avoids a denial of service attack. Imagine an attacker repeatedly attempting a log in and having the passcode pointer move on each failed attempt. After some number of failed attempts, the attacker will have moved the pointer past the end of the passcode list you printed for your wallet! This patch also changes the nature of how an opponent would use a brute force attack, but brute force is still the opponent&#8217;s best attack strategy (we like that).</p>
<p>The second patch is a usability improvement. Since the passcodes are only used once, there&#8217;s no harm in echoing the character back to the screen, and it makes it easier to type in the obscure passcodes.</p>
<p>You&#8217;re welcome to leave out either of these patches.</p>
<h2>Compiling for Snow Leopard</h2>
<p>We&#8217;ll walk through the steps to get this set up for your Mac. The instructions are nearly identical for all other platforms. At the end of this post is a link to a shell script that performs all these steps for you.</p>
<h3>Download</h3>
<p>Download the source code from <a href="http://code.google.com/p/ppp-pam/">http://code.google.com/p/ppp-pam/</a>. The latest version at the time of this writing is <a href="http://ppp-pam.googlecode.com/files/ppp-pam-0.2.tar.gz">ppp-pam-0.2.tar.gz</a>. Decompress in a convenient location and change to that directory:</p>
<pre>rob@mbp:~/Downloads $curl http://ppp-pam.googlecode.com/files/ppp-pam-0.2.tar.gz | tar xz
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100  597k  100  597k    0     0   443k      0  0:00:01  0:00:01 --:--:--  565k
rob@mbp:~/Downloads $cd ppp-pam
rob@mbp:~/Downloads/ppp-pam $</pre>
<h3>Patch Source Files</h3>
<p>To include the patch that stops the passcode pointer from moving after failed login attempts, copy the following code and paste it in the Terminal (while in the ppp-pam directory):</p>
<pre>patch -e ppp/ppp.c &lt;&lt;EOF
343,344c
        incrCurrPasscodeNum();
    }
.
341c
    if (strcmp(getPasscode(currPasscodeNum()), attempt) == 0){
.
EOF</pre>
<p>This will patch the first file. To patch the second file, fixing both the missing header file problem and the echo preference, copy and paste the following into the Terminal:</p>
<pre>patch -e ppp/pam_ppp.c &lt;&lt;EOF
90c
    message.msg_style = PAM_PROMPT_ECHO_ON;
.
47c
    #include "/Developer/SDKs/MacOSX10.5.sdk/usr/include/pam/_pam_macros.h"
.
EOF</pre>
<p>You might want to check that you do in fact have that file:</p>
<pre>$ locate _pam_macros.h
/Developer/SDKs/MacOSX10.4u.sdk/usr/include/pam/_pam_macros.h
/Developer/SDKs/MacOSX10.5.sdk/usr/include/pam/_pam_macros.h</pre>
<h3>Configure and Make</h3>
<p>Now move into the <tt>build</tt> directory and run <tt>../configure &amp;&amp; make</tt> (we&#8217;ll combine to save time and space here):</p>
<pre>rob@mbp:~/Downloads/ppp-pam $cd build
rob@mbp:~/Downloads/ppp-pam/build $../configure &amp;&amp; make
checking for a BSD-compatible install... /opt/local/bin/ginstall -c
checking whether build environment is sane...
...and so forth</pre>
<h3>Install</h3>
<p>If you get no errors, you can run <tt>sudo make install</tt>:</p>
<pre>rob@mbp:~/Downloads/ppp-pam/build $sudo make install
Password:
/bin/sh ../mkinstalldirs /usr/bin
  /bin/sh ./libtool --mode=install /opt/local/bin/ginstall -c pppauth /usr/bin/pppauth
/opt/local/bin/ginstall -c pppauth /usr/bin/pppauth
cp pam_ppp.so /usr/lib/pam/pam_ppp.so
make[1]: Nothing to be done for `install-data-am'.
rob@mbp:~/Downloads/ppp-pam/build $</pre>
<h3>Generate Cards</h3>
<p>Next we have to generate the pre-arranged passcode codes that our system will use. Will create a private key first, and then we&#8217;ll print out the first card to include in our wallet. The information is saved in the <tt>~/.pppauth/&gt; directory.</tt></p>
<p><tt></tt></p>
<p><tt></p>
<pre>rob@mbp:~/Downloads/ppp-pam/build $pppauth --key

@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
  A new sequence key has been generated and saved.  It is
  HIGHLY RECOMMENDED that you IMMEDIATELY print new pass-
  cards in order to access your account in the future.
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@

rob@mbp:~/Downloads/ppp-pam/build $pppauth --text --card 1
MBP.local                          [1]
      A    B    C    D    E    F    G
 1: 7oCA R4%W dxy5 aMNK r:pb Kcg9 Z%fh
 2: yFbs @2NZ @iUv UY:o eiRL Ea29 xMfc
 3: =CUS roUa x@Hf Fmg8 h2NT DF6o RXwS
 4: hHKx t3ia Tj3r +Jfz ?xwc usks zJjY
 5: 6GpN rFgx y3f5 kZoD XYGH v!yD 7Kx2
 6: d#y4 RVRi R66W !js6 6Wah qGSR D8TT
 7: zorX NuzH 3Wfq B@nk wm3v pgGS 2zfm
 8: ZFir ZpuJ d35S #9@G Wazd m#32 F#7s
 9: S@JM K%mt xJ3p NxD= S6By wWie e9:t
10: JEz: SKk? BBHb D!t! XyhK ZbJ# %jB3

rob@mbp:~/Downloads/ppp-pam/build $</pre>
<p>I'll leave it to your imagination as to how you want to print these and store them. You might consider some quality <a href="http://www.riteintherain.com/Categories.aspx?Category=3c0388c0-ff46-41c4-8cff-c75ea14ad32c">Rite-in-the-Rain</a> paper, so it doesn't dissolve in your wallet, or maybe you want to take a different tack and use super-dissolvable "<a href="http://www.google.com/search?client=safari&amp;rls=en&amp;q=spy+paper">spy paper</a>" that is easy to destroy.</p>
<h3>Activate PAM</h3>
<p>We'll take two steps to activate PAM and PPP with SSH. The first is to add a line to the <tt>/etc/pam.d/sshd</tt> file. If you put the line in a different position, your results will vary, but this worked for me.</p>
<pre># sshd: auth account password session
auth       optional       pam_krb5.so
auth       optional       pam_mount.so
auth       sufficient     pam_serialnumber.so serverinstall legacy
auth       required       pam_opendirectory.so
<b>auth       required       pam_ppp.so</b>
account    required       pam_nologin.so
account    required       pam_sacl.so sacl_service=ssh
account    required       pam_opendirectory.so
password   required       pam_opendirectory.so
session    required       pam_launchd.so
session    optional       pam_mount.so</pre>
<p>Now you need to edit the <tt>/etc/sshd_config</tt> file and uncomment the following lines. I'd give you a patch, but I've tweaked my sshd_config file, so the line numbers are not the same. Sorry.</p>
<pre>ChallengeResponseAuthentication yes
...
UsePAM yes</pre>
<h3>Optional chmod</h3>
<p>I'm not sure if it matters, but I changed the permissions on the <tt>~/.pppauth/</tt> folder and files within to remove group permissions:</p>
<pre>rob@mbp:~/Downloads/ppp-pam/build $chmod 700 ~/.pppauth
rob@mbp:~/Downloads/ppp-pam/build $chmod 600 ~/.pppauth/*</pre>
<h2>Download Script</h2>
<p>I have a script <a href="http://blog.iharder.net/wp-content/uploads/2009/09/pam_ppp_installer.sh">pam_ppp_installer.sh</a> that will download the code, patch it, and install it for you. You are welcome to simply run it or (I recommend) study it to see just what it's doing. Don't run strangers' scripts on your computer without inspecting them first! Still I promise I'm not trying to harm your computer.</p>
<p>If anyone knows how to use PAM to intercept logging in to a Mac via the <tt>loginwindow</tt> process, I'd love to hear about it.</p>
<h2>Further Security</h2>
<p>Explore the <tt>/etc/pam.d/</tt> directory to see where else you can use this two factor authentication. For instance you can add a line to the <tt>sudo</tt> file to require this extended security for the <tt>sudo</tt> command:</p>
<pre># sudo: auth account password session
auth       required       pam_opendirectory.so
<strong>auth       required       pam_ppp.so</strong>
account    required       pam_permit.so
password   required       pam_deny.so
session    required       pam_permit.so</pre>
<p>Other files in <tt>/etc/pam.d/</tt> :</p>
<pre>chkpasswd
cups
ftpd
login
login.term
other
passwd
samba
screensaver
sshd
su
sudo</pre>
<p>Enjoy!</p>
<p></tt></p>
]]></content:encoded>
			<wfw:commentRss>https://blog.iharder.net/2009/09/02/ppp-two-factor-authentication-in-snow-leopard-ssh-with-perfect-paper-passwords/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Java 6 and librxtxSerial.jnilib on Intel Mac OS X</title>
		<link>https://blog.iharder.net/2009/08/18/rxtx-java-6-and-librxtxserial-jnilib-on-intel-mac-os-x/</link>
		<comments>https://blog.iharder.net/2009/08/18/rxtx-java-6-and-librxtxserial-jnilib-on-intel-mac-os-x/#comments</comments>
		<pubDate>Tue, 18 Aug 2009 19:37:02 +0000</pubDate>
		<dc:creator>Robert Harder</dc:creator>
				<category><![CDATA[Utility]]></category>

		<guid isPermaLink="false">http://blog.iharder.net/?p=177</guid>
		<description><![CDATA[[UPDATE: This library works with Mac OS X 10.6 Snow Leopard.]

In order to access a serial port in Java, you need the RXTX libraries compiled for your specific hardware. Java uses the Java Native Interface (JNI) to bridge between your platform-independent application code and the hardware-specific serial port drivers.
If you&#8217;ve tried this on an Intel [...]]]></description>
			<content:encoded><![CDATA[<p><strong>[UPDATE: This library works with Mac OS X 10.6 Snow Leopard.]</strong></p>
<p><strong></strong><br />
In order to access a serial port in Java, you need the <a title="Java RXTX libraries home page" href="http://rxtx.org/">RXTX libraries</a> compiled for your specific hardware. Java uses the <a title="Java 1.5 JNI Guide" href="http://java.sun.com/j2se/1.5.0/docs/guide/jni/spec/jniTOC.html">Java Native Interface</a> (JNI) to bridge between your platform-independent application code and the hardware-specific serial port drivers.</p>
<p>If you&#8217;ve tried this on an Intel Mac (perhaps to play with a <a title="Sun SPOT World Home Page" href="http://www.sunspotworld.com/">Sun SPOT</a>), you may be disappointed, since software keeps shipping from people that is either PowerPC only or isn&#8217;t compiled for 64-bit Intel. You&#8217;ve probably seen the <tt>UnsatisfiedLinkError</tt> message. Here you&#8217;ll find a <a href="http://blog.iharder.net/wp-content/uploads/2009/08/librxtxSerial.jnilib"><tt>librxtxSerial.jnilib</tt></a> file with support for both 32- and 64-bit PPC and Intel architectures, fitting the bill perfectly for both Java 5 and Java 6 on the Mac.</p>
<pre>$ file librxtxSerial.jnilib
librxtxSerial.jnilib: Mach-O universal binary with 4 architectures
librxtxSerial.jnilib (for architecture x86_64):	Mach-O 64-bit bundle x86_64
librxtxSerial.jnilib (for architecture i386):	Mach-O bundle i386
librxtxSerial.jnilib (for architecture ppc7400): Mach-O bundle ppc
librxtxSerial.jnilib (for architecture ppc64):	Mach-O 64-bit bundle ppc64</pre>
<p><span id="more-177"></span></p>
<h2>The Need for the RXTX Library</h2>
<p>Java&#8217;s &#8220;write once, run many&#8221; theory of operation works because the Java Virtual Machine (JVM), which must be made for each platform, abstracts away the underlying hardware. As a programmer you can draw circles, label buttons, and even play multimedia without specific knowledge of the host operating system.</p>
<p>A computer&#8217;s serial ports can be abstracted away in the same way, but the standard JVM does not provide a mechanism for this. Sun decided (reasonably, though regrettably, I think) that the serial port would not be a required component for a JVM, and so there are no built-in classes for working with serial ports.</p>
<p>Sun experimented, for a period of time, with a <a title="Defunct Java Communications API" href="http://java.sun.com/products/javacomm/">Java Communications API</a> that would be a sort of plugin for working with things like serial ports (and parallel ports!), but the project and its <tt>javax.comm</tt> package died.</p>
<p>Thanks to the team at <a title="RXTX Library home page" href="http://rxtx.org/">RXTX.org</a>, we now have a <tt>gnu.io</tt> package modeled after Sun&#8217;s <tt>javax.comm</tt> package that is maintained and works. Thanks!</p>
<h2>Why Doesn&#8217;t It Work for You?</h2>
<p>If you&#8217;re reading this, it might be because you <strong>can&#8217;t</strong> get it to work on your Mac. Probably you have an Intel Mac and are using Java 6 or later which requires a 64-bit Intel processor. Perhaps you&#8217;ve seen error messages that say thinks like <tt>UnsatisfiedLinkError</tt> and so forth.</p>
<p>Software talking to the serial port must communicate with the host operating system, and so the underlying native library must be compiled per-platform. Presumably your librxtxSerial.jnilib file is not compiled for your platform. Here&#8217;s how to find out. Open the Terminal, navigate to the folder with a <tt>librxtxSerial.jnilib</tt> file, and use the <tt>file</tt> command. You&#8217;ll probably see this:</p>
<pre>$ cd /Users/rob/SunSPOT/sdk/lib
$ file librxtxSerial.jnilib
librxtxSerial.jnilib: Mach-O universal binary with 2 architectures
librxtxSerial.jnilib (for architecture i386):	Mach-O bundle i386
librxtxSerial.jnilib (for architecture ppc7400): Mach-O bundle ppc</pre>
<p>If you&#8217;re running Java 5 (which comes in 32- and 64-bit flavors on the Mac) you&#8217;re OK, but if you&#8217;re running Java 6, which is 64-bit Intel only, it won&#8217;t work.</p>
<h2>A Library with the Right Architectures</h2>
<p>No problem; all you have to do is re-compile RXTX from sources for your platform, right? I wish. I can&#8217;t even remember all the contortions I went through before I finally got it compiled.</p>
<p>You&#8217;re welcome to follow the various instructions online for compiling it yourself, but it gave me a lot of grief, so I&#8217;m placing a copy on this site (if you trust me not to insert nefarious code). I finally had to patch SerialImpl.c and SerialImpl.h (manually) based on the <a href="http://mailman.qbang.org/pipermail/rxtx/2007-June/3368151.html">patch instructions here</a> and <a href="http://raymesk.blogspot.com/2008/09/java-6-on-mac-os-x-with-sunspots.html">blog posting here</a>.</p>
<p>At the end of the day, we have a <a href="http://blog.iharder.net/wp-content/uploads/2009/08/librxtxSerial.jnilib"><tt>librxtxSerial.jnilib</tt></a> file that has 32- and 64-bit PPC and Intel architectures.</p>
<p>Find all instances of <tt>librxtxSerial.jnilib</tt> on your Mac and replace them with the one you downloaded from here (or compiled yourself). Try the command <tt>locate librxtxSerial.jnilib</tt> in the Terminal to find extra copies hidden in various Java applications.</p>
]]></content:encoded>
			<wfw:commentRss>https://blog.iharder.net/2009/08/18/rxtx-java-6-and-librxtxserial-jnilib-on-intel-mac-os-x/feed/</wfw:commentRss>
		<slash:comments>13</slash:comments>
		</item>
	</channel>
</rss>
