<?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>wally's blog</title>
	<atom:link href="http://matt.matzi.org.uk/feed/" rel="self" type="application/rss+xml" />
	<link>http://matt.matzi.org.uk</link>
	<description>Delving deep into the mind of me</description>
	<lastBuildDate>Mon, 04 Mar 2013 18:35:32 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.1.1</generator>
		<item>
		<title>Woha &#8211; nearly a year!  CKEditor and A4 paper size.</title>
		<link>http://matt.matzi.org.uk/2013/03/04/woha-nearly-a-year-ckeditor-and-a4-paper-size/</link>
		<comments>http://matt.matzi.org.uk/2013/03/04/woha-nearly-a-year-ckeditor-and-a4-paper-size/#comments</comments>
		<pubDate>Mon, 04 Mar 2013 18:35:32 +0000</pubDate>
		<dc:creator>wally</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://matt.matzi.org.uk/?p=226</guid>
		<description><![CDATA[Nearly a year since I last blogged. Phew, caught it just in time First time this year (2013) I got to drive home without my lights on. The clocks haven&#8217;t even gone back yet! Woo-hoo for springtime So today&#8217;s topic, CKEditor and A4 paper. Mmm-hmm. Letter paper, A4, A5, in fact any size. You want [...]]]></description>
			<content:encoded><![CDATA[<p>Nearly a year since I last blogged.  Phew, caught it just in time <img src='http://matt.matzi.org.uk/wp-includes/images/smilies/icon_wink.gif' alt=';-)' class='wp-smiley' /> </p>
<p>First time this year (2013) I got to drive home without my lights on.  The clocks haven&#8217;t even gone back yet!  Woo-hoo for springtime <img src='http://matt.matzi.org.uk/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>So today&#8217;s topic, <a href="http://ckeditor.com">CKEditor</a> and A4 paper.  Mmm-hmm.  Letter paper, A4, A5, in fact any size.  You want to let someone WYSIWYG edit layout on a piece of paper, envelope, acetate, banner, badge or whatever.  Sure, we can do that!</p>
<p><code>&lt;script type="text/javascript"&gt;<br />
// ON CKEDITOR READY:<br />
CKEDITOR.on('instanceReady', function() {;<br />
        var iframe = $('#cke_editable_area iframe').contents ();<br />
        iframe.find ('html').css ({<br />
                'background-color': '#b0b0b0'<br />
        });<br />
        iframe.find ('body').css ({<br />
                'width': '297mm',<br />
                'height': '210mm',<br />
                'background-color': '#ffffff',<br />
                'margin': '0mm',<br />
                'padding': '5mm'<br />
        });<br />
});&lt;/script&gt;</code></p>
<p>Yee-haa cowboy.  The above uses the CKEditor <a href="http://docs.cksource.com/ckeditor_api/symbols/CKEDITOR.html">instanceReady</a> event and some jQuery magic (not optimally written <img src='http://matt.matzi.org.uk/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> ) to force the width/height of the editable area.  Unfortunately text can flow past the bottom (but not off the sides or top) &#8211; but that&#8217;s probably a good thing, else the user would not &#8220;see&#8221; that they&#8217;ve made a mistake.</p>
<p>Some grey colouring gives the illusion that you&#8217;re working with your favourite text editor.</p>
<p>Shove the result to a fresh page with the following CSS for printing, certainly with Chrome &#8211; works like a champ.  (Note I&#8217;m using A4 measurements in the JavaScript, so the CSS below is to match that.)</p>
<p><code>body {<br />
	font-family: sans-serif, Arial, Verdana, "Trebuchet MS";<br />
	width: 297mm;<br />
	height: 210mm;<br />
	background-color: #ffffff;<br />
	margin: 0mm;<br />
	padding: 0mm;<br />
}</p>
<p>@page {<br />
	size: landscape;<br />
	width: 297mm;<br />
	height: 210mm;<br />
	margin: 5mm;<br />
}</code></p>
]]></content:encoded>
			<wfw:commentRss>http://matt.matzi.org.uk/2013/03/04/woha-nearly-a-year-ckeditor-and-a4-paper-size/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Adjusting Timemachine size on ReadyNAS Duo</title>
		<link>http://matt.matzi.org.uk/2012/03/25/adjusting-timemachine-size-on-readynas-duo/</link>
		<comments>http://matt.matzi.org.uk/2012/03/25/adjusting-timemachine-size-on-readynas-duo/#comments</comments>
		<pubDate>Sun, 25 Mar 2012 16:20:23 +0000</pubDate>
		<dc:creator>wally</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://matt.matzi.org.uk/?p=222</guid>
		<description><![CDATA[I have a ReadyNAS Duo, and several Mac devices backing up to it (via the typically &#8220;Apple awesome&#8221; Time Machine feature). I recently upped the allocated disk space in FrontView to 300GB, from 120GB &#8211; which while each Mac&#8217;s Time Machine preferences said &#8220;NAS device, 300GB&#8221; &#8211; claimed the disk didn&#8217;t have enough &#8220;temporary space&#8221; [...]]]></description>
			<content:encoded><![CDATA[<p>I have a ReadyNAS Duo, and several Mac devices backing up to it (via the typically &#8220;Apple awesome&#8221; Time Machine feature).</p>
<p>I recently upped the allocated disk space in FrontView to 300GB, from 120GB &#8211; which while each Mac&#8217;s Time Machine preferences said &#8220;NAS device, 300GB&#8221; &#8211; claimed the disk didn&#8217;t have enough &#8220;temporary space&#8221; to perform the backup.</p>
<p>Hmm.</p>
<p>I got SSH access to the ReadyNAS working &#8211; (I used <a href="http://www.readynas.com/?p=4203">Enable SSH plugin</a>), and took a look around the filesystem.</p>
<p>It appears in classic OSX style, Apple have opted for a simple .plist info file:</p>
<p><code>cat /c/.timemachine/Matthew\ Hall’s\ MacBook.sparsebundle/Info.plist<br />
...<br />
        &lt;key&gt;size&lt;/key&gt;<br />
	&lt;integer&gt;107374182400&lt;/integer&gt;<br />
...</code></p>
<p>Upping the value to the match the new disk size (300*1024*1024*1024), solved the issue.</p>
<p>Presumably (speculation) OSX treats the .sparsebundle directory as a disk image &#8211; and the Info.plist defines how &#8220;big&#8221; the disk image is &#8211; even though its a directory (can anyone confirm?).  Thus the &#8220;disk&#8221; was indeed 300GB, but the existing backup image was only 100GB &#8230;</p>
<p>Shame Netgear / Apple didn&#8217;t put something obvious to allow updating the .plist file, but never mind!  Problem solved &#8230;</p>
]]></content:encoded>
			<wfw:commentRss>http://matt.matzi.org.uk/2012/03/25/adjusting-timemachine-size-on-readynas-duo/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Argos</title>
		<link>http://matt.matzi.org.uk/2012/01/30/argos/</link>
		<comments>http://matt.matzi.org.uk/2012/01/30/argos/#comments</comments>
		<pubDate>Mon, 30 Jan 2012 21:20:07 +0000</pubDate>
		<dc:creator>wally</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://matt.matzi.org.uk/?p=210</guid>
		<description><![CDATA[&#8220;It&#8217;s like playing Bingo, only you you win what you&#8217;ve already paid for!&#8221; &#8211; Michael McIntyre]]></description>
			<content:encoded><![CDATA[<p>&#8220;It&#8217;s like playing Bingo, only you you win what you&#8217;ve already paid for!&#8221;</p>
<p>&#8211; Michael McIntyre</p>
]]></content:encoded>
			<wfw:commentRss>http://matt.matzi.org.uk/2012/01/30/argos/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>MySQL migrations and generating Zabbix Cisco templates</title>
		<link>http://matt.matzi.org.uk/2011/12/07/mysql-migrations-and-zabbix-cisco-templates/</link>
		<comments>http://matt.matzi.org.uk/2011/12/07/mysql-migrations-and-zabbix-cisco-templates/#comments</comments>
		<pubDate>Wed, 07 Dec 2011 10:03:05 +0000</pubDate>
		<dc:creator>wally</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[cisco]]></category>
		<category><![CDATA[scripting]]></category>
		<category><![CDATA[Work]]></category>
		<category><![CDATA[zabbix]]></category>

		<guid isPermaLink="false">http://matt.matzi.org.uk/?p=207</guid>
		<description><![CDATA[What a week. What a month. What a year. So much has happened, far more than I could or should ever write about. Recently we&#8217;ve been migrating MySQL servers from one hardware to another &#8211; for anyone (me!) that finds this useful in the future, firstly &#8220;Hello, and I hope the future is better than [...]]]></description>
			<content:encoded><![CDATA[<p>What a week.  What a month.  What a year.</p>
<p>So much has happened, far more than I could or should ever write about.</p>
<p>Recently we&#8217;ve been migrating MySQL servers from one hardware to another &#8211; for anyone (me!) that finds this useful in the future, firstly &#8220;Hello, and I hope the future is better than the current &#8216;past&#8217;!&#8221;, and secondly &#8220;I hope this does what you need&#8221;:</p>
<p><code>#!/bin/sh<br />
HOST="$1"<br />
USER="$2"<br />
PASS="$3"<br />
mysql -h "$HOST" -u "$USER" -p"$PASS" -e \<br />
  "SELECT CONCAT(\"SHOW GRANTS FOR '\", \<br />
user,\"'@'\",host,\"'\;\") FROM mysql.user;" -B -N | \<br />
mysql -h "$HOST" -u "$USER" -p"$PASS" | egrep -v "^Grants"</code></p>
<p>That small bash script accepts 3 arguments, HOSTNAME, USERNAME and PASSWORD.  Executing it will output &#8220;CREATE USER&#8221; statements for all users on the MySQL instance.</p>
<p>While migrating the MySQL servers, we took the opportunity to setup a new monitoring solution &#8211; Zabbix.  I&#8217;ve used it a couple of times in the past, and in my most humble opinion it&#8217;s failing is it&#8217;s flexibility.  It&#8217;s just so flexible!</p>
<p>We have a fair number of Cisco switches and routers at our disposal here in the office, and setting up Zabbix templates for each is not high on my bucket list.  Why do something by hand that can be done automagically by a computer?</p>
<p><a href="http://matzi.org.uk/mygiftstotheworld/generate-cisco-template">Thus this (very hacky, PHP) script which automatically generates Cisco (SNMP) templates for Zabbix.</a></p>
<p>Simply run &#8220;show snmp mib ifmib ifindex&#8221; on your Cisco device of choice, and shove the output into the script&#8217;s STDIN.  Hey-presto, out comes a Zabbix template!</p>
<p>Modifying the default options in the template is very easy; just edit what you like after line 34.</p>
]]></content:encoded>
			<wfw:commentRss>http://matt.matzi.org.uk/2011/12/07/mysql-migrations-and-zabbix-cisco-templates/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Samba 3, Windows 7 and Domain Admins</title>
		<link>http://matt.matzi.org.uk/2011/07/07/samba-3-windows-7-and-domain-admins/</link>
		<comments>http://matt.matzi.org.uk/2011/07/07/samba-3-windows-7-and-domain-admins/#comments</comments>
		<pubDate>Thu, 07 Jul 2011 14:56:13 +0000</pubDate>
		<dc:creator>wally</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://matt.matzi.org.uk/?p=205</guid>
		<description><![CDATA[*sigh* It&#8217;s been for several weeks that I&#8217;ve been trying (and failing) to aquire Domain Admin status on our Samba domain. With Windows 2000 and XP, administrative access was easy.  A local admin account called &#8220;administrator&#8221;, and a local policy stating who&#8217;s an administrator &#8211; all peachy. You can tell I&#8217;m not a Windows administrator [...]]]></description>
			<content:encoded><![CDATA[<p>*sigh*</p>
<p>It&#8217;s been for several weeks that I&#8217;ve been trying (and failing) to aquire Domain Admin status on our Samba domain.</p>
<p>With Windows 2000 and XP, administrative access was easy.  A local admin account called &#8220;administrator&#8221;, and a local policy stating who&#8217;s an administrator &#8211; all peachy.</p>
<p>You can tell I&#8217;m not a Windows administrator by job!  <em>Obviously</em> domain admins is a far cleaner way to go.</p>
<p>So I dip my toe into Windows 7 on a Samba 3 domain.</p>
<p>It works well.  <em>Too</em> well.  There&#8217;s a small issue with the workstations claiming &#8220;there&#8217;s no logon servers available to handle the request&#8221; for 60+ seconds from a cold-start, but I think that&#8217;s solvable (I suspect WINS, NetBIOS or DNS is failing to warm up in a timely manner).  The domain admins however eluded me.</p>
<p>&#8220;So it&#8217;s OK&#8221; I think to myself.  &#8220;Login as the local administrator &#8211; set some local policies up.  &#8230;  Oh wait, Windows 7 disabled those because I joined the domain and didn&#8217;t first give them passwords.  Sheesh!  Joining the domain admin group it is then.&#8221;</p>
<p>Well I searched the Internet and ripped my hair out.  Week after week the issue prevailed.  Windows 7 wouldn&#8217;t obey the &#8220;Domain Admin&#8221;.  &#8220;Elevated access required.&#8221;</p>
<p>Finally I trip across this: <a href="http://fixunix.com/smb/64004-domain-admin-group-samba-3-a.html">http://fixunix.com/smb/64004-domain-admin-group-samba-3-a.html</a></p>
<p>The second guy motions that &#8220;Domain Admins&#8221; must be group ID 512 (in the Windows mapping) &#8211; and blam.</p>
<p>One Samba restart later &#8230; all works.</p>
<p>Check the documentation out at <a href="http://www.samba.org/samba/docs/man/manpages-3/net.8.html">http://www.samba.org/samba/docs/man/manpages-3/net.8.html</a> &#8230; specifically you&#8217;re looking for something like this:</p>
<p><code>net groupmap add rid=512 unixgroup=MYUNIXGROUPHERE type=domain</code></p>
]]></content:encoded>
			<wfw:commentRss>http://matt.matzi.org.uk/2011/07/07/samba-3-windows-7-and-domain-admins/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Playstation Network nearly back online &#8211;</title>
		<link>http://matt.matzi.org.uk/2011/05/15/playstation-network-nearly-back-online/</link>
		<comments>http://matt.matzi.org.uk/2011/05/15/playstation-network-nearly-back-online/#comments</comments>
		<pubDate>Sun, 15 May 2011 20:48:46 +0000</pubDate>
		<dc:creator>wally</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://matt.matzi.org.uk/?p=195</guid>
		<description><![CDATA[As I sit here typing, the very Playstation Network (PSN) service which has received so much flak over the last month is finally approaching usability once more. I would like to say a huge thank-you to the guys at PSN, there&#8217;s no question over how hard you&#8217;ve been working to get things this far. Despite [...]]]></description>
			<content:encoded><![CDATA[<p>As I sit here typing, the very Playstation Network (PSN) service which has received so much flak over the last month is finally approaching usability once more.</p>
<p>I would like to say a huge thank-you to the guys at PSN, there&#8217;s no question over how hard you&#8217;ve been working to get things this far.  Despite how many will disagree with me, I&#8217;d like to thank the non-tech guys at Sony too, for your honesty and speed with dealing with things.</p>
<p>I work at a PCI-DSS regulated company myself, as a programmer, and don&#8217;t have 1% of the customers PSN does.  We also don&#8217;t provide a service that millions of people rely on &#8220;real-time&#8221; for entertainment purposes, nor which they expect to find working 24/7.</p>
<p>You guys have done a good job, please keep it up.</p>
<p>This could have happened to anyone, although it&#8217;s always easy to point the finger when you&#8217;re the ignorant customer.</p>
]]></content:encoded>
			<wfw:commentRss>http://matt.matzi.org.uk/2011/05/15/playstation-network-nearly-back-online/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Kate and Will &#8211; they made it!</title>
		<link>http://matt.matzi.org.uk/2011/04/29/kate-and-will-they-made-it/</link>
		<comments>http://matt.matzi.org.uk/2011/04/29/kate-and-will-they-made-it/#comments</comments>
		<pubDate>Fri, 29 Apr 2011 10:41:32 +0000</pubDate>
		<dc:creator>wally</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://matt.matzi.org.uk/?p=192</guid>
		<description><![CDATA[Yeah yeah, wasn&#8217;t going to watch it and all that &#8211; but I finally broke. Don&#8217;t they just look great]]></description>
			<content:encoded><![CDATA[<p>Yeah yeah, wasn&#8217;t going to watch it and all that &#8211; but I finally broke.</p>
<p>Don&#8217;t they just look great <img src='http://matt.matzi.org.uk/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p><a href="http://matt.matzi.org.uk/wp-content/uploads/2011/04/katewill.jpg"><img class="aligncenter size-full wp-image-193" title="katewill" src="http://matt.matzi.org.uk/wp-content/uploads/2011/04/katewill.jpg" alt="" width="500" height="280" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://matt.matzi.org.uk/2011/04/29/kate-and-will-they-made-it/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Validating email addresses by SMTP in realtime</title>
		<link>http://matt.matzi.org.uk/2011/04/06/validating-email-addresses-by-smtp-in-realtime/</link>
		<comments>http://matt.matzi.org.uk/2011/04/06/validating-email-addresses-by-smtp-in-realtime/#comments</comments>
		<pubDate>Wed, 06 Apr 2011 08:31:33 +0000</pubDate>
		<dc:creator>wally</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://matt.matzi.org.uk/?p=181</guid>
		<description><![CDATA[Validation of email addresses.  What a painful subject. About a year ago I looked into the possibility of using SMTP to validate email addresses.  As it turns out, it&#8217;s not perfect (a lot of false-positives) but it&#8217;s very reliable (I&#8217;ve failed to get any false-negatives). The following code outlines how this works (written in PHP, [...]]]></description>
			<content:encoded><![CDATA[<p>Validation of email addresses.  What a painful subject.</p>
<p>About a year ago I looked into the possibility of using SMTP to validate email addresses.  As it turns out, it&#8217;s not perfect (a lot of false-<em>positives</em>) but it&#8217;s very reliable (I&#8217;ve failed to get any false-<em>negatives</em>).</p>
<p>The following code outlines how this works (written in PHP, because I was thinking about it in the context of web-apps):</p>
<pre lang="PHP" style="font-size: 0.8em;">&lt;?php
function validate_email_regex ($email) {
   return preg_match ('/\b[A-Z0-9._%+-]+@[A-Z0-9.-]+\.[A-Z]{2,4}\b/i', $email);
}

function validate_email_smtp ($email) {
   if (!validate_email_regex ($email)) return false;
   list ($user, $domain) = split ('@', $email);

   if (!getmxrr ($domain, $mxhosts)) return false;
   $i = 0;
   $fp = false;
   $thishost = isset ($_SERVER['SERVER_NAME']) ? $_SERVER['SERVER_NAME'] : exec ("hostname");
   foreach ($mxhosts as $mxhost) {
      if (++$i &gt; 3) break;    // don't check more than 3 MX records
      if ($fp) fclose ($fp);  // cleanup from last iteration

      $fp = fsockopen ("tcp://$mxhost", 25, $errno, $errstr, 10);
      if (!$fp) continue;
      if (!$str = fgets ($fp)) continue;
      if (substr ($str, 0, 3) != '220') continue;

      fwrite ($fp, "HELO $thishost\r\n");
      $str = fgets ($fp);
      if (substr ($str, 0, 3) != '250') continue;

      fwrite ($fp, "MAIL FROM:&lt;mail@$thishost&gt;\r\n");
      $str = fgets ($fp);
      if (substr ($str, 0, 3) != '250') continue;

      fwrite ($fp, "RCPT TO:&lt;$email&gt;\r\n");
      $str = fgets ($fp);
      if (substr ($str, 0, 3) != '250') {
         fclose ($fp);
         return false;  /* don't proceed with other MX records because of a bad user */
      }

      fclose ($fp);
      break;
   }
   return true;
}
?&gt;</pre>
]]></content:encoded>
			<wfw:commentRss>http://matt.matzi.org.uk/2011/04/06/validating-email-addresses-by-smtp-in-realtime/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>SVN hooks &#8211; receiving HTML formatted emails when SVN commits are made</title>
		<link>http://matt.matzi.org.uk/2011/04/05/svn-hooks-receiving-html-formatted-emails-when-svn-commits-are-made/</link>
		<comments>http://matt.matzi.org.uk/2011/04/05/svn-hooks-receiving-html-formatted-emails-when-svn-commits-are-made/#comments</comments>
		<pubDate>Tue, 05 Apr 2011 08:06:30 +0000</pubDate>
		<dc:creator>wally</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://matt.matzi.org.uk/?p=175</guid>
		<description><![CDATA[While setting up Trac as our company source-code repository yesterday, the question arose of &#8220;What about cute HTML emails when SVN commits are made?&#8221;. Hmmmm.  Thank goodness for SVN hooks &#8211; a wonderfully understated feature of subversion! Go to your subversion directory (that created by &#8220;svnadmin create&#8221;), and enter the &#8220;hooks&#8221; directory. Create a file, executable [...]]]></description>
			<content:encoded><![CDATA[<p>While setting up Trac as our company source-code repository yesterday, the question arose of &#8220;What about cute HTML emails when SVN commits are made?&#8221;.</p>
<p>Hmmmm.  Thank goodness for SVN hooks &#8211; a wonderfully understated feature of subversion!</p>
<p>Go to your subversion directory (that created by &#8220;svnadmin create&#8221;), and enter the &#8220;hooks&#8221; directory.</p>
<p>Create a file, executable and owned by your webserver, called &#8220;post-commit&#8221;:</p>
<pre>touch post-commit
sudo chown www-data:www-data post_commit     # RH and other distros will want apache:apache here
chmod +x post_commit</pre>
<p>Enter the following as it&#8217;s content (this is a fairly self explanatory shell script):</p>
<pre>
<div id="_mcePaste">#!/bin/sh
set -e
REPOS="$1"
REV="$2"
TO="email@address.com"
FROM="email@address.com"
BY=`svnlook author $REPOS -r$REV`
MSG=`svnlook log $REPOS -r$REV`
CHANGED=`svnlook changed $REPOS -r$REV`
DIFF=`svnlook diff $REPOS -r$REV | pygmentize -l diff -f html`
STYLE="borland"
CSS=`pygmentize -S $STYLE -f html`
echo "To: $TO\nFrom: $FROM\nSubject: SVN commit r$REV - ($BY) \"$MSG\"\nContent-Type: text/html; charset=us-ascii\n\n&lt;html&gt;\n&lt;style type='text/css'&gt;\n$CSS&lt;/style&gt;\n&lt;body&gt;\n&lt;p&gt;&lt;a href='https://your.trac.url.com/trac/changeset/$REV/'&gt;View changeset r$REV on Trac&lt;/a&gt;&lt;/p&gt;\n&lt;h3&gt;Files changed:&lt;/h3&gt;&lt;pre&gt;$CHANGED&lt;/pre&gt;\n&lt;h3&gt;Changes made:&lt;/h3&gt;&lt;p&gt;$DIFF&lt;/p&gt;\n&lt;/body&gt;\n&lt;/html&gt;" | /usr/sbin/sendmail -t</div>
</pre>
<p>You&#8217;ll need to apt-get or yum install pygmentizer (package named python-pygments on Debian/Ubuntu) to get the cool diff colouring.</p>
<p>And that&#8217;s it!  (The &#8220;sendmail -t&#8221; reference works with Exim on Debian Squeeze, your mileage as always, may vary.)</p>
]]></content:encoded>
			<wfw:commentRss>http://matt.matzi.org.uk/2011/04/05/svn-hooks-receiving-html-formatted-emails-when-svn-commits-are-made/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Improving CoovaAP portal pages for iPhone and Android</title>
		<link>http://matt.matzi.org.uk/2011/03/19/improving-coovaap-portal-pages-for-iphone-and-android/</link>
		<comments>http://matt.matzi.org.uk/2011/03/19/improving-coovaap-portal-pages-for-iphone-and-android/#comments</comments>
		<pubDate>Sat, 19 Mar 2011 10:49:07 +0000</pubDate>
		<dc:creator>wally</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://matt.matzi.org.uk/?p=171</guid>
		<description><![CDATA[Over the last couple of weeks, I&#8217;ve been spending my spare time playing with the Coova AP (ChilliSpot) wireless hotspot service on a WRT54GL. The main problem I&#8217;ve had with it is the portal pages not looking so good on mobile devices (particularly iPhone and Androids). A little bit of Googling revealed a solution (at [...]]]></description>
			<content:encoded><![CDATA[<p>Over the last couple of weeks, I&#8217;ve been spending my spare time playing with the Coova AP (ChilliSpot) wireless hotspot service on a WRT54GL.</p>
<p>The main problem I&#8217;ve had with it is the portal pages not looking so good on mobile devices (particularly iPhone and Androids).</p>
<p>A little bit of Googling revealed a solution (at least, a solution for websites in general): insert the following meta tag into the HTML header.</p>
<pre>&lt;meta name="viewport" content="width=320; initial-scale=1.0; maximum-scale=1.0; user-scalable=0;" /&gt;</pre>
<p>In the CoovaAP configuration interface, you can apply this for every portal page by adding it to the &#8220;HotSpot&#8221;/&#8221;Portal&#8221;/&#8221;HTML Title&#8221;.</p>
]]></content:encoded>
			<wfw:commentRss>http://matt.matzi.org.uk/2011/03/19/improving-coovaap-portal-pages-for-iphone-and-android/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
