<?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>Thoughtless Banter - John Bellone &#187; Internet</title>
	<atom:link href="http://thoughtlessbanter.com/category/internet/feed/" rel="self" type="application/rss+xml" />
	<link>http://thoughtlessbanter.com</link>
	<description>Musings from an east coast software developer, writer and reader.</description>
	<lastBuildDate>Fri, 04 May 2012 02:35:13 +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>Got Code To Paste In A Haste?</title>
		<link>http://thoughtlessbanter.com/2011/11/30/got-code-to-paste-in-a-haste/</link>
		<comments>http://thoughtlessbanter.com/2011/11/30/got-code-to-paste-in-a-haste/#comments</comments>
		<pubDate>Wed, 30 Nov 2011 16:34:13 +0000</pubDate>
		<dc:creator>JB</dc:creator>
				<category><![CDATA[Internet]]></category>
		<category><![CDATA[Software]]></category>
		<category><![CDATA[Haste]]></category>
		<category><![CDATA[Tools]]></category>

		<guid isPermaLink="false">http://thoughtlessbanter.com/?p=862</guid>
		<description><![CDATA[A very close friend of mine released a new type of pastebin that has some very fancy features that really make it shine over any other interpretation on this type of idea. The client, which is written in Ruby and open source, is quickly installed through the use of the standard Ruby Gem installation approach. [...]]]></description>
			<content:encoded><![CDATA[<p>A <a href="http://twitter.com/seejohnrun">very close friend of mine</a> released a <a href="http://hastebin.com">new type of pastebin</a> that has some very fancy features that really make it shine over any other interpretation on this type of idea. The client, which is <a href="http://github.com/seejohnrun/haste-client">written in Ruby and open source</a>, is quickly installed through the use of the standard Ruby Gem installation approach. At this point you can immediately echo any code that you wish into the <em>haste</em> command on the terminal and it will be pushed up to a <a href="http://github.com/seejohnrun.com/haste-server">node.js powered backend</a> which stores it, syntax highlighted, and returns a URL back down to you.</p>
<p>The <a href="http://hastebin.com">web interface</a> is simplistic, yet beautifully crafted to allow for inline text editing right in your web browser. Shortcut commands exist to create a new piece of code, save one, and tweet it immediately. In a single day it has climbed among <a href="">the top spot on Hacker News</a>, and is already getting some very constructive feedback. The fact that both the server and the client are open source allow for internal implementations to be rolled out without any worry to proprietary code being leaked to the outside.</p>
<p>I know he&#8217;ll be reading this post so I&#8217;ll gripe a little, and give my wish list:</p>
<li>It&#8217;d be nice to allow for a quick shortcut for tab spacing. I work in C/C++ every day, and like to have a little bit more tab that you have there by default. <em>More tab please!</em></li>
<li>In the future when the Gist API becomes public it&#8217;d be really awesome to allow for forking, and pushing back up to your Gist.</li>
<li>An emacs plugin would be nice, but since I know <a href="http://twitter.com/seejohnrun</a>John</a> doesn&#8217;t use Emacs I&#8217;ll probably be writing one myself.</li>
<p>More information can be found <a href="http://www.hastebin.com/about.md">at the main site itself</a>, and of course, go download <a href="http://github.com/seejohnrun/haste-client">the client</a> and <a href="http://github.com/seejohnrun/haste-server">the server</a> and deploy it at your nine-to-five today!</p>
]]></content:encoded>
			<wfw:commentRss>http://thoughtlessbanter.com/2011/11/30/got-code-to-paste-in-a-haste/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Social Integration: Tweeting, +1 and Like</title>
		<link>http://thoughtlessbanter.com/2011/11/29/adding-twitter-1-and-like/</link>
		<comments>http://thoughtlessbanter.com/2011/11/29/adding-twitter-1-and-like/#comments</comments>
		<pubDate>Wed, 30 Nov 2011 04:20:26 +0000</pubDate>
		<dc:creator>JB</dc:creator>
				<category><![CDATA[Internet]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Facebook]]></category>
		<category><![CDATA[Google]]></category>
		<category><![CDATA[Google Plus]]></category>
		<category><![CDATA[integration]]></category>
		<category><![CDATA[like]]></category>
		<category><![CDATA[plus]]></category>
		<category><![CDATA[Twitter]]></category>
		<category><![CDATA[website]]></category>

		<guid isPermaLink="false">http://thoughtlessbanter.com/?p=836</guid>
		<description><![CDATA[You may have noticed that there are several websites now that included integration with social networking websites such as Facebook, Google Plus and Twitter. These small buttons allow your user&#8217;s to share content instantly with their friends. Depending on which you&#8217;re including on your site it&#8217;ll show up differently, and each has a separate process [...]]]></description>
			<content:encoded><![CDATA[<p>You may have noticed that there are several websites now that included integration with social networking websites such as <a href="http://facebook.com">Facebook</a>, <a href="http://plus.google.com">Google Plus</a> and <a href="http://twitter.com">Twitter</a>. These small buttons allow your user&#8217;s to share content instantly with their friends. Depending on which you&#8217;re including on your site it&#8217;ll show up differently, and each has a separate process to include them on your blog&#8217;s pages. Since I am using <a href="http://wordpress.com">WordPress</a> I will explain how to do this, but if you follow the example it should work in the broad case as well.</p>
<p>This functionality is provided by using meta information that is stored on the user&#8217;s browser. Unless you decide to do something nefarious, you do not have to their data by merely adding these buttons, but it does expose your user&#8217;s to a potential security risk. There are browser plugins that allow them to turn off this functionality if they have it enabled. If you&#8217;re comfortable with all this, then go on ahead and follow the instructions.</p>
<p><a href="https://developers.facebook.com/docs/reference/plugins/like/">A useful wizard</a> is available that provides you with both the <a href="">XHTML</a> and Javascript necessary to make this functionality work correctly on your site. The Javascript code snippet provides the bridge between the user&#8217;s browser and the Facebook social graph that this is using in the background. There are a few routes regarding how to implement it, I chose the HTML5 approach which asked me to add a schema namespace to the <em>HTML element</em>, and then used the custom <em>like button</em> element that is provided to display it.</p>
<p><strong>Javascript snippet</strong>&nbsp;<em>Place this after your BODY element</em></p>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;"><span style="color: #339933;">&lt;</span>script src<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;//connect.facebook.net/en_US/all.js&quot;</span><span style="color: #339933;">&gt;&lt;/</span>script<span style="color: #339933;">&gt;</span>
        <span style="color: #339933;">&lt;</span>div id<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;fb-root&quot;</span><span style="color: #339933;">&gt;&lt;/</span>div<span style="color: #339933;">&gt;</span>
        <span style="color: #339933;">&lt;</span>script<span style="color: #339933;">&gt;</span><span style="color: #009900;">&#40;</span><span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span>d<span style="color: #339933;">,</span> s<span style="color: #339933;">,</span> id<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
        <span style="color: #003366; font-weight: bold;">var</span> js<span style="color: #339933;">,</span> fjs <span style="color: #339933;">=</span> d.<span style="color: #660066;">getElementsByTagName</span><span style="color: #009900;">&#40;</span>s<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#91;</span><span style="color: #CC0000;">0</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
        <span style="color: #000066; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span>d.<span style="color: #660066;">getElementById</span><span style="color: #009900;">&#40;</span>id<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><span style="color: #000066; font-weight: bold;">return</span><span style="color: #339933;">;</span><span style="color: #009900;">&#125;</span>
        js <span style="color: #339933;">=</span> d.<span style="color: #660066;">createElement</span><span style="color: #009900;">&#40;</span>s<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> js.<span style="color: #660066;">id</span> <span style="color: #339933;">=</span> id<span style="color: #339933;">;</span>
        js.<span style="color: #660066;">src</span> <span style="color: #339933;">=</span> <span style="color: #3366CC;">&quot;//connect.facebook.net/en_US/all.js#xfbml=1&amp;appId=309698452382243&quot;</span><span style="color: #339933;">;</span>
        fjs.<span style="color: #660066;">parentNode</span>.<span style="color: #660066;">insertBefore</span><span style="color: #009900;">&#40;</span>js<span style="color: #339933;">,</span> fjs<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        <span style="color: #009900;">&#125;</span><span style="color: #009900;">&#40;</span>document<span style="color: #339933;">,</span> <span style="color: #3366CC;">'script'</span><span style="color: #339933;">,</span> <span style="color: #3366CC;">'facebook-jssdk'</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;&lt;/</span>script<span style="color: #339933;">&gt;</span></pre></div></div>

<p><strong>HTML element</strong>&nbsp;<em>Place this where you want the button to appear.</em></p>

<div class="wp_syntax"><div class="code"><pre class="html" style="font-family:monospace;">&lt;fb:like href=&quot;http://example.com&quot; send=&quot;true&quot; layout=&quot;button_count&quot; show_faces=&quot;true&quot; action=&quot;recommend&quot; font=&quot;lucida grande&quot; display=&quot;inline&quot;&gt;&lt;/fb:like&gt;</pre></div></div>

</p>
<p>You will be given the exact HTML element tag that you should use based upon your wizard settings. If you want to use this dynamically in the <a href="http://codex.wordpress.org/The_Loop">WordPress Loop</a> to display under each post you&#8217;ll have to use a PHP function <code>the_permalink();</code> which will return the URI to the page in question. This can also be done on the single pages if you so desire. One last step is to include meta information at the top of each page to let Facebook know how the post should be described in the user&#8217;s activity feed. This is very straight forward and simple. An optional <em>title</em> element should be used on individual pages. Categories can be selected through the wizard.</p>
<p><strong>Meta information</strong>&nbsp;<em>Place this in the HEAD element</em></p>

<div class="wp_syntax"><div class="code"><pre class="html" style="font-family:monospace;">&lt;meta property=&quot;og:type&quot; content=&quot;blog&quot; /&gt;
&lt;meta property=&quot;og:site_name&quot; content=&quot;Thoughtless Banter&quot; /&gt;
&lt;meta property=&quot;fb:admins&quot; content=&quot;199800257&quot; /&gt;</pre></div></div>

</p>
<p>The <a href="http://plus.google.com">Google Plus</a> approach is very similar, and doesn&#8217;t require any meta information tags. When a user decides to &#8220;+1&#8243; any of your posts they will in a special location on that user&#8217;s profile, and in any the subscriber&#8217;s feeds as well. You&#8217;ll need to include a Javascript snippet, like above, and a special HTML tag element. You can add all of this below the Facebook directives if you desire.</p>
<p><strong>Javascript snippet</strong>&nbsp;<em>Place this after the BODY element.</em></p>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;"><span style="color: #339933;">&lt;</span>script type<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;text/javascript&quot;</span><span style="color: #339933;">&gt;</span>
  <span style="color: #009900;">&#40;</span><span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
    <span style="color: #003366; font-weight: bold;">var</span> po <span style="color: #339933;">=</span> document.<span style="color: #660066;">createElement</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'script'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> po.<span style="color: #660066;">type</span> <span style="color: #339933;">=</span> <span style="color: #3366CC;">'text/javascript'</span><span style="color: #339933;">;</span> po.<span style="color: #660066;">async</span> <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">true</span><span style="color: #339933;">;</span>
    po.<span style="color: #660066;">src</span> <span style="color: #339933;">=</span> <span style="color: #3366CC;">'https://apis.google.com/js/plusone.js'</span><span style="color: #339933;">;</span>
    <span style="color: #003366; font-weight: bold;">var</span> s <span style="color: #339933;">=</span> document.<span style="color: #660066;">getElementsByTagName</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'script'</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#91;</span><span style="color: #CC0000;">0</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span> s.<span style="color: #660066;">parentNode</span>.<span style="color: #660066;">insertBefore</span><span style="color: #009900;">&#40;</span>po<span style="color: #339933;">,</span> s<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
  <span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #339933;">&lt;/</span>script<span style="color: #339933;">&gt;</span></pre></div></div>

</p>
<p><strong>HTML element tag</strong>&nbsp;<em>Place this where you wish the button to appear.</em></p>

<div class="wp_syntax"><div class="code"><pre class="html" style="font-family:monospace;">&lt;g:plusone href=&quot;http://example.com&quot; size=&quot;medium&quot; annotation=&quot;inline&quot;&gt;&lt;/g:plusone&gt;</pre></div></div>

</p>
<p>Finally, the Twitter button is the easiest to place, and they once again provide a wizard for you to change the colors of the background, design, and number of tweets you wish to show (if you do not just want a button, but rather the feed itself). This one-liner can be placed anywhere you want the button to appear.</p>
<p>
<div class="wp_syntax"><div class="code"><pre class="html" style="font-family:monospace;">&lt;a href=&quot;https://twitter.com/share&quot; class=&quot;twitter-share-button&quot; data-url=&quot;http://thoughtlessbanter.com/2011/11/23/furniture-for-men/&quot; data-text=&quot;Furniture For Men&quot; data-count=&quot;horizontal&quot; data-via=&quot;johnbellone&quot;&gt;Tweet&lt;/a&gt;&lt;script type=&quot;text/javascript&quot; src=&quot;//platform.twitter.com/widgets.js&quot;&gt;</pre></div></div>

</p>
<p>That should basically the gist of how to get this functionality working on your website. Facebook offers more comprehensive widgets that take advantage of the social graph to display photos, and even information about user&#8217;s actions on your page. There is beta examples of how to post directly to the new <a href="">Facebook Timeline</a> feature that will be rolling out to your profile shortly. As more and more of these snippets become available you should consider both the advantages and the disadvantages of using them. I know that many user&#8217;s are worried about privacy and tracking that all the social sites are beginning to do. It is quite possible in the future that this type of functionality will be <em>opt-in</em> rather than <em>opt-out</em> and it may not work with the breadth of your user&#8217;s without their explicit consent. So be wary designing your website around these widgets specifically.</p>
]]></content:encoded>
			<wfw:commentRss>http://thoughtlessbanter.com/2011/11/29/adding-twitter-1-and-like/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Changing Virtual Hosts: Linode</title>
		<link>http://thoughtlessbanter.com/2011/11/28/changing-virtual-hosts-linnode/</link>
		<comments>http://thoughtlessbanter.com/2011/11/28/changing-virtual-hosts-linnode/#comments</comments>
		<pubDate>Tue, 29 Nov 2011 02:35:10 +0000</pubDate>
		<dc:creator>JB</dc:creator>
				<category><![CDATA[Internet]]></category>
		<category><![CDATA[Cloud]]></category>
		<category><![CDATA[linnode]]></category>
		<category><![CDATA[virtual hosting]]></category>

		<guid isPermaLink="false">http://thoughtlessbanter.com/?p=851</guid>
		<description><![CDATA[In the past I have had some problems with shared hosting services mainly due to the speed and limited functionality that was offered through their control panel interfaces. This one in particular used that famous cPanel garbage that got popular when most administrators didn&#8217;t know a lick about using Linux. A few years ago there [...]]]></description>
			<content:encoded><![CDATA[<p>In the past I have had some problems with <a href="http://dreamhost.com">shared hosting services</a> mainly due to the speed and limited functionality that was offered through their control panel interfaces. This one in particular used that famous <a href="http://cpanel.com">cPanel</a> garbage that got popular when most administrators didn&#8217;t know a lick about using Linux. A few years ago there was this whole &#8220;cloud&#8221; term that was passed around like the town slut. What this basically means is distributed, always-on, fault-tolerant, all those terms that your rockstar network engineer has thrown at you but really doesn&#8217;t know anything about. What it gives us neophyte administrators is a cheap, virtual Linux server that we can configure to our own liking.</p>
<p>This meant that I was no longer tethered to the limitations of the infrastructure provided by the website. My <a href="http://slicehost.net">previous host</a> got swallowed up by Rackspace and went to shit. A few months ago someone told me about <a href="http://www.linode.com/?r=b90dcd1bc65db59266072739b19ace1c82dceec0">Linnode</a> as it is a local Jersey business, so I started to check them out, and finally bit the bullet today and started the migration process from my old host to this brand spanking-new piece of iron. It took me about an hour and a half to get the blog post that you&#8217;re reading up and going. Not too shabby.</p>
<p>I&#8217;d like to reminisce for a moment: I remember way back when I had to work with someone that was paying hundreds of dollars a month for hosting to get ten megabytes and a subdomain for their account to start a video game portal in the late nineties. These bastards were being charged, by the subdomain, some absurd amount by the web host to set up a few DNS records. Now, mind you, it took sometimes several <em>days</em> for DNS to propagate across the Internet back then. I was able to accomplish this feat in the matter of about fifteen minutes, and ironically enough, the last machine that I had access to to actually receive the DNS update was my previous virtual host. Bastards.</p>
<p>So if you&#8217;re going to take the leap to virtual cloud hosting, give Jersey some love and set it up on <a href="http://www.linode.com/?r=b90dcd1bc65db59266072739b19ace1c82dceec0">Linnode.com</a>, and by clicking on that link you&#8217;ll give me a free credit for $20 if you sign up for three months. Not going to lie, I completely wrote this post to hopefully get two or three of you poor schmucks to get me a month of free hosting. But hell, I&#8217;m going to be posting more set up information regarding my LAMP stack in the upcoming day or so. Free consulting as far as I am concerned.</p>
<p>As always, go fuck yourself.</p>
]]></content:encoded>
			<wfw:commentRss>http://thoughtlessbanter.com/2011/11/28/changing-virtual-hosts-linnode/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Speeding Up With Apache With Nginx</title>
		<link>http://thoughtlessbanter.com/2011/11/27/speeding-up-apache-with-nginx/</link>
		<comments>http://thoughtlessbanter.com/2011/11/27/speeding-up-apache-with-nginx/#comments</comments>
		<pubDate>Mon, 28 Nov 2011 04:30:08 +0000</pubDate>
		<dc:creator>JB</dc:creator>
				<category><![CDATA[Internet]]></category>
		<category><![CDATA[Technology]]></category>
		<category><![CDATA[apache]]></category>
		<category><![CDATA[LAMP]]></category>
		<category><![CDATA[nginx]]></category>
		<category><![CDATA[Performance Tuning]]></category>
		<category><![CDATA[Wordpress]]></category>

		<guid isPermaLink="false">http://thoughtlessbanter.com/?p=842</guid>
		<description><![CDATA[For the past year or so I have been using nginx as a proxy in front of my Apache instances on the server that runs this blog, and a few other websites that I manage. The virtual machine itself is running an older LTS version of Ubuntu, and most of the applications on here are [...]]]></description>
			<content:encoded><![CDATA[<p>For the past year or so I have been using <a href="http://nginx.org/">nginx</a> as a proxy in front of my <a href="http://httpd.apache.org/docs/2.0/">Apache</a> instances on the server that runs this blog, and a few other websites that I manage. The virtual machine itself is running an older LTS version of <a href="https://wiki.ubuntu.com/LTS">Ubuntu</a>, and most of the applications on here are a traditional <a href="http://en.wikipedia.org/wiki/LAMP_(software_bundle)">LAMP setup</a> with a few C/C++ testing tools scattered around. For the most part it is operating as web server with a small work load. But as I&#8217;ve been adding a few more services running in the background I have noticed a little slowdown with <a href="http://wordpress.org">WordPress</a>.</p>
<p>There are some obvious advantages to this set up: Nginx can serve up all of the static content very, very quickly without having to send it down to the Apache instances to process. This frees up those daemons to only serve application logic, which in this case is the WordPress PHP application, but would work for nearly anything that you have set up with it. I will give you a quick example of the configuration that I have set up for this site.</p>
<p>This is the main configuration file for the Nginx application. Most of the commands here I have plucked from various tutorials across the internet, specifically dealing with the gzip settings, and as you can see there are a few connection and process related settings. These can all be tweaked at your desire, but I find that they work best on my low load cloud virtual server. The information to note here is the location of the proxy server (127.0.0.1:8080) that the requests will be sent to, as well as some folders for errors, logs, etc. These are all standard with the Nginx installation from aptitude and should be modified to suite you. Note the section where we include any scripts that are in /etc/nginx/sites-enabled/* which is similar to the set up of the Apache portion of the LAMP stack.</p>
<p><strong>/etc/nginx/nginx.conf</strong></p>

<div class="wp_syntax"><div class="code"><pre class="xorg_conf" style="font-family:monospace;">user  op;
worker_processes  <span style="color: #cc66cc;">2</span>;
&nbsp;
error_log  logs/error.log warn;
<span style="color: #adadad; font-style: italic;">#error_log  logs/error.log  notice;</span>
<span style="color: #adadad; font-style: italic;">#error_log  logs/error.log  info;</span>
&nbsp;
pid        logs/nginx.pid;
&nbsp;
events <span class="br0">&#123;</span>
    worker_connections  <span style="color: #cc66cc;">1024</span>;
<span class="br0">&#125;</span>
&nbsp;
http <span class="br0">&#123;</span>
    include       mime.types;
    default_type  application/octet-stream;
&nbsp;
    log_format  main  '$remote_addr - $remote_user <span class="br0">&#91;</span>$time_local<span class="br0">&#93;</span> <span style="color: #0000ff;">&quot;$request&quot;</span> '
                      '$status $body_bytes_sent <span style="color: #0000ff;">&quot;$http_referer&quot;</span> '
                      '<span style="color: #0000ff;">&quot;$http_user_agent&quot;</span> <span style="color: #0000ff;">&quot;$http_x_forwarded_for&quot;</span>';
&nbsp;
    access_log  logs/access.log  main;
&nbsp;
    gzip on;
    gzip_http_version <span style="color: #cc66cc;">1.0</span>;
    gzip_comp_level <span style="color: #cc66cc;">2</span>;
    gzip_min_length <span style="color: #cc66cc;">1100</span>;
    gzip_types text/plain text/css application/json application/x-javascript text/xml application/xml application/xml+rss text/javascript;
    gzip_buffers <span style="color: #cc66cc;">16</span> 8k;
    gzip_disable <span style="color: #0000ff;">&quot;MSIE [1-6].(?!.*SV1)&quot;</span>;
    gzip_vary on;
&nbsp;
    include /etc/nginx/sites-enabled/*;
&nbsp;
    server <span class="br0">&#123;</span>
        listen       <span style="color: #cc66cc;">80</span> default;
        access_log  logs/host.access.log  main;
&nbsp;
        error_page   <span style="color: #cc66cc;">500</span> <span style="color: #cc66cc;">502</span> <span style="color: #cc66cc;">503</span> <span style="color: #cc66cc;">504</span>  /50x.html;
        location = /50x.html <span class="br0">&#123;</span>
            root   html;
        <span class="br0">&#125;</span>
&nbsp;
        location / <span class="br0">&#123;</span>
                 include /etc/nginx/proxy.conf;
                 proxy_pass http://127.0.0.1:<span style="color: #cc66cc;">8080</span>;
        <span class="br0">&#125;</span>
    <span class="br0">&#125;</span>
<span class="br0">&#125;</span></pre></div></div>

</p>
<p>This configuration file sets up the particular domain inside of the Nginx proxy. It covers both the fully qualified domain name and the alias, and provides the root directory for serving up the static content. If there is content that you do not want to be served up (e.g. you have a public folder) make sure to point this only to your assets directory. We set up the path for logs to be written to (you&#8217;ll have to <em>mkdir -p</em> those directories) as well. The real gem here is the regular expression that specifies what static content will not get fielded off to the apache daemons. Obviously you can make any corrections here that you see fit. When you are done set up a symbolic link in /etc/nginx/sites-enabled/<site>.</p>
<p><strong>/etc/nginx/sites-available/thoughtlessbanter.com</strong></p>

<div class="wp_syntax"><div class="code"><pre class="xorg_conf" style="font-family:monospace;">server <span class="br0">&#123;</span>
 server_name www.thoughtlessbanter.com thoughtlessbanter.com;
 root /path/to/thoughtlessbanter.com/;
&nbsp;
 access_log /var/log/nginx/thoughtlessbanter.com/access.log;
 error_log /var/log/nginx/thoughtlessbanter.com/error.log warn;
&nbsp;
 location ~* ^.+.<span class="br0">&#40;</span>jpg|jpeg|gif|png|ico|css|zip|tgz|gz|rar|bz2|doc|xls|exe|pdf|ppt|txt|tar|mid|midi|wav|bmp|rtf|js<span class="br0">&#41;</span>$ <span class="br0">&#123;</span>
              access_log off;
              expires 30d;
 <span class="br0">&#125;</span>
&nbsp;
 location / <span class="br0">&#123;</span>
              include /etc/nginx/proxy.conf;
              proxy_pass http://127.0.0.1:<span style="color: #cc66cc;">8080</span>;
 <span class="br0">&#125;</span>
<span class="br0">&#125;</span></pre></div></div>

</p>
<p>This little tidbit is necessary to send over the header information from the HTTP client to the Apache daemon. These proxy settings, with this configuration set up, will affect <em>every single web request</em>, so be careful with what you modify here. There are additional parameters involving the maximum size of a payload, send, connect, and read timeouts, etc. These can all be looked up with <a href="http://wiki.nginx.org/HttpProxyModule">a quick Google search</a> and modified freely.</p>
<p><strong>/etc/nginx/proxy.conf</strong></p>

<div class="wp_syntax"><div class="code"><pre class="xorg_conf" style="font-family:monospace;">proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;</pre></div></div>

</p>
<p>Last you&#8217;ll need to modify your virtual host for all of the websites to now accept the connection on the new port, 8080, which is were Nginx will proxy the requests to. Be sure to set the server alias for both the fully qualified domain, and the shortened one. I am not an Apache configuration guru here, so some of the other options may not be applicable, but they seem to do the job for me. Most of my domains are further configured appropriately in the .htaccess in the document root directory.</p>
<p><strong>/etc/apache2/sites-available/thoughtlessbanter.com</strong></p>

<div class="wp_syntax"><div class="code"><pre class="xml" style="font-family:monospace;"><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;VirtualHost</span> *:8080<span style="color: #000000; font-weight: bold;">&gt;</span></span>
              ServerAdmin jb@thunkbrightly.com
              ServerName thoughtlessbanter.com
              ServerAlias www.thoughtlessbanter.com
              DocumentRoot /path/to/thoughtlessbanter.com
              <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;Directory</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span>
               Options FollowSymLinks
               AllowOverride All
              <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/Directory<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
              <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;Directory</span> /path/to/thoughtlessbanter.com<span style="color: #000000; font-weight: bold;">&gt;</span></span>
               Options Indexes FollowSymLinks MultiViews
               AllowOverride All
               Order allow,deny
               allow from all
              <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/Directory<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
&nbsp;
              ErrorLog /var/log/apache2/thoughtlessbanter.com-error.log
              CustomLog /var/log/apache2/access.log combined
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/VirtualHost<span style="color: #000000; font-weight: bold;">&gt;</span></span></span></pre></div></div>

</p>
<p>When you have made all of the changes feel free to restart the services and test your website. Once all the instances are bounced you should be able to point the browser to the location and still bring up your website. If you check the logs located in /var/log/nginx/<site> and /var/log/apache2/<site>.log you should be able to see your static content requests hitting nginx, and being served up right from there. The apache daemons will now only serve the application logic.</p>
<p>Let me know what you think. I&#8217;m sure I&#8217;ve made a few mistakes.</p>
]]></content:encoded>
			<wfw:commentRss>http://thoughtlessbanter.com/2011/11/27/speeding-up-apache-with-nginx/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Installing Lion</title>
		<link>http://thoughtlessbanter.com/2011/07/26/installing-lion/</link>
		<comments>http://thoughtlessbanter.com/2011/07/26/installing-lion/#comments</comments>
		<pubDate>Wed, 27 Jul 2011 03:08:55 +0000</pubDate>
		<dc:creator>JB</dc:creator>
				<category><![CDATA[Dreams and Thoughts]]></category>
		<category><![CDATA[Internet]]></category>
		<category><![CDATA[Technology]]></category>

		<guid isPermaLink="false">http://thoughtlessbanter.com/?p=789</guid>
		<description><![CDATA[At some point near the end of last week I decided to try out this new fangled operating system that Apple has been toting for the better part of the year. I used their Mac App Store but within the first few minutes I ran into some issues that should have been a forewarning to [...]]]></description>
			<content:encoded><![CDATA[<p>At some point near the end of last week I decided to try out this new fangled operating system that Apple has been toting for the better part of the year. I used their <a href="http://www.apple.com/mac/app-store/">Mac App Store</a> but within the first few minutes I ran into some issues that should have been a forewarning to spending the time to be an early adopter of Lion.</p>
<p>Earlier in the year I installed a developer preview of Lion which did not seem to include too many features. In fact, I did not even remember that I installed this, and when it came to the Mac App Store at first it believed that I already had Lion installed. After some searching through Google and forum posts I was able to figure out how to reset the Mac App Store and get Lion downloaded. The installer kicked off without any problems. This is when the proverbial shit hit the fan.</p>
<p>I was greeted with a failure message that basically told me jack squat. My disk was corrupt and unable to be repaired by the Lion installation image (or the bundled Disk Utility program). This was a real problem. After some quick searching some fellow patrons suggested trying a repair installation with the original Snow Leopard installation disk. I tried this and was met with a little success &#8211; I was now greeted with a seemingly updated installer that included Safari and an updated version of Disk Utility. But to no avail was I able to actually get Lion installed on the disk. My laptop was effectively a brick.</p>
<p>Since I was actually busy this weekend (riding the Monster around New Jersey) I decided that I would make an appointment to see the &#8220;Genius&#8221; bar at the heralded 5th Avenue Apple Store in New York City. This was a big mistake. Despite making the appointment an hour and a half ahead, arriving fifteen minutes before my appointment, it took them a full hour to actually see me. Not the best service thus far. The &#8220;Genius&#8221; that I met with was baffled at the problem claiming to never have seen the installation do this to a laptop. Great.</p>
<p>What really complicated the matter was that I was using FileVault to encrypt my home directory just in case my laptop got stolen. If it wasn&#8217;t for this fact I would have merely copied all of my music, photos, and documents over from the directory to an intermediate storage device. After completing the re-installation of Lion I could copy it over and all is good. But, rightfully so, this was not the way to actually complete the measure.</p>
<p>Now I am writing this without actually attempting to open up the encrypted sparsebundle that my data is stored in. I have a copy on an external drive that I mounted in the Lion installer, and copied over the files from the Terminal application. The actual Lion installation (after using Disk Utility to erase my main disk) went smoothly without a hitch. All of my applications were installed and ready to go after about an hour and a half.</p>
<p>The only thing that remains right now is getting the sparsebundle mounted unencrypted so I can extract the data, and figuring out why <a href="http://thoughtlessbanter.com/2010/09/12/time-machine-backups-over-samba/">my instructions for using a third party device to backup with Time Machine</a> don&#8217;t work. It is looking like that Apple is requiring the use of AFP protocol for Time Machine backups. This won&#8217;t be too much of a problem as the open source netatalk solves this for all of you Linux users, but for people using an integrated device that runs a stripped down version of Linux it may be a little bit of a pain to get this on the device. Nevertheless, I am on the problem.</p>
]]></content:encoded>
			<wfw:commentRss>http://thoughtlessbanter.com/2011/07/26/installing-lion/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

<!-- Performance optimized by W3 Total Cache. Learn more: http://www.w3-edge.com/wordpress-plugins/

Page Caching using memcached
Object Caching 539/647 objects using memcached

Served from: thoughtlessbanter.com @ 2012-05-19 16:32:45 -->
