<?xml version="1.0"?>
<rss version="2.0">
<channel>
<title>CastlesBlog</title>
<link>http://www.castlesblog.com/</link>
<description>A blog about making a blog</description>
<copyright>All content is copyright to Marc Castles</copyright>
<language>en-au</language>
<generator>CastlesBlog</generator><item>
<title>Feed Icon</title>
<link>http://www.castlesblog.com/2010/march/9/feed-icon</link>
<description>&lt;p&gt;I've made a few tweaks to the castlesblog template. Images now have padding and margins and headings look a bit neater.&lt;/p&gt;&lt;p&gt;You might also notice I added a feed icon to the top right. If your browser supports it there is a CSS rotation on it to it to make it a bit interesting. If its not rotated this is what you are missing out on...&lt;/p&gt;&lt;img src=&quot;http://static.castlesblog.com/data/feed-screenshot.png&quot; alt=&quot;Feed Screenshot&quot; /&gt;&lt;p&gt;As far as I know the rotation works in Firefox, Safari, Chrome and Opera. The CSS to do it is fairly simple:&lt;/p&gt;&lt;pre&gt;-o-transform:rotate(-15deg); /*OPERA*/
-moz-transform:rotate(-15deg); /*MOZILLA*/
-webkit-transform:rotate(-15deg); /*WEBKIT*/&lt;/pre&gt;</description>
<pubDate>Mon, 8 Mar 2010 13:39:14 +0000</pubDate>
</item><item>
<title>Cookieless Domain</title>
<link>http://www.castlesblog.com/2010/february/27/cookieless-domain</link>
<description>&lt;h2&gt;Update&lt;/h2&gt;&lt;p&gt;There has been a few  updates to the new template to fix some errors plus I've given &lt;a href=&quot;http://www.opera.com&quot;&gt;Opera&lt;/a&gt; some love. The CSS background gradient is the only feature missing from Opera and while I could get it working with a background image the alternative looks fine. I'm sure the folks at Opera are working on CSS gradient support and it will be available soon.&lt;/p&gt;&lt;a href=&quot;http://static.castlesblog.com/data/opera-screenshot.jpg&quot;&gt;&lt;img src=&quot;http://static.castlesblog.com/data/opera-screenshot-thumb.png&quot;  alt=&quot;Opera Screenshot&quot; /&gt;&lt;/a&gt;&lt;h2&gt;PageSpeed &amp;amp; Yslow&lt;/h2&gt;&lt;p&gt;One of the main features I want to highlight with CastlesBlog is speed. I found the results were pretty good after inspecting &lt;a href=&quot;http://code.google.com/speed/page-speed/&quot;&gt;PageSpeed&lt;/a&gt; and &lt;a href=&quot;http://developer.yahoo.com/yslow/&quot;&gt;Yslow&lt;/a&gt; but there were a few optimisations that could be made.&lt;/p&gt;&lt;blockquote&gt;Tip: &lt;a href=&quot;http://code.google.com/speed/page-speed/&quot;&gt;PageSpeed&lt;/a&gt; and &lt;a href=&quot;http://developer.yahoo.com/yslow/&quot;&gt;Yslow&lt;/a&gt; are fantastic &lt;a href=&quot;http://www.getfirebug.com/&quot;&gt;Firebug&lt;/a&gt; addons and are great tools if you want to dig deep into a websites rendering speed.&lt;/blockquote&gt;&lt;p&gt;The main issue that they highlighted was to put my static content on a cookieless domain. I've never done anything like this before and I didn't even know what cookieless domain was. &lt;a href=&quot;http://code.google.com/speed/page-speed/docs/request.html#ServeFromCookielessDomain&quot;&gt;Read about it here.&lt;/a&gt; After a bit of investigating I think I worked it out. Here is my understanding: &lt;em&gt;When you create a cookie on a site the cookie information is transmitted and received with every request. That means every image, css or javascript file that doesn't actually need the information will get it and send it.&lt;/em&gt; Now I know your thinking that fairly trivial as cookies are generally tiny and not worth the hassle. I agree! Especially on this site which doesn't get the amount of traffic or have enough resources to warrant such optimisations. The problem for me was that I was intrigued and that sent me on a journey to work out how to actually get a cookieless domain working.&lt;/p&gt;&lt;p&gt;From what I read you can avoid sending cookies if you setup a separate domain or CNAME and serve the content from there.&lt;/p&gt;&lt;blockquote&gt;Tip: I found myself using cookies and I didn't even know it. Calling session_start(); in php will set a PHPSESSID cookie. &lt;/blockquote&gt;&lt;h2&gt;What is a CNAME?&lt;/h2&gt;&lt;p&gt;From &lt;a href=&quot;http://en.wikipedia.org/wiki/Cname&quot;&gt;Wikipedia&lt;/a&gt;:&lt;/p&gt;&lt;blockquote&gt;A CNAME record or Canonical Name record is a type of resource record in the Domain Name System (DNS) that specifies that the domain name is an alias of another, canonical domain name.&lt;/blockquote&gt;&lt;p&gt;So basically I could setup a CNAME that points to www.castlesblog.com and serve static resources from there. I wouldn't have to change the structure of my site and old content would still work fine. Sounds good to me.&lt;/p&gt;&lt;p&gt;To setup in Plesk I did the following:&lt;/p&gt; &lt;ol&gt;&lt;li&gt;Click on DNS Settings&lt;/li&gt;&lt;li&gt;Click Add Record&lt;/li&gt;&lt;li&gt;Select CNAME record type&lt;/li&gt;&lt;li&gt;Enter the domain name I wanted to use. I chose to use &quot;static&quot; (static.castlesblog.com)&lt;/li&gt;&lt;li&gt;Finally, enter the canonical name of the domain. For me I used www.castlesblog.com&lt;/li&gt;&lt;li&gt;Click Ok and then Save&lt;/li&gt;&lt;/ol&gt;&lt;p&gt;One other thing I needed to do to get this to work in Plesk was to create a vhost.conf file in the domain conf directory (/var/www/vhosts/castlesblog.com/conf/vhost.conf) with the following content: &quot;ServerAlias static.castlesblog.com&quot; then reconfigure that domain:&lt;/p&gt;&lt;pre&gt;/usr/local/psa/admin/sbin/websrvmng --reconfigure-vhost --vhost-name=castlesblog.com&lt;/pre&gt;&lt;p&gt;The last thing I needed to do was update all my posts and html links to the static domain. For example the following:&lt;/p&gt;&lt;pre&gt;&amp;lt;img src=&amp;quot;/data/img1.jpg&amp;quot; /&amp;gt;&lt;/pre&gt;&lt;p&gt;would become:&lt;/p&gt;&lt;pre&gt;&amp;lt;img src=&amp;quot;http://static.castlesblog.com/data/img1.jpg&amp;quot; /&amp;gt;&lt;/pre&gt;&lt;p&gt;To prevent people browsing the secondary domain I setup a .htaccess redirect to redirect any non file requests to the proper domain. The code looks like this:&lt;/p&gt;&lt;pre&gt;# cookieless domain for images and stuff
RewriteCond %{HTTP_HOST} ^static\.castlesblog\.com [NC]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ http://www.castlesblog.com/$1 [R=301,L]&lt;/pre&gt;&lt;h2&gt;Serve dynamic-static files&lt;/h2&gt;&lt;p&gt;One final optimisation was to serve javascript as one file to save browser requests. I like to separate javascript files so that it obvious what is in them so I wasn't going to move all the javascript into one file. I managed to get the merge working with the following code:&lt;/p&gt;&lt;pre&gt;&amp;lt;?php
$offset = 60 * 60 * 24 * 7; // Cache for 1 weeks
header('Content-type: application/x-javascript');
header('Accept-Ranges: bytes');
header ('Cache-Control: max-age=' . $offset);
header ('Expires: ' . gmdate (&amp;quot;D, d M Y H:i:s&amp;quot;, time() + $offset) . ' GMT');
header ('Pragma: cache');

