<?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>sylv3rblade dot com</title>
	<atom:link href="http://sylv3rblade.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://sylv3rblade.com</link>
	<description>Enjoying a Geek&#039;s Life with Anime, Rails, and Digital Photography!</description>
	<lastBuildDate>Fri, 02 Mar 2012 03:11:01 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.2</generator>
		<item>
		<title>DRYing HTML using content_for and helpers</title>
		<link>http://sylv3rblade.com/2012/03/drying-html-using-content_for-and-helper/</link>
		<comments>http://sylv3rblade.com/2012/03/drying-html-using-content_for-and-helper/#comments</comments>
		<pubDate>Fri, 02 Mar 2012 03:00:34 +0000</pubDate>
		<dc:creator>sylv3rblade</dc:creator>
				<category><![CDATA[Ruby on Rails]]></category>
		<category><![CDATA[content_for]]></category>
		<category><![CDATA[DRY]]></category>
		<category><![CDATA[LocalJumpError]]></category>
		<category><![CDATA[no block given (yield)]]></category>
		<category><![CDATA[Rails 3]]></category>
		<category><![CDATA[yield]]></category>

		<guid isPermaLink="false">http://sylv3rblade.com/?p=182</guid>
		<description><![CDATA[I recently encountered a scenario where I needed to dry up some HTML code for a navigation snippet that needed to appear on both the top and bottom of my main content. Here&#8217;s a snipped version of the code The (&#8230;)</p><p><a href="http://sylv3rblade.com/2012/03/drying-html-using-content_for-and-helper/">Read the rest of this entry &#187;</a></p>]]></description>
			<content:encoded><![CDATA[<p>I recently encountered a scenario where I needed to dry up some HTML code for a navigation snippet that needed to appear on both the top and bottom of my main content.  Here&#8217;s a snipped version of the code</p>
<pre class="brush: xml; title: ; notranslate">
&lt;div class=&quot;tablenav top row&quot;&gt;
   &lt;div class=&quot;somenavigationfunction&quot;&gt;&lt;/div&gt;
   &lt;div class=&quot;anotherfunction&quot;&gt;&lt;/div&gt;
   &lt;!--
      Some code for the navigation here
    --&gt;
&lt;/div&gt;
&lt;div class=&quot;display row&quot;&gt;
   &lt;!--
      Main display page here
    --&gt;
&lt;/div&gt;
&lt;div class=&quot;tablenav bottom row&quot;&gt;
   &lt;div class=&quot;somenavigationfunction&quot;&gt;&lt;/div&gt;
   &lt;div class=&quot;anotherfunction&quot;&gt;&lt;/div&gt;
   &lt;!--
      Some code for the navigation here
    --&gt;
&lt;/div&gt;
</pre>
<p>The code that I need repeated divs with tablenav classes.  The usual way to go about this is using <strong>content_for</strong> and <strong>yield</strong>:</p>
<pre class="brush: ruby; title: ; notranslate">
&lt;% content_for :tablenav do %&gt;
   &lt;div class=&quot;tablenav top row&quot;&gt;
      &lt;div class=&quot;somenavigationfunction&quot;&gt;&lt;/div&gt;
      &lt;div class=&quot;anotherfunction&quot;&gt;&lt;/div&gt;
      &lt;!--
         Some code for the navigation here
       --&gt;
   &lt;/div&gt;
&lt;% yield :tablenav %&gt;
&lt;div class=&quot;display row&quot;&gt;
   &lt;!--
      Main display page here
    --&gt;
&lt;/div&gt;
&lt;% yield :tablenav %&gt;
</pre>
<p>A bit DRY-er now right?  The problem with this approach is that both instances of the yielded output sports the same set of classes.  This is good most of the time but in my current usage, I need the top instance to use a &#8220;top&#8221; class while the bottom one needed a &#8220;bottom&#8221; class for proper padding.  I could simply add another div to wrap each of the yield lines but that&#8217;s requires me to edit the css file to reflect the change.  Here&#8217;s the solution I came up with using content_for and helpers:</p>
<pre class="brush: ruby; title: ; notranslate">
&lt;% content_for :tablenav do %&gt;
   &lt;div class=&quot;tablenav top row&quot;&gt;
      &lt;div class=&quot;somenavigationfunction&quot;&gt;&lt;/div&gt;
      &lt;div class=&quot;anotherfunction&quot;&gt;&lt;/div&gt;
      &lt;!--
         Some code for the navigation here
       --&gt;
   &lt;/div&gt;
&lt;%= nav_block(&quot;top&quot;) %&gt;
&lt;div class=&quot;display row&quot;&gt;
   &lt;!--
      Main display page here
    --&gt;
&lt;/div&gt;
&lt;%= nav_block(&quot;bottom&quot;) %&gt;
</pre>
<p>And the code for the helper</p>
<pre class="brush: ruby; title: ; notranslate">
def nav_block(location = nil, &amp;block)
  content_tag(&quot;div&quot;, content_for(:tablenav), :class =&gt; &quot;tablenav #{location} row&quot;).html_safe
end
</pre>
<p>Just fire up the page in your browse and watch it work <img src='http://sylv3rblade.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> .  Now how exactly did this works?  Turns out that <strong>content_for</strong> can also be used to output it&#8217;s contents.  If you&#8217;re wondering why yield wasn&#8217;t used is because it simply doesn&#8217;t work with helpers.  If you tried to use yield, you&#8217;ll end up with the following <strong>LocalJumpError</strong>: <strong>no block given (yield)</strong>.</p>
<p><strong>Important Note</strong>: I&#8217;ve only tested this on Rails 3.x, Rails 3.2 to be exact.<br />
Hope that helps.</p>
]]></content:encoded>
			<wfw:commentRss>http://sylv3rblade.com/2012/03/drying-html-using-content_for-and-helper/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>[Linux] changing file or folder permission recursively</title>
		<link>http://sylv3rblade.com/2012/02/linux-changing-file-or-folder-permission-recursively/</link>
		<comments>http://sylv3rblade.com/2012/02/linux-changing-file-or-folder-permission-recursively/#comments</comments>
		<pubDate>Sat, 18 Feb 2012 22:40:32 +0000</pubDate>
		<dc:creator>sylv3rblade</dc:creator>
				<category><![CDATA[Linux]]></category>

		<guid isPermaLink="false">http://sylv3rblade.com/?p=178</guid>
		<description><![CDATA[I recently encountered a permissions problem when installing a new application on my Wiredtree VPS.  The crux of the problem was some of the necessary files have the wrong access permission thereby rendering the application almost inoperable.  To fix that, (&#8230;)</p><p><a href="http://sylv3rblade.com/2012/02/linux-changing-file-or-folder-permission-recursively/">Read the rest of this entry &#187;</a></p>]]></description>
			<content:encoded><![CDATA[<p>I recently encountered a permissions problem when installing a new application on my Wiredtree VPS.  The crux of the problem was some of the necessary files have the wrong access permission thereby rendering the application almost inoperable.  To fix that, I needed to change permissions of a whole lot of files and folders.  And while I could&#8217;ve changed the permissions individually, it would&#8217;ve taken quite a long time so here&#8217;s what I found to work</p>
<p>To set all the folders to 755:</p>
<pre class="brush: bash; title: ; notranslate">
find . -type d -exec chmod 755 {} \;
</pre>
<p>To set all files to 644:</p>
<pre class="brush: bash; title: ; notranslate">
find . -type f -exec chmod 644 {} \;
</pre>
<p>Let&#8217;s say you want to change the permissions of files that end only in .rb and set it to 755 (pattern escaped with slashes)</p>
<pre class="brush: bash; title: ; notranslate">
find . -name \*\.rb -exec chmod 644 {} \;
</pre>
<p>Simple right?</p>
]]></content:encoded>
			<wfw:commentRss>http://sylv3rblade.com/2012/02/linux-changing-file-or-folder-permission-recursively/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Leaving the current nest</title>
		<link>http://sylv3rblade.com/2012/02/leaving-the-current-nest/</link>
		<comments>http://sylv3rblade.com/2012/02/leaving-the-current-nest/#comments</comments>
		<pubDate>Thu, 02 Feb 2012 10:17:29 +0000</pubDate>
		<dc:creator>sylv3rblade</dc:creator>
				<category><![CDATA[Personal Space]]></category>

		<guid isPermaLink="false">http://sylv3rblade.com/?p=175</guid>
		<description><![CDATA[So yes. I finally made the decision to write THE letter. I&#8217;ll be forwarding it to my superiors on the 15th and I&#8217;ll be signing my contract with the new company on Monday. More monies plox.]]></description>
			<content:encoded><![CDATA[<p>So yes. I finally made the decision to write THE letter.</p>
<p>I&#8217;ll be forwarding it to my superiors on the 15th and I&#8217;ll be signing my contract with the new company on Monday. More monies plox.</p>
]]></content:encoded>
			<wfw:commentRss>http://sylv3rblade.com/2012/02/leaving-the-current-nest/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>ArgumentError: invalid byte sequence in US-ASCII</title>
		<link>http://sylv3rblade.com/2012/01/argumenterror-invalid-byte-sequence-in-us-ascii/</link>
		<comments>http://sylv3rblade.com/2012/01/argumenterror-invalid-byte-sequence-in-us-ascii/#comments</comments>
		<pubDate>Mon, 02 Jan 2012 23:54:20 +0000</pubDate>
		<dc:creator>sylv3rblade</dc:creator>
				<category><![CDATA[Ruby on Rails]]></category>

		<guid isPermaLink="false">http://sylv3rblade.com/?p=158</guid>
		<description><![CDATA[If you&#8217;re on Ruby 1.9.2 and have started getting this error when trying to install gems (either by gem install or bundle install), your environment is simply missing the LANG variable and is loading up US-ASCII by default. To fix (&#8230;)</p><p><a href="http://sylv3rblade.com/2012/01/argumenterror-invalid-byte-sequence-in-us-ascii/">Read the rest of this entry &#187;</a></p>]]></description>
			<content:encoded><![CDATA[<p>If you&#8217;re on Ruby 1.9.2 and have started getting this error when trying to install gems (either by gem install or bundle install), your environment is simply missing the LANG variable and is loading up US-ASCII by default.</p>
<p>To fix this, simply run the command below before installing anything</p>
<pre class="brush: bash; title: ; notranslate">export LANG=en_US.UTF-8</pre>
<p>or to make it more streamlined, add it to your .bashrc or zshrc (if you&#8217;re using the zsh shell).</p>
]]></content:encoded>
			<wfw:commentRss>http://sylv3rblade.com/2012/01/argumenterror-invalid-byte-sequence-in-us-ascii/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Built a new PC over the holidays</title>
		<link>http://sylv3rblade.com/2012/01/built-a-new-pc-over-the-holidays/</link>
		<comments>http://sylv3rblade.com/2012/01/built-a-new-pc-over-the-holidays/#comments</comments>
		<pubDate>Sun, 01 Jan 2012 13:16:48 +0000</pubDate>
		<dc:creator>sylv3rblade</dc:creator>
				<category><![CDATA[Personal Space]]></category>

		<guid isPermaLink="false">http://sylv3rblade.com/?p=156</guid>
		<description><![CDATA[I was planning on saving things up for Ivy Bridge but seeing that it&#8217;s release date is around 6 months (or more) away, I decided to bite the bullet and splurge a bit to build a new gaming PC. Here&#8217;s (&#8230;)</p><p><a href="http://sylv3rblade.com/2012/01/built-a-new-pc-over-the-holidays/">Read the rest of this entry &#187;</a></p>]]></description>
			<content:encoded><![CDATA[<p>I was planning on saving things up for Ivy Bridge but seeing that it&#8217;s release date is around 6 months (or more) away, I decided to bite the bullet and splurge a bit to build a new gaming PC.</p>
<p><a href="http://sylv3rblade.com/wp-content/uploads/2012/01/DSC_0111.jpg"><img class="aligncenter size-large wp-image-159" title="DSC_0111" src="http://sylv3rblade.com/wp-content/uploads/2012/01/DSC_0111-500x332.jpg" alt="" width="500" height="332" /></a></p>
<p>Here&#8217;s what I&#8217;ve bought to build my rig:</p>
<ul>
<li>Intel i5-2500K</li>
<li>Asus P8P67-M B3</li>
<li>G.Skill RipJaws 8gb (2x 4GB 1600Mhz)  DDR3</li>
<li>Seagate 500GB 7200 Sata 3</li>
<li>Cooler Master V8 CPU Cooler</li>
<li>Cooler Master Storm Enforcer</li>
<li>AeroCool Strike-X 80PLUS 600W PSU</li>
</ul>
<p>Total cost, around 30K Php</p>
<p><a href="http://sylv3rblade.com/wp-content/uploads/2012/01/DSC_0117.jpg"><img class="aligncenter size-large wp-image-160" title="DSC_0117" src="http://sylv3rblade.com/wp-content/uploads/2012/01/DSC_0117-500x332.jpg" alt="" width="500" height="332" /></a>Why the i5-2500k?  It&#8217;s the most popular CPU in Intel&#8217;s current Sandy Bridge line and with good reason.  First off, it&#8217;s the cheapest unlocked processor, the next item on the list is the i7-2600K and while offers a bit of improvement over the 2500K, the added cost for me is simply not worth it.</p>
<p>My initial build had me going with the Asus P8P67-M B3&#8211;take note that I say initial because I&#8217;m going to replace it soon with a Z68 board (either an Intel one or another Asus board).  Mind you if you&#8217;re looking for a cheap way to mount your Sandy Bridge processor, the  P8P67-M  is a good board,  It&#8217;s got the basics laid down like support for 1600 Mhz DDR3 DIMMs, support for fairly large CPU cooler (in my case the Cooler Master V8), SATA 3 6Gb/s ports, USB3, etc.    <del>For my use case however, I&#8217;ll be better off going with a Z68 board due to Virtu, Intel&#8217;s multi-GPU solution implemented at board-level.  Basically the gist of Virtu is that you&#8217;ll be using Sandy Bridge&#8217;s on-chip GPU until your applications demand something beefier.  I&#8217;m still looking at reviews but I think my gist is spot on so correct me if I&#8217;m wrong as I&#8217;m basing this on a several weeks old review from Anandtech. </del> Apparently I read things wrong, Virtu appears to be implemented on application level indicating that there will be a performance hit when you opt to use the IGP and discrete GPU at the same time :/  Darn.</p>
<p>I stuck with a Seagate 500GB 7200 because I still have my 1TB Seagate 10K Raptor which I&#8217;m currently using as my primary drive.  I wanted to get an SSD for this but that&#8217;ll have to wait for my Ivy Bridge (??? hopefully haha) build.</p>
<p>Looking at the list, there&#8217;s no GPU from the things I&#8217;ve bought.  I still have two DX10 GPUs which have served me well, the GeForce 460 GTX and the Radeon 4850 1GB SE.   The current build uses the Nvidia card because I had stability issues with the 4850 :/ I&#8217;m still going to use for my HTPC once I have purchased the new Z68 board.</p>
<p>Now for the case, I opted for the Storm Enforcer because my first choice, the 690 II Advanced was sadly out of stock <img src='http://sylv3rblade.com/wp-includes/images/smilies/icon_sad.gif' alt=':(' class='wp-smiley' /> .  Compared to my older case, the Thermaltake V3, the Storm Enforcer was a hell of a  lot easier to work with due to it&#8217;s massive size and features.  The price is well worth the looks too <img src='http://sylv3rblade.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>I got the v8 and Strike-X PSU for kicks (admittedly it was an expensive choice &gt;_&gt; but it looks quite well with the case doesn&#8217;t it?).</p>
<h2>Is it worth it?</h2>
<p>In a word, yes.</p>
<p>My computer is now leagues faster than my older rig which was based on a Core 2 Duo processor and it feels a lot snappier than my 2011 Macbook Pro who&#8217;s performance is quite bottlenecked by the 5400 RPM drive (something I plan to remedy in the near future).  In terms of games, I can play Metro 2033 on High (with a few tweaks) and Skyrim on Ultra at 1920 x 1080 resolution considerably well (with a quite a few dropped frames on areas with high particle count thanks to my video card and it&#8217;s limited bus :/).  One of the best perks I&#8217;ve had is mirroring games on my 32 LCD TV so my &#8220;audience&#8221; can enjoy watching me play <img src='http://sylv3rblade.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> ).</p>
<p>My new build will be an i3-2100 HTPC/Fileserver which I plan to get this January to replace my Buffalo NAS.
<a href='http://sylv3rblade.com/2012/01/built-a-new-pc-over-the-holidays/dsc_0111/' title='DSC_0111'><img width="150" height="150" src="http://sylv3rblade.com/wp-content/uploads/2012/01/DSC_0111-150x150.jpg" class="attachment-thumbnail" alt="DSC_0111" title="DSC_0111" /></a>
<a href='http://sylv3rblade.com/2012/01/built-a-new-pc-over-the-holidays/dsc_0117/' title='DSC_0117'><img width="150" height="150" src="http://sylv3rblade.com/wp-content/uploads/2012/01/DSC_0117-150x150.jpg" class="attachment-thumbnail" alt="DSC_0117" title="DSC_0117" /></a>
<a href='http://sylv3rblade.com/2012/01/built-a-new-pc-over-the-holidays/dsc_0123/' title='DSC_0123'><img width="150" height="150" src="http://sylv3rblade.com/wp-content/uploads/2012/01/DSC_0123-150x150.jpg" class="attachment-thumbnail" alt="DSC_0123" title="DSC_0123" /></a>
<a href='http://sylv3rblade.com/2012/01/built-a-new-pc-over-the-holidays/dsc_0128/' title='DSC_0128'><img width="150" height="150" src="http://sylv3rblade.com/wp-content/uploads/2012/01/DSC_0128-150x150.jpg" class="attachment-thumbnail" alt="DSC_0128" title="DSC_0128" /></a>
<a href='http://sylv3rblade.com/2012/01/built-a-new-pc-over-the-holidays/dsc_0134/' title='DSC_0134'><img width="150" height="150" src="http://sylv3rblade.com/wp-content/uploads/2012/01/DSC_0134-150x150.jpg" class="attachment-thumbnail" alt="DSC_0134" title="DSC_0134" /></a>
<a href='http://sylv3rblade.com/2012/01/built-a-new-pc-over-the-holidays/dsc_0137/' title='DSC_0137'><img width="150" height="150" src="http://sylv3rblade.com/wp-content/uploads/2012/01/DSC_0137-150x150.jpg" class="attachment-thumbnail" alt="DSC_0137" title="DSC_0137" /></a>
<a href='http://sylv3rblade.com/2012/01/built-a-new-pc-over-the-holidays/dsc_0142/' title='DSC_0142'><img width="150" height="150" src="http://sylv3rblade.com/wp-content/uploads/2012/01/DSC_0142-150x150.jpg" class="attachment-thumbnail" alt="DSC_0142" title="DSC_0142" /></a>
<a href='http://sylv3rblade.com/2012/01/built-a-new-pc-over-the-holidays/dsc_0143/' title='DSC_0143'><img width="150" height="150" src="http://sylv3rblade.com/wp-content/uploads/2012/01/DSC_0143-150x150.jpg" class="attachment-thumbnail" alt="DSC_0143" title="DSC_0143" /></a>
</p>
]]></content:encoded>
			<wfw:commentRss>http://sylv3rblade.com/2012/01/built-a-new-pc-over-the-holidays/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Need moar coffee</title>
		<link>http://sylv3rblade.com/2011/11/need-moar-coffee/</link>
		<comments>http://sylv3rblade.com/2011/11/need-moar-coffee/#comments</comments>
		<pubDate>Thu, 24 Nov 2011 01:34:58 +0000</pubDate>
		<dc:creator>sylv3rblade</dc:creator>
				<category><![CDATA[Personal Space]]></category>

		<guid isPermaLink="false">http://sylv3rblade.com/?p=142</guid>
		<description><![CDATA[Sleep is a bit of a rare commodity for me these past few days :/ Must. Get. Sleep. But I need to finish my projects. Need. Moar. Coffee.]]></description>
			<content:encoded><![CDATA[<p>Sleep is a bit of a rare commodity for me these past few days :/  </p>
<p>Must.<br />
Get.<br />
Sleep.</p>
<p>But I need to finish my projects.  </p>
<p><a href="http://sylv3rblade.com/wp-content/uploads/2011/11/DSC_0720.jpg"><img src="http://sylv3rblade.com/wp-content/uploads/2011/11/DSC_0720-500x753.jpg" alt="" title="Need moar coffee" width="500" height="753" class="aligncenter size-large wp-image-149" /></a></p>
<p>Need.<br />
Moar.<br />
Coffee.</p>
]]></content:encoded>
			<wfw:commentRss>http://sylv3rblade.com/2011/11/need-moar-coffee/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Back online yay!</title>
		<link>http://sylv3rblade.com/2011/10/back-online-yay/</link>
		<comments>http://sylv3rblade.com/2011/10/back-online-yay/#comments</comments>
		<pubDate>Thu, 27 Oct 2011 00:24:33 +0000</pubDate>
		<dc:creator>sylv3rblade</dc:creator>
				<category><![CDATA[Web Hosting]]></category>

		<guid isPermaLink="false">http://sylv3rblade.com/?p=131</guid>
		<description><![CDATA[FINALLY! I lost all hope of waiting for the host of my dev box to get things in line and bring back my development VPS from it&#8217;s infinite downtime so I said &#8220;screw it&#8221; and moved this blog back under (&#8230;)</p><p><a href="http://sylv3rblade.com/2011/10/back-online-yay/">Read the rest of this entry &#187;</a></p>]]></description>
			<content:encoded><![CDATA[<p>FINALLY!</p>
<p>I lost all hope of waiting for the host of my dev box to get things in line and bring back my development VPS from it&#8217;s infinite downtime so I said &#8220;screw it&#8221; and moved this blog back under my  &#8220;blog&#8221; server at WiredTree and got myself a new VPS from Linode. </p>
<p>Hurrah!</p>
<p>From the get go, I LOOOOOOOVE Linode. Awesome ticket response time, awesome server spec for your money and best of all, I got a VPS in Tokyo (response time yay).  Checkout their plans <a href="http://www.linode.com/?r=c4b97def4eb0615490aba507091ec4628b92a4b3">here</a> [Protip: that's my referral link].</p>
<p><a href="http://sylv3rblade.com/wp-content/uploads/2011/10/Linode_logo.jpeg"><img src="http://sylv3rblade.com/wp-content/uploads/2011/10/Linode_logo.jpeg" alt="" title="Linode_logo" width="267" height="59" class="aligncenter size-full wp-image-133" /></a></p>
<p>You can checkout the only project (for now at least) I have on my Linode VPS (Project Alter.. check it out <a href="http://projectalter.com">here</a>).  Once I get things running smoothly (posting updates, not rolling out new code since that&#8217;s been optimized thanks to Capistrano), I&#8217;ll upload more projects onto it.</p>
<p>I am a bit miffed that they only support credit card payments as I have to manually deposit money onto my EON card to pay for it instead of simply getting paypal subscription to do it for me but hey, for the money I&#8217;m paying and the service I&#8217;m getting, it&#8217;s worth it.  Yes, I could simply allow my EON card to draw funds from my Paypal account but I don&#8217;t like the extra charges.</p>
<p>In any case, I&#8217;m happy to get things back online.  Now I need to go back to work on Project Alter <img src='http://sylv3rblade.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://sylv3rblade.com/2011/10/back-online-yay/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Installing XCache on a server with Cpanel</title>
		<link>http://sylv3rblade.com/2011/05/installing-xcache-on-a-server-with-cpanel/</link>
		<comments>http://sylv3rblade.com/2011/05/installing-xcache-on-a-server-with-cpanel/#comments</comments>
		<pubDate>Tue, 03 May 2011 01:12:43 +0000</pubDate>
		<dc:creator>sylv3rblade</dc:creator>
				<category><![CDATA[Web Hosting]]></category>

		<guid isPermaLink="false">http://sylv3rblade.com/?p=125</guid>
		<description><![CDATA[Traffic on my VPS jumped over the past few weeks and I needed a better caching solution so I installed W3 Total Cache. It provided you the option of caching pages, databases queries, features an object cache and even allows (&#8230;)</p><p><a href="http://sylv3rblade.com/2011/05/installing-xcache-on-a-server-with-cpanel/">Read the rest of this entry &#187;</a></p>]]></description>
			<content:encoded><![CDATA[<p>Traffic on my VPS jumped over the past few weeks and I needed a better caching solution so I installed W3 Total Cache.  It provided you the option of caching pages, databases queries, features an object cache and even allows you to configure a CDN to serve your files.  Trouble is, my server only had eaccelerator installed and it wasn&#8217;t compiled to use object-caching.  Instead of upgrading recompiling eaccelerator, I opted to install XCache on my CPanel-enabled VPS.</p>
<p>Here&#8217;s a complete guide on installing Xcache on Cpanel.</p>
<p>First get the latest sources for XCache.  As of publishing this guide, it&#8217;s 1.3.1</p>
<pre class="brush: bash; title: ; notranslate">
cd /usr/src/
wget http://xcache.lighttpd.net/pub/Releases/1.3.1/xcache-1.3.1.tar.gz
</pre>
<p>After which, unarchive the source and cd into the directory</p>
<pre class="brush: bash; title: ; notranslate">
tar -xzvf xcache-1.3.1.tar.gz
cd xcache-1.3.1
</pre>
<p>Time to configure the sources for the current PHP environment</p>
<pre class="brush: bash; title: ; notranslate">
[root@host xcache-1.3.1]# phpize
Configuring for:
PHP Api Version:         20041225
Zend Module Api No:      20060613
Zend Extension Api No:   220060519
</pre>
<p>Once you see the message above, XCache is ready to install.</p>
<pre class="brush: bash; title: ; notranslate">
./configure &amp;&amp; make &amp;&amp; make install
</pre>
<p>This will check for errors and run the installation script.  Once complete, you should see this line:</p>
<pre class="brush: bash; title: ; notranslate">
Installing shared extensions: /usr/local/lib/php/extensions/no-debug-non-zts-20060613/
</pre>
<p>If like me, you have a different OPCode cache installed like eaccelerator, you need to comment any instances of these from your php.ini file.  In my case it was</p>
<pre class="brush: bash; title: ; notranslate">
extension=eaccelerator.so
eaccelerator.shm_size=&quot;16&quot;
eaccelerator.cache_dir=&quot;/tmp/eaccelerator&quot;
eaccelerator.enable=&quot;1&quot;
eaccelerator.optimizer=&quot;1&quot;
eaccelerator.check_mtime=&quot;1&quot;
eaccelerator.debug=&quot;0&quot;
eaccelerator.filter=&quot;&quot;
eaccelerator.shm_max=&quot;0&quot;
eaccelerator.shm_ttl=&quot;0&quot;
eaccelerator.shm_prune_period=&quot;0&quot;
eaccelerator.shm_only=&quot;0&quot;
eaccelerator.compress=&quot;1&quot;
eaccelerator.compress_level=&quot;9&quot;
</pre>
<p>After that copy these into the php.ini.  Note that these are the settings on my server.  Tweak them as you need or please.</p>
<pre class="brush: bash; title: ; notranslate">
zend_extension=&quot;/usr/local/lib/php/extensions/no-debug-non-zts-20060613/xcache.so&quot;
[xcache.admin]
xcache.admin.auth = off
xcache.admin.enable_auth = off

; admin installation: http://xcache.lighttpd.net/wiki/InstallAdministration
xcache.admin.user = &quot;admin username&quot; ;if you're going to use this
xcache.admin.pass = &quot;md5 hash of your password&quot; ;change accordingly

[xcache]
xcache.shm_scheme = &quot;mmap&quot;
; to disable: xcache.size=0
; to enable : xcache.size=64M etc (any size &gt; 0) and your system mmap allows
xcache.size = 128M
; set to cpu count (cat /proc/cpuinfo |grep -c processor)
xcache.count = 4
; just a hash hints, you can always store count(items) &gt; slots
xcache.slots = 8K
; ttl of the cache item, 0=forever
xcache.ttl = 13300
xcache.cacher = On
; interval of gc scanning expired items, 0=no scan, other values is in seconds
xcache.gc_interval = 0

; same as aboves but for variable cache
xcache.var_size = 2M
xcache.var_count = 2
xcache.var_slots = 1K
; default ttl
xcache.var_ttl = 3600
xcache.var_maxttl = 7200
xcache.var_gc_interval = 300

xcache.test = Off
; N/A for /dev/zero
xcache.readonly_protection = Off
; for *nix, xcache.mmap_path is a file path, not directory.
; Use something like &quot;/tmp/xcache&quot; if you want to turn on ReadonlyProtection
; 2 group of php won't share the same /tmp/xcache
; for win32, xcache.mmap_path=anonymous map name, not file path
xcache.mmap_path = &quot;/dev/zero&quot;

; leave it blank(disabled) or &quot;/tmp/phpcore/&quot;
; make sure it's writable by php (without checking open_basedir)
xcache.coredump_directory = &quot;&quot;

; per request settings
xcache.cacher = On
xcache.stat = On
xcache.optimizer = Off

[xcache.coverager]
; per request settings
; enable coverage data collecting for xcache.coveragedump_directory and xcache_coverager_start/stop/get/clean() functions (will hurt executing performance)
xcache.coverager = Off
</pre>
<p>After editing your PHP ini, type:</p>
<pre class="brush: bash; title: ; notranslate">
 php -v
</pre>
<p>to check if things loaded properly.  This is the output from my server:</p>
<pre class="brush: bash; title: ; notranslate">
[root@host xcache-1.3.1]# php -v
PHP 5.2.11 (cli) (built: Oct 27 2009 16:43:13)
Copyright (c) 1997-2009 The PHP Group
Zend Engine v2.2.0, Copyright (c) 1998-2009 Zend Technologies
    with XCache v1.3.1, Copyright (c) 2005-2010, by mOo
    with the ionCube PHP Loader v3.3.20, Copyright (c) 2002-2010, by ionCube Ltd., and
    with Zend Extension Manager v1.2.2, Copyright (c) 2003-2007, by Zend Technologies
    with Zend Optimizer v3.3.3, Copyright (c) 1998-2007, by Zend Technologies
</pre>
<p>And you&#8217;re done.  After which i simply set W3 Total Cache to use XCache for Database and Object Caching, flushed all existing caches and voila!</p>
]]></content:encoded>
			<wfw:commentRss>http://sylv3rblade.com/2011/05/installing-xcache-on-a-server-with-cpanel/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Just upgraded ;)</title>
		<link>http://sylv3rblade.com/2011/04/just-upgraded/</link>
		<comments>http://sylv3rblade.com/2011/04/just-upgraded/#comments</comments>
		<pubDate>Tue, 19 Apr 2011 05:40:45 +0000</pubDate>
		<dc:creator>sylv3rblade</dc:creator>
				<category><![CDATA[Personal Space]]></category>
		<category><![CDATA[Macbook Pro]]></category>

		<guid isPermaLink="false">http://sylv3rblade.com/?p=87</guid>
		<description><![CDATA[I bit the bullet. I&#8217;ve managed to complete a few projects this year which gave me enough money to sponsor the upgrade . Yep it&#8217;s a costly upgrade (but I still have a few more things to get, like 2 (&#8230;)</p><p><a href="http://sylv3rblade.com/2011/04/just-upgraded/">Read the rest of this entry &#187;</a></p>]]></description>
			<content:encoded><![CDATA[<p>I bit the bullet.</p>
<p>I&#8217;ve managed to complete a few projects this year which gave me enough money to sponsor the upgrade <img src='http://sylv3rblade.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> .  </p>
<p>Yep it&#8217;s a costly upgrade (but I still have a few more things to get, like 2 SSDs, one for my older Core 2 13&#8243; MBP and the new one) but it&#8217;s well worth every cent spent.<br />
<span id="more-87"></span></p>
<p><a href="http://sylv3rblade.com/wp-content/uploads/2011/04/DSC_0560.jpg"><img src="http://sylv3rblade.com/wp-content/uploads/2011/04/DSC_0560-500x332.jpg" alt="" title="Hello MacBook Pro 2011" width="500" height="332" class="aligncenter size-large wp-image-107" /></a></p>
<p>I decided to upgrade my work/play/all-around laptop for several reasons:</p>
<ul>
<li>The older model is showing it&#8217;s age, cucumber tests take AGES to run</li>
<li>The cramped 13&#8243; screen is really getting to me</li>
<li>I need more computing power for the tools I use in photography (Photoshop, Lightroom, etc)</li>
<li>Gaems!  (lol)</li>
</ul>
<p><a href="http://sylv3rblade.com/wp-content/uploads/2011/04/DSC_0567.jpg"><img src="http://sylv3rblade.com/wp-content/uploads/2011/04/DSC_0567-500x332.jpg" alt="" title="Hello MacBook Pro 2011" width="500" height="332" class="aligncenter size-large wp-image-108" /></a><br />
Powered by an i7 Sandy Bridge chip, this brand new model is wickedly fast.  Of course it&#8217;s still hindered by the 5400 RPM HDD (which I&#8217;ll be remedying in a few months or so) but in terms of number crunching and general response time, it&#8217;s still a cut above my older Core 2 Duo powered MBP.  The 6490M is still quite slow (yeah, yeah, I should&#8217;ve gotten the better model) in terms of drawing pixels but it&#8217;s still more than enough to run the only games I play on the Mac, StarCraft 2 and Civilization V.</p>
<p>I could&#8217;ve waited until Lion was released before getting this unit but I think it&#8217;s well worth forking the customary upgrade fee.  Besides, my main computer kicked the bucket at the time so I really needed a beefy machine.  :/  Too bad it pushed back my plans on getting a new rig till October (or December at worst) but at least I&#8217;ll be able to get either a Z68-based or Bulldoser-based rig by then.  So yeah, everything went better than expected <img src='http://sylv3rblade.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://sylv3rblade.com/2011/04/just-upgraded/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>cPanel error: httpd failed &#8211; A restart was attempted automagically</title>
		<link>http://sylv3rblade.com/2011/04/cpanel-error-httpd-failed-a-restart-was-attempted-automagically/</link>
		<comments>http://sylv3rblade.com/2011/04/cpanel-error-httpd-failed-a-restart-was-attempted-automagically/#comments</comments>
		<pubDate>Sun, 10 Apr 2011 12:37:02 +0000</pubDate>
		<dc:creator>sylv3rblade</dc:creator>
				<category><![CDATA[Web Hosting]]></category>
		<category><![CDATA[Apache]]></category>
		<category><![CDATA[cPanel]]></category>
		<category><![CDATA[httpd failed]]></category>

		<guid isPermaLink="false">http://sylv3rblade.com/?p=111</guid>
		<description><![CDATA[While my recent server transfer has been smooth sailing, I did encounter one error that bugged the hell out of me. At certain points of the day, I&#8217;d be receiving a notice that my VPS had it&#8217;s httpd process fail (&#8230;)</p><p><a href="http://sylv3rblade.com/2011/04/cpanel-error-httpd-failed-a-restart-was-attempted-automagically/">Read the rest of this entry &#187;</a></p>]]></description>
			<content:encoded><![CDATA[<p>While my recent server transfer has been smooth sailing, I did encounter one error that bugged the hell out of me.</p>
<p>At certain points of the day, I&#8217;d be receiving a notice that my VPS had it&#8217;s httpd process fail and restart automatically.  A copy of the email is posted below:</p>
<blockquote><p>httpd failed @ Sun Apr 10 07:07:09 2011.. A restart was attempted automagically.<br />
Service Check Method:  [tcp connect]</p>
<p>Failure Reason: Unable to connect to port 80</p></blockquote>
<p>After a quick bout of google-fu I found our that the server is exceeding the allowed number of connections <img src='http://sylv3rblade.com/wp-includes/images/smilies/icon_sad.gif' alt=':(' class='wp-smiley' />   Not good considering that the new server is quite powerful enough to handle more than it&#8217;s current peak traffic.  Reading further into this, I had to execute this line:</p>
<pre class="brush: plain; title: ; notranslate">
grep MaxClients /usr/local/apache/logs/error_log
</pre>
<p>which then netted me this response:</p>
<pre class="brush: bash; title: ; notranslate">
WARNING: MaxClients of 512 exceeds ServerLimit value of 256 servers,
 lowering MaxClients to 256.  To increase, please see the ServerLimit
[Sat Apr 09 12:47:10 2011] [error] server reached MaxClients setting, consider raising the MaxClients setting
</pre>
<p>Soooo the problem is how apache is setup.  The fix?  Simply log in to cPanel and set the setting for MaxClients to something higher (in my case I doubled the number from 256 to 512) as well as he ServerLimit (to the same number).  Of course if you want to do this manually, simply edit the MaxClients settings on apache&#8217;s httpd.conf file and restart the server.</p>
]]></content:encoded>
			<wfw:commentRss>http://sylv3rblade.com/2011/04/cpanel-error-httpd-failed-a-restart-was-attempted-automagically/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

