<?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>acloudtree &#187; error</title>
	<atom:link href="http://www.acloudtree.com/tag/error/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.acloudtree.com</link>
	<description>Programming, Computers, Writing, Economics, and Life</description>
	<lastBuildDate>Tue, 07 Feb 2012 00:03:38 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Developing a Chrome Extension and the &#8220;Origin is not allowed by Access-Control-Allow-Origin Error&#8221;</title>
		<link>http://www.acloudtree.com/developing-a-chrome-extension-and-the-origin-is-not-allowed-by-access-control-allow-origin-error/</link>
		<comments>http://www.acloudtree.com/developing-a-chrome-extension-and-the-origin-is-not-allowed-by-access-control-allow-origin-error/#comments</comments>
		<pubDate>Wed, 11 Jan 2012 15:30:38 +0000</pubDate>
		<dc:creator>jared.folkins</dc:creator>
				<category><![CDATA[AJAX]]></category>
		<category><![CDATA[chrome]]></category>
		<category><![CDATA[developer]]></category>
		<category><![CDATA[error]]></category>
		<category><![CDATA[extension]]></category>
		<category><![CDATA[Javascript]]></category>
		<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://www.acloudtree.com/?p=1180</guid>
		<description><![CDATA[I have been messing around building a Chrome extension and am fetching some resources using good ol&#8217; XMLHttpRequest(). At least I was trying to do so and instead was getting an epic fail. I am using the google developer debugger to test (tutorial) and saw the following error in the console. Example: Origin &#91;YOUR_RESOURCE_NAME&#93; is [...]]]></description>
			<content:encoded><![CDATA[<p>I have been messing around building a Chrome extension and am fetching some resources using good ol&#8217; XMLHttpRequest(). At least I was trying to do so and instead was getting an epic fail.</p>
<p>I am using the google developer debugger to test (<a title="google tutorial for developers tools" href="http://code.google.com/chrome/extensions/tut_debugging.html" target="_blank">tutorial</a>) and saw the following error in the console.</p>
<p>Example:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">Origin <span style="color: #7a0874; font-weight: bold;">&#91;</span>YOUR_RESOURCE_NAME<span style="color: #7a0874; font-weight: bold;">&#93;</span> is not allowed by Access-Control-Allow-Origin Error.</pre></div></div>

<p>I thought I had configured my manifest.json file with the correct permissions.</p>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;">...<span style="color: #660066;">snip</span>...
  <span style="color: #3366CC;">&quot;permissions&quot;</span> <span style="color: #339933;">:</span> <span style="color: #009900;">&#91;</span>
    <span style="color: #3366CC;">&quot;https://*.domain.com&quot;</span>
  <span style="color: #009900;">&#93;</span><span style="color: #339933;">,</span>
...<span style="color: #660066;">snip</span>...</pre></div></div>

<p>Turns out I was simply missing the trailing slash /.</p>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;">...<span style="color: #660066;">snip</span>...
  <span style="color: #3366CC;">&quot;permissions&quot;</span> <span style="color: #339933;">:</span> <span style="color: #009900;">&#91;</span>
    <span style="color: #3366CC;">&quot;https://*.domain.com/&quot;</span>
  <span style="color: #009900;">&#93;</span><span style="color: #339933;">,</span>
...<span style="color: #660066;">snip</span>...</pre></div></div>

<p>Hope that helps someone.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.acloudtree.com/developing-a-chrome-extension-and-the-origin-is-not-allowed-by-access-control-allow-origin-error/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Ruby, Rails 3.1, and the dreaded &#8220;Could not find a JavaScript runtime&#8221; error</title>
		<link>http://www.acloudtree.com/ruby-rails-3-1-and-the-dreaded-could-not-find-a-javascript-runtime-error/</link>
		<comments>http://www.acloudtree.com/ruby-rails-3-1-and-the-dreaded-could-not-find-a-javascript-runtime-error/#comments</comments>
		<pubDate>Tue, 06 Sep 2011 18:53:27 +0000</pubDate>
		<dc:creator>jared.folkins</dc:creator>
				<category><![CDATA[Rails]]></category>
		<category><![CDATA[3.1]]></category>
		<category><![CDATA[could]]></category>
		<category><![CDATA[error]]></category>
		<category><![CDATA[find]]></category>
		<category><![CDATA[Javascript]]></category>
		<category><![CDATA[not]]></category>
		<category><![CDATA[rails]]></category>
		<category><![CDATA[Ruby]]></category>
		<category><![CDATA[runtime]]></category>

		<guid isPermaLink="false">http://www.acloudtree.com/?p=1068</guid>
		<description><![CDATA[While deploying a custom Rails 3.1 application I came across the following error. Could not find a JavaScript runtime. See https://github.com/sstephenson/execjs for a list of available runtimes. The fix was simple. Add these gems to your application Gemfile gem 'execjs' gem 'therubyracer' And run bundler. $ bundle install]]></description>
			<content:encoded><![CDATA[<p>While deploying a custom Rails 3.1 application I came across the following error.</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">Could not <span style="color: #c20cb9; font-weight: bold;">find</span> a JavaScript runtime. See https:<span style="color: #000000; font-weight: bold;">//</span>github.com<span style="color: #000000; font-weight: bold;">/</span>sstephenson<span style="color: #000000; font-weight: bold;">/</span>execjs <span style="color: #000000; font-weight: bold;">for</span> a list of available runtimes.</pre></div></div>

<p>The fix was simple.</p>
<p>Add these gems to your application Gemfile</p>

<div class="wp_syntax"><div class="code"><pre class="ruby" style="font-family:monospace;">gem <span style="color:#996600;">'execjs'</span>
gem <span style="color:#996600;">'therubyracer'</span></pre></div></div>

<p>And run bundler.</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">$ bundle <span style="color: #c20cb9; font-weight: bold;">install</span></pre></div></div>

]]></content:encoded>
			<wfw:commentRss>http://www.acloudtree.com/ruby-rails-3-1-and-the-dreaded-could-not-find-a-javascript-runtime-error/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>(Nerd) Ubuntu 9.10 + installing wireshark</title>
		<link>http://www.acloudtree.com/nerd-ubuntu-9-10-installing-wireshark/</link>
		<comments>http://www.acloudtree.com/nerd-ubuntu-9-10-installing-wireshark/#comments</comments>
		<pubDate>Wed, 02 Dec 2009 23:59:19 +0000</pubDate>
		<dc:creator>jared.folkins</dc:creator>
				<category><![CDATA[Networking]]></category>
		<category><![CDATA[Ubuntu]]></category>
		<category><![CDATA[devices]]></category>
		<category><![CDATA[error]]></category>
		<category><![CDATA[packet]]></category>
		<category><![CDATA[permissions]]></category>
		<category><![CDATA[sniffing]]></category>
		<category><![CDATA[wireshark]]></category>

		<guid isPermaLink="false">http://www.acloudtree.com/?p=107</guid>
		<description><![CDATA[From the command line 1 sudo apt-get install wireshark Once the process completes, wireshark will be installed. The only problem is that if you open the wireshark application, there will not be any physical eth(N) devices to sniff. So how do we remedy this? Open the application &#8216;Main Menu&#8217; Select wireshark properties We need to [...]]]></description>
			<content:encoded><![CDATA[<p>From the command line</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
</pre></td><td class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">apt-get</span> <span style="color: #c20cb9; font-weight: bold;">install</span> wireshark</pre></td></tr></table></div>

<p>Once the process completes, wireshark will be installed. The only problem is that if you open the wireshark application, there will not be any physical eth(N) devices to sniff. So how do we remedy this?</p>
<p><strong>Open the application &#8216;Main Menu&#8217;<br />
</strong><br />
<img class="aligncenter size-full wp-image-130" title="PathToMainMenu" src="http://www.acloudtree.com/wp-content/uploads/2009/12/PathToMainMenu.png" alt="PathToMainMenu" width="453" height="780" /></p>
<p><strong>Select wireshark properties<br />
</strong><br />
<img class="aligncenter size-full wp-image-129" title="SelectWiresharkProperties" src="http://www.acloudtree.com/wp-content/uploads/2009/12/SelectWiresharkProperties.png" alt="SelectWiresharkProperties" width="628" height="505" /></p>
<p><strong>We need to change the command from this<br />
</strong><img class="aligncenter size-full wp-image-132" title="Wireshark" src="http://www.acloudtree.com/wp-content/uploads/2009/12/Wireshark1.png" alt="Wireshark" width="436" height="220" /></p>
<p><strong>To this</strong><br />
<img class="aligncenter size-full wp-image-127" title="GksudoWireshark" src="http://www.acloudtree.com/wp-content/uploads/2009/12/GksudoWireshark.png" alt="GksudoWireshark" width="437" height="222" /></p>
<p>And what is the reason? Well the ethernet or wireless devices we are after are owned by <em>root</em>. So if we tack on the <em>gksudo</em> command to the front of the <em>wireshark</em> init command, we are effectively opening <em>wireshark</em> as <strong><em>root</em></strong>. With all the implied responsibilities and permissions, make sense?</p>
]]></content:encoded>
			<wfw:commentRss>http://www.acloudtree.com/nerd-ubuntu-9-10-installing-wireshark/feed/</wfw:commentRss>
		<slash:comments>13</slash:comments>
		</item>
		<item>
		<title>(Nerd) Python2.6, Screen scraping, and Javascript cookies</title>
		<link>http://www.acloudtree.com/nerd-python2-6-screen-scraping-and-javascript-cookies/</link>
		<comments>http://www.acloudtree.com/nerd-python2-6-screen-scraping-and-javascript-cookies/#comments</comments>
		<pubDate>Thu, 12 Nov 2009 05:34:41 +0000</pubDate>
		<dc:creator>jared.folkins</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[cookielib]]></category>
		<category><![CDATA[error]]></category>
		<category><![CDATA[Javascript]]></category>
		<category><![CDATA[Mechanize]]></category>
		<category><![CDATA[Python]]></category>
		<category><![CDATA[Scraping]]></category>
		<category><![CDATA[Screen]]></category>
		<category><![CDATA[Urllib2]]></category>

		<guid isPermaLink="false">http://www.acloudtree.com/?p=98</guid>
		<description><![CDATA[Recently I tried *scraping some data from a website and was running into problems. I don&#8217;t have a fix at the moment but I made the first big break through. My first attempt at scraping the data with Python was met with immediate denial. And I was able to get similar results (though not exact) [...]]]></description>
			<content:encoded><![CDATA[<p>Recently I tried *scraping some data from a website and was running into problems. I don&#8217;t have a fix at the moment but I made the first big break through.</p>
<p>My first attempt at scraping the data with Python was met with immediate denial. And I was able to get similar results (though not exact) by disabling cookies in my browser (firefox3.5) and accessing the desired site. The fact that the results were not identical confused me some. But I figured it was a subtle difference in the way Firefox handled the request versus how I was handling the request programmatically with <em>Python</em>, <em>mechanize</em>, <em>urllib2</em>, and <em>cookielib</em>.</p>
<p>Still, after several hours I still was unable to make the desired request to the server. So I started doing some digging. It turns out that these libraries are unable to automatically handle cookies set by Javascript. So, to test this, I disabled Javascript in my browser, made the request, and <strong>got the exact same results</strong>. YES!!!</p>
<p>As a quick test I was able to extract the cookies&#8217; value using the LiveHeader extension in Firefox. I then took this value and manually assigned it to the header of my Python request. I then got the desired results in my Python program. I&#8217;ll post an example of my solution when I get it up and running.</p>
<p>Troubleshooting:</p>
<p>In your browser I would do the following in order to try and recreate what is happening in your program.</p>
<ol>
<li>Disable Javascript</li>
<li>Disable Cookies</li>
<li>Access headers with Firefox plugin</li>
</ol>
<p>*Programmatically extracting data from a website</p>
]]></content:encoded>
			<wfw:commentRss>http://www.acloudtree.com/nerd-python2-6-screen-scraping-and-javascript-cookies/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

