<?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>The Lost Notebook &#187; Work</title>
	<atom:link href="http://funinc.org/category/work/feed" rel="self" type="application/rss+xml" />
	<link>http://funinc.org</link>
	<description>Things that I tend to forget</description>
	<lastBuildDate>Fri, 20 Jan 2012 14:42:07 +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>Apache Reverse Proxy + SSH Reverse Tunnel</title>
		<link>http://funinc.org/20111229/apache-reverse-proxy-ssh-reverse-tunnel</link>
		<comments>http://funinc.org/20111229/apache-reverse-proxy-ssh-reverse-tunnel#comments</comments>
		<pubDate>Thu, 29 Dec 2011 14:17:34 +0000</pubDate>
		<dc:creator>abdallah</dc:creator>
				<category><![CDATA[Tools]]></category>
		<category><![CDATA[Work]]></category>
		<category><![CDATA[apache]]></category>
		<category><![CDATA[proxy]]></category>
		<category><![CDATA[reverse proxy]]></category>
		<category><![CDATA[ssh]]></category>
		<category><![CDATA[testing]]></category>
		<category><![CDATA[tunnel]]></category>
		<category><![CDATA[tutorial]]></category>

		<guid isPermaLink="false">http://funinc.org/?p=328</guid>
		<description><![CDATA[Disclaimer: This setup is just a bit crazy, and I wouldn&#8217;t recommend it for a production site. Works for me. I needed to allow some clients to test a web app I&#8217;m working on. But I didn&#8217;t want to deploy the code to a server for now for different reasons (mainly memory constraints). So the [...]]]></description>
			<content:encoded><![CDATA[<p><small><em>Disclaimer: This setup is just a bit crazy, and I wouldn&#8217;t recommend it for a production site. Works for me.</em></small><br />
I needed to allow some clients to test a web app I&#8217;m working on. But I didn&#8217;t want to deploy the code to a server for now for different reasons (mainly memory constraints). So the solution was to setup a reverse proxy using apache to my local machine. Check out the code after the break <span id="more-328"></span><br />
Here&#8217;s the <code>VirtualHost</code> I created: </p>
<div class="dean_ch" style="white-space: wrap;">
<ol>
<li class="li1">
<div class="de1"><span class="sc3"><span class="re1">&lt;VirtualHost</span> *:<span class="nu0">80</span><span class="re2">&gt;</span></span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; ServerName proj312.grat.in</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; ProxyPass / http://home-ip:18000/</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; ProxyPassReverse / http://home-ip:18000/</div>
</li>
<li class="li2">
<div class="de2"><span class="sc3"><span class="re1">&lt;/VirtualHost<span class="re2">&gt;</span></span></span></div>
</li>
</ol>
</div>
<p>The problem is that my home-ip is not fixed. A Dynamic DNS setup is the fix that comes to mind first. But, I thought I would try something else: <code>Reverse SSH Tunnel</code><br />
I used the recipe and explanations in <a href="http://toic.org/blog/2009/01/18/reverse-ssh-port-forwarding/" title="reverse-ssh-port-forwarding" target="_blank">this article</a>. Mostly, all I needed to do was the following:</p>
<div class="dean_ch" style="white-space: wrap;">
<ol>
<li class="li1">
<div class="de1"><span class="kw2">ssh</span> -fNR <span class="nu0">18000</span>:localhost:<span class="nu0">8000</span> myserver</div>
</li>
</ol>
</div>
<p>Where the 18000 is the port on the server, and 8000 is the port on the home machine. No harm in using the same port numbers, btw.</p>
<p>I then changed the <code>VirtualHost</code> configuration in apache on the server to read: </p>
<div class="dean_ch" style="white-space: wrap;">
<ol>
<li class="li1">
<div class="de1"><span class="sc3"><span class="re1">&lt;VirtualHost</span> *:<span class="nu0">80</span><span class="re2">&gt;</span></span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; ServerName proj312.grat.in</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; ProxyPass / http://127.0.0.1:18000/</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; ProxyPassReverse / http://127.0.0.1:18000/</div>
</li>
<li class="li2">
<div class="de2"><span class="sc3"><span class="re1">&lt;/VirtualHost<span class="re2">&gt;</span></span></span></div>
</li>
</ol>
</div>
<p>Restart apache on the server and all falls in place perfectly.</p>
]]></content:encoded>
			<wfw:commentRss>http://funinc.org/20111229/apache-reverse-proxy-ssh-reverse-tunnel/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Suspend Ubuntu Desktop</title>
		<link>http://funinc.org/20111227/suspend-ubuntu-desktop</link>
		<comments>http://funinc.org/20111227/suspend-ubuntu-desktop#comments</comments>
		<pubDate>Tue, 27 Dec 2011 12:06:25 +0000</pubDate>
		<dc:creator>abdallah</dc:creator>
				<category><![CDATA[Tools]]></category>
		<category><![CDATA[android]]></category>
		<category><![CDATA[connectbot]]></category>
		<category><![CDATA[electricity]]></category>
		<category><![CDATA[hibernate]]></category>
		<category><![CDATA[lebanon]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[ssh]]></category>
		<category><![CDATA[suspend]]></category>
		<category><![CDATA[ubuntu]]></category>

		<guid isPermaLink="false">http://funinc.org/?p=323</guid>
		<description><![CDATA[Simple command line: pm-suspend An interesting alternative would be: pm-suspend-hybrid From the man page: pm-suspend-hybrid Hybrid-suspend is the process where the system does everything it needs to hibernate, but suspends instead of shutting down. This means that your computer can wake up quicker than for normal hibernation if you do not run out of power, [...]]]></description>
			<content:encoded><![CDATA[<p>Simple command line: <code>pm-suspend</code><br />
An interesting alternative would be: <code>pm-suspend-hybrid</code></p>
<p><span id="more-323"></span></p>
<p>From the man page:</p>
<blockquote><p><strong>pm-suspend-hybrid</strong><br />
           Hybrid-suspend is the process where the system does everything it needs to hibernate, but suspends instead of shutting down. This means that your computer can<br />
           wake up quicker than for normal hibernation if you do not run out of power, and you can resume even if you run out of power. s2both(8) is an hybrid-suspend<br />
           implementation.</p>
</blockquote>
<p>Background story: Electricity problems in Lebanon, and old UPS, causing me plenty of headaches. So I needed a quick way to suspend/hibernate the desktop without loosing all my volatile settings and open files. I added a shortcut for a <a href="http://code.google.com/p/connectbot/">ConnectBot</a> host configuration on my android phone that runs this command on the desktop (remotely): <code>sudo pm-suspend-hybrid</code><br />
This way if the backup generator starts in time or not, everything is back up and running in under <del datetime="2011-12-27T12:14:51+00:00">45s</del>12s (just clocked it!).</p>
]]></content:encoded>
			<wfw:commentRss>http://funinc.org/20111227/suspend-ubuntu-desktop/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Quick SSH Tunnel using Putty</title>
		<link>http://funinc.org/20111221/quick-ssh-tunnel-using-putty</link>
		<comments>http://funinc.org/20111221/quick-ssh-tunnel-using-putty#comments</comments>
		<pubDate>Wed, 21 Dec 2011 13:27:56 +0000</pubDate>
		<dc:creator>abdallah</dc:creator>
				<category><![CDATA[Tools]]></category>
		<category><![CDATA[Work]]></category>
		<category><![CDATA[firewall]]></category>
		<category><![CDATA[glassfish]]></category>
		<category><![CDATA[mysql]]></category>
		<category><![CDATA[putty]]></category>
		<category><![CDATA[server]]></category>
		<category><![CDATA[ssh]]></category>
		<category><![CDATA[tunnel]]></category>

		<guid isPermaLink="false">http://funinc.org/?p=314</guid>
		<description><![CDATA[Two easy steps to create a tunnel from a remote server port to your localhost. It&#8217;s handy if you&#8217;re trying to connect to a mysql, jboss, etc. installation bound to localhost only (for better security. Check out the screenshots after the break 1- Add the remote server&#8217;s information (Session) 2- Add the tunnel information (Connection [...]]]></description>
			<content:encoded><![CDATA[<p>Two easy steps to create a tunnel from a remote server port to your localhost. It&#8217;s handy if you&#8217;re trying to connect to a mysql, jboss, etc. installation bound to localhost only (for better security. Check out the screenshots after the break<span id="more-314"></span></p>
<p>1- Add the remote server&#8217;s information (Session)<br />
<a href="http://funinc.org/wp-content/uploads/putty-cfg-1.png"><img src="http://funinc.org/wp-content/uploads/putty-cfg-1-300x288.png" alt="" title="putty-cfg-1" width="300" height="288" class="alignnone size-medium wp-image-315" /></a></p>
<p>2- Add the tunnel information (Connection &#8211; SSH &#8211; Tunnels)<br />
<a href="http://funinc.org/wp-content/uploads/putty-cfg-2.png"><img src="http://funinc.org/wp-content/uploads/putty-cfg-2-300x288.png" alt="" title="putty-cfg-2" width="300" height="288" class="alignnone size-medium wp-image-316" /></a><br />
You need to edit the Source port and Destination then click the &#8220;Add&#8221; button. </p>
<p>This should be enough. Either go back to the &#8220;Session&#8221; screen and save the configuration for later. Or simply click &#8220;Open&#8221; to get started. </p>
<p>Creating an SSH tunnel or forwarding ports is pretty easy when you&#8217;re on a Linux machine. Simply type the following in the shell:</p>
<div class="dean_ch" style="white-space: wrap;">
<ol>
<li class="li1">
<div class="de1"><span class="kw2">ssh</span> -fLN <span class="nu0">8080</span>:<span class="nu0">127.0</span><span class="nu0">.0</span><span class="nu0">.1</span>:<span class="nu0">8080</span> myserver.tld</div>
</li>
</ol>
</div>
<p>Where the first 8080 is the local port and the second 8080 is the port on the server.</p>
<p>Practically, let&#8217;s say you have a <a href="http://glassfish.java.net" target="_blank">glassfish</a> installation on your server at 10.0.10.15. You cannot access the admin port 8484 on that server as it&#8217;s by default bound to localhost only. So, you can create a tunnel using the following command and access the glassfish admin site as if it&#8217;s on the local machine at <code>http://127.0.0.1:8484/</code>:</p>
<div class="dean_ch" style="white-space: wrap;">
<ol>
<li class="li1">
<div class="de1"><span class="kw2">ssh</span> -fLN <span class="nu0">8484</span>:<span class="nu0">127.0</span><span class="nu0">.0</span><span class="nu0">.1</span>:<span class="nu0">8484</span> <span class="nu0">10.0</span><span class="nu0">.10</span><span class="nu0">.15</span></div>
</li>
</ol>
</div>
]]></content:encoded>
			<wfw:commentRss>http://funinc.org/20111221/quick-ssh-tunnel-using-putty/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Django Class-Based Generic Views</title>
		<link>http://funinc.org/20111220/django-class-based-generic-views</link>
		<comments>http://funinc.org/20111220/django-class-based-generic-views#comments</comments>
		<pubDate>Tue, 20 Dec 2011 14:09:59 +0000</pubDate>
		<dc:creator>abdallah</dc:creator>
				<category><![CDATA[Blogging]]></category>
		<category><![CDATA[Coding]]></category>
		<category><![CDATA[Work]]></category>
		<category><![CDATA[class-based]]></category>
		<category><![CDATA[django]]></category>
		<category><![CDATA[generic views]]></category>
		<category><![CDATA[jqm]]></category>
		<category><![CDATA[jquery]]></category>
		<category><![CDATA[jquerymobile]]></category>

		<guid isPermaLink="false">http://funinc.org/?p=306</guid>
		<description><![CDATA[After working with Paypouy on a quick project using the php-based, shared-hosting-friendly CodeIgniter, I&#8217;m back to the more familiar waters of Python/Django. I was asked to create a small organizer/calendar type app for a client to be used mainly from a smart phone. The app seemed very straight forward, so I thought I&#8217;d rely on [...]]]></description>
			<content:encoded><![CDATA[<p>After working with Paypouy on a quick project using the php-based, <a href="http://moodeef.com" target="_blank">shared-hosting</a>-friendly <a href="http://codeigniter.com" title="CodeIgniter" target="_blank">CodeIgniter</a>, I&#8217;m back to the more familiar waters of Python/Django.</p>
<p>I was asked to create a small organizer/calendar type app for a client to be used mainly from a smart phone. The app seemed very straight forward, so I thought I&#8217;d rely on the <a href="https://docs.djangoproject.com/en/dev/topics/class-based-views/" target="_blank">generic views</a> for most of the work.</p>
<p>Check out some of the code after the break <span id="more-306"></span><br />
Here&#8217;s a bit of code:</p>
<div class="dean_ch" style="white-space: wrap;">
<ol>
<li class="li1">
<div class="de1"><span class="co1"># urls.py</span></div>
</li>
<li class="li1">
<div class="de1"><span class="kw1">from</span> django.<span class="me1">conf</span>.<span class="me1">urls</span> <span class="kw1">import</span> patterns, include, url</div>
</li>
<li class="li1">
<div class="de1"><span class="kw1">from</span> django.<span class="me1">views</span>.<span class="me1">generic</span> <span class="kw1">import</span> ListView, DetailView</div>
</li>
<li class="li1">
<div class="de1"><span class="kw1">from</span> app.<span class="me1">views</span> <span class="kw1">import</span> \</div>
</li>
<li class="li2">
<div class="de2">&nbsp; &nbsp; CalendarView, DeleteCalView, UpdateCalView, CreateCalView</div>
</li>
<li class="li1">
<div class="de1">&nbsp;</div>
</li>
<li class="li1">
<div class="de1">urlpatterns = patterns<span class="br0">&#40;</span><span class="st0">&#8221;</span>,</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; url<span class="br0">&#40;</span>r<span class="st0">&#8216;^calendar/create/$&#8217;</span>, CreateCalView.<span class="me1">as_view</span><span class="br0">&#40;</span><span class="br0">&#41;</span>, name=<span class="st0">&quot;cal_create&quot;</span><span class="br0">&#41;</span>,</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; url<span class="br0">&#40;</span>r<span class="st0">&#8216;^calendar/(?P&lt;slug&gt;[0-9]+)/$&#8217;</span>, DetailView.<span class="me1">as_view</span><span class="br0">&#40;</span>model=Presentation, slug_field=<span class="st0">&#8216;number&#8217;</span><span class="br0">&#41;</span>, name=<span class="st0">&#8216;presentation&#8217;</span><span class="br0">&#41;</span>,</div>
</li>
<li class="li2">
<div class="de2">&nbsp; &nbsp; url<span class="br0">&#40;</span>r<span class="st0">&#8216;^calendar/$&#8217;</span>, ListView.<span class="me1">as_view</span><span class="br0">&#40;</span>model=Presentation, context_object_name=<span class="st0">&#8216;presentation&#8217;</span><span class="br0">&#41;</span>, name=<span class="st0">&#8216;presentation_list&#8217;</span><span class="br0">&#41;</span>,</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; url<span class="br0">&#40;</span>r<span class="st0">&#8216;^calendar/upcoming/$&#8217;</span>, CalendarView.<span class="me1">as_view</span><span class="br0">&#40;</span><span class="br0">&#41;</span>, <span class="br0">&#123;</span><span class="st0">&#8216;as&#8217;</span>: <span class="st0">&#8216;upcoming&#8217;</span><span class="br0">&#125;</span>, name=<span class="st0">&#8216;upcoming&#8217;</span><span class="br0">&#41;</span>,</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; url<span class="br0">&#40;</span>r<span class="st0">&#8216;^calendar/presented/$&#8217;</span>, CalendarView.<span class="me1">as_view</span><span class="br0">&#40;</span><span class="br0">&#41;</span>, <span class="br0">&#123;</span><span class="st0">&#8216;as&#8217;</span>: <span class="st0">&#8216;presented&#8217;</span><span class="br0">&#125;</span>, name=<span class="st0">&#8216;presented&#8217;</span><span class="br0">&#41;</span>,</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; url<span class="br0">&#40;</span>r<span class="st0">&#8216;^calendar/unconfirmed/$&#8217;</span>, CalendarView.<span class="me1">as_view</span><span class="br0">&#40;</span><span class="br0">&#41;</span>, <span class="br0">&#123;</span><span class="st0">&#8216;as&#8217;</span>: <span class="st0">&#8216;unconfirmed&#8217;</span><span class="br0">&#125;</span>, name=<span class="st0">&#8216;unconfirmed&#8217;</span><span class="br0">&#41;</span>,</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; url<span class="br0">&#40;</span>r<span class="st0">&#8216;^calendar/confirm/(?P&lt;pk&gt;[0-9]+)/$&#8217;</span>, UpdateCalView.<span class="me1">as_view</span><span class="br0">&#40;</span><span class="br0">&#41;</span>, <span class="br0">&#123;</span><span class="st0">&#8216;as&#8217;</span>: <span class="st0">&#8216;confirm&#8217;</span><span class="br0">&#125;</span>, name=<span class="st0">&quot;cal_confirm&quot;</span><span class="br0">&#41;</span>,</div>
</li>
<li class="li2">
<div class="de2">&nbsp; &nbsp; url<span class="br0">&#40;</span>r<span class="st0">&#8216;^calendar/delete/(?P&lt;pk&gt;[0-9]+)/$&#8217;</span>, DeleteCalView.<span class="me1">as_view</span><span class="br0">&#40;</span><span class="br0">&#41;</span>, name=<span class="st0">&quot;cal_del&quot;</span><span class="br0">&#41;</span>,</div>
</li>
<li class="li1">
<div class="de1"><span class="br0">&#41;</span></div>
</li>
</ol>
</div>
<p>and some code from the Views:</p>
<div class="dean_ch" style="white-space: wrap;">
<ol>
<li class="li1">
<div class="de1"><span class="co1"># views.py</span></div>
</li>
<li class="li1">
<div class="de1"><span class="kw1">class</span> CalendarView<span class="br0">&#40;</span>ListView<span class="br0">&#41;</span>:</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; template_name = <span class="st0">&quot;calendar/calendar.html&quot;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; </div>
</li>
<li class="li2">
<div class="de2">&nbsp; &nbsp; <span class="kw1">def</span> get_queryset<span class="br0">&#40;</span><span class="kw2">self</span><span class="br0">&#41;</span>:</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; called_as = <span class="kw2">self</span>.<span class="me1">kwargs</span><span class="br0">&#91;</span><span class="st0">&#8216;as&#8217;</span><span class="br0">&#93;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; <span class="kw1">if</span> <span class="br0">&#40;</span>called_as <span class="kw1">in</span> <span class="br0">&#91;</span><span class="st0">&quot;home&quot;</span>, <span class="st0">&quot;upcoming&quot;</span><span class="br0">&#93;</span><span class="br0">&#41;</span>:</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="kw1">return</span> Calendar.<span class="me1">objects</span>.<span class="me1">order_by</span><span class="br0">&#40;</span><span class="st0">&#8216;scheduled_on&#8217;</span><span class="br0">&#41;</span>.<span class="kw2">filter</span><span class="br0">&#40;</span>scheduled_on__gt=<span class="kw3">datetime</span>.<span class="me1">now</span><span class="br0">&#40;</span><span class="br0">&#41;</span><span class="br0">&#41;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; <span class="kw1">if</span> <span class="br0">&#40;</span>called_as==<span class="st0">&quot;presented&quot;</span><span class="br0">&#41;</span>:</div>
</li>
<li class="li2">
<div class="de2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="kw1">return</span> Calendar.<span class="me1">objects</span>.<span class="me1">order_by</span><span class="br0">&#40;</span><span class="st0">&#8216;scheduled_on&#8217;</span><span class="br0">&#41;</span>.<span class="kw2">filter</span><span class="br0">&#40;</span>scheduled_on__lt=<span class="kw3">datetime</span>.<span class="me1">now</span><span class="br0">&#40;</span><span class="br0">&#41;</span>, status=<span class="st0">&quot;P&quot;</span><span class="br0">&#41;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; <span class="kw1">if</span> <span class="br0">&#40;</span>called_as==<span class="st0">&quot;unconfirmed&quot;</span><span class="br0">&#41;</span>:</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="kw1">return</span> Calendar.<span class="me1">objects</span>.<span class="me1">order_by</span><span class="br0">&#40;</span><span class="st0">&#8216;scheduled_on&#8217;</span><span class="br0">&#41;</span>.<span class="kw2">filter</span><span class="br0">&#40;</span>scheduled_on__gt=<span class="kw3">datetime</span>.<span class="me1">now</span><span class="br0">&#40;</span><span class="br0">&#41;</span>, status=<span class="st0">&quot;R&quot;</span><span class="br0">&#41;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; </div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; <span class="kw1">def</span> get_context_data<span class="br0">&#40;</span><span class="kw2">self</span>, **kwargs<span class="br0">&#41;</span>:</div>
</li>
<li class="li2">
<div class="de2">&nbsp; &nbsp; &nbsp; &nbsp; called_as = <span class="kw2">self</span>.<span class="me1">kwargs</span><span class="br0">&#91;</span><span class="st0">&#8216;as&#8217;</span><span class="br0">&#93;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; context = <span class="kw2">super</span><span class="br0">&#40;</span>CalendarView, <span class="kw2">self</span><span class="br0">&#41;</span>.<span class="me1">get_context_data</span><span class="br0">&#40;</span>**kwargs<span class="br0">&#41;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; <span class="kw1">if</span> <span class="br0">&#40;</span>called_as <span class="kw1">in</span> <span class="br0">&#91;</span><span class="st0">&quot;home&quot;</span>, <span class="st0">&quot;upcoming&quot;</span><span class="br0">&#93;</span><span class="br0">&#41;</span>:</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; context<span class="br0">&#91;</span><span class="st0">&#8216;title&#8217;</span><span class="br0">&#93;</span> = <span class="st0">&quot;Upcoming Presentations&quot;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; <span class="kw1">if</span> <span class="br0">&#40;</span>called_as==<span class="st0">&quot;presented&quot;</span><span class="br0">&#41;</span>:</div>
</li>
<li class="li2">
<div class="de2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; context<span class="br0">&#91;</span><span class="st0">&#8216;title&#8217;</span><span class="br0">&#93;</span> = <span class="st0">&quot;Done&quot;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; <span class="kw1">if</span> <span class="br0">&#40;</span>called_as==<span class="st0">&quot;unconfirmed&quot;</span><span class="br0">&#41;</span>:</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; context<span class="br0">&#91;</span><span class="st0">&#8216;title&#8217;</span><span class="br0">&#93;</span> = <span class="st0">&quot;Unconfirmed Presentations&quot;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; context<span class="br0">&#91;</span><span class="st0">&#8216;actions&#8217;</span><span class="br0">&#93;</span> = <span class="br0">&#91;</span><span class="st0">&#8216;confirm&#8217;</span>, <span class="st0">&#8216;delete&#8217;</span><span class="br0">&#93;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; <span class="kw1">return</span> context</div>
</li>
<li class="li2">
<div class="de2">&nbsp; &nbsp; &nbsp; &nbsp; </div>
</li>
<li class="li1">
<div class="de1"><span class="kw1">class</span> DeleteCalView<span class="br0">&#40;</span>DeleteView<span class="br0">&#41;</span>:</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; model = Calendar</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; template_name = <span class="st0">&quot;calendar/delete.html&quot;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; success_url = <span class="st0">&quot;/&quot;</span> </div>
</li>
<li class="li2">
<div class="de2">&nbsp; &nbsp; </div>
</li>
<li class="li1">
<div class="de1"><span class="kw1">class</span> UpdateCalView<span class="br0">&#40;</span>UpdateView<span class="br0">&#41;</span>:</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; model = Calendar</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; template_name = <span class="st0">&quot;calendar/update.html&quot;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; success_url = <span class="st0">&quot;/&quot;</span> </div>
</li>
<li class="li2">
<div class="de2">&nbsp; &nbsp; </div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; <span class="kw1">def</span> get_context_data<span class="br0">&#40;</span><span class="kw2">self</span>, **kwargs<span class="br0">&#41;</span>:</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; called_as = <span class="kw2">self</span>.<span class="me1">kwargs</span><span class="br0">&#91;</span><span class="st0">&#8216;as&#8217;</span><span class="br0">&#93;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; context = <span class="kw2">super</span><span class="br0">&#40;</span>UpdateCalView, <span class="kw2">self</span><span class="br0">&#41;</span>.<span class="me1">get_context_data</span><span class="br0">&#40;</span>**kwargs<span class="br0">&#41;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; <span class="kw1">if</span> <span class="br0">&#40;</span>called_as==<span class="st0">&quot;confirm&quot;</span><span class="br0">&#41;</span>:</div>
</li>
<li class="li2">
<div class="de2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; context<span class="br0">&#91;</span><span class="st0">&#8216;confirm_form&#8217;</span><span class="br0">&#93;</span> = <span class="kw2">True</span> &nbsp; </div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; <span class="kw1">return</span> context</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; </div>
</li>
<li class="li1">
<div class="de1"><span class="kw1">class</span> CreateCalView<span class="br0">&#40;</span>CreateView<span class="br0">&#41;</span>:</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; model = Calendar</div>
</li>
<li class="li2">
<div class="de2">&nbsp; &nbsp; template_name = <span class="st0">&quot;calendar/update.html&quot;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; success_url = <span class="st0">&quot;/&quot;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; </div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; <span class="kw1">def</span> get_initial<span class="br0">&#40;</span><span class="kw2">self</span><span class="br0">&#41;</span>:</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; initial = <span class="kw2">super</span><span class="br0">&#40;</span>CreateView, <span class="kw2">self</span><span class="br0">&#41;</span>.<span class="me1">get_initial</span><span class="br0">&#40;</span><span class="br0">&#41;</span></div>
</li>
<li class="li2">
<div class="de2">&nbsp; &nbsp; &nbsp; &nbsp; initial = initial.<span class="kw3">copy</span><span class="br0">&#40;</span><span class="br0">&#41;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; initial<span class="br0">&#91;</span><span class="st0">&#8216;status&#8217;</span><span class="br0">&#93;</span> = <span class="st0">&#8216;R&#8217;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; <span class="kw1">return</span> initial</div>
</li>
<li class="li1">
<div class="de1">&nbsp;</div>
</li>
</ol>
</div>
<p>I should mention that most of the code in the views.py could simply be removed and the equivalent added in the urls.py file. For example:</p>
<div class="dean_ch" style="white-space: wrap;">
<ol>
<li class="li1">
<div class="de1"><span class="kw1">class</span> DeleteCalView<span class="br0">&#40;</span>DeleteView<span class="br0">&#41;</span>:</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; model = Calendar</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; template_name = <span class="st0">&quot;calendar/delete.html&quot;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; success_url = <span class="st0">&quot;/&quot;</span> </div>
</li>
</ol>
</div>
<p>could be replaced by editing the line in urls.py: </p>
<div class="dean_ch" style="white-space: wrap;">
<ol>
<li class="li1">
<div class="de1">url<span class="br0">&#40;</span>r<span class="st0">&#8216;^calendar/delete/(?P&lt;pk&gt;[0-9]+)/$&#8217;</span>, </div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; DeleteView.<span class="me1">as_view</span><span class="br0">&#40;</span>model=Calendar, template_name=<span class="st0">&quot;calendar/delete.html&quot;</span>, success_url=<span class="st0">&quot;/&quot;</span><span class="br0">&#41;</span>,</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; name=<span class="st0">&quot;cal_del&quot;</span><span class="br0">&#41;</span>,</div>
</li>
</ol>
</div>
<p>Note also that you can simply use the default <strong>template_name</strong> instead of adding your own (less code!).</p>
<p>Since the app would mostly be used from smart phones, I used <a href="http://jquerymobile.com" title="jQueryMobile" target="_blank">jQueryMobile</a> for most of the template work (and its <a href="http://dev.jtsage.com/jQM-DateBox/" title="JQM DateBox" target="_blank">DateBox plugin</a>. Here&#8217;s a bit of code from that:</p>
<div class="dean_ch" style="white-space: wrap;">
<ol>
<li class="li1">
<div class="de1">&lt;!&#8211; base.html&gt;
</div>
</li>
<li class="li1">
<div class="de1">&lt;head&gt;
</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; &lt;link rel=&quot;stylesheet&quot; href=&quot;/s/css/jquery.mobile-1.0.min.css&quot; /&gt;
</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; &lt;link rel=&quot;stylesheet&quot; href=&quot;/s/css/jquery.mobile.datebox.min.css&quot; /&gt;
</div>
</li>
<li class="li2">
<div class="de2">&nbsp; &nbsp; &nbsp; &nbsp; &lt;script src=&quot;/s/js/jquery-1.7.1.min.js&quot; &gt;&lt;/script&gt;
</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; &lt;script src=&quot;/s/js/jquery.mobile-1.0.min.js&quot; &gt;&lt;/script&gt;
</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; &lt;script src=&quot;/s/js/jquery.mobile.datebox.min.js&quot; &gt;&lt;/script&gt;
</div>
</li>
<li class="li1">
<div class="de1">&lt;meta name=&quot;viewport&quot; content=&quot;width=device-width, initial-scale=1&quot;&gt;
</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &lt;/head&gt;
</div>
</li>
<li class="li2">
<div class="de2">&nbsp; &nbsp; &lt;body&gt;
</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; &lt;div data-role=&quot;page&quot;&gt;
</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;div data-role=&quot;header&quot;&gt;
</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; {% block header %}{% endblock %}
</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;div data-role=&quot;navbar&quot;&gt;
</div>
</li>
<li class="li2">
<div class="de2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;ul&gt;&lt;li&gt;&lt;a href=&quot;{% url home %}&quot; data-icon=&quot;home&quot;&gt;Calendar&lt;/a&gt;&lt;/li&gt;
</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;li&gt;&lt;a href=&quot;{% url cal_create %}&quot; data-icon=&quot;plus&quot; data-rel=&quot;dialog&quot;&gt;Add&lt;/a&gt;&lt;/li&gt;&lt;/ul&gt;
</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;/div&gt;
</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;/div&gt;
</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;div data-role=&quot;content&quot;&gt;
</div>
</li>
<li class="li2">
<div class="de2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; {% block content %}{% endblock %}
</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;/div&gt;
</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&lt;/div&gt;
</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &lt;/body&gt;
</div>
</li>
<li class="li1">
<div class="de1">&nbsp;</div>
</li>
</ol>
</div>
<p>and the listing:</p>
<div class="dean_ch" style="white-space: wrap;">
<ol>
<li class="li1">
<div class="de1">{% extends &quot;base.html&quot; %}
</div>
</li>
<li class="li1">
<div class="de1">{% block header %}&lt;h2&gt;{{ title|default:&quot;Presentations&quot; }}&lt;/h2&gt;{% endblock %}
</div>
</li>
<li class="li1">
<div class="de1">&nbsp;</div>
</li>
<li class="li1">
<div class="de1">{% block content %}
</div>
</li>
<li class="li2">
<div class="de2">&nbsp; &nbsp; &lt;div data-role=&quot;controlgroup&quot; data-type=&quot;horizontal&quot;&gt;
</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; &lt;a href=&quot;{% url presented %}&quot; data-role=&quot;button&quot;&gt;Presented&lt;/a&gt;
</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; &lt;a href=&quot;{% url upcoming %}&quot; data-role=&quot;button&quot;&gt;Upcoming&lt;/a&gt;
</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; &lt;a href=&quot;{% url unconfirmed %}&quot; data-role=&quot;button&quot;&gt;Unconfirmed&lt;/a&gt;
</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &lt;/div&gt;
</div>
</li>
<li class="li2">
<div class="de2">&nbsp; &nbsp; &lt;ul data-role=&quot;listview&quot; data-inset=&quot;true&quot; data-filter=&quot;true&quot;&gt;
</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; {% regroup object_list by presented_on|date:&quot;F&quot; as objects_by_month %}
</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; {% for o in objects_by_month %}
</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;li data-role=&quot;list-divider&quot;&gt;{{ o.grouper }}&lt;/li&gt;
</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; {% for c in o.list %}
</div>
</li>
<li class="li2">
<div class="de2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;li&gt;
</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;a href=&quot;{% url cal_confirm c.pk %}&quot; data-rel=&quot;dialog&quot;&gt;
</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;p&gt;{{ c.scheduled_on }}&lt;/p&gt;&lt;h3&gt;{{ c.title }}&lt;/h3&gt;
</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;p&gt;{{ c.speaker }}&lt;/p&gt;
</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;/a&gt;
</div>
</li>
<li class="li2">
<div class="de2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;/li&gt;
</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; {% endfor %}
</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; {% endfor %}
</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &lt;/ul&gt;
</div>
</li>
<li class="li1">
<div class="de1">{% endblock %}</div>
</li>
</ol>
</div>
<p>It&#8217;s good to be back. And the project was fun and apparently very useful. In the spirit of agile development, the first iteration took about 3 hours to complete. I am still waiting for feedback to get started on the next one (should be related to hooking Google Calendar to the app).</p>
]]></content:encoded>
			<wfw:commentRss>http://funinc.org/20111220/django-class-based-generic-views/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Safely Rebooting RimuHosting VPS (via API)</title>
		<link>http://funinc.org/20111026/safely-rebooting-rimuhosting-vps-via-api</link>
		<comments>http://funinc.org/20111026/safely-rebooting-rimuhosting-vps-via-api#comments</comments>
		<pubDate>Wed, 26 Oct 2011 10:18:07 +0000</pubDate>
		<dc:creator>abdallah</dc:creator>
				<category><![CDATA[Tools]]></category>
		<category><![CDATA[Work]]></category>

		<guid isPermaLink="false">http://funinc.org/?p=300</guid>
		<description><![CDATA[First, get the API keys from the control panel at https://rimuhosting.com/cp/apikeys.jsp The documentation for the API can be found here So to reboot, I use the following script: #!/bin/bash APIKEY=00000000000000000000000000 VPSOID=0000000 VPSNAME=whatever curl -H &#34;Content-Type: application/json&#34; -H &#34;Accept: application/json&#34; -H &#34;Authorization: rimuhosting apikey=$APIKEY&#34; -X PUT -d &#8216;{&#34;reboot_request&#34;: {&#34;running_state&#34;: &#34;RESTARTING&#34;}}&#8217; https://rimuhosting.com/r/orders/order-$VPSOID-$VPSNAME/vps/running-state That seems to be much [...]]]></description>
			<content:encoded><![CDATA[<p>First, get the API keys from the control panel at https://rimuhosting.com/cp/apikeys.jsp<br />
<a href="https://rimuhosting.com/cp/apikeys.jsp"><img src="http://funinc.org/wp-content/uploads/rimu-api-keys-234x300.png" alt="API Keys page" title="API Keys page" width="234" height="300" class="alignnone size-medium wp-image-301" /></a></p>
<p>The documentation for the API can be found <a href="http://apidocs.rimuhosting.com" title="RimuHosting API docs" target="_blank">here</a></p>
<p>So to reboot, I use the following script:</p>
<div class="dean_ch" style="white-space: wrap;">
<ol>
<li class="li1">
<div class="de1"><span class="re3">#!/bin/bash </span></div>
</li>
<li class="li1">
<div class="de1"><span class="re2">APIKEY=</span><span class="nu0">00000000000000000000000000</span></div>
</li>
<li class="li1">
<div class="de1"><span class="re2">VPSOID=</span><span class="nu0">0000000</span></div>
</li>
<li class="li1">
<div class="de1"><span class="re2">VPSNAME=</span>whatever</div>
</li>
<li class="li2">
<div class="de2">curl -H <span class="st0">&quot;Content-Type: application/json&quot;</span> -H <span class="st0">&quot;Accept: application/json&quot;</span> -H <span class="st0">&quot;Authorization: rimuhosting apikey=$APIKEY&quot;</span> -X PUT -d <span class="st0">&#8216;{&quot;reboot_request&quot;: {&quot;running_state&quot;: &quot;RESTARTING&quot;}}&#8217;</span> https://rimuhosting.com/r/orders/order-<span class="re1">$VPSOID</span>-<span class="re1">$VPSNAME</span>/vps/running-state</div>
</li>
</ol>
</div>
<p>That seems to be much safer than running: <code>sudo reboot</code> </p>
]]></content:encoded>
			<wfw:commentRss>http://funinc.org/20111026/safely-rebooting-rimuhosting-vps-via-api/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Using ePubLib for Android</title>
		<link>http://funinc.org/20111012/using-epublib-for-android</link>
		<comments>http://funinc.org/20111012/using-epublib-for-android#comments</comments>
		<pubDate>Wed, 12 Oct 2011 09:01:15 +0000</pubDate>
		<dc:creator>abdallah</dc:creator>
				<category><![CDATA[Coding]]></category>
		<category><![CDATA[android]]></category>
		<category><![CDATA[epub]]></category>
		<category><![CDATA[epublib]]></category>
		<category><![CDATA[esd]]></category>
		<category><![CDATA[java]]></category>
		<category><![CDATA[scriptures]]></category>
		<category><![CDATA[snippet]]></category>

		<guid isPermaLink="false">http://funinc.org/?p=299</guid>
		<description><![CDATA[I&#8217;m rewriting the Examine the Scriptures Daily android app. With the ESD files published as ePub files it&#8217;s easier to get the data now, and it will allow more languages to be supported without the hassle of converting from WTLib. Here&#8217;s the code snippet I&#8217;m using to read the ePub book. The library I&#8217;m using [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;m rewriting the <a href="http://funinc.org/20110707/daily-scriptures-android.moo/" title="Daily Scriptures Android App">Examine the Scriptures Daily</a> android app. With the ESD files published as <a href="http://www.jw.org/index.html?option=QrYQCsVrGlBBX" title="JW.ORG :: Digital Publications">ePub</a> files it&#8217;s easier to get the data now, and it will allow more languages to be supported without the hassle of converting from WTLib.</p>
<p>Here&#8217;s the code snippet I&#8217;m using to read the ePub book. The library I&#8217;m using is <a href="http://www.siegmann.nl/epublib/android" title="ePubLib for Android">ePubLib</a>, and I&#8217;m displaying the page in a standard WebView:</p>
<div class="dean_ch" style="white-space: wrap;">
<ol>
<li class="li1">
<div class="de1"> &nbsp; &nbsp;<span class="co1">// Load the book and get a specific date</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; AssetManager assetManager = getAssets<span class="br0">&#40;</span><span class="br0">&#41;</span>;</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; <span class="kw2">try</span> <span class="br0">&#123;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; <span class="co1">// find InputStream for book</span></div>
</li>
<li class="li2">
<div class="de2">&nbsp; &nbsp; &nbsp; &nbsp; <a href="http://www.google.com/search?hl=en&amp;q=allinurl%3AInputStream+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span class="kw3">InputStream</span></a> epubInputStream = assetManager.<span class="me1">open</span><span class="br0">&#40;</span><span class="st0">&quot;es12_E.epub&quot;</span><span class="br0">&#41;</span>;</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; <span class="co1">// Load Book from inputStream</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; <span class="kw2">this</span>.<span class="me1">book</span> = <span class="br0">&#40;</span><span class="kw2">new</span> EpubReader<span class="br0">&#40;</span><span class="br0">&#41;</span><span class="br0">&#41;</span>.<span class="me1">readEpub</span><span class="br0">&#40;</span>epubInputStream<span class="br0">&#41;</span>;</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; getSpecificdate<span class="br0">&#40;</span><span class="st0">&quot;2012-12-1&quot;</span><span class="br0">&#41;</span>;</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; <span class="br0">&#125;</span> <span class="kw2">catch</span> <span class="br0">&#40;</span><a href="http://www.google.com/search?hl=en&amp;q=allinurl%3AIOException+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span class="kw3">IOException</span></a> e<span class="br0">&#41;</span> <span class="br0">&#123;</span></div>
</li>
<li class="li2">
<div class="de2">&nbsp; &nbsp; &nbsp; &nbsp; Log.<span class="me1">e</span><span class="br0">&#40;</span><span class="st0">&quot;epublib&quot;</span>, e.<span class="me1">getMessage</span><span class="br0">&#40;</span><span class="br0">&#41;</span><span class="br0">&#41;</span>;</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; <span class="br0">&#125;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp;</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; <span class="kw2">private</span> <span class="kw4">void</span> getSpecificdate<span class="br0">&#40;</span><a href="http://www.google.com/search?hl=en&amp;q=allinurl%3AString+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span class="kw3">String</span></a> day<span class="br0">&#41;</span> <span class="br0">&#123;</span> </div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; <a href="http://www.google.com/search?hl=en&amp;q=allinurl%3ADate+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span class="kw3">Date</span></a> d; </div>
</li>
<li class="li2">
<div class="de2">&nbsp; &nbsp; &nbsp; &nbsp; <span class="kw4">int</span> dayOfMonth;</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; <span class="kw4">int</span> monthOfYear;</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; <a href="http://www.google.com/search?hl=en&amp;q=allinurl%3ACalendar+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span class="kw3">Calendar</span></a> cal = <a href="http://www.google.com/search?hl=en&amp;q=allinurl%3ACalendar+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span class="kw3">Calendar</span></a>.<span class="me1">getInstance</span><span class="br0">&#40;</span><span class="br0">&#41;</span>;</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; <span class="kw2">try</span> <span class="br0">&#123;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; d = dateFormat.<span class="me1">parse</span><span class="br0">&#40;</span>day<span class="br0">&#41;</span>;</div>
</li>
<li class="li2">
<div class="de2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; cal.<span class="me1">setTime</span><span class="br0">&#40;</span>d<span class="br0">&#41;</span>;</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <a href="http://www.google.com/search?hl=en&amp;q=allinurl%3AString+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span class="kw3">String</span></a> hrefDate = hrefFormat.<span class="me1">format</span><span class="br0">&#40;</span>d<span class="br0">&#41;</span>.<span class="me1">toUpperCase</span><span class="br0">&#40;</span><span class="br0">&#41;</span>;</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; dayOfMonth=cal.<span class="me1">get</span><span class="br0">&#40;</span><a href="http://www.google.com/search?hl=en&amp;q=allinurl%3ACalendar+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span class="kw3">Calendar</span></a>.<span class="me1">DAY_OF_MONTH</span><span class="br0">&#41;</span>;</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; monthOfYear=cal.<span class="me1">get</span><span class="br0">&#40;</span><a href="http://www.google.com/search?hl=en&amp;q=allinurl%3ACalendar+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span class="kw3">Calendar</span></a>.<span class="me1">MONTH</span><span class="br0">&#41;</span>;</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; hrefDate += <span class="br0">&#40;</span>dayOfMonth==<span class="nu0">1</span><span class="br0">&#41;</span> ? <span class="st0">&quot;.xhtml&quot;</span> : <span class="st0">&quot;-split&quot;</span>+dayOfMonth+<span class="st0">&quot;.xhtml&quot;</span>;</div>
</li>
<li class="li2">
<div class="de2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; hrefDate = dblzero.<span class="me1">format</span><span class="br0">&#40;</span>monthOfYear<span class="nu0">+4</span><span class="br0">&#41;</span>+hrefDate.<span class="me1">substring</span><span class="br0">&#40;</span><span class="nu0">2</span><span class="br0">&#41;</span>;</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="co1">// Here&#8217;s the part you&#8217;re looking for</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Resource r = <span class="kw2">this</span>.<span class="me1">book</span>.<span class="me1">getResources</span><span class="br0">&#40;</span><span class="br0">&#41;</span>.<span class="me1">getByHref</span><span class="br0">&#40;</span>hrefDate<span class="br0">&#41;</span>;</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; WebView wv = <span class="br0">&#40;</span>WebView<span class="br0">&#41;</span> findViewById<span class="br0">&#40;</span>R.<span class="me1">id</span>.<span class="me1">webView1</span><span class="br0">&#41;</span>;</div>
</li>
<li class="li2">
<div class="de2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <a href="http://www.google.com/search?hl=en&amp;q=allinurl%3AString+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span class="kw3">String</span></a> data = <span class="kw2">new</span> <a href="http://www.google.com/search?hl=en&amp;q=allinurl%3AString+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span class="kw3">String</span></a><span class="br0">&#40;</span> r.<span class="me1">getData</span><span class="br0">&#40;</span><span class="br0">&#41;</span> <span class="br0">&#41;</span>;</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; wv.<span class="me1">loadDataWithBaseURL</span><span class="br0">&#40;</span><span class="st0">&quot;file:///android_asset/&quot;</span>, data, <span class="st0">&quot;text/html&quot;</span>, <span class="st0">&quot;utf-8&quot;</span>, <span class="kw2">null</span><span class="br0">&#41;</span>;</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#125;</span> <span class="kw2">catch</span> <span class="br0">&#40;</span><a href="http://www.google.com/search?hl=en&amp;q=allinurl%3AParseException+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span class="kw3">ParseException</span></a> e<span class="br0">&#41;</span> <span class="br0">&#123;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; e.<span class="me1">printStackTrace</span><span class="br0">&#40;</span><span class="br0">&#41;</span>;</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#125;</span></div>
</li>
<li class="li2">
<div class="de2">&nbsp; &nbsp; &nbsp; &nbsp; </div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; <span class="br0">&#125;</span></div>
</li>
</ol>
</div>
]]></content:encoded>
			<wfw:commentRss>http://funinc.org/20111012/using-epublib-for-android/feed</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>Android Plugin for Eclipse Hanging</title>
		<link>http://funinc.org/20111005/android-plugin-for-eclipse-hanging</link>
		<comments>http://funinc.org/20111005/android-plugin-for-eclipse-hanging#comments</comments>
		<pubDate>Wed, 05 Oct 2011 08:59:36 +0000</pubDate>
		<dc:creator>abdallah</dc:creator>
				<category><![CDATA[Work]]></category>
		<category><![CDATA[android]]></category>
		<category><![CDATA[eclipse]]></category>
		<category><![CDATA[fix]]></category>
		<category><![CDATA[ubuntu]]></category>

		<guid isPermaLink="false">http://funinc.org/?p=297</guid>
		<description><![CDATA[For a couple of weeks now I have been trying to get the Android Plugin for Eclipse to play nicely on my new 64bit Ubuntu 11.10. It was always hanging without a good explanation. The only message I got was &#8220;Loading Data for Android 2.3.3&#8243; and it reaches 100% but stays there. I thought it [...]]]></description>
			<content:encoded><![CDATA[<p>For a couple of weeks now I have been trying to get the <a href="http://developer.android.com/sdk/eclipse-adt.html" title="Android Plugin for Eclipse">Android Plugin for Eclipse</a> to play nicely on my new 64bit Ubuntu 11.10.<br />
It was always hanging without a good explanation. The only message I got was &#8220;Loading Data for Android 2.3.3&#8243; and it reaches 100% but stays there.</p>
<p>I thought it was related to the fact that I&#8217;m using the latest Indigo (3.7) eclipse, but that wasn&#8217;t it (I tried with earlier versions). I also thought it was because of the 64bit java I installed separately (not using apt). That wasn&#8217;t it either (the apt installed version didn&#8217;t work either). Stupid solutions, I know, but I had to try!</p>
<p>The solution was to rename the SDK directory and remove the _x64 from the end of that. After that, I set it in <code>Windows -> Preferences -> Android -> SDK location</code> and applied the changes and voila! It works now.</p>
<p>I&#8217;ll be fixing the <a href="http://funinc.org/20110707/daily-scriptures-android.moo/" title="Daily Scriptures Android App">ESD</a> app based on some kind feedback from friends. And maybe work on other pending projects as well. Stay tuned.</p>
]]></content:encoded>
			<wfw:commentRss>http://funinc.org/20111005/android-plugin-for-eclipse-hanging/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Recovering from a failed RAID drive</title>
		<link>http://funinc.org/20110928/recovering-from-a-failed-raid-drive</link>
		<comments>http://funinc.org/20110928/recovering-from-a-failed-raid-drive#comments</comments>
		<pubDate>Wed, 28 Sep 2011 08:31:44 +0000</pubDate>
		<dc:creator>abdallah</dc:creator>
				<category><![CDATA[Work]]></category>
		<category><![CDATA[array]]></category>
		<category><![CDATA[disk]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[mount]]></category>
		<category><![CDATA[raid]]></category>
		<category><![CDATA[recovery]]></category>

		<guid isPermaLink="false">http://funinc.org/?p=296</guid>
		<description><![CDATA[I was trying to mount one of the disks from a failed RAID array. The disk was put in a USB enclosure and hooked to the machine. Here&#8217;s what I saw: srv0:~# mount /dev/sdc3 /mnt/usb/ mount: unknown filesystem type &#8216;mdraid&#8217; srv0:~# mdadm &#8211;examine /dev/sdc mdadm: No md superblock detected on /dev/sdc. I panicked a little, [...]]]></description>
			<content:encoded><![CDATA[<p>I was trying to mount one of the disks from a failed RAID array. The disk was put in a USB enclosure and hooked to the machine. Here&#8217;s what I saw: </p>
<div class="dean_ch" style="white-space: wrap;">
<ol>
<li class="li1">
<div class="de1">srv0:~<span class="re3"># <span class="kw2">mount</span> /dev/sdc3 /mnt/usb/</span></div>
</li>
<li class="li1">
<div class="de1"><span class="kw2">mount</span>: unknown filesystem <span class="kw3">type</span> <span class="st0">&#8216;mdraid&#8217;</span></div>
</li>
<li class="li1">
<div class="de1">srv0:~<span class="re3"># mdadm &#8211;examine /dev/sdc</span></div>
</li>
<li class="li1">
<div class="de1">mdadm: No md superblock detected on /dev/sdc.</div>
</li>
</ol>
</div>
<p>I panicked a little, then tried the following that worked: </p>
<div class="dean_ch" style="white-space: wrap;">
<ol>
<li class="li1">
<div class="de1">srv0:~<span class="re3"># <span class="kw2">mount</span> /dev/sdc3 /mnt/usb/ -o ro -t ext3</span></div>
</li>
<li class="li1">
<div class="de1">srv0:~<span class="re3"># <span class="kw2">ls</span> /mnt/usb</span></div>
</li>
<li class="li1">
<div class="de1">bin &nbsp; dev &nbsp; etc &nbsp; initrd.img &nbsp;lib64&nbsp; &nbsp;media &nbsp;opt &nbsp; root &nbsp;selinux &nbsp;sys &nbsp;usr&nbsp; vmlinuz</div>
</li>
<li class="li1">
<div class="de1">boot &nbsp;home &nbsp;lib&nbsp; &nbsp; &nbsp; &nbsp;lost+found &nbsp;mnt&nbsp; &nbsp; proc &nbsp;sbin &nbsp;srv &nbsp; &nbsp; &nbsp;tmp &nbsp;var</div>
</li>
</ol>
</div>
]]></content:encoded>
			<wfw:commentRss>http://funinc.org/20110928/recovering-from-a-failed-raid-drive/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Django uWSGI and Nginx on Ubuntu 11.10</title>
		<link>http://funinc.org/20110923/django-uwsgi-and-nginx-on-ubuntu-11-10</link>
		<comments>http://funinc.org/20110923/django-uwsgi-and-nginx-on-ubuntu-11-10#comments</comments>
		<pubDate>Fri, 23 Sep 2011 17:12:45 +0000</pubDate>
		<dc:creator>abdallah</dc:creator>
				<category><![CDATA[Tools]]></category>
		<category><![CDATA[configuration]]></category>
		<category><![CDATA[django]]></category>
		<category><![CDATA[nginx]]></category>
		<category><![CDATA[python]]></category>
		<category><![CDATA[uwsgi]]></category>

		<guid isPermaLink="false">http://funinc.org/?p=294</guid>
		<description><![CDATA[Installing my simple Django app on a new Ubuntu 11.10 machine using uWSGI and Nginx]]></description>
			<content:encoded><![CDATA[<p>I&#8217;m working my way through installing my simple django app on a new Ubuntu machine using the components mentioned above.</p>
<p>So far, here&#8217;s what I&#8217;ve done:</p>
<ul>
<li>apt-get install nginx-full</li>
<li>apt-get install uwsgi uwsgi-plugin-python</li>
<li>installed django from svn <a href="http://www.djangoproject.com/download/" target="_blank">described in the docs</a></li>
</ul>
<p>The nginx configuration can be found in /etc/nginx/sites-available/default. Of course, it&#8217;s best to make a copy of that file and edit it for the site/app I&#8217;m working on. Here&#8217;s what I put in it:</p>
<div class="dean_ch" style="white-space: wrap;">
<ol>
<li class="li1">
<div class="de1">server <span class="br0">&#123;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; listen &nbsp; <span class="nu0">80</span>;</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; server_name sss.<span class="me1">grat</span>.<span class="me1">in</span>;</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; access_log /var/log/nginx/sss.<span class="me1">grat</span>.<span class="me1">in</span>-access.<span class="me1">log</span>;</div>
</li>
<li class="li2">
<div class="de2">&nbsp; &nbsp; location /media <span class="br0">&#123;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; alias /home/sss/app/media/;</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; <span class="br0">&#125;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; location /<span class="kw4">static</span> <span class="br0">&#123;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; alias /home/sss/app/<span class="kw4">static</span>/;</div>
</li>
<li class="li2">
<div class="de2">&nbsp; &nbsp; <span class="br0">&#125;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; location / <span class="br0">&#123;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; uwsgi_pass unix:<span class="co1">///var/run/sss.grat.in.sock;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; include uwsgi_params;</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; <span class="br0">&#125;</span></div>
</li>
<li class="li2">
<div class="de2"><span class="br0">&#125;</span></div>
</li>
</ol>
</div>
<p>Now for the uWSGI configuration file. I created the file /etc/uwsgi/apps-available/sss.ini and added the following lines:</p>
<div class="dean_ch" style="white-space: wrap;">
<ol>
<li class="li1">
<div class="de1"><span class="re0"><span class="br0">&#91;</span>uwsgi<span class="br0">&#93;</span></span></div>
</li>
<li class="li1">
<div class="de1"><span class="re1">chdir </span>=<span class="re2"> /home/sss/app</span></div>
</li>
<li class="li1">
<div class="de1"><span class="re1">pythonpath </span>=<span class="re2"> /home/sss</span></div>
</li>
<li class="li1">
<div class="de1"><span class="re1">env </span>=<span class="re2"> DJANGO_SETTINGS_MODULE=app.settings</span></div>
</li>
<li class="li2">
<div class="de2"># load django</div>
</li>
<li class="li1">
<div class="de1"><span class="re1">module </span>=<span class="re2"> django.core.handlers.wsgi:WSGIHandler<span class="br0">&#40;</span><span class="br0">&#41;</span></span></div>
</li>
</ol>
</div>
<p>it&#8217;s really just that. What took me so long was to figure out that in Debian/Ubuntu you <strong>have to</strong> install uwsgi-plugin-python, otherwise you&#8217;ll keep on getting weird error messages. Also, the default ini file has most of the settings (in /etc/default/uwsgi) so you should either read or edit that to make sure you&#8217;re getting all the right values.</p>
]]></content:encoded>
			<wfw:commentRss>http://funinc.org/20110923/django-uwsgi-and-nginx-on-ubuntu-11-10/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Site ScreenShot Part 2 &#8211; Planning</title>
		<link>http://funinc.org/20110923/site-screenshot-part-2-planning</link>
		<comments>http://funinc.org/20110923/site-screenshot-part-2-planning#comments</comments>
		<pubDate>Fri, 23 Sep 2011 12:16:51 +0000</pubDate>
		<dc:creator>abdallah</dc:creator>
				<category><![CDATA[Coding]]></category>
		<category><![CDATA[Work]]></category>
		<category><![CDATA[celery]]></category>
		<category><![CDATA[code]]></category>
		<category><![CDATA[django]]></category>
		<category><![CDATA[planning]]></category>
		<category><![CDATA[python]]></category>
		<category><![CDATA[rabbitqm]]></category>
		<category><![CDATA[screenshot]]></category>

		<guid isPermaLink="false">http://funinc.org/?p=290</guid>
		<description><![CDATA[I was having a little conversation with my friend Ghassan from LebanonDesign and he mentioned his company was actually using something similar to SiteScreenShot to generate thumbnails for their different websites. So I thought I could scale my code to do the same. Of course, plenty of changes should be considered: Snapshot generation currently takes [...]]]></description>
			<content:encoded><![CDATA[<p>I was having a little conversation with my friend <a href="http://ghassanelias.com" target="_blank">Ghassan</a> from <a href="http://lebanondesign.com" target="_blank">LebanonDesign</a> and he mentioned his company was actually using something similar to <a href="http://sss.grat.in" target="_blank">SiteScreenShot</a> to generate thumbnails for their different websites. So I thought I could scale my code to do the same. Of course, plenty of changes should be considered:</p>
<ul>
<li>Snapshot generation currently takes 3-5 seconds to complete. So I need to do 2 things:</li>
<ul>
<li>Tell the user that the app is actually working on generating the snapshot</li>
<li>Provide a way to retrieve the pic once the snapshot is generated</li>
<li>Make things go faster if possible</li>
</ul>
<li>Getting more users means more load on the server, what should we use?</li>
<ul>
<li>Replace Apache with <a href="http://wiki.nginx.org" target="_blank">Nginx</a> for faster static file delivery</li>
<li>Use a queue manager like <a href="http://celeryproject.org/" target="_blank">Celery</a>/<a href="http://rabbitmq.com" target="_blank">RabbitQM</a> to distribute the load</li>
</ul>
</ul>
<p>I&#8217;m currently testing some code with <a href="https://github.com/ask/django-celery" target="_blank">django-celery</a> and I&#8217;ll try to post more information here (so I can remember what I&#8217;m doing)</p>
<p>Also on my list is making the site accessible via a simple API.</p>
<p>I also need to research a better way to take the screenshots on a headless server.</p>
<p><span style="color: #ff0000;"> <script type="text/javascript"><!--
google_ad_client = "ca-pub-1751139883162449";
/* sss bottom */
google_ad_slot = "5668547926";
google_ad_width = 728;
google_ad_height = 90;
//-->
</script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script>.<a href="http://www.yuyuh.com/soft/insert-adsense/"><small>advertisement</small></a></span></p>
]]></content:encoded>
			<wfw:commentRss>http://funinc.org/20110923/site-screenshot-part-2-planning/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

