<?xml version="1.0" encoding="utf-8"?>
<rss xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title>Matt Ronge</title><link>http://www.mronge.com</link><description></description><atom:link href="http://www.mronge.com/feeds/all.rss.xml" rel="self"></atom:link><lastBuildDate>Wed, 04 Jan 2012 00:00:00 -0000</lastBuildDate><item><title>T-Minus Zero</title><link>http://www.mronge.com/t-minus-zero.html</link><description>&lt;p&gt;After a long hiatus I've decided to revive my blog. To encourage my blogging I've made writing posts as frictionless as possible. I previously used Wordpress and a custom Django app, but both were clunky. My new setup is simpler, just a directory on Dropbox filled with Markdown files. Now I can write in the editor of my choice and as soon as I save the article is live.&lt;/p&gt;
&lt;p&gt;To generate this site I'm using the nifty static blogging engine &lt;a href="http://readthedocs.org/docs/pelican/en/2.7.2/"&gt;Pelican&lt;/a&gt;. My server runs a copy of Dropbox that syncs the posts. Whenever a file changes in the Dropbox directory, Pelican kicks out an updated version of my site.&lt;/p&gt;
&lt;h3&gt;How to setup Dropbox based blogging&lt;/h3&gt;
&lt;p&gt;If you'd like a similar setup it's not hard. Once you have a server running the HTTP server of your choice, you'll need to add Pelican, Dropbox and incron. I installed on an Ubuntu 10.04 server but other versions of Linux should be comparable.&lt;/p&gt;
&lt;h3&gt;Dropbox&lt;/h3&gt;
&lt;p&gt;The first step is getting Dropbox installed. I setup the stock version available from Dropbox's website and found &lt;a href="http://ubuntuservergui.com/ubuntu-server-guide/install-dropbox-ubuntu-server"&gt;this tutorial&lt;/a&gt; to be very helpful. In particular make sure you setup a script in /etc/init.d/ to automatically start the Dropbox daemon. I used the script shown on the linked tutorial for my init.d script.&lt;/p&gt;
&lt;p&gt;You probably want a separate Dropbox account specifically for your blog. Otherwise all your Dropbox files will be synced to your server, a waste of space and a potential security issue. Instead I shamelessly stole the idea of using Dropbox folder sharing from &lt;a href="http://joehewitt.com/2011/10/03/dropbox-is-my-publish-button"&gt;Joe Hewitt&lt;/a&gt;. The idea is that you have two Dropbox accounts and then let the blog Dropbox account share its posts folder with your main Dropbox account. Check out the Dropbox web interface for details.&lt;/p&gt;
&lt;h3&gt;Pelican&lt;/h3&gt;
&lt;p&gt;Pelican is what powers the blog and generates the static output. The install is super simple:&lt;/p&gt;
&lt;div class="codehilite"&gt;&lt;pre&gt;&lt;span class="gp"&gt;$&lt;/span&gt; sudo aptitude install python-pip
&lt;span class="gp"&gt;$&lt;/span&gt; sudo pip install pelican
&lt;span class="gp"&gt;$&lt;/span&gt; sudo pip install markdown
&lt;/pre&gt;&lt;/div&gt;


&lt;h3&gt;incron&lt;/h3&gt;
&lt;p&gt;The final piece is incron which detects change in the Dropbox directory and executes Pelican when it sees a change. Setup is easy but slightly more involved than Dropbox or Pelican:&lt;/p&gt;
&lt;div class="codehilite"&gt;&lt;pre&gt;&lt;span class="gp"&gt;$&lt;/span&gt; sudo aptitude install incron
&lt;/pre&gt;&lt;/div&gt;


&lt;p&gt;Only users specified in &lt;code&gt;/etc/incron.allow&lt;/code&gt; are allowed to use incron so add your user account:&lt;/p&gt;
&lt;div class="codehilite"&gt;&lt;pre&gt;&lt;span class="gp"&gt;$&lt;/span&gt; sudo &lt;span class="nb"&gt;echo&lt;/span&gt; &lt;span class="nv"&gt;$USER&lt;/span&gt; &amp;gt;&amp;gt; /etc/incron.allow
&lt;/pre&gt;&lt;/div&gt;


&lt;p&gt;Now you need to configure incron which is done like cron:&lt;/p&gt;
&lt;div class="codehilite"&gt;&lt;pre&gt;&lt;span class="gp"&gt;$&lt;/span&gt; incrontab -e
&lt;/pre&gt;&lt;/div&gt;


&lt;p&gt;Here is what my incrontab file looks like:&lt;/p&gt;
&lt;div class="codehilite"&gt;&lt;pre&gt;&lt;span class="go"&gt;/home/mronge/Dropbox/Blog/Posts IN_MODIFY,IN_CREATE,IN_DELETE,IN_MOVE /home/mronge/update_blog.sh&lt;/span&gt;
&lt;/pre&gt;&lt;/div&gt;


&lt;p&gt;And then inside &lt;code&gt;update_blog.sh&lt;/code&gt; I have:&lt;/p&gt;
&lt;div class="codehilite"&gt;&lt;pre&gt;&lt;span class="go"&gt;pelican /home/mronge/Dropbox/Blog/Posts -t /home/mronge/Dropbox/Blog/Site -o /var/www/mronge -s /home/mronge/pelican_conf.py&lt;/span&gt;
&lt;/pre&gt;&lt;/div&gt;


&lt;p&gt;which simply runs Pelican and specifies a template, output directory and settings file to use.&lt;/p&gt;
&lt;p&gt;And that's it! You now have a Dropbox powered blog. If you have any questions feel free to contact me.&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Matt Ronge</dc:creator><pubDate>Wed, 04 Jan 2012 00:00:00 -0000</pubDate></item></channel></rss>