if(!ob_start(&amp;quot;ob_gzhandler&amp;quot;)) ob_start();

include('../javascript/jquery-1.4.2.min.js');
include('../javascript/jquery.easing.js');
include('../templates/castlesblog/template.js');&lt;/pre&gt;&lt;p&gt;When a site needs a new javascript file I will include it in this file and the php will do the rest.&lt;/p&gt;&lt;p&gt;To make the script tag look like this:&lt;/p&gt;&lt;pre&gt;&amp;lt;script src=&amp;quot;http://static.castlesblog.com/javascript/scripts.js&amp;quot; type=&amp;quot;text/javascript&amp;quot;&amp;gt;&amp;lt;/script&amp;gt;&lt;/pre&gt;&lt;p&gt;I added the following to the .htaccess:&lt;/p&gt;&lt;pre&gt;#compile all scripts into one file...
RewriteRule ^javascript/scripts.js$ includes/scripts.php [L]&lt;/pre&gt;&lt;h2&gt;Final Test&lt;/h2&gt;&lt;p&gt;To see if this works I will include the same file from two different domains. This first file should have cookies and the second should not.&lt;/p&gt;&lt;img src=&quot;/data/iphone-screenshot.jpg&quot; alt=&quot;iPhone Preview&quot; /&gt;&lt;img src=&quot;http://static.castlesblog.com/data/iphone-screenshot.jpg&quot; alt=&quot;iPhone Preview&quot; /&gt;&lt;p&gt;And the results are in.. I think they speak for themselves:&lt;/p&gt;&lt;img src=&quot;http://static.castlesblog.com/data/cookieless-results.png&quot; alt=&quot;cookieless domain results&quot; /&gt;</description>
<pubDate>Sat, 27 Feb 2010 03:52:10 +0000</pubDate>
</item><item>
<title>New Template</title>
<link>http://www.castlesblog.com/2010/january/18/new-template</link>
<description>&lt;p&gt;Over the last month or so I've been putting together a new template for this site. It's not quite finished yet but I thought its better to release it at its current stage (Otherwise it will be another month before an update). The most notable features are:&lt;/p&gt;
&lt;ul&gt;&lt;li&gt;HTML5 compliant&lt;/li&gt;&lt;li&gt;
CSS3 Gradients&lt;/li&gt;&lt;li&gt;CSS3 rounded corners + rgba colours&lt;/li&gt;&lt;li&gt;Mobile device support (only tested on my iPhone)&lt;/li&gt;&lt;li&gt;@font-face for the title&lt;/li&gt;&lt;/ul&gt;
&lt;p&gt;Surprisingly it looks alright in older browsers.... and cough.. IE. Internet Explorer manages a gradient behind the menu buttons via the use of a css expression.&lt;/p&gt;</description>
<pubDate>Sun, 17 Jan 2010 23:09:23 +0000</pubDate>
</item><item>
<title>MythTV Pre-Shutdown script</title>
<link>http://www.castlesblog.com/2010/january/1/mythtv-pre-shutdown-script</link>
<description>&lt;p&gt;Just like my previous post this is here so I won't forget how I setup my MythTV pre shutdown script. This will check for netatalk connections, terminal (via ssh or locally) or if transmission is open.&lt;/p&gt;&lt;p&gt;Script file: /usr/bin/mythpreshutdown.sh&lt;/p&gt;

