<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">

  <title><![CDATA[Jordan Has a Blog]]></title>
  <link href="http://jordanmessina.com/atom.xml" rel="self"/>
  <link href="http://jordanmessina.com/"/>
  <updated>2012-01-24T19:01:47-08:00</updated>
  <id>http://jordanmessina.com/</id>
  <author>
    <name><![CDATA[Jordan Messina]]></name>
    
  </author>
  <generator uri="http://octopress.org/">Octopress</generator>

  
  <entry>
    <title type="html"><![CDATA[Install Any App on the Kindle Fire]]></title>
    <link href="http://jordanmessina.com/2011/11/15/install-any-app-on-the-kindle-fire/"/>
    <updated>2011-11-15T23:03:07-08:00</updated>
    <id>http://jordanmessina.com/2011/11/15/install-any-app-on-the-kindle-fire</id>
    <content type="html"><![CDATA[<p>Here&#8217;s a quick video I made showing how to install Easy Installer and install
Opera Mini (or any other app) on your Kindle Fire. Here&#8217;s the link for <a href="http://www.opera.com/mobile/download/versions/">Opera Mini</a>.</p>

<iframe width="560" height="315" src="http://www.youtube.com/embed/cDrYDK9q-NM" frameborder="0" allowfullscreen></iframe>



]]></content>
  </entry>
  
  <entry>
    <title type="html"><![CDATA[For those looking for an easy Rackspace Cloud Files folder sync solution]]></title>
    <link href="http://jordanmessina.com/2010/10/06/for-those-looking-for-an-easy-rackspace-cloud-files-folder-sync-solution/"/>
    <updated>2010-10-06T23:23:39-07:00</updated>
    <id>http://jordanmessina.com/2010/10/06/for-those-looking-for-an-easy-rackspace-cloud-files-folder-sync-solution</id>
    <content type="html"><![CDATA[<p>I&#8217;m working on a script that will handle this for you, my company needed it
and I couldn&#8217;t find a good solution so I&#8217;m just setting a cron job to run this
every night to make sure any new images are pushed to our Rackspace Container.
The source is on <a href="http://github.com/jordanmessina/RackBack">github</a>.</p>
]]></content>
  </entry>
  
  <entry>
    <title type="html"><![CDATA[I'm calling myself out]]></title>
    <link href="http://jordanmessina.com/2010/08/20/im-calling-myself-out/"/>
    <updated>2010-08-20T13:04:06-07:00</updated>
    <id>http://jordanmessina.com/2010/08/20/im-calling-myself-out</id>
    <content type="html"><![CDATA[<p>Last night while I was in the car with my roommate, I was discussing how if I
had just kept up with a few projects that I had started in the past, I&#8217;d
probably have some mild success and traction with at least one of them by now.
I just finished up Rework by 37signals and I think I got the most out of the
very last page of the book from the essay about Inspiration. Inspiration is
perishable, when you have it you work your ass off nonstop until you literally
can&#8217;t work anymore. It&#8217;s an amazing feeling and such a high to be working on
something that you truly believe can change the world. As my roommate says,
it&#8217;s 20 hours of work for 10 minutes of fun and that&#8217;s what all my past
projects have seemed to end as, only 10 minutes of fun.</p>

<p>So I realized the problem is that once the inspiration goes away, and it
always seems to run out at some point, I end with this &#8216;meh&#8217; feeling and
things just aren&#8217;t as fun as they used to be. It sucks to admit this happens,
and I&#8217;m writing this blog post to help myself from making lies in believing
that I&#8217;m still pumped about things I&#8217;ve started earlier and convincing myself
that I&#8217;m just too busy at the moment to put time into it. Instead, I need to
just suck it up and get back to work on things that I&#8217;ve started until they&#8217;re
finished. If I was excited enough at one point to put so much work into it, I
might as well complete it and stick to it so that it at least has a shot. My
goal with any project of mine is to just have people use it and appreciate it,
not to make millions and cash out quick. So quitting is obviously the worst
thing I can do, but also the easiest thing to do because I can always make
excuses as to why it would never have worked anyway.</p>

<p>Some of the past projects I&#8217;ve quit include a web app directory in 2007 that I
didn&#8217;t see a market for after it was all built and complete. It was also
designed terribly, code wise, so changes took far too long, never try to roll
your own framework if you really don&#8217;t know what you&#8217;re doing. Now I see about
5 or 6 clones that all have a decent user base and I think how that could have
been me.</p>

<p>I also had a podcast with two friends that was running for about a month back
in 2008. We had about 10 listeners by episode 5 but since we were expecting
overnight success, and didn&#8217;t get it, we decided that we just didn&#8217;t have the
time to continue working on it.</p>

<p>Finally, I created a Craigslist alert app which, after spamming twitter quite
a bit, ended up with about 100 happy users. I saw some opportunity to make it
even better so I started from scratch and started developing what I would
describe now as Notifo + Twilio + other cool features. Neither of these
services existed at the time, and I had a family friend who is an amazing web
designer on board for equity to help out. I had some personal issues that set
me back about 6 months and by the time I came around I saw too many
competitors in the space and decided to stop development and not even give it
a shot.</p>

<p>After thinking last night about all these things, I ended up being a little
disappointed with myself, so here I am writing a blog post to make sure I
never make these mistakes again. The point of me telling you? I&#8217;m hoping you
keep me in check. If I say I have a project to share with you, hound me until I
actually release it.</p>
]]></content>
  </entry>
  
  <entry>
    <title type="html"><![CDATA[Django - Allow users to log in using email rather than username]]></title>
    <link href="http://jordanmessina.com/2010/06/12/django-allow-users-to-log-in-using-email-rather-than-username/"/>
    <updated>2010-06-12T13:45:17-07:00</updated>
    <id>http://jordanmessina.com/2010/06/12/django-allow-users-to-log-in-using-email-rather-than-username</id>
    <content type="html"><![CDATA[<p>One of the annoying things about Django is that it doesn&#8217;t allow logins via
email out of the box if you&#8217;re using their built-in user authentication . You
must create your own authentication backend in order to accomplish this.
However, one of the things I love about Django is the ability to create
authentication backends without too much of a headache. This comes in handy
when dealing with things like allowing users to log in via Twitter, Facebook
Connect, any OpenID providers, or allowing them to login via email and
password.</p>

<p>Django authentication backends are quite simple, essentially whenever you call
the <code>django.contrib.auth.authenticate()</code> function, Django uses the
authenticate method in any of the classes specified by the
<code>AUTHENTICATION_BACKENDS</code> tuple set in your settings.py. If one of the classes
fails to authenticate the user, Django moves on to the next one until either
one successfully returns a user object or there are no other backends to
attempt, in which case it results in a failed login. A very simple
authentication backend which allows users to login via email rather than
username is the following code in backends.py:</p>

<figure class='code'><figcaption><span>backends.py</span></figcaption><div class="highlight"><table><tr><td class="gutter"><pre class="line-numbers"><span class='line-number'>1</span>
<span class='line-number'>2</span>
<span class='line-number'>3</span>
<span class='line-number'>4</span>
<span class='line-number'>5</span>
<span class='line-number'>6</span>
<span class='line-number'>7</span>
<span class='line-number'>8</span>
<span class='line-number'>9</span>
<span class='line-number'>10</span>
<span class='line-number'>11</span>
<span class='line-number'>12</span>
<span class='line-number'>13</span>
<span class='line-number'>14</span>
<span class='line-number'>15</span>
<span class='line-number'>16</span>
<span class='line-number'>17</span>
</pre></td><td class='code'><pre><code class='python'><span class='line'><span class="kn">from</span> <span class="nn">django.conf</span> <span class="kn">import</span> <span class="n">settings</span>
</span><span class='line'><span class="kn">from</span> <span class="nn">django.contrib.auth.models</span> <span class="kn">import</span> <span class="n">User</span>
</span><span class='line'>
</span><span class='line'><span class="k">class</span> <span class="nc">EmailModelBackend</span><span class="p">(</span><span class="nb">object</span><span class="p">):</span>
</span><span class='line'>    <span class="k">def</span> <span class="nf">authenticate</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">username</span><span class="o">=</span><span class="bp">None</span><span class="p">,</span> <span class="n">password</span><span class="o">=</span><span class="bp">None</span><span class="p">):</span>
</span><span class='line'>        <span class="k">try</span><span class="p">:</span>
</span><span class='line'>            <span class="n">user</span> <span class="o">=</span> <span class="n">User</span><span class="o">.</span><span class="n">objects</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="n">email</span><span class="o">=</span><span class="n">username</span><span class="p">)</span>
</span><span class='line'>            <span class="k">if</span> <span class="n">user</span><span class="o">.</span><span class="n">check_password</span><span class="p">(</span><span class="n">password</span><span class="p">):</span>
</span><span class='line'>                <span class="k">return</span> <span class="n">user</span>
</span><span class='line'>        <span class="k">except</span> <span class="n">User</span><span class="o">.</span><span class="n">DoesNotExist</span><span class="p">:</span>
</span><span class='line'>            <span class="k">return</span> <span class="bp">None</span>
</span><span class='line'>
</span><span class='line'>    <span class="k">def</span> <span class="nf">get_user</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">user_id</span><span class="p">):</span>
</span><span class='line'>        <span class="k">try</span><span class="p">:</span>
</span><span class='line'>            <span class="k">return</span> <span class="n">User</span><span class="o">.</span><span class="n">objects</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="n">pk</span><span class="o">=</span><span class="n">user_id</span><span class="p">)</span>
</span><span class='line'>        <span class="k">except</span> <span class="n">User</span><span class="o">.</span><span class="n">DoesNotExist</span><span class="p">:</span>
</span><span class='line'>            <span class="k">return</span> <span class="bp">None</span>
</span></code></pre></td></tr></table></div></figure>


<p></p>

<p>And you simply need to add to your settings.py:</p>

<figure class='code'><figcaption><span>settings.py</span></figcaption><div class="highlight"><table><tr><td class="gutter"><pre class="line-numbers"><span class='line-number'>1</span>
<span class='line-number'>2</span>
<span class='line-number'>3</span>
<span class='line-number'>4</span>
</pre></td><td class='code'><pre><code class='python'><span class='line'><span class="n">AUTHENTICATION_BACKENDS</span> <span class="o">=</span> <span class="p">(</span>
</span><span class='line'>    <span class="s">&#39;path.to.this.backends.EmailModelBackend&#39;</span><span class="p">,</span>
</span><span class='line'>    <span class="s">&#39;django.contrib.auth.backends.ModelBackend&#39;</span><span class="p">,</span>
</span><span class='line'><span class="p">)</span>
</span></code></pre></td></tr></table></div></figure>


<p>I generally place my backends in whatever app I create to store extra user
info, but you can put it anywhere, just make sure it&#8217;s in your PYTHONPATH.</p>
]]></content>
  </entry>
  
  <entry>
    <title type="html"><![CDATA[Django 1.2 - CSRF verification failed. Request aborted.]]></title>
    <link href="http://jordanmessina.com/2010/05/24/django-1-2-csrf-verification-failed/"/>
    <updated>2010-05-24T20:25:52-07:00</updated>
    <id>http://jordanmessina.com/2010/05/24/django-1-2-csrf-verification-failed</id>
    <content type="html"><![CDATA[<p>I was getting this 403 error today while attempting to make a POST request to
a view:</p>

<blockquote><p>403 Forbidden</p>

<p>CSRF verification failed. Request aborted.</p>

<p>Help Reason given for failure:</p>

<p>CSRF cookie not set.</p></blockquote>

<p><strong>Edit 10/29/2010</strong>
I&#8217;ve modified this post to only contain the proper way of resolving the issue. You can read about Cross Site Request Forgeries <a href="http://www.squarefree.com/securitytips/web-developers.html#CSRF">here</a> and Django&#8217;s protection mechanisms <a href="https://docs.djangoproject.com/en/dev/ref/contrib/csrf/">here</a></p>

<p>To resolve the 403 issue, you want to add the csrf_token template tag within your form somewhere. This adds a hidden div with the value of the input as the csrf token:</p>

<figure class='code'><figcaption><span>anything.html</span></figcaption><div class="highlight"><table><tr><td class="gutter"><pre class="line-numbers"><span class='line-number'>1</span>
<span class='line-number'>2</span>
<span class='line-number'>3</span>
<span class='line-number'>4</span>
</pre></td><td class='code'><pre><code class='html'><span class='line'><span class="nt">&lt;form</span> <span class="na">action=</span><span class="s">&quot;...&quot;</span> <span class="na">method=</span><span class="s">&quot;POST&quot;</span><span class="nt">&gt;</span>
</span><span class='line'>    {% csrf_token %}
</span><span class='line'>    ...
</span><span class='line'><span class="nt">&lt;/form&gt;</span>
</span></code></pre></td></tr></table></div></figure>


<p>If you&#8217;d like to not protect against CSRF with Django&#8217;s built in mechanisms, use the csrf_exempt decorator:</p>

<figure class='code'><figcaption><span>views.py</span></figcaption><div class="highlight"><table><tr><td class="gutter"><pre class="line-numbers"><span class='line-number'>1</span>
<span class='line-number'>2</span>
<span class='line-number'>3</span>
<span class='line-number'>4</span>
<span class='line-number'>5</span>
</pre></td><td class='code'><pre><code class='python'><span class='line'><span class="kn">from</span> <span class="nn">django.views.decorators.csrf</span> <span class="kn">import</span> <span class="n">csrf_exempt</span>
</span><span class='line'><span class="o">...</span>
</span><span class='line'><span class="nd">@csrf_exempt</span>
</span><span class='line'><span class="k">def</span> <span class="nf">my_func</span><span class="p">(</span><span class="n">request</span><span class="p">):</span>
</span><span class='line'>    <span class="o">...</span>
</span></code></pre></td></tr></table></div></figure>

]]></content>
  </entry>
  
  <entry>
    <title type="html"><![CDATA[Illegal Streaming]]></title>
    <link href="http://jordanmessina.com/2009/10/11/illegal-streaming/"/>
    <updated>2009-10-11T14:46:05-07:00</updated>
    <id>http://jordanmessina.com/2009/10/11/illegal-streaming</id>
    <content type="html"><![CDATA[<p>I was faced with a problem last Sunday, like many football fans usually are,
of not being able to watch the game that I really care about. Rather, I have
to watch what the CBS and Fox stations in my area decide are the games that
appeal to the general mass of viewers. The thing I find crazy is the fact that
the NFL fails to please their entire viewership by not leveraging the Internet
when it comes to sports. But when it comes to television shows, the
broadcasting companies are finally understanding how to please people. Look at
the success there has been with streaming shows directly from the
broadcaster’s websites, streaming the shows right from Hulu, and all the other
means of show streaming that are legal now. Why haven’t more content providers
done this for sports? I know ESPN has ESPN360, but this doesn’t provide every
game that ESPN plays on television, and it is also only available for people
using an ISP that has signed up for it. So ESPN is ALMOST there, but not
quite. As I sit here watching one football game that is being streamed
illegally on Justin.tv, and watching another one simultaneously on television,
I realized I’m exposed to twice as many advertisements. The illegal stream is
doing more good for the broadcasting company than bad. I find it crazy that
the NFL wouldn’t cut a deal with Fox and CBS to allow the games to be streamed
legally. I’m not the most business savvy person by any means, but I feel like
less than 1% of NFL fans will buy an NFL package from their cable provider
that allows them to watch any game they want, while over 30% (literarlly making
percentages up) would watch a game streaming legally on cbs.com. Since it’s all
about money (although it should be about caring for the fans that really make the NFL
the sport it is) you tell me which deal would be more profitable for the NFL? I know
there are many aspects of the business I’m completely ignorant to, and there
are probably plenty of reasons why this isn’t possible, but considering it’s
2009 and they are losing money from illegal streaming, they might as well make
everyone happy and make some money at the same time. I’m going to get back to
watching my illegal stream, where everyone is benefiting BUT the NFL.</p>
]]></content>
  </entry>
  
  <entry>
    <title type="html"><![CDATA[OLPC Project Could Help More Than Just The Children]]></title>
    <link href="http://jordanmessina.com/2008/05/13/olpc-project-could-help-more-than-just-the-children/"/>
    <updated>2008-05-13T02:37:18-07:00</updated>
    <id>http://jordanmessina.com/2008/05/13/olpc-project-could-help-more-than-just-the-children</id>
    <content type="html"><![CDATA[<p>According to stats posted by the <a href="http://www.internetworldstats.com/">Miniwatts Marketing Group</a> and the annual <a href="http://www.fundforpeace.org/web/index.php?option=com_content&amp;task=view&amp;id=229&amp;Itemid=366">Failed State Index</a>,
it appears that the OLPC project could help more than just the unprivileged
children who receive laptops.</p>

<p>The Failed State Index gives each country a score off 1-10 based on 12
indicators. The higher the index score, the more unstable the country is.
Comparing the index score to the penetration rate of internet usage based on
population yields interesting results:</p>

<p><img src="http://jordanmessina.com/images/2008-05-13-olpc-project-could-help-more-than-just-the-children/graph1.jpg" alt="" /></p>

<p>One potential argument could be that the states(countries) with low index
scores are most likely states with poor economies, which would obviously
effect the number of people who could even afford internet in the first place.</p>

<p>To test if the trend of increasing stability exists when countries with
similar economies are compared, a similar chart is created using countries
with I-5 indicator scores below 6. This indicator of the Failed State Index
gives a score based on uneven economic development along group lines.</p>

<p>By comparing countries only with economies promising enough to sustain the
costs of the infrastructures needed for internet, we get a better picture of
how the internet truly effects ones stability.</p>

<p><img src="http://jordanmessina.com/images/2008-05-13-olpc-project-could-help-more-than-just-the-children/graph2.jpg" alt="" /></p>

<p>As we can see, the upward trend still exists with countries with similar economies.
Efforts by groups like the OLPC Association could end up affecting more than just
the children the project aspired to help in the first place. Maybe some foreign aid
should go towards building the infrastructures needed to get these failing states
wired so they can stop relying on their corrupt or incapable governments and help
solve critical issues themselves.</p>

<p>Besides, our foreign aid policy has proven not to work well in the first
place, so we might as well try something new. I&#8217;m aware by simply wiring a
country and allowing the citizens to have access to computers and the Internet
isn&#8217;t going to magically increase their stability, but it would definitely
help them in so many ways. Just think how much these technologies help us
everyday and where we&#8217;d be without them. To say that this couldn&#8217;t help a
failing state pick itself off the ground would be absurd.</p>

<p>All data used for this can be seen
<a href="http://jordanmessina.com/images/2008-05-13-olpc-project-could-help-more-than-just-the-children/data.jpg">here</a></p>
]]></content>
  </entry>
  
  <entry>
    <title type="html"><![CDATA[We forgot to pay the power bill...]]></title>
    <link href="http://jordanmessina.com/2008/04/30/we-forgot-to-pay-the-power-bill/"/>
    <updated>2008-04-30T00:42:16-07:00</updated>
    <id>http://jordanmessina.com/2008/04/30/we-forgot-to-pay-the-power-bill</id>
    <content type="html"><![CDATA[<p>My friend&#8217;s power got turned off because he lost the game of &#8220;Let&#8217;s see how
long I can wait to pay bills,&#8221; so he came to my room because he really
<del>needed</del> wanted to play some GTA IV. This was the only place we could
squeeze him in.</p>

<p><img src="http://jordanmessina.com/images/2008-04-30-we-forgot-to-pay-the-power-bill/gta.jpg" alt="" /></p>
]]></content>
  </entry>
  
</feed>

