<?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>MattAustin.me.uk &#187; thummer</title> <atom:link href="http://mattaustin.me.uk/category/thummer/feed/" rel="self" type="application/rss+xml" /><link>http://mattaustin.me.uk</link> <description>Python, Django, open source, Linux, and other internet shenanigans</description> <lastBuildDate>Sun, 03 Jun 2012 07:20:41 +0000</lastBuildDate> <language>en</language> <sy:updatePeriod>hourly</sy:updatePeriod> <sy:updateFrequency>1</sy:updateFrequency> <generator>http://wordpress.org/?v=3.3.2</generator> <item><title>Installing thummer 0.01 on Ubuntu 8.04 LTS Server</title><link>http://mattaustin.me.uk/2009/01/installing-thummer-on-ubuntu-804-lts-server/</link> <comments>http://mattaustin.me.uk/2009/01/installing-thummer-on-ubuntu-804-lts-server/#comments</comments> <pubDate>Wed, 14 Jan 2009 11:00:40 +0000</pubDate> <dc:creator>Matt</dc:creator> <category><![CDATA[thummer]]></category> <category><![CDATA[ubuntu]]></category> <category><![CDATA[apache]]></category> <category><![CDATA[cutycapt]]></category> <category><![CDATA[django]]></category> <category><![CDATA[gecko]]></category> <category><![CDATA[webkit]]></category> <category><![CDATA[xvfb]]></category> <guid
isPermaLink="false">http://mattaustin.me.uk/?p=25</guid> <description><![CDATA[thummer is a website-snapshot and thumbnailing utility I am working on, built using django. Read my previous thummer blog post to find out more about the project. Assumptions In this article, I am assuming that we are installing thummer on an existing Ubuntu server (8.04 or later) with Apache already installed, and that you are [...]]]></description> <content:encoded><![CDATA[<p>thummer is a website-snapshot and thumbnailing utility I am working on, built using django. Read my <a
href="/2009/01/thummer-website-thumbnail-generator-cutycapt-django/">previous thummer blog post</a> to find out more about the project.</p><h3>Assumptions</h3><p>In this article, I am assuming that we are installing thummer on an existing Ubuntu server (8.04 or later) with Apache already installed, and that you are comfortable with editing apt&#8217;s sources.list file.</p><h2>Step 1: Install A &#8220;Fake&#8221; X-Server</h2><p>If you do not have a desktop environment installed on your server (probably a good thing!), then you will need to install <strong>xvfb</strong>, which provides a virtual screen so that we can capture the rendered output of the website:</p><blockquote><p>Xvfb provides an X server that can run on machines with no display hardware and no physical input devices. It emulates a dumb framebuffer using virtual memory.</p></blockquote><ul><li><code>sudo apt-get install <a
href="apt://xvfb">xvfb</a></code></li></ul><h2>Step 2: Install CutyCapt</h2><p>We now need to install CutyCapt (webkit rendering).</p><p>First, we need to install the cutycapt dependencies and build tools:</p><ul><li><code>sudo apt-get install <a
href="apt://build-essential">build-essential</a></code></li></ul><p>For hardy only: We also need some packages from hardy-backports &#8211; add the following lines to /etc/apt/sources.list.</p><p><code>deb http://archive.ubuntu.com/ubuntu hardy-backports main restricted universe multiverse<br
/>deb-src http://archive.ubuntu.com/ubuntu hardy-backports main restricted universe multiverse</code></p><p>Now install the required qt4 packages:</p><ul><li><code>sudo apt-get update</code></li><li><code>sudo apt-get install <a
href="apt://libqt4-dev">libqt4-dev</a> <a
href="apt://libqt4-webkit">libqt4-webkit</a> <a
href="apt://libqt4-svg">libqt4-svg</a></code></li></ul><p>It&#8217;s now probably a good idea to remove (or comment out) the hardy-backports lines from your sources.list file.</p><p>Download cutycapt source, and expand the tarball:</p><ul><li><code>cd ~/</code></li><li><code>wget http://cutycapt.svn.sourceforge.net/viewvc/cutycapt/CutyCapt.tar.gz\?view\=tar</code></li><li><code>tar -xvvzf CutyCapt.tar.gz\?view\=tar</code></li></ul><p>Compile cutycapt:</p><ul><li><code>cd CutyCapt</code></li><li><code>qmake</code></li><li><code>make</code></li></ul><h2>Step 3: Install Django</h2><p>First install some packages we&#8217;ll need later:</p><ul><li><code>sudo apt-get install <a
href="apt://python-django">python-django</a> <a
href="apt://python-imaging">python-imaging</a> <a
href="apt://python-pysqlite2">python-pysqlite2</a> <a
href="apt://libapache2-mod-python">libapache2-mod-python</a></code></li></ul><p>For hardy only: The version of django hardy ships with is too old for thummer. Install Jaunty&#8217;s version of <a
href="https://launchpad.net/ubuntu/jaunty/+package/python-django">python-django</a> from the updates repository by downloading the .deb file from Launchpad (remember to keep an eye out for future security updates):</p><ul><li><code>cd ~/</code></li><li><code>wget http://launchpadlibrarian.net/17665378/python-django_1.0-1ubuntu1_all.deb</code></li><li><code>sudo dpkg -i python-django_1.0-1ubuntu1_all.deb</code></li></ul><h2>Step 4: Install &#038; Configure thummer</h2><p>Download thummer, expand the tarball, and move the extracted files to /var/www:</p><ul><li><code>cd ~/</code></li><li><code>wget http://launchpad.net/thummer/trunk/0.01/+download/thummer_0.01.tar.gz</code></li><li><code>tar -xvvzf thummer_0.01.tar.gz</code></li><li><code>sudo mv thummer_0.01 /var/www/thummer</code></li></ul><p>Make sure subversion is installed:</p><ul><li><code>sudo apt-get install <a
href="apt://subversion">subversion</a></code></li></ul><p>Download the required site-package, sorl-thumbnails:</p><ul><li><code>sudo svn checkout http://sorl-thumbnail.googlecode.com/svn/trunk/sorl /usr/local/lib/python2.5/site-packages/sorl</code></li></ul><p>Create the database, and initial admin user:</p><ul><li><code>cd /var/www/thummer/thummer</code></li><li><code>./manage.py syncdb</code></li></ul><p>Set owner so that the apache process can write to the database:</p><ul><li><code>sudo chown -R www-data /var/www/thummer/database</code></li></ul><p>Set owner so that the apache process can write to the media directory:</p><ul><li><code>sudo chown -R www-data /var/www/thummer/media</code></li></ul><p>Update the django website settings:</p><ul><li><code>sudo nano ./settings.py</code></li></ul><p>Make sure that &#8220;<code>XVFB = True</code>&#8220;, specify the <strong>full path to the database</strong> for DATABASE_NAME.</p><p>Ensure the full path to the CutyCapt binary is correct.</p><h2>Step 5: Configure Apache</h2><p>Ensure that the python module for Apache is enabled:</p><ul><li><code>sudo a2enmod mod_python</code></li></ul><p>Create a virtual-host site configuration file:</p><ul><li><code>sudo nano /etc/apache2/sites-available/thummer</code></li></ul><p>Paste in the following configuration &#8211; replace &#8220;thummer.domainname.com&#8221; with your desired domain name:</p><div><pre>
&#60;VirtualHost *&#62;
  ServerName thummer.domainname.com
  DocumentRoot /var/www/thummer/thummer
  &#60;Directory "/var/www/thummer/thummer"&#62;
    AllowOverride All
    Order Allow,Deny
    Allow from All
    SetHandler python-program
    PythonHandler django.core.handlers.modpython
    SetEnv DJANGO_SETTINGS_MODULE thummer.settings
    PythonPath "['/var/www/thummer'] + sys.path"
  &#60;/Directory&#62;
  # Static Media Content
  Alias /media /var/www/thummer/media
  &#60;Location "/media"&#62;
    SetHandler None
    Order Allow,Deny
    Allow from All
  &#60;/Location&#62;
  Alias /admin-media /usr/share/python-support/python-django/django/contrib/admin/media
  &#60;Location "/admin-media"&#62;
    SetHandler None
    Order Allow,Deny
    Allow from All
  &#60;/Location&#62;