&lt;pre&gt;#!/bin/sh

logfile=/var/log/mythtv/mythpreshutdown.log
echo `date` &gt; $logfile

ps_afpd=`ps axo euid,comm,user | grep afpd | grep -v -c root`
ps_who=`who | grep -c pts`
ps_transmission=`ps aux | grep transmission | grep -v -c grep`

SD=0

if [ $ps_who != 0 ]; then
  echo &quot;user logged in&quot; &gt;&gt; $logfile
  SD=1
fi

if [ $ps_afpd != 0 ]; then
  echo &quot;afpd connection exists&quot; &gt;&gt; $logfile
  SD=1
fi

if [ $ps_transmission != 0 ]; then
  echo &quot;transmission running&quot; &gt;&gt; $logfile
  SD=1
fi

exit $SD&lt;/pre&gt;</description>
<pubDate>Fri, 1 Jan 2010 06:08:07 +0000</pubDate>
</item><item>
<title>Ubuntu Wake on Lan (WOL)</title>
<link>http://www.castlesblog.com/2009/december/31/ubuntu-wake-on-lan</link>
<description>&lt;p&gt;This post is written so that I won't forget how I got WOL working with my Asus motherboard and Mythbuntu (Karmic Koala).&lt;/p&gt;
&lt;p&gt;Ensure WOL is enabled in BIOS. For the &lt;a href=&quot;http://asus.com/product.aspx?P_ID=fFZ8oUIGmLpwNMjj&quot;&gt;Asus P5KC motherboard&lt;/a&gt; setting &lt;strong&gt;&quot;Power On By PCIE Devices&quot;&lt;/strong&gt; to &lt;strong&gt;Enabled&lt;/strong&gt; worked for me.&lt;/p&gt;
&lt;p&gt;Create &lt;strong&gt;wakeonlanconfig&lt;/strong&gt; in &lt;strong&gt;/etc/init.d/&lt;/strong&gt; with the following contents:&lt;/p&gt;
&lt;pre&gt;#!/bin/bash
ethtool -s eth0 wol g
exit&lt;/pre&gt;
&lt;p&gt;Set permissions:&lt;/p&gt;
&lt;pre&gt;chmod a+x wakeonlanconfig&lt;/pre&gt;
&lt;p&gt;Make the script start on boot:&lt;/p&gt;
&lt;pre&gt;update-rc.d -f wakeonlanconfig defaults&lt;/pre&gt;
&lt;p&gt;Make sure there are no errors:&lt;/p&gt;
&lt;pre&gt;/etc/init.d/wakeonlanconfig&lt;/pre&gt;
&lt;p&gt;Port forward port 9 over UDP on my router to 192.168.1.255 (this broadcasts on my &lt;a href=&quot;http://www.dlink.com.au/Products.aspx?Sec=1&amp;amp;Sub1=1&amp;amp;Sub2=2&amp;amp;PID=294&quot;&gt;D-Link DSL-2740B&lt;/a&gt;)&lt;/p&gt;
&lt;p&gt;and test with:&lt;/p&gt;
&lt;pre&gt;wakeonlan -i &amp;lt;HOME IP ADDRESS&amp;gt; &amp;lt;MYTHTV MAC ADDRESS&amp;gt;&lt;/pre&gt;
&lt;p&gt;*Note* most of this is lifted from Chris Tucker's &lt;a href=&quot;http://ubuntuforums.org/showthread.php?t=234588&quot;&gt;post&lt;/a&gt; on the ubuntu forums&lt;/p&gt;</description>
<pubDate>Wed, 30 Dec 2009 14:37:45 +0000</pubDate>
</item><item>
<title>MythTV Glass OSD</title>
<link>http://www.castlesblog.com/2009/november/30/mythtv_glass_osd</link>
<description>&lt;p&gt;Last weekend I was thinking about creating my own &lt;a href=&quot;http://www.mythtv.org&quot;&gt;MythTv&lt;/a&gt; theme. Rather than diving in the deep end I thought I would begin with an OSD theme. (OSD themes are overlay themes for video playback)&lt;/p&gt;&lt;p&gt;I have called my new theme &lt;strong&gt;Glass&lt;/strong&gt; and it is based on Black Curves. I have been using it successfully for the last week but there is a few glitches with the alignment of images in the edit dialog. I spoke to a few people via IRC who said that the OSD is currently undergoing a re-write. I may take another look at this when .23 is released.&lt;/p&gt;&lt;p&gt;The direction I took with this theme was to be simple, elegant and not to get in the way. I have made it freely available (GPL etc etc). &lt;del&gt;&lt;a href=&quot;/public/Glass-OSD-V1.zip&quot;&gt;Download it here&lt;/a&gt;&lt;/del&gt; Version 1.1 available &lt;a href=&quot;/public/Glass-OSD-V1.1.zip&quot;&gt;here&lt;/a&gt; (includes a few minor tweaks and fixed layout of recording editing)&lt;/p&gt;&lt;p&gt;Here are a few screenshots of it in action:&lt;/p&gt;&lt;p&gt;&lt;img src=&quot;http://static.castlesblog.com/data/mythtv-glass-osd-screenshot-1.jpg&quot; alt=&quot;Mythtv Glass OSD screenshot 1&quot; width=&quot;700&quot; height=&quot;394&quot; /&gt;&lt;img src=&quot;http://static.castlesblog.com/data/mythtv-glass-osd-screenshot-2.jpg&quot; alt=&quot;Mythtv Glass OSD screenshot 2&quot; width=&quot;700&quot; height=&quot;394&quot; /&gt;&lt;/p&gt;&lt;p&gt;If you have any comments or suggestions please post below. In particular.. would you like to see this style carried out to a full blown myth theme?&lt;/p&gt;&lt;p&gt;Also, In building this theme I've come up with a few ideas for another one that I might start working on over the next few weeks. Stay tuned.&lt;/p&gt;</description>
<pubDate>Mon, 30 Nov 2009 12:17:45 +0000</pubDate>
</item><item>
<title>Ballarat Renovations</title>
<link>http://www.castlesblog.com/2009/october/2/ballarat-renovations</link>
<description>&lt;p&gt;Once again its been a long time between posts. I've been working on the forms class for this site and I think I'm about ready to start on integrating it.&lt;/p&gt;&lt;p&gt;In the meantime I thought I would share a link to a site I've whipped up. Its very basic and primary purpose is to promote &lt;a href=&quot;http://www.ballarat-renovations.com.au&quot;&gt;Ballarat Renovations&lt;/a&gt;. If you are in the Ballarat region and need some renovation work done check it out... &lt;a href=&quot;http://www.ballarat-renovations.com.au&quot;&gt;http://www.ballarat-renovations.com.au&lt;/a&gt;&lt;/p&gt;</description>
<pubDate>Fri, 2 Oct 2009 02:50:48 +0000</pubDate>
</item><item>
<title>Heading Animation</title>
<link>http://www.castlesblog.com/2009/july/1/heading_animation</link>
<description>&lt;p&gt;On the CastlesBlog template the headings now animate when you press previous or next. I'm using the jQuery easing class to make it look smooth.&lt;/p&gt;&lt;p&gt;I've also set a min-height for the container as it was jumping up and down a bit.&lt;/p&gt;</description>
<pubDate>Wed, 1 Jul 2009 02:12:18 +0000</pubDate>
</item><item>
<title>Ajax Homepage</title>
<link>http://www.castlesblog.com/2009/july/1/ajax_homepage</link>
<description>&lt;p&gt;I've just completed ajaxing the homepage. Once the viewing post has loaded the page will get the previous post in the background. When you click previous or next this information will be used instead of reloading the page.&lt;/p&gt;&lt;p&gt;This gives the illusion that the website is extremely fast loading. I may add the ability to scrub through posts in the future as that would be cool.&lt;/p&gt;&lt;p&gt;This should still work fine if you don't have javascript or if your a search engine crawler as the href tags are still available.&lt;/p&gt;</description>
<pubDate>Tue, 30 Jun 2009 13:12:33 +0000</pubDate>
</item><item>
<title>Updated Skin and rewritten Blog Class</title>
<link>http://www.castlesblog.com/2009/june/28/updated_skin_rewritten_blog_class</link>
<description>&lt;p&gt;Over the last week I've been working on the look of this blog. It's definitely better, but still needs work. I've been playing with some new CSS3 features and in particular I've used the new box-shadow to add some depth. This works great in &lt;a href=&quot;http://www.getfirefox.com&quot;&gt;Firefox&lt;/a&gt; / &lt;a href=&quot;http://www.apple.com/safari&quot;&gt;Safari&lt;/a&gt; and &lt;a href=&quot;http://www.google.com/chrome&quot;&gt;Chrome&lt;/a&gt;. I might actually try to achieve this with images as I have noticed that using the box shadow in such a large area taxes the browsers performance.&lt;/p&gt;&lt;p&gt;The blog class has been re-written and custom templates are now available. Its fairly simple to create a custom skin. All you do is create a folder and add tpl_home.php, tpl_posts.php and tpl_post.php files. These files are the layout for the homepage, post listing and posts/comments page respectively. This folder also contains the css and javascript for the template. I'm sure I will expand on this in the future but for now its all I need.&lt;/p&gt;</description>
<pubDate>Sun, 28 Jun 2009 10:56:19 +0000</pubDate>
</item></channel></rss>