<?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>*Coder Blog</title>
	<atom:link href="http://www.starcoder.com/wordpress/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.starcoder.com/wordpress</link>
	<description>An Intersection of Life, Technology, and Meteorology</description>
	<lastBuildDate>Tue, 14 Feb 2012 22:34:44 +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>Apple&#8217;s Mythical iTV</title>
		<link>http://www.starcoder.com/wordpress/2012/02/apples-mythical-itv/</link>
		<comments>http://www.starcoder.com/wordpress/2012/02/apples-mythical-itv/#comments</comments>
		<pubDate>Tue, 14 Feb 2012 22:29:21 +0000</pubDate>
		<dc:creator>mike</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://www.starcoder.com/wordpress/?p=313</guid>
		<description><![CDATA[I don&#8217;t know if Apple is planning to release an &#8220;iTV&#8221; at some point, but this is the wrong approach competitors should be taking.  According to Chris Moseley, AV product manager at Samsung:
We&#8217;ve not seen what they&#8217;ve done but what we can say is that they don&#8217;t have 10,000 people in R&#038;D in the [...]]]></description>
			<content:encoded><![CDATA[<p>I don&#8217;t know if Apple is planning to release an &#8220;iTV&#8221; at some point, but this is the wrong approach competitors should be taking.  According to <a href="http://www.pocket-lint.com/news/44396/apple-tv-no-concern-samsung">Chris Moseley, AV product manager at Samsung</a>:</p>
<blockquote><p>We&#8217;ve not seen what they&#8217;ve done but what we can say is that they don&#8217;t have 10,000 people in R&#038;D in the vision category.</p>
<p>They don&#8217;t have the best scaling engine in the world and they don&#8217;t have world renowned picture quality that has been awarded more than anyone else.</p>
<p>TVs are ultimately about picture quality. Ultimately. How smart they are&#8230;great, but let&#8217;s face it that&#8217;s a secondary consideration. The ultimate is about picture quality and there is no way that anyone, new or old, can come along this year or next year and beat us on picture quality.</p>
</blockquote>
<p>He makes a good point: TVs are about picture quality.  The thing is, I&#8217;ve never seen another brand of computer monitor (perhaps high-end NEC displays, but those are on a different pricing level) hold a candle to the picture quality you get from any of Apple&#8217;s modern LCDs.  Picture quality just isn&#8217;t going to be an issue if Apple ever ships an iTV.</p>
<p>The quote above reminded me a lot of a <a href="http://www.brighthand.com/default.asp?newsID=12631">statement Palm&#8217;s then-CEO Ed Colligan made back in 2006</a> about the rumored iPhone:</p>
<blockquote><p>&#8220;We&#8217;ve learned and struggled for a few years here figuring out how to make a decent phone. PC guys are not going to just figure this out. They&#8217;re not going to just walk in.</p>
</blockquote>
<p>We all know how that turned out&#8230;</p>
]]></content:encoded>
			<wfw:commentRss>http://www.starcoder.com/wordpress/2012/02/apples-mythical-itv/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Apps for Water</title>
		<link>http://www.starcoder.com/wordpress/2011/12/apps-for-water/</link>
		<comments>http://www.starcoder.com/wordpress/2011/12/apps-for-water/#comments</comments>
		<pubDate>Wed, 07 Dec 2011 02:56:21 +0000</pubDate>
		<dc:creator>mike</dc:creator>
				<category><![CDATA[Apps for Water]]></category>

		<guid isPermaLink="false">http://www.starcoder.com/wordpress/?p=311</guid>
		<description><![CDATA[It&#8217;s important to me that Gaucho Software, as a company, gives back to society as a whole.  This manifests itself in a variety of ways, from providing the app XRG for free (and open-sourcing the code), to donating money to different charitable organizations.  With the holiday season upon us, I wanted to take [...]]]></description>
			<content:encoded><![CDATA[<p>It&#8217;s important to me that <a href="http://www.gauchosoft.com/">Gaucho Software</a>, as a company, gives back to society as a whole.  This manifests itself in a variety of ways, from providing the app <a href="http://www.gauchosoft.com/xrg/">XRG</a> for free (and open-sourcing the code), to donating money to different charitable organizations.  With the holiday season upon us, I wanted to take this opportunity to give again, but in a bigger way than ever before.  So today I&#8217;m announcing a new campaign called Apps for Water.</p>
<p>Apps for Water gives app developers a chance to donate one day of their sales to a very worthy cause: providing clean water for developing nations.  It seems like a simple thing, turn on a faucet and clean water pours out.  Unfortunately, there are almost 1 billion people in the world who don&#8217;t have a safe, clean water source.  This isn&#8217;t just a minor inconvenience.  It turns out, the lack of safe water is one of the leading causes of death worldwide.  Over 2,000,000 people die each year from diseases stemming from the lack of clean water.</p>
<p>This is where organizations like <a href="http://www.charitywater.org/">charity: water</a> come in.  The goal of these organizations is to provide safe water for communities in developing nations.  Believe it or not, it only costs about $20 to give a new person access to clean water.  And because of a collection of private donors that pay for the day-to-day operations of charity: water, every dime that is donated by 3rd parties to their organization goes directly toward water projects.</p>
<p>So here&#8217;s the deal.  Gaucho Software will be donating 100% of the proceeds from app sales on December 20th, 2011 to <a href="http://www.charitywater.org/">charity: water</a>.  Help fund a water project, get an app for free.  Furthermore, as an additional incentive to donate, <a href="http://GetSeasonality.com/core/">Seasonality Core</a> and <a href="http://GetSeasonality.com/go/">Seasonality Go</a> will be on sale that day for 20% off.</p>
<p><b>A call to app developers&#8230;</b></p>
<p>But the hope is that my offer will be just the tip of the iceberg.  I would like to formally invite all other developers of Mac and iOS apps to participate in this campaign.  We&#8217;re setting up a new website<sup>1</sup> at <a href="http://AppsForWater.com/">AppsForWater.com</a> to list all the apps that will be giving discounts and donating their proceeds that day to charity: water.  Then we&#8217;ll get the word out, and tell everyone about how they can give clean water to communities in need.</p>
</p>
<p>If you are a developer who is interested in participating, please <a href="mailto:signup2011@appsforwater.com">send me an email</a> or <a href="http://twitter.com/mikepj/">ping me on Twitter</a>.  I will do my best to answer any questions and will let you know what materials I need to have your apps listed.</p>
<p>It&#8217;s been shown time and time again that the Mac and iOS community can make a big difference in the world.  Please help us do it again.</p>
<p><br/></p>
<p><sup>1</sup> I want to send a special thanks to Fran&ccedil;ois Joseph de Kermadec and the rest of the team at <a href="http://tfk.fr/">Trumper, Forsyth &#038; Kline</a> for so generously donating their time to develop the website for this project.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.starcoder.com/wordpress/2011/12/apps-for-water/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Using IOKit to Detect Graphics Hardware</title>
		<link>http://www.starcoder.com/wordpress/2011/10/using-iokit-to-detect-graphics-hardware/</link>
		<comments>http://www.starcoder.com/wordpress/2011/10/using-iokit-to-detect-graphics-hardware/#comments</comments>
		<pubDate>Fri, 21 Oct 2011 19:56:31 +0000</pubDate>
		<dc:creator>mike</dc:creator>
				<category><![CDATA[Cocoa]]></category>
		<category><![CDATA[Coding]]></category>
		<category><![CDATA[Gaucho Software]]></category>
		<category><![CDATA[OpenGL]]></category>
		<category><![CDATA[Seasonality]]></category>
		<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://www.starcoder.com/wordpress/?p=302</guid>
		<description><![CDATA[After Seasonality Core 2 was released a couple of weeks ago, I received email from a few users reporting problems they were experiencing with the app.  The common thread in all the problems was having a single graphics card (in this case, it was the nVidia 7300).  When the application launched, there would [...]]]></description>
			<content:encoded><![CDATA[<p>After Seasonality Core 2 was released a couple of weeks ago, I received email from a few users reporting problems they were experiencing with the app.  The common thread in all the problems was having a single graphics card (in this case, it was the nVidia 7300).  When the application launched, there would be several graphics artifacts in the map view (which is now written in OpenGL), and even outside the Seasonality Core window.  It really sounded like I was trying to use OpenGL to do something that wasn&#8217;t compatible with the nVidia 7300.</p>
<p>I&#8217;m still in the process of working around the problem, but I wanted to make sure that any work-around would not affect the other 99% of my users who don&#8217;t have this graphics card.  So I set out to try and find a method of detecting which graphics cards are installed in a user&#8217;s Mac.  You can use the system_profiler terminal command to do this:</p>
<p><code>system_profiler SPDisplaysDataType</code></p>
<p>But running an external process from within the app is slow, and it can be difficult to parse the data reliably.  Plus, if the system_profiler command goes away, the application code won&#8217;t work.  I continued looking…</p>
<p>Eventually, I found that I might be able to get this information from IOKit.  If you run the command ioreg -l, you&#8217;ll get a lengthy tree of hardware present in your Mac.  I&#8217;ve used IOKit in my code before, so I figured I would try to do that again.  Here is the solution I came up with:</p>
<pre>
// Check the PCI devices for video cards.
CFMutableDictionaryRef match_dictionary = IOServiceMatching("IOPCIDevice");

// Create a iterator to go through the found devices.
io_iterator_t entry_iterator;
if (IOServiceGetMatchingServices(kIOMasterPortDefault,
                                 match_dictionary,
                                 &#038;entry_iterator) == kIOReturnSuccess)
{
  // Actually iterate through the found devices.
  io_registry_entry_t serviceObject;
  while ((serviceObject = IOIteratorNext(entry_iterator))) {
    // Put this services object into a dictionary object.
    CFMutableDictionaryRef serviceDictionary;
    if (IORegistryEntryCreateCFProperties(serviceObject,
                                          &#038;serviceDictionary,
                                          kCFAllocatorDefault,
                                          kNilOptions) != kIOReturnSuccess)
    {
      // Failed to create a service dictionary, release and go on.
      IOObjectRelease(serviceObject);
      continue;
    }

    // If this is a GPU listing, it will have a "model" key
    // that points to a CFDataRef.
    const void *model = CFDictionaryGetValue(serviceDictionary, @"model");
    if (model != nil) {
      if (CFGetTypeID(model) == CFDataGetTypeID()) {
        // Create a string from the CFDataRef.
        NSString *s = [[NSString alloc] initWithData:(NSData *)model
                                            encoding:NSASCIIStringEncoding];
        NSLog(@"Found GPU: %@", s);
        [s release];
      }
    }

    // Release the dictionary created by IORegistryEntryCreateCFProperties.
    CFRelease(serviceDictionary);
  }
}
</pre>
]]></content:encoded>
			<wfw:commentRss>http://www.starcoder.com/wordpress/2011/10/using-iokit-to-detect-graphics-hardware/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>File Vault 2 on the 2011 MacBook Air</title>
		<link>http://www.starcoder.com/wordpress/2011/10/file-vault-2-on-the-2011-macbook-air/</link>
		<comments>http://www.starcoder.com/wordpress/2011/10/file-vault-2-on-the-2011-macbook-air/#comments</comments>
		<pubDate>Thu, 20 Oct 2011 20:56:54 +0000</pubDate>
		<dc:creator>mike</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://www.starcoder.com/wordpress/?p=280</guid>
		<description><![CDATA[I recently upgraded to a 2011 MacBook Air.  With the new Sandy Bridge processors having encryption routines built-in, I decided to try out File Vault 2 on Lion to see what kind of performance impact it would have while accessing the disk.  Here&#8217;s the configuration of my MacBook Air for reference:
11&#8243; MacBook Air [...]]]></description>
			<content:encoded><![CDATA[<p>I recently upgraded to a 2011 MacBook Air.  With the new Sandy Bridge processors having encryption routines built-in, I decided to try out File Vault 2 on Lion to see what kind of performance impact it would have while accessing the disk.  Here&#8217;s the configuration of my MacBook Air for reference:</p>
<p>11&#8243; MacBook Air (Summer 2011)<br />
1.8Ghz Core i7<br />
256GB SSD (Samsung model)</p>
<p>First the baseline.  Before enabling File Vault, I did a quick test of writing a 10GB file and then reading it back.</p>
<p><code>Blade:~ mike$ time dd if=/dev/zero of=test bs=1073741824 count=10<br />
10+0 records in<br />
10+0 records out<br />
10737418240 bytes transferred in 41.938686 secs (256026577 bytes/sec)<br />
real	0m42.021s<br />
user	0m0.005s<br />
sys	0m6.827s<br />
Blade:~ mike$ time dd if=test of=/dev/null bs=1073741824 count=10<br />
10+0 records in<br />
10+0 records out<br />
10737418240 bytes transferred in 37.969485 secs (282790726 bytes/sec)<br />
real	0m38.055s<br />
user	0m0.005s<br />
sys	0m5.069s</code></p>
<p>After enabling File Vault, the Mac restarts and it took about 50 minutes to finish the initial encryption.  While the encoding was taking place I was seeing roughly 95-120MB/sec transfer rates (190-240MB/sec combined read/write bandwidth), and it averaged about 45-50% CPU usage (% of a single core) during the encoding process.</p>
<p>So what how was performance with encryption enabled?  Check this out…</p>
<p><code>Blade:~ mike$ time dd if=/dev/zero of=test bs=1073741824 count=10<br />
10+0 records in<br />
10+0 records out<br />
10737418240 bytes transferred in 45.342448 secs (236807202 bytes/sec)</p>
<p>real	0m45.418s<br />
user	0m0.001s<br />
sys	0m7.721s<br />
Blade:~ mike$ time dd if=test of=/dev/null bs=1073741824 count=10<br />
10+0 records in<br />
10+0 records out<br />
10737418240 bytes transferred in 40.052954 secs (268080558 bytes/sec)</p>
<p>real	0m40.133s<br />
user	0m0.001s<br />
sys	0m4.032s</code></p>
<p>So read operations take a 5.5% hit, and write operations are 8.1% slower with File Vault 2 enabled.  That&#8217;s a performance penalty I can live with for the extra peace of mind of my data being secure while traveling.  Even better is the amount of CPU used was about the same whether encryption was enabled or disabled.</p>
<p>Performance summary:</p>
<table width="100%">
<tr>
<th>File Vault</th>
<th colspan="2" align="center">Read</th>
<th colspan="2" align="center">Write</th>
</tr>
<tr>
<td></td>
<th align="center">Bandwidth</th>
<th align="center">CPU</th>
<th align="center">Bandwidth</th>
<th align="center">CPU</th>
</tr>
<tr>
<th>Disabled</th>
<td align="center">269.69 MB/s</td>
<td align="center">5.074s</td>
<td align="center">244.16 MB/s</td>
<td align="center">6.832s</td>
</tr>
<tr>
<th>Enabled</th>
<td align="center">255.66 MB/s</td>
<td align="center">4.033s</td>
<td align="center">225.84 MB/s</td>
<td align="center">7.722s</td>
</tr>
</table>
]]></content:encoded>
			<wfw:commentRss>http://www.starcoder.com/wordpress/2011/10/file-vault-2-on-the-2011-macbook-air/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>When the App Store thinks an app is installed when it really isn&#8217;t</title>
		<link>http://www.starcoder.com/wordpress/2011/10/when-the-app-store-thinks-an-app-is-installed-when-it-really-isnt/</link>
		<comments>http://www.starcoder.com/wordpress/2011/10/when-the-app-store-thinks-an-app-is-installed-when-it-really-isnt/#comments</comments>
		<pubDate>Wed, 05 Oct 2011 15:57:46 +0000</pubDate>
		<dc:creator>mike</dc:creator>
				<category><![CDATA[Macintosh]]></category>

		<guid isPermaLink="false">http://www.starcoder.com/wordpress/?p=274</guid>
		<description><![CDATA[I was trying to figure out a problem where the Mac App Store incorrectly thought an application was installed on my Mac.  For the life of me, I couldn&#8217;t figure out why it thought that app was installed when it wasn&#8217;t.  I tried deleting caches, restarting the Mac, Spotlighting for all apps with [...]]]></description>
			<content:encoded><![CDATA[<p>I was trying to figure out a problem where the Mac App Store incorrectly thought an application was installed on my Mac.  For the life of me, I couldn&#8217;t figure out why it thought that app was installed when it wasn&#8217;t.  I tried deleting caches, restarting the Mac, Spotlighting for all apps with that name, all to no avail.</p>
<p>It ended up the problem was from the LaunchServices database.  The App Store checks LaunchServices to see which apps are installed.  Apparently LaunchServices still had a record of an application bundle even though it had been deleted.  Here&#8217;s how to use the Terminal to check and see which apps are in the LaunchServices database:</p>
<p><code>/System/Library/Frameworks/CoreServices.framework/\<br />
Versions/A/Frameworks/LaunchServices.framework/Versions/\<br />
A/Support/lsregister -dump</code></p>
<p>If you search through that verbose output and find an app that isn&#8217;t really there, you should rebuild the LaunchServices database.  You can do that with the following command:</p>
<p><code>/System/Library/Frameworks/CoreServices.framework\<br />
/Versions/A/Frameworks/LaunchServices.framework/Versions\<br />
/A/Support/lsregister -kill -r -domain local -domain system -domain user</code></p>
<p>Hope this saves someone an hour or two of problem-solving…</p>
]]></content:encoded>
			<wfw:commentRss>http://www.starcoder.com/wordpress/2011/10/when-the-app-store-thinks-an-app-is-installed-when-it-really-isnt/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Shrinking a Linux Software RAID Volume</title>
		<link>http://www.starcoder.com/wordpress/2011/08/shrinking-a-linux-software-raid-volume/</link>
		<comments>http://www.starcoder.com/wordpress/2011/08/shrinking-a-linux-software-raid-volume/#comments</comments>
		<pubDate>Wed, 17 Aug 2011 16:43:58 +0000</pubDate>
		<dc:creator>mike</dc:creator>
				<category><![CDATA[Sys Admin]]></category>

		<guid isPermaLink="false">http://www.starcoder.com/wordpress/?p=270</guid>
		<description><![CDATA[I upgrade the disks in my servers a lot, and often times this requires replacing 3-4 drives.  Throwing the old drives out would be a huge waste, so I bring them back to my office and put them in a separate Linux file server with a ton of drive bays.  I wrote about [...]]]></description>
			<content:encoded><![CDATA[<p>I upgrade the disks in my servers a lot, and often times this requires replacing 3-4 drives.  Throwing the old drives out would be a huge waste, so I bring them back to my office and put them in a separate Linux file server with a ton of drive bays.  I wrote <a href="http://www.starcoder.com/wordpress/2009/09/building-a-soho-file-server-the-hardware/">about the fileserver previously</a>.</p>
<p>In the file server, I configure the drives into multiple RAID 5 volumes.  Right now, I have 3 RAID volumes, each with four drives.  Yesterday, one of the disks in an older volume went bad.  So right now I&#8217;m running 3 out of 4 drives in a RAID 5.  No data loss yet, which is good.  Since this is an older RAID volume, I&#8217;ve decided not to replace the failed drive.  Instead, I&#8217;ll just shrink the RAID from 4 disks into 3 disks.  It was quite a hassle to figure out how to do this by researching online, so I thought I would document the entire process here, step by step, to save other people some time in the future.  It should go without saying that you should have a recent backup of everything on the volume you are about to change.</p>
<ol>
<li>Make sure the old disk really is removed from the array.  The device name shouldn&#8217;t show up in /proc/mdstat and mdadm &#8211;detail should say &#8220;removed&#8221;.  If not, be sure you mdadm &#8211;fail and mdadm &#8211;remove the device from the array.
<pre># cat /proc/mdstat
Personalities : [linear] [multipath] [raid0] [raid1] [raid6]...
md0 : active raid5 sdh2[1] sdj2[0] sdi2[3]
      1452572928 blocks level 5, 64k chunk, algorithm 2 [4/3] [UU_U]

unused devices: &lt;none&gt;
# mdadm --detail /dev/md0
/dev/md0:
        Version : 0.90
  Creation Time : Wed Apr  8 12:24:35 2009
     Raid Level : raid5
     Array Size : 1452572928 (1385.28 GiB 1487.43 GB)
  Used Dev Size : 484190976 (461.76 GiB 495.81 GB)
   Raid Devices : 4
  Total Devices : 3
Preferred Minor : 0
    Persistence : Superblock is persistent

    Update Time : Tue Aug 16 13:33:25 2011
          State : clean, degraded
 Active Devices : 3
Working Devices : 3
 Failed Devices : 0
  Spare Devices : 0

         Layout : left-symmetric
     Chunk Size : 64K

           UUID : 02f177d1:cb919a65:cb0d4135:3973d77d
         Events : 0.323834

    Number   Major   Minor   RaidDevice State
       0       8      146        0      active sync   /dev/sdj2
       1       8      114        1      active sync   /dev/sdh2
       2       0        0        2      removed
       3       8      130        3      active sync   /dev/sdi2</pre>
</li>
<li>Unmount the filesystem:
<pre># umount /dev/md0</pre>
</li>
<li>Run fsck on the filesystem:
<pre># e2fsck -f /dev/md0</pre>
</li>
<li>Shrink the filesystem, giving yourself plenty of extra space for disk removal.  Here I resized the partition to 800 GB, to give plenty of breathing room for a RAID 5 of three 500 GB drives.  We&#8217;ll expand the filesystem to fill the gaps later.
<pre># resize2fs /dev/md0 800G</pre>
</li>
<li>Now we need to actually reconfigure the array to use one less disk.  To do this, we&#8217;ll first query mdadm to find out how big the new array needs to be.  Then we&#8217;ll resize the array and reconfigure it for one fewer disk.  First, query mdadm for a new size (replace -n3 with the number of disks in the new array):
<pre># mdadm --grow -n3 /dev/md0
mdadm: this change will reduce the size of the array.
       use --grow --array-size first to truncate array.
       e.g. mdadm --grow /dev/md0 --array-size 968381952</pre>
</li>
<li>This gives our new size as being 968381952.  Use this to resize the array:
<pre># mdadm --grow /dev/md0 --array-size 968381952</pre>
</li>
<li>Now that the array has been truncated, we set it to reside on one fewer disk:
<pre># mdadm --grow -n3 /dev/md0 --backup-file /root/mdadm.backup</pre>
</li>
<li>Check to make sure the array is rebuilding.  You should see something like this:
<pre># cat /proc/mdstat
Personalities : [linear] [multipath] [raid0] [raid1] [raid6]...
md0 : active raid5 sdh2[1] sdj2[0] sdi2[3]
      968381952 blocks super 0.91 level 5, 64k chunk, algorithm 2 [3/2] [UU_]
      [&gt;....................]  reshape =  1.8% (9186496/484190976)
                                  finish=821.3min speed=9638K/sec</pre>
</li>
<li>At this point, you probably want to wait until the array finishes rebuilding.  However, Linux software RAID is smart enough to figure things out if you don&#8217;t want to wait.  Run fsck again before expanding your filesystem back to it&#8217;s maximum size (resize2fs requires this).
<pre># e2fsck -f /dev/md0</pre>
</li>
<li>Now do the actual expansion so the partition uses the complete raid volume (resize2fs will use the max size if a size isn&#8217;t specified):
<pre># resize2fs /dev/md0
<pre></li>
<li>(Optional) Run fsck one last time to make sure everything is still sane:
<pre># e2fsck -f /dev/md0</pre>
</li>
<li>Finally, remount the filesystem:
<pre># mount /dev/md0</pre>
</li>
</ol>
<p>Everything went smoothly for me while going through this process.  I could have just destroyed the entire old array and recreated a new one, but this process was easier and I didn't have to move a bunch of data around.  Certainly if you are using a larger array, and are going from 10 disks to 9 or something along those lines, this benefits of using this process are even greater.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.starcoder.com/wordpress/2011/08/shrinking-a-linux-software-raid-volume/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Creating Seasonality Map Tiles</title>
		<link>http://www.starcoder.com/wordpress/2011/06/creating-seasonality-map-tiles/</link>
		<comments>http://www.starcoder.com/wordpress/2011/06/creating-seasonality-map-tiles/#comments</comments>
		<pubDate>Thu, 02 Jun 2011 21:52:50 +0000</pubDate>
		<dc:creator>mike</dc:creator>
				<category><![CDATA[Gaucho Software]]></category>
		<category><![CDATA[Seasonality]]></category>
		<category><![CDATA[Weather]]></category>

		<guid isPermaLink="false">http://www.starcoder.com/wordpress/?p=268</guid>
		<description><![CDATA[In a weather app, maps are important.  So important, that as a developer of weather apps, I&#8217;ve learned far more than I ever care to know about topography.  When I originally created the maps for Seasonality, I had to balance download size with resolution.  If I bumped up the resolution too far, [...]]]></description>
			<content:encoded><![CDATA[<p>In a weather app, maps are important.  So important, that as a developer of weather apps, I&#8217;ve learned far more than I ever care to know about topography.  When I originally created the maps for Seasonality, I had to balance download size with resolution.  If I bumped up the resolution too far, then the download size would be too big for users on slower internet connections.  If I used too low of a resolution, the maps would look crappy.  I ended up settling on 21600&#215;10800 pixel terrain map, which after decent image compression resulted in Seasonality being a 16-17 MB download.  At the time, most apps were around 5 MB or less, so Seasonality was definitely a more substantial download.</p>
<p>That compromise was pretty good back in 2005, but now that a half-decade has passed it is time to revisit the terrain I am including in the app.  Creating a whole new terrain image set is a whole lot of work though, so I thought I would share what goes into the process here.</p>
<p>First, you have to find a good source of map data.  For Seasonality, I&#8217;ve always liked the natural terrain look.  The NASA Blue Marble imagery is beautiful, and free to use commercially, so that was an easy decision.  For the original imagery I used the first generation Blue Marble imagery.  Now I am using the Blue Marble Next Generation for even higher resolution.</p>
<p>Next you have to decide how you are going to tile the image.  I&#8217;ve chosen a pretty simple tiling method, where individual tiles are 512&#215;512 pixels, and zoom levels change by a power of 2.  Square tiles are best for OpenGL rendering, and while a larger (1024, or even 2048 pixel) tile would work, 512&#215;512 pixel tiles are faster to load into memory and if downloading over the network it will transfer faster as well.  From there, you have to figure out how many tiles will be at each zoom level.  I&#8217;ve chosen to use a 4&#215;2 tile grid as a base, so the smallest image of the entire globe will be 2048 x 1024 pixels and made up of 8 tiles.  As the user zooms in further, they will hit 4096&#215;2048, 8192&#215;4096, 16384&#215;8192 pixel zoom levels and so on.  I&#8217;ve decided to provide terrain all the way up to 65536&#215;32768 pixels.</p>
<p>Now that you have an idea of what tiles need to be provided, you need to actually create the images.  This is the most time consuming part of the process.  Things to consider include the image format and compression amounts to use on all the tiles, and these are dependent on the type of display you are trying to generate.  Creating all the tiles manually would take forever, so it&#8217;s best to automate this process.</p>
<p>The Blue Marble imagery comes in 8 tiles of 21600&#215;21600 each (the full set of images for every month of the year is around 25 GB).  I start by creating the biggest tile zoom level and moving down from there.  For my 65536&#215;32768 zoom level, I&#8217;ll resize each of the 8 tiles into 16384&#215;16384 pixel images.  I use a simple Automator action in Mac OS X to do this.  I created an action that takes the selected files in the Finder and creates copies of the images and resizes the copies to the specified resolution.</p>
<p>Now that I have 8 tiles at the correct resolution, I need to create the 512&#215;512 tiles for the final product.  For Seasonality, I also need to draw all the country/state borders at this point, because otherwise the maps are blank.  I created a custom Cocoa app that will read in a map image with specified latitude/longitude ranges, draw the boundaries, and write out the tiled images to a folder.  My app has the restriction of only handling a single image at a time, I&#8217;ll have to drag each of the 8 tiles in separately for each zoom level.  It&#8217;s not ideal, but I don&#8217;t do this too often either.  For the 65536&#215;32768 zoom level, I end up with 8192 individual tile images.  Smaller zoom levels result in far fewer tiles, but you can see why automation is helpful here.</p>
<p>It&#8217;s a lot of work, but in the end the results are great.  For Seasonality, along with higher resolution terrain, I&#8217;m also bringing in the Blue Marble&#8217;s monthly images.  If everything goes as planned, Seasonality will show the &#8220;average&#8221; terrain for every month of the year.  Users will be able to see the foliage change as well as the snow line move throughout the seasons.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.starcoder.com/wordpress/2011/06/creating-seasonality-map-tiles/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Packing in the inodes</title>
		<link>http://www.starcoder.com/wordpress/2011/04/packing-in-the-inodes/</link>
		<comments>http://www.starcoder.com/wordpress/2011/04/packing-in-the-inodes/#comments</comments>
		<pubDate>Wed, 13 Apr 2011 18:06:04 +0000</pubDate>
		<dc:creator>mike</dc:creator>
				<category><![CDATA[Seasonality]]></category>
		<category><![CDATA[Seasonality Go]]></category>
		<category><![CDATA[Storage]]></category>
		<category><![CDATA[Sys Admin]]></category>

		<guid isPermaLink="false">http://www.starcoder.com/wordpress/?p=264</guid>
		<description><![CDATA[The new forecast server I&#8217;m working on for Seasonality users is using the filesystem heirarchy as a form of database instead of PostgreSQL.  This will slow down the forecast generation code a bit, because I&#8217;m writing a ton of small files instead of letting Postgres optimize disk I/O.  However, reading from the database will be [...]]]></description>
			<content:encoded><![CDATA[<p>The new forecast server I&#8217;m working on for Seasonality users is using the filesystem heirarchy as a form of database instead of PostgreSQL.  This will slow down the forecast generation code a bit, because I&#8217;m writing a ton of small files instead of letting Postgres optimize disk I/O.  However, reading from the database will be lightning fast, because filesystems are very efficient at traversing directory structures.</p>
<p>The problem I ran into was that I was quickly hitting the maximum number of files on the filesystem.  The database I&#8217;m working on creates millions of files to store its data in, and I was quickly running out of inodes.</p>
<p>Earlier today I installed a fresh copy of Ubuntu on a virtual machine where the final forecast server will reside.  Of course I forgot to increase the number of inodes before installing the OS on the new partition.  Unfortunately, there is no way to add more inodes to a Linux ext4 filesystem without reformatting the volume.  Luckily I caught the problem pretty early and didn&#8217;t get too far into the system setup.</p>
<p>To fix the issue, I booted off the Ubuntu install ISO again and chose the repair boot option.  Then I had it start a console without selecting a root partition (if you select a root partition, it will mount the partition and when I tried to unmount it, the partition was in use).  This let me format the partition with an increased number of inodes using the -N flag in mkfs:</p>
<pre>mkfs.ext4 -N 100000000 /dev/sda1</pre>
<p>That ought to be enough. <img src='http://www.starcoder.com/wordpress/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' />   After that, I was able to install Ubuntu on the new partition (just making sure not to select to format that same partition again, wiping out your super-inode format).</p>
<p>The forecast server is coming along quite well.  I&#8217;m hoping to post more about how it all works in the near future.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.starcoder.com/wordpress/2011/04/packing-in-the-inodes/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Office Network Updates</title>
		<link>http://www.starcoder.com/wordpress/2011/04/office-network-updates/</link>
		<comments>http://www.starcoder.com/wordpress/2011/04/office-network-updates/#comments</comments>
		<pubDate>Thu, 07 Apr 2011 15:29:49 +0000</pubDate>
		<dc:creator>mike</dc:creator>
				<category><![CDATA[Gaucho Software]]></category>
		<category><![CDATA[Network]]></category>
		<category><![CDATA[Seasonality]]></category>
		<category><![CDATA[Storage]]></category>
		<category><![CDATA[Sys Admin]]></category>

		<guid isPermaLink="false">http://www.starcoder.com/wordpress/?p=260</guid>
		<description><![CDATA[Over the past several weeks, I&#8217;ve been spending a lot of time working on server-side changes.  There are two main server tasks that I&#8217;ve been focusing on.  The first task is a new weather forecast server for Seasonality users.  I&#8217;ll talk more about this in a later post.  The second task [...]]]></description>
			<content:encoded><![CDATA[<p>Over the past several weeks, I&#8217;ve been spending a lot of time working on server-side changes.  There are two main server tasks that I&#8217;ve been focusing on.  The first task is a new weather forecast server for Seasonality users.  I&#8217;ll talk more about this in a later post.  The second task is a general rehash of computing resources on the office network.</p>
<p>Last year I bought a new server to replace the 5 year old weather server I was using at the time.  This server is being coloed at a local ISPs datacenter.  I ended up with a Dell R710 with a Xeon E5630 quad-core CPU and 12GB of RAM.  I have 2 mirrored RAID volumes on the server.  The fast storage is handled by 2 300GB 15000 RPM drives.  I also have a slower mirrored RAID using 2 500GB 7200 RPM SAS drives that&#8217;s used mostly to store archived weather data.  The whole system is running VMware ESXi with 5-6 virtual machines, and has been working great so far.</p>
<p>Adding this new server meant that it was time to bring the old one back to the office.  For its time, the old server was a good box, but I was starting to experience reliability issues with it in a production environment (which is why I replaced it to begin with).  The thing is, the hardware is still pretty decent (dual core Athlon, 4GB of RAM, 4x 750GB disks), so I decided I would use it as a development server.  I mounted it in the office rack and started using it almost immediately.</p>
<p>A development box really doesn&#8217;t need a 4 disk RAID though.  I currently have a Linux file server in a chassis with 20 drive bays.  I can always use more space on the file server, so it made sense to consolidate the storage there.  I moved the 4 750GB disks over to the file server (setup as a RAID 5) and installed just a single disk in the development box.  This brings the total redundant file server storage up past 4 TB.</p>
<p>The next change was with the network infrastructure itself.  I have 2 Netgear 8 port gigabit switches to shuffle traffic around the local network.  Well, one of them died a few days ago so I had to replace it.  I considered just buying another 8 port switch to replace the dead one, but with a constant struggle to find open ports and the desire to tidy my network a bit, I decided to replace both switches with a single 24 port Netgear Smart Switch.  The new switch, which is still on its way, will let me setup VLANs to make my network management easier.  The new switch also allows for port trunking, which I am anxious to try.  Both my Mac Pro and the Linux file server have dual gigabit ethernet ports.  It would be great to trunk the two ports on each box for 2 gigabits of bandwidth between those two hosts.</p>
<p>The last recent network change was the addition of a new wireless access point.  I&#8217;ve been using a Linksys 802.11g wireless router for the last several years.  In recent months, it has started to drop wireless connections randomly every couple of hours.  This got to be pretty irritating on devices like laptops and the iPad where a wired network option really wasn&#8217;t available.  I finally decided to break down and buy a new wireless router.  There are a lot of choices in this market, but I decided to take the easy route and just get an Apple Airport Extreme.  I was tempted to try an ASUS model with <a href="http://www.dd-wrt.com/site/index">DD-WRT</a> or <a href="http://www.polarcloud.com/tomato">Tomato Firmware</a>, but in the end I decided I just didn&#8217;t have the time to mess with it.  So far, I&#8217;ve been pretty happy with the Airport Extreme&#8217;s 802.11n performance over the slower 802.11g.</p>
<p>Looking forward to finalizing the changes above.  I&#8217;ll post some photos of the rack once it&#8217;s completed.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.starcoder.com/wordpress/2011/04/office-network-updates/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Enabling Ping and Traceroute on the Cisco ASA 5505</title>
		<link>http://www.starcoder.com/wordpress/2011/03/enabling-ping-and-traceroute-on-the-cisco-asa-5505/</link>
		<comments>http://www.starcoder.com/wordpress/2011/03/enabling-ping-and-traceroute-on-the-cisco-asa-5505/#comments</comments>
		<pubDate>Mon, 21 Mar 2011 19:47:07 +0000</pubDate>
		<dc:creator>mike</dc:creator>
				<category><![CDATA[Cisco ASA]]></category>
		<category><![CDATA[Network]]></category>

		<guid isPermaLink="false">http://www.starcoder.com/wordpress/?p=255</guid>
		<description><![CDATA[Today I found some time to sit down and figure out why my ASA box was denying ping, traceroute and other ICMP traffic.  Denying all ICMP traffic is the most secure option, and I think Cisco made a good choice by making this the default.  However, I really wanted to be able to [...]]]></description>
			<content:encoded><![CDATA[<p>Today I found some time to sit down and figure out why my ASA box was denying ping, traceroute and other ICMP traffic.  Denying all ICMP traffic is the most secure option, and I think Cisco made a good choice by making this the default.  However, I really wanted to be able to ping and traceroute from inside my network to the outside world, if for no other reason than to check the latency of my servers.  Here&#8217;s how to do it in ASDM.</p>
<p>First, open an ASDM connection to your router.  Go into the Configuration screens and click on Firewall to configure the firewall options.  Then click on Service Policy Rules to configure the services that the firewall software will monitor.  Select the global policy (first and only one in the list), and click on the Edit button.  Switch to the Rule Actions (3rd) tab, and in the list check to enable ICMP.  You can leave ICMP Error unchecked.  Close that and Apply the changes.</p>
<p>Now, if you just want to be able to ping, stop here and you are done.  However, traceroute will not work with this setup.  For traceroute to work, you have to complete this follow-up task.</p>
<p>While still under the Firewall configuration switch to the Access Rules item.  Add an access rule to permit ICMP traffic.  Click the Add button, make sure the interface is set to outside, action is Permit, and Source/Destination is any.  Under Service, click the … button and select the icmp line and click OK.  Click OK again in the Add Access Rule dialog and Apply the results to finish the process.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.starcoder.com/wordpress/2011/03/enabling-ping-and-traceroute-on-the-cisco-asa-5505/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

