<?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>KrisWillis.com</title>
	<atom:link href="http://www.kriswillis.com/index.php/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.kriswillis.com</link>
	<description></description>
	<lastBuildDate>Fri, 09 Oct 2009 14:41:51 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Shorten URLs and post to Twitter with PHP and cURL</title>
		<link>http://www.kriswillis.com/index.php/2009/10/09/shorten-urls-and-post-to-twitter-with-php-and-curl/</link>
		<comments>http://www.kriswillis.com/index.php/2009/10/09/shorten-urls-and-post-to-twitter-with-php-and-curl/#comments</comments>
		<pubDate>Fri, 09 Oct 2009 14:41:51 +0000</pubDate>
		<dc:creator>Kris</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[Web Development]]></category>
		<category><![CDATA[cURL]]></category>
		<category><![CDATA[Twitter]]></category>

		<guid isPermaLink="false">http://kriswillis.com/?p=109</guid>
		<description><![CDATA[I recently had the task of automatically &#8220;tweeting&#8221; when a new article was posted to one of the websites I had built, it turns out to be a pretty simple operation thanks to both Twitter and Bit.ly providing a straight forward API. An account with Bit.ly does have to be opened to obtain an API [...]]]></description>
			<content:encoded><![CDATA[<p>I recently had the task of automatically &#8220;tweeting&#8221; when a new article was posted to one of the websites I had built, it turns out to be a pretty simple operation thanks to both Twitter and Bit.ly providing a straight forward API. An account with Bit.ly does have to be opened to obtain an API key.</p>
<p>I decided to use the built-in cURL functionality of PHP for interacting with the APIs. This code uses some of the JSON functions introduced in PHP 5.2.0 so a recent install of PHP is required as the Bit.ly API responds with a JSON string. On to the code&#8230;<br />
<span id="more-109"></span></p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
</pre></td><td class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">function</span> shorten_url<span style="color: #009900;">&#40;</span><span style="color: #000088;">$long_url</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
    <span style="color: #000088;">$login</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;username&quot;</span><span style="color: #339933;">;</span>
    <span style="color: #000088;">$api</span>   <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;api key&quot;</span><span style="color: #339933;">;</span>
    <span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span><span style="color: #339933;">!</span><span style="color: #990000;">empty</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$long_url</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
        <span style="color: #000088;">$shortener</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;http://api.bit.ly/shorten?version=2.0.1&amp;longUrl=<span style="color: #006699; font-weight: bold;">{$long_url}</span>&amp;login=<span style="color: #006699; font-weight: bold;">{$login}</span>&amp;apiKey=<span style="color: #006699; font-weight: bold;">{$api}</span>&quot;</span><span style="color: #339933;">;</span>
&nbsp;
        <span style="color: #000088;">$ch</span> <span style="color: #339933;">=</span> <span style="color: #990000;">curl_init</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        <span style="color: #990000;">curl_setopt</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$ch</span><span style="color: #339933;">,</span> CURLOPT_URL<span style="color: #339933;">,</span> <span style="color: #000088;">$shortener</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        <span style="color: #990000;">curl_setopt</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$ch</span><span style="color: #339933;">,</span> CURLOPT_HEADER<span style="color: #339933;">,</span> <span style="color: #cc66cc;">0</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        <span style="color: #990000;">curl_setopt</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$ch</span><span style="color: #339933;">,</span> CURLOPT_RETURNTRANSFER<span style="color: #339933;">,</span> <span style="color: #cc66cc;">1</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        <span style="color: #990000;">curl_setopt</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$ch</span><span style="color: #339933;">,</span> CURLOPT_FOLLOWLOCATION<span style="color: #339933;">,</span> <span style="color: #cc66cc;">1</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        <span style="color: #990000;">curl_setopt</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$ch</span><span style="color: #339933;">,</span> CURLOPT_TIMEOUT<span style="color: #339933;">,</span> <span style="color: #cc66cc;">10</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        <span style="color: #000088;">$x</span> <span style="color: #339933;">=</span> <span style="color: #990000;">curl_exec</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$ch</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        <span style="color: #990000;">curl_close</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$ch</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
        <span style="color: #000088;">$json</span> <span style="color: #339933;">=</span> <span style="color: #990000;">json_decode</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$x</span><span style="color: #339933;">,</span><span style="color: #009900; font-weight: bold;">true</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        <span style="color: #b1b100;">return</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$json</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'statusCode'</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">==</span> <span style="color: #0000ff;">&quot;OK&quot;</span><span style="color: #009900;">&#41;</span> ? <span style="color: #000088;">$json</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'results'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#91;</span><span style="color: #000088;">$long_url</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'shortUrl'</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">:</span> <span style="color: #009900; font-weight: bold;">false</span><span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span> <span style="color: #b1b100;">else</span> <span style="color: #009900;">&#123;</span>
        <span style="color: #b1b100;">return</span> <span style="color: #009900; font-weight: bold;">false</span><span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">function</span> twitter<span style="color: #009900;">&#40;</span><span style="color: #000088;">$status</span><span style="color: #339933;">,</span><span style="color: #000088;">$url</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
    <span style="color: #000088;">$username</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;username&quot;</span><span style="color: #339933;">;</span>
    <span style="color: #000088;">$password</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;password&quot;</span><span style="color: #339933;">;</span>
    <span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span><span style="color: #339933;">!</span><span style="color: #990000;">empty</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$status</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
        <span style="color: #000088;">$limit</span> <span style="color: #339933;">=</span> <span style="color: #cc66cc;">140</span><span style="color: #339933;">;</span>
        <span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$short</span> <span style="color: #339933;">=</span> shorten_url<span style="color: #009900;">&#40;</span><span style="color: #000088;">$url</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
            <span style="color: #000088;">$length</span> <span style="color: #339933;">=</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$limit</span> <span style="color: #339933;">-</span> <span style="color: #009900;">&#40;</span><span style="color: #990000;">strlen</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$short</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">+</span> <span style="color: #cc66cc;">4</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
            <span style="color: #000088;">$status</span> <span style="color: #339933;">=</span> <span style="color: #009900;">&#40;</span><span style="color: #990000;">strlen</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$status</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">&gt;</span> <span style="color: #000088;">$length</span><span style="color: #009900;">&#41;</span> ? <span style="color: #990000;">substr</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$status</span><span style="color: #339933;">,</span><span style="color: #cc66cc;">0</span><span style="color: #339933;">,</span><span style="color: #000088;">$length</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">.</span><span style="color: #0000ff;">&quot;... &quot;</span><span style="color: #339933;">.</span><span style="color: #000088;">$short</span> <span style="color: #339933;">:</span> <span style="color: #000088;">$status</span><span style="color: #339933;">.</span><span style="color: #0000ff;">&quot; &quot;</span><span style="color: #339933;">.</span><span style="color: #000088;">$short</span><span style="color: #339933;">;</span>
&nbsp;
            <span style="color: #000088;">$ch</span> <span style="color: #339933;">=</span> <span style="color: #990000;">curl_init</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
            <span style="color: #990000;">curl_setopt</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$ch</span><span style="color: #339933;">,</span> CURLOPT_URL<span style="color: #339933;">,</span> <span style="color: #0000ff;">&quot;http://twitter.com/statuses/update.xml&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
            <span style="color: #990000;">curl_setopt</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$ch</span><span style="color: #339933;">,</span> CURLOPT_HEADER<span style="color: #339933;">,</span> <span style="color: #cc66cc;">0</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
            <span style="color: #990000;">curl_setopt</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$ch</span><span style="color: #339933;">,</span> CURLOPT_RETURNTRANSFER<span style="color: #339933;">,</span> <span style="color: #cc66cc;">1</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
            <span style="color: #990000;">curl_setopt</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$ch</span><span style="color: #339933;">,</span> CURLOPT_FOLLOWLOCATION<span style="color: #339933;">,</span> <span style="color: #cc66cc;">1</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
            <span style="color: #990000;">curl_setopt</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$ch</span><span style="color: #339933;">,</span> CURLOPT_TIMEOUT<span style="color: #339933;">,</span> <span style="color: #cc66cc;">10</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
            <span style="color: #990000;">curl_setopt</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$ch</span><span style="color: #339933;">,</span> CURLOPT_USERPWD<span style="color: #339933;">,</span> <span style="color: #0000ff;">&quot;<span style="color: #006699; font-weight: bold;">{$username}</span>:<span style="color: #006699; font-weight: bold;">{$password}</span>&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
            <span style="color: #990000;">curl_setopt</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$ch</span><span style="color: #339933;">,</span> CURLOPT_POSTFIELDS<span style="color: #339933;">,</span> <span style="color: #0000ff;">&quot;status=&quot;</span><span style="color: #339933;">.</span><span style="color: #000088;">$status</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
            <span style="color: #000088;">$x</span> <span style="color: #339933;">=</span> <span style="color: #990000;">curl_exec</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$ch</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
            <span style="color: #990000;">curl_close</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$ch</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
            <span style="color: #000088;">$p</span> <span style="color: #339933;">=</span> <span style="color: #990000;">xml_parser_create</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
            <span style="color: #990000;">xml_parse_into_struct</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$p</span><span style="color: #339933;">,</span> <span style="color: #000088;">$x</span><span style="color: #339933;">,</span> <span style="color: #000088;">$vals</span><span style="color: #339933;">,</span> <span style="color: #000088;">$index</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
            <span style="color: #990000;">xml_parser_free</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$p</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
            <span style="color: #b1b100;">return</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$vals</span><span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">0</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'tag'</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">==</span> <span style="color: #0000ff;">&quot;STATUS&quot;</span><span style="color: #009900;">&#41;</span> ? <span style="color: #009900; font-weight: bold;">true</span> <span style="color: #339933;">:</span> <span style="color: #009900; font-weight: bold;">false</span><span style="color: #339933;">;</span>
        <span style="color: #009900;">&#125;</span> <span style="color: #b1b100;">else</span> <span style="color: #009900;">&#123;</span>
            <span style="color: #b1b100;">return</span> <span style="color: #009900; font-weight: bold;">false</span><span style="color: #339933;">;</span>
        <span style="color: #009900;">&#125;</span>
    <span style="color: #009900;">&#125;</span> <span style="color: #b1b100;">else</span> <span style="color: #009900;">&#123;</span>
        <span style="color: #b1b100;">return</span> <span style="color: #009900; font-weight: bold;">false</span><span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#125;</span></pre></td></tr></table></div>

]]></content:encoded>
			<wfw:commentRss>http://www.kriswillis.com/index.php/2009/10/09/shorten-urls-and-post-to-twitter-with-php-and-curl/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>mt-daapd transcoding failed after upgrading to Jaunty</title>
		<link>http://www.kriswillis.com/index.php/2009/07/26/mt-daapd-transcoding-failed-after-upgrading-to-jaunty/</link>
		<comments>http://www.kriswillis.com/index.php/2009/07/26/mt-daapd-transcoding-failed-after-upgrading-to-jaunty/#comments</comments>
		<pubDate>Sun, 26 Jul 2009 17:33:13 +0000</pubDate>
		<dc:creator>Kris</dc:creator>
				<category><![CDATA[GNU Linux]]></category>

		<guid isPermaLink="false">http://kriswillis.com/?p=104</guid>
		<description><![CDATA[After upgrading my media server to Jaunty recently I noticed that I could no longer play FLAC files from within iTunes under OS X. I couldn&#8217;t figure out why this was happening, but to solve it I configured mt-daapd to handle the transcoding with a script rather than with ffmpeg.
There are a few small issues [...]]]></description>
			<content:encoded><![CDATA[<p>After upgrading my media server to Jaunty recently I noticed that I could no longer play FLAC files from within iTunes under OS X. I couldn&#8217;t figure out why this was happening, but to solve it I configured mt-daapd to handle the transcoding with a script rather than with ffmpeg.</p>
<p>There are a few small issues that don&#8217;t make this reconfiguration as straight forward as you would hope. First of all, the required script (mt-daapd-ssc.sh) is not installed along with mt-daapd, so I had to pull it from the svn repository and drop it into /usr/bin. Also, mt-daapd-ssc.sh uses wavstreamer to encode the decoded FLAC file, so if that isn&#8217;t available on your system, you&#8217;ll need to install that too. I believe it is built along with the rest of mt-daapd when building from source.</p>
<p>Next up, mt-daapd.conf needs to be modified to change how the transcoding is handled, the following lines need to be uncommented:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">ssc_prog = <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>bin<span style="color: #000000; font-weight: bold;">/</span>mt-daapd-ssc.sh
ssc_codectypes = ogg,flac,alac</pre></div></div>

<p>The following line needs the ssc-ffmpeg.so part removed:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">plugins = rsp.so,ssc-ffmpeg.so</pre></div></div>

<p>At this stage, I thought that this was all that was required, but I still couldn&#8217;t get it working. Upon searching the Ubuntu Forums, someone else had already been through this and pointed out that one component of this set-up (I&#8217;m unsure which) requires an older version of FLAC, so a symlink had to be created.</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">ln</span> <span style="color: #660033;">-s</span> <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>lib<span style="color: #000000; font-weight: bold;">/</span>libFLAC.so.8.2.0 <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>lib<span style="color: #000000; font-weight: bold;">/</span>libFLAC.so.7</pre></div></div>

<p>After restarting mt-daapd, iTunes was again playing FLAC files!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.kriswillis.com/index.php/2009/07/26/mt-daapd-transcoding-failed-after-upgrading-to-jaunty/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Adding a printer within Ubuntu</title>
		<link>http://www.kriswillis.com/index.php/2009/04/01/adding-a-printer-within-ubuntu/</link>
		<comments>http://www.kriswillis.com/index.php/2009/04/01/adding-a-printer-within-ubuntu/#comments</comments>
		<pubDate>Wed, 01 Apr 2009 10:49:05 +0000</pubDate>
		<dc:creator>Kris</dc:creator>
				<category><![CDATA[GNU Linux]]></category>
		<category><![CDATA[Gadgets]]></category>

		<guid isPermaLink="false">http://kriswillis.com/?p=100</guid>
		<description><![CDATA[One of our office printers decided to die the other day, a Brother multi-function laser printer, which I recall took quite a lot of messing around to get it printing from Ubuntu and once it was set-up it always took a while to send pages to the printer. Sometimes, it printed just a bunch of [...]]]></description>
			<content:encoded><![CDATA[<p>One of our office printers decided to die the other day, a Brother multi-function laser printer, which I recall took quite a lot of messing around to get it printing from Ubuntu and once it was set-up it always took a while to send pages to the printer. Sometimes, it printed just a bunch of garbage instead of the document I sent too.</p>
<p>Our new printer, an HP 2727nf MFP, was a completely different experience. After hooking it up to the network and selecting to add a new printer within Ubuntu, it searched for printers, found the new HP, fetched and installed the required drivers and <em>just worked</em>! Pages are sent to the printer almost immediatly and have printed perfectly every time, so far.</p>
<p>Also, I set the same printer up on 6 machines in the office, 1 x Ubuntu, 2 x Xubuntu, 1 x OS X, 1 x Vista, 1 x XP Pro. By the time it was set-up on the first Windows machine I had already completed the set-up on all three Linux machines &#8211; Two thumbs up for Ubuntu and HP.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.kriswillis.com/index.php/2009/04/01/adding-a-printer-within-ubuntu/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Overview of open tickets across multiple trac environments</title>
		<link>http://www.kriswillis.com/index.php/2009/02/26/overview-of-open-tickets-across-multiple-trac-environments/</link>
		<comments>http://www.kriswillis.com/index.php/2009/02/26/overview-of-open-tickets-across-multiple-trac-environments/#comments</comments>
		<pubDate>Thu, 26 Feb 2009 10:26:20 +0000</pubDate>
		<dc:creator>Kris</dc:creator>
				<category><![CDATA[PHP]]></category>

		<guid isPermaLink="false">http://kriswillis.com/?p=86</guid>
		<description><![CDATA[I&#8217;ve recently started using Trac internally for managing the ever growing list of projects that I have built and am responsible for maintaining. There is currently no feature within Trac for displaying a list of all the environments and how many open tickets each one has, and I&#8217;m guessing this is down to the fact [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve recently started using <a href="http://trac.edgewall.org">Trac</a> internally for managing the ever growing list of projects that I have built and am responsible for maintaining. There is currently no feature within Trac for displaying a list of all the environments and how many open tickets each one has, and I&#8217;m guessing this is down to the fact that each environment has it&#8217;s own SQLite database.</p>
<p>However, browsing the root of the Trac install does give a list of all the available environments, and there are RSS feeds available for any of the reports that have been created. So I wrote a quick script to pull information from both of these resources and display a list of all available environments and how many open tickets each one has. <span id="more-86"></span></p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
</pre></td><td class="code"><pre class="php" style="font-family:monospace;">&lt;!DOCTYPE html PUBLIC &quot;-//W3C//DTD XHTML 1.0 Strict//EN&quot; &quot;http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd&quot;&gt;
&lt;html xmlns=&quot;http://www.w3.org/1999/xhtml&quot;&gt;
    &lt;head&gt;
        &lt;title&gt;Available Projects&lt;/title&gt;
    &lt;/head&gt;
    &lt;body&gt;
        <span style="color: #000000; font-weight: bold;">&lt;?php</span>
        <span style="color: #b1b100;">require_once</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;magpierss-0.72/rss_fetch.inc&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
        <span style="color: #000088;">$root</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;http://trac.kris&quot;</span><span style="color: #339933;">;</span>
        <span style="color: #000088;">$c</span> <span style="color: #339933;">=</span> <span style="color: #990000;">file_get_contents</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$root</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        <span style="color: #990000;">preg_match_all</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;/&lt;a href=<span style="color: #000099; font-weight: bold;">\&quot;</span>\/([a-z0-9_-]+)<span style="color: #000099; font-weight: bold;">\&quot;</span>.*&gt;(.*)&lt;\/a&gt;/i&quot;</span><span style="color: #339933;">,</span><span style="color: #000088;">$c</span><span style="color: #339933;">,</span><span style="color: #000088;">$matches</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
        <span style="color: #b1b100;">echo</span> <span style="color: #0000ff;">&quot;&lt;h1&gt;Available Projects&lt;/h1&gt;&lt;ul&gt;&quot;</span><span style="color: #339933;">;</span>
        <span style="color: #b1b100;">foreach</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$matches</span><span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">1</span><span style="color: #009900;">&#93;</span> <span style="color: #b1b100;">as</span> <span style="color: #000088;">$k</span> <span style="color: #339933;">=&gt;</span> <span style="color: #000088;">$v</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
            <span style="color: #000088;">$rss</span> <span style="color: #339933;">=</span> fetch_rss<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;<span style="color: #006699; font-weight: bold;">$root</span>/<span style="color: #006699; font-weight: bold;">$v</span>/report/1?format=rss&amp;USER=kris&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
            <span style="color: #b1b100;">echo</span> <span style="color: #0000ff;">&quot;&lt;li&gt;&lt;a href='<span style="color: #006699; font-weight: bold;">$root</span>/<span style="color: #006699; font-weight: bold;">$v</span>/report/1'&gt;&quot;</span><span style="color: #339933;">.</span><span style="color: #000088;">$matches</span><span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">2</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#91;</span><span style="color: #000088;">$k</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">.</span><span style="color: #0000ff;">&quot;&lt;/a&gt; (&quot;</span><span style="color: #339933;">.</span><span style="color: #990000;">count</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$rss</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">items</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">.</span><span style="color: #0000ff;">&quot;)&lt;/li&gt;&quot;</span><span style="color: #339933;">;</span>
        <span style="color: #009900;">&#125;</span>
        <span style="color: #b1b100;">echo</span> <span style="color: #0000ff;">&quot;&lt;/ul&gt;&quot;</span><span style="color: #339933;">;</span>
        <span style="color: #000000; font-weight: bold;">?&gt;</span>
    &lt;/body&gt;
&lt;/html&gt;</pre></td></tr></table></div>

]]></content:encoded>
			<wfw:commentRss>http://www.kriswillis.com/index.php/2009/02/26/overview-of-open-tickets-across-multiple-trac-environments/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Boss SD-1 not switching off</title>
		<link>http://www.kriswillis.com/index.php/2008/09/27/boss-sd-1-not-switching-off/</link>
		<comments>http://www.kriswillis.com/index.php/2008/09/27/boss-sd-1-not-switching-off/#comments</comments>
		<pubDate>Sat, 27 Sep 2008 15:17:01 +0000</pubDate>
		<dc:creator>Kris</dc:creator>
				<category><![CDATA[Gadgets]]></category>
		<category><![CDATA[Guitar]]></category>

		<guid isPermaLink="false">http://kriswillis.com/?p=64</guid>
		<description><![CDATA[Although I hardly use my SD-1, due to my GT-8 having all of the overdrive settings I could possibly want, it was still annoying me that I had a faulty pedal sitting on my shelf. The problem I was experiencing was that the SD-1 was constantly stuck in its on position &#8211; Stomping on it [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://kriswillis.com/wp-content/uploads/2008/09/dscn0677.jpg"><img src="http://kriswillis.com/wp-content/uploads/2008/09/dscn0677.jpg" border="1" alt="SD-1 Inside" width="150" align="right" /></a>Although I hardly use my SD-1, due to my GT-8 having all of the overdrive settings I could possibly want, it was still annoying me that I had a faulty pedal sitting on my shelf. The problem I was experiencing was that the SD-1 was constantly stuck in its on position &#8211; Stomping on it did nothing but continue with the overdrive.</p>
<p>After taking it apart and hooking it back up to some power, a guitar and an amp, in its disassembled state it was working fine &#8211; Reassemble and the fault reappears. It was instantly obvious that something was shorting out against the metal casing. You&#8217;d have thought that there was some form of non-conductive coating on the base-plate &#8211; Maybe there is, but defective near the switching area of the circuit. Covering the base-plate with insulation tape fixed the issue and it&#8217;s now working perfectly again!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.kriswillis.com/index.php/2008/09/27/boss-sd-1-not-switching-off/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>SiI-3114 and Ubuntu</title>
		<link>http://www.kriswillis.com/index.php/2008/09/18/sii-3114-and-ubuntu/</link>
		<comments>http://www.kriswillis.com/index.php/2008/09/18/sii-3114-and-ubuntu/#comments</comments>
		<pubDate>Thu, 18 Sep 2008 20:43:44 +0000</pubDate>
		<dc:creator>Kris</dc:creator>
				<category><![CDATA[GNU Linux]]></category>
		<category><![CDATA[Gadgets]]></category>

		<guid isPermaLink="false">http://kriswillis.com/?p=62</guid>
		<description><![CDATA[My media server was getting to the stage where it required some extra discs, so I purchased another pair of 500GB SATA disks and a SiI-3114 based PCI to 4-port SATA controller card to hook them up to as I was out of spare SATA ports.
Upon booting there was no sign of the cards BIOS [...]]]></description>
			<content:encoded><![CDATA[<p>My media server was getting to the stage where it required some extra discs, so I purchased another pair of 500GB SATA disks and a SiI-3114 based PCI to 4-port SATA controller card to hook them up to as I was out of spare SATA ports.</p>
<p>Upon booting there was no sign of the cards BIOS during POST and no sign of the disks attached to it either after booting into Ubuntu, though running <em>lspci</em> reported that the card was present. After poking around with a mixture of Google and the Ubuntu forums, a number of people were having issues with the card but no conclusive fix had been found.</p>
<p>So I head on over to the Silicon Image website to check if there are any new BIOS images available, and surprisingly there was! After downloading, and realising that the only flash tool available was DOS based along with my server not having a floppy drive or a CD drive to boot into a DOS shell with I managed to get a USB stick booting into DOS with the flash tool.</p>
<p>To cut the story short &#8211; Flashing the card with the latest non-RAID version of the BIOS fixed my issue. It was now displaying the BIOS upon boot, and the attached disks were visible when running <em>lshw -C disk</em>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.kriswillis.com/index.php/2008/09/18/sii-3114-and-ubuntu/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Replacing the microphone in a Blackberry 8800</title>
		<link>http://www.kriswillis.com/index.php/2008/08/10/replacing-the-microphone/</link>
		<comments>http://www.kriswillis.com/index.php/2008/08/10/replacing-the-microphone/#comments</comments>
		<pubDate>Sun, 10 Aug 2008 12:52:05 +0000</pubDate>
		<dc:creator>Kris</dc:creator>
				<category><![CDATA[Gadgets]]></category>

		<guid isPermaLink="false">http://kriswillis.com/?p=56</guid>
		<description><![CDATA[So I accidentally spilled a cup of tea over my Blackberry. Fortunately, after drying it off most of it worked perfectly bar one of the most important components in a mobile phone &#8211; The microphone.
After doing a little research, it turns out that the mic is surface mounted to the keyboard PCB so to replace [...]]]></description>
			<content:encoded><![CDATA[<p>So I accidentally spilled a cup of tea over my Blackberry. Fortunately, after drying it off most of it worked perfectly bar one of the most important components in a mobile phone &#8211; The microphone.</p>
<p>After doing a little research, it turns out that the mic is surface mounted to the keyboard PCB so to replace the mic I&#8217;d need a new (or working) keyboard PCB. The only place I could find this component new was on some American website, which after shipping and other taxes involved in importing stuff, would have cost about £70. Or, I could have sent it off to Vodafone for repair at a cost of £60 and a few weeks Blackberry-less no doubt.</p>
<p>I ended up grabbing what was described as a faulty 8800 from someone on eBay for about £40, the description said it had a software fault, so there was a good chance that the hardware was in good condition. It turns out that there was nothing wrong with it from what I could gather after messing around with it for a couple of minutes. But it was on the o2 network, so no use to me.<span id="more-56"></span></p>
<p>After disassembling one of my 8800s it turns out that the keyboard PCB is somehow permanently fixed to the chassis. I made several attempts to split the two apart, but was concerned as to how functional the PCB would have been afterwards, and how I was going to mount the replacement. I&#8217;m assuming that if I were to order the replacement part from America, it would arrive mounted to the chassis. The only issue with this, is that the sticker with the serial number, IMEI, BT MAC etc. is also permanently stuck to the back of the chassis.</p>
<p>There isn&#8217;t <em>too much</em> work involved in taking one of these things apart. After removing the battery, MicroSD card and sim card out there are four Torx T5 (or T4 &#8211; My precision Torx drivers aren&#8217;t marked) screws to remove. After removing the two chrome plastic side plates, which are just clipped on, the back cover comes off with a bit of jiggling.</p>
<p>After removing the back cover, there are a further two T5 screw to remove near the top which releases the clipped on front cover and keypad. At the bottom there is then a plastic cover that just pulls off, underneath is a small PCB which looks like it contains some form of antenna, possibly GPRS/EDGE based on what was printed on the cover.</p>
<p>The next task is to remove the frame that the loudspeaker is mounted to. This frame is just clipped on with two clips either side, and two clips at the top. There is also a wire linking the main board to the antenna board which is clipped to the frame, it&#8217;s easiest to unplug the wire at each end before removing the frame.</p>
<p>After the frame is removed, the main PCB should be fairly easy to remove after unplugging the ribbon cables from the display and keyboard. Flip the chassis over and remove the display by firmly pulling it away from the metal backing plate, it is only held on with an adhesive pad. At this stage I got the second 8800 to the same stage, and reassembled my original phone around the chassis with the working keyboard mounted to it. It&#8217;s always worth checking that it is functioning before putting it back in its casing &#8211; You don&#8217;t want to put it all back together only to find there is a bad connection somewhere!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.kriswillis.com/index.php/2008/08/10/replacing-the-microphone/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Logitech MX5000 and Ubuntu</title>
		<link>http://www.kriswillis.com/index.php/2008/05/09/logitech-mx5000-and-ubuntu/</link>
		<comments>http://www.kriswillis.com/index.php/2008/05/09/logitech-mx5000-and-ubuntu/#comments</comments>
		<pubDate>Fri, 09 May 2008 19:59:58 +0000</pubDate>
		<dc:creator>Kris</dc:creator>
				<category><![CDATA[GNU Linux]]></category>
		<category><![CDATA[Gadgets]]></category>
		<category><![CDATA[Bluetooth]]></category>
		<category><![CDATA[Logitech]]></category>
		<category><![CDATA[Ubuntu]]></category>

		<guid isPermaLink="false">http://kriswillis.com/?p=54</guid>
		<description><![CDATA[Since I first bought my Logitech MX5000 combo it has never worked correctly on Ubuntu (back to 6.06 maybe&#8230;) after booting. The keyboard would work perfectly in the BIOS and even in GRUB, but as soon as I reached the (GUI) log-in screen my MX5000 would become unresponsive until I disconnected the USB Bluetooth receiver [...]]]></description>
			<content:encoded><![CDATA[<p>Since I first bought my Logitech MX5000 combo it has never worked correctly on Ubuntu (back to 6.06 maybe&#8230;) after booting. The keyboard would work perfectly in the BIOS and even in GRUB, but as soon as I reached the (GUI) log-in screen my MX5000 would become unresponsive until I disconnected the USB Bluetooth receiver and plugged it back in. As you could imagine, quite tedious on every boot.</p>
<p>After doing a bit of research, this appears to be a fairly common issue. One suggestion that did work for me was to remove the bluez-* packages, but apparently there is the side effect of other Bluetooth devices no longer working. This isn&#8217;t an issue for me, so it&#8217;ll keep me happy until a real fix is in place.</p>
<p>Drop the following into your CLI if you&#8217;re having the same issue&#8230;<br />
<code>sudo apt-get remove bluez-cups bluez-pcmcia-support bluez-pin bluez-utils</code></p>
]]></content:encoded>
			<wfw:commentRss>http://www.kriswillis.com/index.php/2008/05/09/logitech-mx5000-and-ubuntu/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>IE6 Bug: H1 tags with background colours</title>
		<link>http://www.kriswillis.com/index.php/2008/03/28/ie6-bug-h1-tags-with-background-colours/</link>
		<comments>http://www.kriswillis.com/index.php/2008/03/28/ie6-bug-h1-tags-with-background-colours/#comments</comments>
		<pubDate>Fri, 28 Mar 2008 14:27:48 +0000</pubDate>
		<dc:creator>Kris</dc:creator>
				<category><![CDATA[Web Development]]></category>
		<category><![CDATA[bug]]></category>
		<category><![CDATA[ie6]]></category>

		<guid isPermaLink="false">http://kriswillis.com/index.php/2008/03/28/ie6-bug-h1-tags-with-background-colours/</guid>
		<description><![CDATA[I have just noticed an odd bug when viewing a H1 tag with a background colour under IE6 &#8211; There is no background colour until the H1 is taken out of view by scrolling it out of the viewport and then bringing it back again. Highlighting the text partially brings in some colour.
One solution for [...]]]></description>
			<content:encoded><![CDATA[<p><img class="alignright" src="http://kriswillis.com/wp-content/uploads/2008/03/noie.png" border="0" alt="No IE6" />I have just noticed an odd bug when viewing a H1 tag with a background colour under IE6 &#8211; There is no background colour until the H1 is taken out of view by scrolling it out of the viewport and then bringing it back again. Highlighting the text partially brings in some colour.</p>
<p>One solution for this issue is add relative positioning to the tags CSS class.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.kriswillis.com/index.php/2008/03/28/ie6-bug-h1-tags-with-background-colours/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Table joins in MySQL with no matches</title>
		<link>http://www.kriswillis.com/index.php/2008/02/17/table-joins-in-mysql-with-no-matches/</link>
		<comments>http://www.kriswillis.com/index.php/2008/02/17/table-joins-in-mysql-with-no-matches/#comments</comments>
		<pubDate>Sun, 17 Feb 2008 16:13:25 +0000</pubDate>
		<dc:creator>Kris</dc:creator>
				<category><![CDATA[MySQL]]></category>
		<category><![CDATA[Web Development]]></category>
		<category><![CDATA[join]]></category>

		<guid isPermaLink="false">http://kriswillis.com/index.php/2008/02/17/table-joins-in-mysql-with-no-matches/</guid>
		<description><![CDATA[I consider my understanding of MySQL around the intermediate level, but when writing table joins in the past I have always used the &#8216;equi-join&#8217; method:
SELECT t1.*, t2.`name` FROM t1, t2 WHERE t1.n = t2.n;
Now, when a record for t2.n doesn&#8217;t exist, a row will not be returned. To solve this problem in the past, I [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://kriswillis.com/wp-content/uploads/2008/02/mysql_100x52-64.gif" title="MySQL Logo"><img src="http://kriswillis.com/wp-content/uploads/2008/02/mysql_100x52-64.gif" alt="MySQL Logo" class="alignright" align="right" border="0" /></a>I consider my understanding of MySQL around the intermediate level, but when writing table joins in the past I have always used the &#8216;equi-join&#8217; method:</p>
<p><code>SELECT t1.*, t2.`name` FROM t1, t2 WHERE t1.n = t2.n;</code></p>
<p>Now, when a record for t2.n doesn&#8217;t exist, a row will not be returned. To solve this problem in the past, I would have executed two separate queries and process the output with PHP &#8211; Not the most efficient solution.</p>
<p><span id="more-50"></span>Today I had to write a query on a relatively larger scale with a number of table joins. I knew for a fact that a few of these joins would not have matching data on all occasions and splitting one query into <em>x</em>  queries and then processing the results would not be a good idea in the slightest.</p>
<p>Searching Google yielded  bugger all on the subject, though that could have been down to my search criteria. The MySQL manual was helpful as usual (that&#8217;s sarcasm, by the way &#8211; They should take a page out of PHPs book, their manual is great), but with a mixture of the two I found the solution. Left joins.</p>
<p><code>SELECT t1.*, t2.`name` FROM t1 LEFT JOIN t2 ON t1.n = t2.n;</code></p>
<p>The above will return a row, even if there isn&#8217;t a match for t1.n = t2.n. Learning every day&#8230;</p>
]]></content:encoded>
			<wfw:commentRss>http://www.kriswillis.com/index.php/2008/02/17/table-joins-in-mysql-with-no-matches/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>
