<?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>Phil Chen &#187; Development 101</title>
	<atom:link href="http://www.philchen.com/category/development-101/feed" rel="self" type="application/rss+xml" />
	<link>http://www.philchen.com</link>
	<description>Phil Chen</description>
	<lastBuildDate>Fri, 23 Jul 2010 03:36:53 +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>Velocity: The Ultimate Web Performance and Operations Conference</title>
		<link>http://www.philchen.com/2010/07/16/velocity-the-ultimate-web-performance-and-operations-conference</link>
		<comments>http://www.philchen.com/2010/07/16/velocity-the-ultimate-web-performance-and-operations-conference#comments</comments>
		<pubDate>Fri, 16 Jul 2010 16:45:14 +0000</pubDate>
		<dc:creator>Phil Chen</dc:creator>
				<category><![CDATA[Development 101]]></category>
		<category><![CDATA[Networking 101]]></category>
		<category><![CDATA[Systems 101]]></category>

		<guid isPermaLink="false">http://www.philchen.com/?p=640</guid>
		<description><![CDATA[&#160;
Last month, I attended O&#8217;Reilly&#8217;s Velocity Web Performance and Operations Conference and, without fail, the information I came away with reinforced existing VMIX initiatives and strategies, and inspired new ones.

Attending the Velocity Conference, I had three goals:

To listen to relevant industry-leading speakers, regarding how to improve performance and operational efficiency, taking this information and disseminating [...]]]></description>
			<content:encoded><![CDATA[<p>&nbsp;
<p>Last month, I attended <a href="http://en.oreilly.com/velocity2010" target="_blank">O&#8217;Reilly&#8217;s Velocity Web Performance and Operations Conference</a> and, without fail, the information I came away with reinforced existing <a href="http://www.vmix.com" target="_blank">VMIX</a> initiatives and strategies, and inspired new ones.<br />
<span id="more-640"></span><br />
Attending the Velocity Conference, I had three goals:</p>
<ul>
<li>To listen to relevant industry-leading speakers, regarding how to improve performance and operational efficiency, taking this information and disseminating it to my colleagues who couldn&#8217;t attend.</li>
<li>To meet and discuss with peers from companies facing the same challenges and hurdles when it comes to performance and operations. Understanding their approaches and pitfalls while offering my own experiences.</li>
<li>And, finally, being away from interruptions at work, to simply be inspired by the incredibly smart people around me to draft new strategies for increasing scale, efficiency and performance to bring back and implement.</li>
</ul>
<p><h3><a href="http://www.vmix.com/blog/wp-content/uploads/2010/07/velocity.jpg"><img class="alignleft size-medium wp-image-1042" title="O'Reilly's Velocity Web Performance and Operations Conference" src="http://www.vmix.com/blog/wp-content/uploads/2010/07/velocity-300x199.jpg" alt="" width="300" height="199" /></a>It&#8217;s All About the Data</h3>
<p>At Velocity this year, as well as the previous two, I became aware of underlying themes that went beyond specific technologies or tools.</p>
<p>The most important, which in some cases may seem obvious, is to make decisions based on data.</p>
<p>A lot of times, decisions are made based on theory, instinct, wishful thinking and other motivating factors.</p>
<p>Validating these factors with data collected from your applications, infrastructure and clients will allow you to make the most informed decision. The more data points you collect, the higher the odds are that your decisions will result in the kind of outcomes you think they should.</p>
<p>One important method of data collection that is overlooked at times is the <em>human </em>factor. No matter how much our hardware computing evolves, humans still decide which methods or strategies to implement in order to provide a complete solution. And the human brain is still the highest performing computer on the market. Going to a conference and interacting with peers and colleagues on operations and web performance allows us to complete the system.</p>
<h3>Learning and Implementing</h3>
<p>As a result of attending the Velocity Conferences over the past three years, we have been able to implement the following technologies and optimizations, which have greatly impacted our efficiency at VMIX.</p>
<p><strong>Velocity 2008</strong></p>
<p>I met <a href="http://brian.moonspot.net/" target="_blank">Brian Moon</a> and <a href="http://dormando.livejournal.com" target="_blank">Alan Kasindorf (dormando)</a> and, after discussing file-system optimization, proceeded to implement some <a href="http://www.philchen.com/2009/02/09/some-tuning-tips-for-apache-mod_cache-mod_disk_cache" target="_blank">file-system tuning</a> which, in turn, helped increase our Apache Web Servers running mod_disk_cache efficiency by 3 times.</p>
<p><strong>Velocity 2009</strong></p>
<p>After several BOF (Birds of a Feather) sessions, and speaking with various attendees, I was convinced to give <a href="http://www.puppetlabs.com/puppet/introduction/" target="_blank">Puppet</a> (Configuration Management Framework) a try, along with <a href="https://fedorahosted.org/cobbler/" target="_blank">Cobbler</a> for rapid Linux installs. We&#8217;d previously used <a href="http://www.cfengine.org/" target="_blank">CFengine</a> and <a href="http://www.redhat.com/docs/manuals/linux/RHL-7.3-Manual/custom-guide/ch-kickstart2.html" target="_blank"> Standalone Kickstart</a> and felt they were not necessarily the right tools for our operation. After proof of concept (POC), we deployed Puppet and Cobbler and are now able to build and control systems at a quicker rate, with more management and less complication.</p>
<p><strong>Velocity 2010</strong></p>
<p>I attended a talk by <a href="http://www.ogre.com/" target="_blank">Leif Hedstrom</a> on <a href="http://trafficserver.apache.org/" target="_blank">Apache Traffic Server</a> and realized it was open sourced from Yahoo to the <a href="http://apache.org" target="_blank">Apache Organization</a>. I had known about the Traffic Server back in the Inktomi days (1990&#8217;s), as well as from a company I worked for that licensed the code. However, I hadn&#8217;t realized it was openly available. After hearing that Yahoo uses the Traffic Server for their own CDN network, I decided to give it a shot and plan on using it to possibly replacing our <a href="http://www.squid-cache.org/" target="_blank">Squid</a> servers at VMIX.</p>
<p>Currently, we are running a bit of a bake-off between Squid and Apache Traffic Server, and preliminary results for Traffic Server are so favorable that, by next month, Squid might be calamari.</p>
<p>In quick closing, hopefully O&#8217;Reilly and the Velocity Program Committee keeps up the good work and my list of things learned and implemented grows!</p>
<p style="text-align: left;"><span style="color: #808080;"><em>Phil Chen is Director of Systems Engineering at VMIX.</em></span></p>
]]></content:encoded>
			<wfw:commentRss>http://www.philchen.com/2010/07/16/velocity-the-ultimate-web-performance-and-operations-conference/feed</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>Apache Mod_Deflate and Flash SWF Files Don&#8217;t Like Each Other</title>
		<link>http://www.philchen.com/2009/08/04/apache-mod_deflate-and-flash-swf-files-dont-like-each-other</link>
		<comments>http://www.philchen.com/2009/08/04/apache-mod_deflate-and-flash-swf-files-dont-like-each-other#comments</comments>
		<pubDate>Wed, 05 Aug 2009 04:49:42 +0000</pubDate>
		<dc:creator>Phil Chen</dc:creator>
				<category><![CDATA[Development 101]]></category>
		<category><![CDATA[Systems 101]]></category>

		<guid isPermaLink="false">http://www.philchen.com/?p=550</guid>
		<description><![CDATA[Recently I was working on a Flex project and upon completion and successful QA, I deployed it on a clients server for use. After embedding the SWF file and adding the data.xml that populated the flash application, I could not load the application in Firefox or IE. Several refreshes would load the application occasionally, however [...]]]></description>
			<content:encoded><![CDATA[<p>Recently I was working on a Flex project and upon completion and successful QA, I deployed it on a clients server for use. After embedding the SWF file and adding the data.xml that populated the flash application, I could not load the application in Firefox or IE. Several refreshes would load the application occasionally, however most of the time I just had a grey box. <span id="more-550"></span></p>
<p>So while troubleshooting using Firebug, I realized that the clients server I had deployed on was using Apache 2.2.11 with Mod_Deflate enabled, a method commonly used to compress up to 70% of data transfered over the wire to speed page loads. I then had a flash back on reading an article about issues with compression of SWF&#8217;s, and upon further investigation of the clients Apache configuration file I saw SWF was not excluded from compression via Mod_Deflate.</p>
<p>Mod_Deflate was compressing SWF files sending them with chunked transfer encoding to the browser. It appears the last part of the chunk was being missed by the browser. By refreshing the browser cache it sometimes filled in the missing chunk, and displayed the application.</p>
<p>So I added SWF to the list of files not to compress via Mod_Deflate and the application worked perfectly everytime.</p>
<p>Below is the section I added the SWF exclusion:</p>
<p>BEFORE:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&lt;</span>Location <span style="color: #000000; font-weight: bold;">/&gt;</span>
<span style="color: #666666; font-style: italic;"># Insert filter</span>
SetOutputFilter DEFLATE
&nbsp;
<span style="color: #666666; font-style: italic;"># Netscape 4.x has some problems...</span>
BrowserMatch ^Mozilla<span style="color: #000000; font-weight: bold;">/</span><span style="color: #000000;">4</span> gzip-only-text<span style="color: #000000; font-weight: bold;">/</span>html
&nbsp;
<span style="color: #666666; font-style: italic;"># Netscape 4.06-4.08 have some more problems</span>
BrowserMatch ^Mozilla<span style="color: #000000; font-weight: bold;">/</span><span style="color: #000000;">4</span>\.0<span style="color: #7a0874; font-weight: bold;">&#91;</span><span style="color: #000000;">678</span><span style="color: #7a0874; font-weight: bold;">&#93;</span> no-gzip
&nbsp;
<span style="color: #666666; font-style: italic;"># MSIE masquerades as Netscape, but it is fine</span>
BrowserMatch \bMSIE <span style="color: #000000; font-weight: bold;">!</span>no-gzip <span style="color: #000000; font-weight: bold;">!</span>gzip-only-text<span style="color: #000000; font-weight: bold;">/</span>html
&nbsp;
<span style="color: #666666; font-style: italic;"># Don't compress images and other uncompressible content</span>
SetEnvIfNoCase Request_URI \
 \.<span style="color: #7a0874; font-weight: bold;">&#40;</span>?:gif<span style="color: #000000; font-weight: bold;">|</span>jpe?g<span style="color: #000000; font-weight: bold;">|</span>png<span style="color: #000000; font-weight: bold;">|</span>rar<span style="color: #000000; font-weight: bold;">|</span><span style="color: #c20cb9; font-weight: bold;">zip</span><span style="color: #000000; font-weight: bold;">|</span>exe<span style="color: #000000; font-weight: bold;">|</span>flv<span style="color: #000000; font-weight: bold;">|</span>mov<span style="color: #000000; font-weight: bold;">|</span>wma<span style="color: #000000; font-weight: bold;">|</span>mp3<span style="color: #000000; font-weight: bold;">|</span>avi<span style="color: #000000; font-weight: bold;">|</span>mp?g<span style="color: #7a0874; font-weight: bold;">&#41;</span>$ no-gzip dont-vary
&nbsp;
<span style="color: #666666; font-style: italic;"># Make sure proxies don't deliver the wrong content</span>
Header append Vary User-Agent <span style="color: #007800;"><span style="color: #c20cb9; font-weight: bold;">env</span></span>=<span style="color: #000000; font-weight: bold;">!</span>dont-vary
<span style="color: #000000; font-weight: bold;">&lt;/</span>Location<span style="color: #000000; font-weight: bold;">&gt;</span></pre></div></div>

<p>AFTER:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">&nbsp;
<span style="color: #000000; font-weight: bold;">&lt;</span>Location <span style="color: #000000; font-weight: bold;">/&gt;</span>
<span style="color: #666666; font-style: italic;"># Insert filter</span>
SetOutputFilter DEFLATE
&nbsp;
<span style="color: #666666; font-style: italic;"># Netscape 4.x has some problems...</span>
BrowserMatch ^Mozilla<span style="color: #000000; font-weight: bold;">/</span><span style="color: #000000;">4</span> gzip-only-text<span style="color: #000000; font-weight: bold;">/</span>html
&nbsp;
<span style="color: #666666; font-style: italic;"># Netscape 4.06-4.08 have some more problems</span>
BrowserMatch ^Mozilla<span style="color: #000000; font-weight: bold;">/</span><span style="color: #000000;">4</span>\.0<span style="color: #7a0874; font-weight: bold;">&#91;</span><span style="color: #000000;">678</span><span style="color: #7a0874; font-weight: bold;">&#93;</span> no-gzip
&nbsp;
<span style="color: #666666; font-style: italic;"># MSIE masquerades as Netscape, but it is fine</span>
BrowserMatch \bMSIE <span style="color: #000000; font-weight: bold;">!</span>no-gzip <span style="color: #000000; font-weight: bold;">!</span>gzip-only-text<span style="color: #000000; font-weight: bold;">/</span>html
&nbsp;
<span style="color: #666666; font-style: italic;"># Don't compress images and other uncompressible content</span>
SetEnvIfNoCase Request_URI \
 \.<span style="color: #7a0874; font-weight: bold;">&#40;</span>?:gif<span style="color: #000000; font-weight: bold;">|</span>jpe?g<span style="color: #000000; font-weight: bold;">|</span>png<span style="color: #000000; font-weight: bold;">|</span>rar<span style="color: #000000; font-weight: bold;">|</span><span style="color: #c20cb9; font-weight: bold;">zip</span><span style="color: #000000; font-weight: bold;">|</span>exe<span style="color: #000000; font-weight: bold;">|</span>flv<span style="color: #000000; font-weight: bold;">|</span>mov<span style="color: #000000; font-weight: bold;">|</span>wma<span style="color: #000000; font-weight: bold;">|</span>mp3<span style="color: #000000; font-weight: bold;">|</span>avi<span style="color: #000000; font-weight: bold;">|</span>swf<span style="color: #000000; font-weight: bold;">|</span>mp?g<span style="color: #7a0874; font-weight: bold;">&#41;</span>$ no-gzip dont-vary
&nbsp;
<span style="color: #666666; font-style: italic;"># Make sure proxies don't deliver the wrong content</span>
Header append Vary User-Agent <span style="color: #007800;"><span style="color: #c20cb9; font-weight: bold;">env</span></span>=<span style="color: #000000; font-weight: bold;">!</span>dont-vary
<span style="color: #000000; font-weight: bold;">&lt;/</span>Location<span style="color: #000000; font-weight: bold;">&gt;</span></pre></div></div>

]]></content:encoded>
			<wfw:commentRss>http://www.philchen.com/2009/08/04/apache-mod_deflate-and-flash-swf-files-dont-like-each-other/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>How to use the PERL Blowfish Encryption Module with Padding Capabilities</title>
		<link>http://www.philchen.com/2007/08/26/how-to-use-a-perl-blowfish-encryption-module-with-padding</link>
		<comments>http://www.philchen.com/2007/08/26/how-to-use-a-perl-blowfish-encryption-module-with-padding#comments</comments>
		<pubDate>Mon, 27 Aug 2007 03:07:54 +0000</pubDate>
		<dc:creator>Phil Chen</dc:creator>
				<category><![CDATA[Development 101]]></category>

		<guid isPermaLink="false">http://www.philchen.com/2007/08/26/how-to-use-a-perl-blowfish-encryption-module-with-padding/</guid>
		<description><![CDATA[If you have a scenerio when encryption is necessary for your data, aÂ perl scriptÂ utilizing the Crypt::Blowfish module to get the job done may be your answer. The code is pretty straight foward however it has an additional padding section which helps you negotiate data not matching your designated encryption key size.

The first script encrypts and [...]]]></description>
			<content:encoded><![CDATA[<p>If you have a scenerio when encryption is necessary for your data, aÂ perl scriptÂ utilizing the Crypt::Blowfish module to get the job done may be your answer. The code is pretty straight foward however it has an additional padding section which helps you negotiate data not matching your designated encryption key size.<br />
<span id="more-45"></span></p>
<p>The first script encrypts and pads data from a plaintext.txt file using Crypt::Blowfish into a ciphertext.txt file. The second script decrypts the cipher and writes it to a file.</p>
<p><strong>blowfish.pl</strong></p>

<div class="wp_syntax"><div class="code"><pre class="perl" style="font-family:monospace;"><span style="color: #666666; font-style: italic;">#!/usr/bin/perl</span>
<span style="color: #000000; font-weight: bold;">use</span> Crypt<span style="color: #339933;">::</span><span style="color: #006600;">Blowfish</span><span style="color: #339933;">;</span>
<span style="color: #0000ff;">$key</span> <span style="color: #339933;">=</span> <span style="color: #ff0000;">'12345678123456781234567812345678'</span><span style="color: #339933;">;</span>
<span style="color: #0000ff;">$cipher</span> <span style="color: #339933;">=</span> Crypt<span style="color: #339933;">::</span><span style="color: #006600;">Blowfish</span><span style="color: #339933;">-&gt;</span><span style="color: #006600;">new</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">$key</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000066;">open</span> <span style="color: #009900;">&#40;</span>PLAINTEXT<span style="color: #339933;">,</span> <span style="color: #ff0000;">&quot;plaintext.txt&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #b1b100;">while</span> <span style="color: #009900;">&#40;</span><span style="color: #000066;">read</span><span style="color: #009900;">&#40;</span>PLAINTEXT<span style="color: #339933;">,</span> <span style="color: #0000ff;">$block</span><span style="color: #339933;">,</span> <span style="color: #cc66cc;">8</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
<span style="color: #0000ff;">$len</span>Â  <span style="color: #339933;">=</span> <span style="color: #000066;">length</span> <span style="color: #0000ff;">$block</span><span style="color: #339933;">;</span>
<span style="color: #0000ff;">$size</span> <span style="color: #339933;">+=</span> <span style="color: #0000ff;">$len</span><span style="color: #339933;">;</span>
<span style="color: #666666; font-style: italic;"># Add padding if necessary</span>
<span style="color: #0000ff;">$block</span> <span style="color: #339933;">.=</span> <span style="color: #ff0000;">&quot;<span style="color: #000099; font-weight: bold;">\0</span>00&quot;</span>x<span style="color: #009900;">&#40;</span><span style="color: #cc66cc;">8</span><span style="color: #339933;">-</span><span style="color: #0000ff;">$len</span><span style="color: #009900;">&#41;</span> <span style="color: #b1b100;">if</span> <span style="color: #0000ff;">$len</span> <span style="color: #339933;">&lt;</span> <span style="color: #cc66cc;">8</span><span style="color: #339933;">;</span>
<span style="color: #0000ff;">$ciphertext</span> <span style="color: #339933;">.=</span> <span style="color: #0000ff;">$cipher</span><span style="color: #339933;">-&gt;</span><span style="color: #006600;">encrypt</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">$block</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
<span style="color: #666666; font-style: italic;"># Record the size of the plaintext, so that the recipient</span>
<span style="color: #666666; font-style: italic;"># knows how much padding to remove.</span>
<span style="color: #000066;">open</span> <span style="color: #009900;">&#40;</span>CIPHERTEXT<span style="color: #339933;">,</span> <span style="color: #ff0000;">&quot;&gt;ciphertext.txt&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000066;">print</span> CIPHERTEXT <span style="color: #ff0000;">&quot;$size<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span><span style="color: #339933;">;</span>
<span style="color: #000066;">print</span> CIPHERTEXT <span style="color: #0000ff;">$ciphertext</span><span style="color: #339933;">;</span></pre></div></div>

<p><strong>decryptblowfish.pl</strong></p>

<div class="wp_syntax"><div class="code"><pre class="perl" style="font-family:monospace;"><span style="color: #666666; font-style: italic;">#!/usr/bin/perl</span>
<span style="color: #000000; font-weight: bold;">use</span> Crypt<span style="color: #339933;">::</span><span style="color: #006600;">Blowfish</span><span style="color: #339933;">;</span>
<span style="color: #0000ff;">$key</span> <span style="color: #339933;">=</span> <span style="color: #ff0000;">'12345678123456781234567812345678'</span><span style="color: #339933;">;</span>
<span style="color: #0000ff;">$cipher</span> <span style="color: #339933;">=</span> Crypt<span style="color: #339933;">::</span><span style="color: #006600;">Blowfish</span><span style="color: #339933;">-&gt;</span><span style="color: #006600;">new</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">$key</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000066;">open</span> <span style="color: #009900;">&#40;</span>CIPHERTEXT<span style="color: #339933;">,</span> <span style="color: #ff0000;">&quot;ciphertext.txt&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #0000ff;">$size</span> <span style="color: #339933;">=</span> <span style="color: #009999;">&lt;CIPHERTEXT&gt;</span><span style="color: #339933;">;</span>
<span style="color: #b1b100;">while</span> <span style="color: #009900;">&#40;</span><span style="color: #000066;">read</span><span style="color: #009900;">&#40;</span>CIPHERTEXT<span style="color: #339933;">,</span> <span style="color: #0000ff;">$ct</span><span style="color: #339933;">,</span> <span style="color: #cc66cc;">8</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
<span style="color: #0000ff;">$pt</span> <span style="color: #339933;">.=</span> <span style="color: #0000ff;">$cipher</span><span style="color: #339933;">-&gt;</span><span style="color: #006600;">decrypt</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">$ct</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
<span style="color: #666666; font-style: italic;"># Write only $size bytes of the output; ignore padding.</span>
<span style="color: #000066;">open</span> <span style="color: #009900;">&#40;</span>PLAINTEXT<span style="color: #339933;">,</span> <span style="color: #ff0000;">&quot;&gt;decrypted.txt&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000066;">print</span> PLAINTEXT <span style="color: #000066;">substr</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">$pt</span><span style="color: #339933;">,</span> <span style="color: #cc66cc;">0</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">$size</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

]]></content:encoded>
			<wfw:commentRss>http://www.philchen.com/2007/08/26/how-to-use-a-perl-blowfish-encryption-module-with-padding/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>
