<?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>Andrew M. Whalen &#187; unix</title>
	<atom:link href="http://amwhalen.com/archives/tag/unix/feed" rel="self" type="application/rss+xml" />
	<link>http://amwhalen.com</link>
	<description>Thoughts on the web, programming and other nerdery by Andrew M. Whalen.</description>
	<lastBuildDate>Thu, 29 Dec 2011 14:13:12 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Editing Songbird Add-ons</title>
		<link>http://amwhalen.com/archives/2009/04/08/editing-songbird-add-ons</link>
		<comments>http://amwhalen.com/archives/2009/04/08/editing-songbird-add-ons#comments</comments>
		<pubDate>Wed, 08 Apr 2009 19:35:58 +0000</pubDate>
		<dc:creator>Andrew</dc:creator>
				<category><![CDATA[uncategorized]]></category>
		<category><![CDATA[add-on]]></category>
		<category><![CDATA[hacks]]></category>
		<category><![CDATA[How-To]]></category>
		<category><![CDATA[programming]]></category>
		<category><![CDATA[songbird]]></category>
		<category><![CDATA[tech]]></category>
		<category><![CDATA[unix]]></category>

		<guid isPermaLink="false">http://amwhalen.com/blog/?p=594</guid>
		<description><![CDATA[The <a href="http://addons.songbirdnest.com/addon/1301">Notify Me</a> add-on allows you to get <a href="http://growl.info/">Growl</a> notifications when the song changes. Unfortunately, the add-on hadn't been updated in 4 months. Here's how I made it work with the latest version of Songbird.]]></description>
			<content:encoded><![CDATA[<p>If you haven&#8217;t seen it yet, <a href="http://getsongbird.com/">Songbird</a> is a Mozilla-based open-source music player. I&#8217;ve been using for some time now and it&#8217;s amazing.</p>
<p>Just like Firefox, it has a system of add-ons. The <a href="http://addons.songbirdnest.com/addon/1301">Notify Me</a> add-on allows you to get <a href="http://growl.info/">Growl</a> notifications when the song changes. Unfortunately, the add-on hasn&#8217;t been updated in 4 months. Here&#8217;s how I made it work with the latest version of Songbird.</p>
<p>Download the add-on from the <a href="http://addons.songbirdnest.com">Songbird Add-ons</a> page. The .xpi file is just a zip file, and we have to unzip it to modify the contents. In Terminal, change to the directory where the .xpi file is (mine was on my desktop). Make a temporary folder to put the add-on files into when they&#8217;re unzipped. Put the .xpi into that folder and unzip it, then move the .xpi file out of there. Here&#8217;s the process in Terminal:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #7a0874; font-weight: bold;">cd</span> ~<span style="color: #000000; font-weight: bold;">/</span>Desktop
<span style="color: #c20cb9; font-weight: bold;">mkdir</span> notifyme
<span style="color: #c20cb9; font-weight: bold;">mv</span> notifyme-osx-1.1.0.xpi notifyme<span style="color: #000000; font-weight: bold;">/</span>
<span style="color: #7a0874; font-weight: bold;">cd</span> notifyme
<span style="color: #c20cb9; font-weight: bold;">unzip</span> notifyme-osx-1.1.0.xpi
<span style="color: #c20cb9; font-weight: bold;">mv</span> notifyme-osx-1.1.0.xpi ..<span style="color: #000000; font-weight: bold;">/</span></pre></div></div>

<p>Once unzipped you&#8217;ll find a file named <code>install.rdf</code>. Open that up in a plain-text editor (Not MS Word) and change the <code>maxVersion</code> variable to whatever version you want. I&#8217;m changing it from 1.1.0rc1 to 1.2.0a.</p>

<div class="wp_syntax"><div class="code"><pre class="xml" style="font-family:monospace;"><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;em:maxVersion<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>1.1.0rc1<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/em:maxVersion<span style="color: #000000; font-weight: bold;">&gt;</span></span></span></pre></div></div>

<p>Save <code>install.rdf</code> and zip the add-on back up (notice I changed the file name):</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">zip</span> <span style="color: #660033;">-r</span> ..<span style="color: #000000; font-weight: bold;">/</span>notifyme-osx-1.2.0a-unofficial.xpi .</pre></div></div>

<p>You can then go to Tools -> Add-ons&#8230; in Songbird, click Install&#8230; and find the .xpi file you just zipped. It shouldn&#8217;t warn you about the version being incompatible anymore.</p>
<p>Although I just detailed how to do this and it worked for this add-on, I don&#8217;t recommended it. The max version is there for a reason. There may have been changes to Songbird that make an add-on incompatible with a higher version. Don&#8217;t blame me if you try this and your computer catches fire.</p>
<p><strong>Here&#8217;s the finished product:</strong> <a href="http://amwhalen.com/blog/wp-content/uploads/2009/04/notifyme-osx-120a-unofficial.xpi" onClick="javascript:pageTracker._trackPageview('/downloads/notifyme-osx-120a-unofficial.xpi');" class="download">notifyme-osx-120a-unofficial.xpi</a></p>
]]></content:encoded>
			<wfw:commentRss>http://amwhalen.com/archives/2009/04/08/editing-songbird-add-ons/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Y2K38: The New Y2K</title>
		<link>http://amwhalen.com/archives/2008/01/16/y2k38-the-new-y2k</link>
		<comments>http://amwhalen.com/archives/2008/01/16/y2k38-the-new-y2k#comments</comments>
		<pubDate>Wed, 16 Jan 2008 13:02:59 +0000</pubDate>
		<dc:creator>Andrew</dc:creator>
				<category><![CDATA[uncategorized]]></category>
		<category><![CDATA[computers]]></category>
		<category><![CDATA[tech]]></category>
		<category><![CDATA[timestamp]]></category>
		<category><![CDATA[unix]]></category>
		<category><![CDATA[y2k]]></category>
		<category><![CDATA[y2k38]]></category>

		<guid isPermaLink="false">http://amwhalen.com/blog/archives/2008/01/16/y2k38-the-new-y2k/</guid>
		<description><![CDATA[Remember the Y2K scare? Everyone was afraid the world would end when clocks changed over to January 1st, 2000. Why? Because many antiquated computer systems were never programmed with knowledge of the year 2000. The values for years on these systems were stored as only two numbers. So 76 meant 1976, and 00 meant 1900. [...]]]></description>
			<content:encoded><![CDATA[<p>Remember the Y2K scare? Everyone was afraid the world would end when clocks changed over to January 1st, 2000. Why? Because many antiquated computer systems were never programmed with knowledge of the year 2000. The values for years on these systems were stored as only two numbers. So 76 meant 1976, and 00 meant 1900. So what would happen when the year changed from 1999 to 2000? The computer thought it was 1900 again. There was a wraparound problem. Luckily, the world didn&#8217;t end, and no major catastrophes resulted.</p>
<p>Fast forward 38 years to 2038, when a similar problem will occur. Unix timestamps are used to keep track of time for many systems. A Unix timestamp is the number of seconds since the Unix epoch, which was January 1st, 1970 at 12:00am. Unfortunately, these Unix timestamps have been stored using only 32 bits as <em>signed</em> integers. The maximum signed integer which can be represented in 32 bits is 2,147,483,647 seconds. January 1st, 1970 12:00am plus 2,147,483,647 seconds is January 19, 2038 3:14:07am. When it turns to 3:14:08am on that day, the Unix timestamp will wraparound to -2,147,483,648, so those seconds would be <em>subtracted</em> from 1970, giving you a date of about 8pm on December 13, 1901.</p>
<p>There have already been reports of problems from this. Many programs which calculate dates into the future more than 30 years, and use Unix timestamps, are likely to fail or get very confused at the least. There doesn&#8217;t appear to be any easy solution to this problem. Changing from 32 to 64 bits would allow us to calculate time in seconds for another 290 billion years. Unfortunately, the standard 32 bit timestamp is used in so much software and hardware that it&#8217;s impossible to update everything that relies on it. We&#8217;ll see what happens in 2038&#8230; or should I say 1901?</p>
]]></content:encoded>
			<wfw:commentRss>http://amwhalen.com/archives/2008/01/16/y2k38-the-new-y2k/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Time Lapse Sunrise</title>
		<link>http://amwhalen.com/archives/2007/04/27/time-lapse-sunrise</link>
		<comments>http://amwhalen.com/archives/2007/04/27/time-lapse-sunrise#comments</comments>
		<pubDate>Fri, 27 Apr 2007 14:14:45 +0000</pubDate>
		<dc:creator>Andrew</dc:creator>
				<category><![CDATA[uncategorized]]></category>
		<category><![CDATA[bash]]></category>
		<category><![CDATA[gphoto]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[photography]]></category>
		<category><![CDATA[programming]]></category>
		<category><![CDATA[timelapse]]></category>
		<category><![CDATA[unix]]></category>
		<category><![CDATA[video]]></category>
		<category><![CDATA[youtube]]></category>

		<guid isPermaLink="false">http://amwhalen.com/blog/archives/2007/04/27/time-lapse-sunrise/</guid>
		<description><![CDATA[Way back in January I was playing around with this great software called gphoto. It allows you to attach your digital camera to your computer and take photos. This has many uses, one of which is to create time lapse movies by writing a script to take pictures every so often. So that&#8217;s what I [...]]]></description>
			<content:encoded><![CDATA[<div class="video"><object width="425" height="350"><param name="movie" value="http://www.youtube.com/v/cT7pZrv1vLg"></param> <embed src="http://www.youtube.com/v/cT7pZrv1vLg" type="application/x-shockwave-flash" width="425" height="350"></embed></object></div>
<p>Way back in January I was playing around with this great software called <a href="http://www.gphoto.org/">gphoto</a>. It allows you to attach your digital camera to your computer and take photos. This has many uses, one of which is to create time lapse movies by writing a script to take pictures every so often. So that&#8217;s what I did, one January night. I wrote a script to take a picture every 15 seconds or so, and set it to run from 6am to 6pm. Unfortunately, my battery died only an hour or two in, so I came out with an 11 second video of a partial time lapse sunrise.</p>
]]></content:encoded>
			<wfw:commentRss>http://amwhalen.com/archives/2007/04/27/time-lapse-sunrise/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Changing File Extensions</title>
		<link>http://amwhalen.com/archives/2007/04/20/changing-file-extensions</link>
		<comments>http://amwhalen.com/archives/2007/04/20/changing-file-extensions#comments</comments>
		<pubDate>Fri, 20 Apr 2007 15:28:52 +0000</pubDate>
		<dc:creator>Andrew</dc:creator>
				<category><![CDATA[uncategorized]]></category>
		<category><![CDATA[bash]]></category>
		<category><![CDATA[How-To]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[programming]]></category>
		<category><![CDATA[tech]]></category>
		<category><![CDATA[unix]]></category>

		<guid isPermaLink="false">http://amwhalen.com/blog/archives/2007/04/20/changing-file-extensions/</guid>
		<description><![CDATA[Today at work I needed to change a whole directory (with many sub-directories and sub-sub-directories and&#8230; etc.) of .php files to the .html file extension. Since the files were on a Unix server, I wrote a quick Bash shell script to take care of this for me. #!/bin/bash &#160; function change_extension_recursive &#123; &#160; #change all [...]]]></description>
			<content:encoded><![CDATA[<p>Today at work I needed to change a whole directory (with many sub-directories and sub-sub-directories and&#8230; etc.) of .php files to the .html file extension. Since the files were on a Unix server, I wrote a quick Bash shell script to take care of this for me.</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #666666; font-style: italic;">#!/bin/bash</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">function</span> change_extension_recursive <span style="color: #7a0874; font-weight: bold;">&#123;</span>
&nbsp;
	<span style="color: #666666; font-style: italic;">#change all .php to .html</span>
	<span style="color: #000000; font-weight: bold;">for</span> f <span style="color: #000000; font-weight: bold;">in</span> <span style="color: #007800;">$1</span><span style="color: #000000; font-weight: bold;">/*</span>.php; <span style="color: #000000; font-weight: bold;">do</span>
		<span style="color: #c20cb9; font-weight: bold;">mv</span> <span style="color: #007800;">$f</span> <span style="color: #007800;">$1</span><span style="color: #000000; font-weight: bold;">/`</span><span style="color: #c20cb9; font-weight: bold;">basename</span> <span style="color: #007800;">$f</span> .php<span style="color: #000000; font-weight: bold;">`</span>.html;
		<span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #007800;">$f</span>;
	<span style="color: #000000; font-weight: bold;">done</span>;
&nbsp;
	<span style="color: #666666; font-style: italic;"># recurse on any directories</span>
	<span style="color: #000000; font-weight: bold;">for</span> d <span style="color: #000000; font-weight: bold;">in</span> <span style="color: #007800;">$1</span><span style="color: #000000; font-weight: bold;">/*</span>; <span style="color: #000000; font-weight: bold;">do</span>
&nbsp;
		<span style="color: #000000; font-weight: bold;">if</span> <span style="color: #7a0874; font-weight: bold;">test</span> <span style="color: #660033;">-d</span> <span style="color: #007800;">$d</span>; <span style="color: #000000; font-weight: bold;">then</span>
			change_extension_recursive <span style="color: #007800;">$d</span>;
		<span style="color: #000000; font-weight: bold;">fi</span>;
&nbsp;
	<span style="color: #000000; font-weight: bold;">done</span>;
&nbsp;
<span style="color: #7a0874; font-weight: bold;">&#125;</span>
&nbsp;
<span style="color: #007800;">dir</span>=<span style="color: #000000; font-weight: bold;">`</span><span style="color: #7a0874; font-weight: bold;">pwd</span><span style="color: #000000; font-weight: bold;">`</span>;
&nbsp;
change_extension_recursive <span style="color: #007800;">$dir</span>;</pre></div></div>

]]></content:encoded>
			<wfw:commentRss>http://amwhalen.com/archives/2007/04/20/changing-file-extensions/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