&#60;/VirtualHost&#62;
</pre></div><p>Enable the site, and restart apache:</p><ul><li><code>sudo a2ensite thummer</code></li><li><code>sudo /etc/init.d/apache2 restart</code></li></ul><p>Bam! Thats It! Enjoy, and let me know how it goes!</p><h2>Usage</h2><p>Just use the following URL syntax to reference the image (e.g. in img elements):</p><p><code>http://thummer.domainname.com/[width]/[height]/[crop]/http://url-to-capture/</code></p><p>the value of [crop] can either be 0 or 1, where 0 = scale &#038; fit, and 1 = scale &#038; crop.</p><p>e.g. to generate a 300&#215;300 pixel cropped thumbnail of the <a
href="http://news.bbc.co.uk/">BBC News</a> website:</p><p><code>http://thummer.domainname.com/300/300/1/http://news.bbc.co.uk/</code></p><p><code>&#60;img src="http://thummer.domainname.com/300/300/1/http://news.bbc.co.uk/" alt="BBC News website thumbnail" /&#62;</code></p><p>And here is the result:</p><p><img
src="http://thummer.mattaustin.me.uk/300/300/1/http://news.bbc.co.uk/" alt="BBC News website thumbnail" /></p><p>Remember you can access the admin interface by going to http://thummer.domainname.com/admin where you can delete snapshots &#8211; so that they are regenerated next time they are requested.</p> ]]></content:encoded> <wfw:commentRss>http://mattaustin.me.uk/2009/01/installing-thummer-on-ubuntu-804-lts-server/feed/</wfw:commentRss> <slash:comments>4</slash:comments> </item> <item><title>Website Thumbnail Generator Web App &#8211; thummer</title><link>http://mattaustin.me.uk/2009/01/thummer-website-thumbnail-generator-cutycapt-django/</link> <comments>http://mattaustin.me.uk/2009/01/thummer-website-thumbnail-generator-cutycapt-django/#comments</comments> <pubDate>Sat, 10 Jan 2009 02:37:16 +0000</pubDate> <dc:creator>Matt</dc:creator> <category><![CDATA[thummer]]></category> <category><![CDATA[cutycapt]]></category> <category><![CDATA[django]]></category> <category><![CDATA[ubuntu]]></category> <category><![CDATA[xvfb]]></category> <guid
isPermaLink="false">http://mattaustin.me.uk/?p=7</guid> <description><![CDATA[Over Christmas I began learning django and python. I always find it better to learn new languages when you are applying what you read to a project that you are actually interested in, and think might come in useful. Well, after finding this great article on website thumbnail generation using cutycapt and django I decided [...]]]></description> <content:encoded><![CDATA[<p><img
class="alignright" title="BBC News Website Thumbnail" src="http://thummer.mattaustin.me.uk/250/400/1/http://news.bbc.co.uk/" alt="" width="250" height="400" />Over Christmas I began learning <a
href="http://www.djangoproject.com/">django</a> and <a
href="http://www.python.org/">python</a>. I always find it better to learn new languages when you are applying what you read to a project that you are actually interested in, and think might come in useful. Well, after finding this great article on <a
href="http://lapin-blanc.net/09/11/2008/django-website-thumbnail-generator/">website thumbnail generation using cutycapt and django</a> I decided to make a small web service / web app which would generate and serve website thumbnail screenshots of varying sizes.</p><p>I&#8217;ve always had difficulty with the &#8220;free&#8221; web thumbnail services out there &#8211; they usually limit the number of requests and/or thumbnail sizes as well as using watermarks or requiring link backs. And this is understandable &#8211; running this kind of service en-mass is resource hungry, and those servers aren&#8217;t going to pay for themselves.</p><p>The idea of thummer is to allow people to set up their own thumbnail service on their own server, allowing them to generate snapshots of websites at any size with no restrictions.</p><p>Unfortunately because of some dependencies (CutyCapt requires qt4 and an X server) setting it up isn&#8217;t quite as easy as I&#8217;d hoped, but isn&#8217;t very difficult (lots of steps &#8211; but not tricky). <del
datetime="2009-01-14T12:31:12+00:00">I&#8217;ll post some instructions in the near future for Ubuntu 8.04 LTS Server.</del> I have now posted the (rather lengthy) <a
href="/2009/01/installing-thummer-on-ubuntu-804-lts-server/">installation instructions for Ubuntu 8.04 LTS</a>.</p><p>I have set up a <a
href="https://launchpad.net/thummer">project page on Launchpad for thummer</a>, so any bugs and questions can be tracked. The current release can be <a
href="https://launchpad.net/thummer/+download">downloaded from Launchpad here</a>.</p><p>A demo I set up is <a
href="http://thummer.mattaustin.me.uk/">available here</a> (but may disappear in the future if it starts getting hammered!).</p><p>This is my first django/python project, so any feedback is more than welcome!</p> ]]></content:encoded> <wfw:commentRss>http://mattaustin.me.uk/2009/01/thummer-website-thumbnail-generator-cutycapt-django/feed/</wfw:commentRss> <slash:comments>1</slash:comments> </item> </channel> </rss>
