<?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>Tue, 06 Sep 2011 14:21:26 +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>Terminal bell with gnome-terminal, screen and irssi</title>
		<link>http://www.kriswillis.com/index.php/2011/09/06/terminal-bell-with-gnome-terminal-screen-and-irssi/</link>
		<comments>http://www.kriswillis.com/index.php/2011/09/06/terminal-bell-with-gnome-terminal-screen-and-irssi/#comments</comments>
		<pubDate>Tue, 06 Sep 2011 14:17:11 +0000</pubDate>
		<dc:creator>Kris</dc:creator>
				<category><![CDATA[GNU Linux]]></category>

		<guid isPermaLink="false">http://www.kriswillis.com/?p=150</guid>
		<description><![CDATA[It&#8217;s been a while now that I have been using irssi and screen to connect to IRC, and I have always found it annoying that I could never get notifications for nick highlights working. I have since stumbled upon a couple of irssi and screen commands that now allow this set-up to ring the terminal [...]]]></description>
			<content:encoded><![CDATA[<p>It&#8217;s been a while now that I have been using irssi and screen to connect to IRC, and I have always found it annoying that I could never get notifications for nick highlights working. I have since stumbled upon a couple of irssi and screen commands that now allow this set-up to ring the terminal bell on any of my configured highlights.</p>
<p><strong>irssi</strong><br />
<kbd>/set bell_beeps ON</kbd><br />
<kbd>/set beep_msg_level MSGS HILIGHT</kbd><br />
<kbd>/set beep_when_window_active ON</kbd><br />
<kbd>/set beep_when_away ON</kbd></p>
<p><strong>screen (toggle visual/audible bell)</strong><br />
<kbd>Ctrl+a Ctrl+g</kbd></p>
<p><strong>gnome-terminal</strong><br />
Edit -&gt; Profile Preferences -&gt; General -&gt; Terminal Bell</p>
]]></content:encoded>
			<wfw:commentRss>http://www.kriswillis.com/index.php/2011/09/06/terminal-bell-with-gnome-terminal-screen-and-irssi/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Failed to import current network settings into target system</title>
		<link>http://www.kriswillis.com/index.php/2010/09/10/failed-to-import-current-network-settings-into-target-system/</link>
		<comments>http://www.kriswillis.com/index.php/2010/09/10/failed-to-import-current-network-settings-into-target-system/#comments</comments>
		<pubDate>Fri, 10 Sep 2010 12:49:13 +0000</pubDate>
		<dc:creator>Kris</dc:creator>
				<category><![CDATA[GNU Linux]]></category>

		<guid isPermaLink="false">http://www.kriswillis.com/?p=128</guid>
		<description><![CDATA[I decided to try out some light-weight distros on some old hardware I had lying around, one such distro was ArchLinux, mainly because it would be interesting to try something that is not Debian based. During the installation process, at the &#8220;Configure System&#8221; stage I received the following error message: Failed to import current network [...]]]></description>
			<content:encoded><![CDATA[<p>I decided to try out some light-weight distros on some old hardware I had lying around, one such distro was ArchLinux, mainly because it would be interesting to try something that is not Debian based. During the installation process, at the &#8220;Configure System&#8221; stage I received the following error message:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">Failed to import current network settings into target system</pre></div></div>

<p>I thought nothing of it and hit the OK button to proceed. The next stage presented me with a bunch of system files to configure, except that they were all empty &#8211; I can&#8217;t imagine writing these files from scratch is part of the install process! After a bit of research, it turns out that this happens when the <code>dhcpd</code> package fails to download in the previous stage. All I had to do to fix this was to run the &#8220;Install Packages&#8221; step again, this time it only downloaded / installed what had previously failed, and my config files were no longer empty.</p>
<p>It turns out, ArchLinux is <em>so</em> light-weight, that all you end up with after installation is the CLI, you have to install Xorg, a window manager, and all of the related bits and pieces yourself &#8211; Which is nice, from a customization perspective.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.kriswillis.com/index.php/2010/09/10/failed-to-import-current-network-settings-into-target-system/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>ps_files_cleanup_dir: opendir(/var/lib/php5) failed: Permission denied (13)</title>
		<link>http://www.kriswillis.com/index.php/2010/09/09/ps_files_cleanup_dir-opendirvarlibphp5-failed-permission-denied-13/</link>
		<comments>http://www.kriswillis.com/index.php/2010/09/09/ps_files_cleanup_dir-opendirvarlibphp5-failed-permission-denied-13/#comments</comments>
		<pubDate>Thu, 09 Sep 2010 14:35:57 +0000</pubDate>
		<dc:creator>Kris</dc:creator>
				<category><![CDATA[GNU Linux]]></category>
		<category><![CDATA[PHP]]></category>

		<guid isPermaLink="false">http://www.kriswillis.com/?p=130</guid>
		<description><![CDATA[When running PHP5 under Ubuntu, every ~100 times you call session_start() the following error is thrown: ps_files_cleanup_dir: opendir&#40;/var/lib/php5&#41; failed: Permission denied &#40;13&#41; in ... By default, session data is stored in /var/lib/php5 which has its permissions set to only allow data to be deleted by it&#8217;s owner (and root). It&#8217;s like this because there is [...]]]></description>
			<content:encoded><![CDATA[<p>When running PHP5 under Ubuntu, every ~100 times you call session_start() the following error is thrown:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">ps_files_cleanup_dir: opendir<span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #000000; font-weight: bold;">/</span>var<span style="color: #000000; font-weight: bold;">/</span>lib<span style="color: #000000; font-weight: bold;">/</span>php5<span style="color: #7a0874; font-weight: bold;">&#41;</span> failed: Permission denied <span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #000000;">13</span><span style="color: #7a0874; font-weight: bold;">&#41;</span> <span style="color: #000000; font-weight: bold;">in</span> ...</pre></div></div>

<p>By default, session data is stored in /var/lib/php5 which has its permissions set to only allow data to be deleted by it&#8217;s owner (and root). It&#8217;s like this because there is a cron script that periodically clears the session data. To prevent PHP from also trying to do this, switch off the session garbage collection in php.ini (/etc/php5/apache2/php.ini) with the following:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">session.gc_probability = <span style="color: #000000;">0</span></pre></div></div>

<p>It is quite likely to be set to 1 by default. Save changes and restart apache.</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: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>init.d<span style="color: #000000; font-weight: bold;">/</span>apache2 restart</pre></div></div>

]]></content:encoded>
			<wfw:commentRss>http://www.kriswillis.com/index.php/2010/09/09/ps_files_cleanup_dir-opendirvarlibphp5-failed-permission-denied-13/feed/</wfw:commentRss>
		<slash:comments>9</slash:comments>
		</item>
		<item>
		<title>Revo 3610 HTPC</title>
		<link>http://www.kriswillis.com/index.php/2010/06/27/revo-3610-htpc/</link>
		<comments>http://www.kriswillis.com/index.php/2010/06/27/revo-3610-htpc/#comments</comments>
		<pubDate>Sun, 27 Jun 2010 16:23:55 +0000</pubDate>
		<dc:creator>Kris</dc:creator>
				<category><![CDATA[Gadgets]]></category>
		<category><![CDATA[GNU Linux]]></category>

		<guid isPermaLink="false">http://www.kriswillis.com/?p=124</guid>
		<description><![CDATA[I store all of my media on a file server (running Ubuntu Server 10.04) which currently contains a 6TB RAID5 array, then stream whatever I want to watch to a client device hooked up to my TV, up until yesterday this was a Popcorn Hour A-110. Although the A-110 plays back almost anything I throw [...]]]></description>
			<content:encoded><![CDATA[<p>I store all of my media on a file server (running Ubuntu Server 10.04) which currently contains a 6TB RAID5 array, then stream whatever I want to watch to a client device hooked up to my TV, up until yesterday this was a Popcorn Hour A-110. Although the A-110 plays back almost anything I throw at it, and generally flawlessly, the navigation is not the best, the UI is not the prettiest to look at and the network functionality is pretty slow. I&#8217;ve had my eye on <a title="Boxee" href="http://boxee.tv" target="_blank">Boxee</a> for a while now and have been patiently waiting for the release of the <a title="Boxee Box" href="http://boxee.tv/box" target="_blank">Boxee Box</a>, but they&#8217;ve recently announced on their blog that it has been delayed until November 2010 for the US release, and no mention of the Europe release. With this in mind, I decided to run Boxee on a low powered HTPC.</p>
<p>A couple of people in both forums and IRC have recommended the Acer Aspire Revo 3610 net-top machine as a candidate for running Boxee, so after a little research I picked on up from eBuyer at a bargain £180 for the N330 / 2GB / 250GB / Linpus configuration, delivered the next day for free. After firing it up for the first time, I spent less than 5 minutes poking around the pre-installed Linpus out of curiosity (the 250GB disk was oddly configured with a single 10GB partition), then promptly wiped it and installed Ubuntu 10.04 (x64) and the latest Boxee release.</p>
<p>Having previously read <a href="http://www.greenhughes.com/content/boxee-and-ubuntu-1004-lts-acer-aspire-revo" target="_blank">Liam Green-Hughes&#8217; website</a>, I was aware that I needed to tweak some settings to get the digital sound working, though there was a slight difference with my Revo in that I have three different S/PDIF levels within alsamixer &#8211; &#8220;S/PDIF&#8221;, &#8220;S/PDIF Default PCM&#8221; and &#8220;S/PDIF 1&#8243;. I un-muted all  of them but have yet to experiment to see what each of them does. I set my output device to &#8220;Digital Stereo (IEC958) Output&#8221; within the Ubuntu sound configuration as I want the audio to be sent to my amp over S/PDIF for decoding; after messing around with a few different combinations of settings within Boxee I was getting sound for files encoded with normal stereo sound, but silence for anything with multiple channels (DD / DTS). After a couple of hours of tinkering and research, it turns out that pulseaudio has a default sample rate of 44.1kHz and <a title="Ubuntu Forums" href="http://ubuntuforums.org/showpost.php?p=7560563&amp;postcount=3" target="_blank">AC3 (Dolby Digital) is signed 16-bit little-endian 2-channel 48kHz PCM data</a>, configuring pulseaudio to run with a sample rate of 48kHz appears to have fixed the issue, as I am now getting DD and DTS passed to my amp for every media file I have tested.</p>
<p>After playing around with the Revo / Boxee combination for about a day, it&#8217;s generally all positive; it plays back 720p/1080p content perfectly by passing the majority of the HD video decoding to the ION chip with the help of VDPAU available within GNU/Linux, the CPU is running at ~10% during all of this while managing perfectly with non-HD content too but with a little more strain on the N330. While &#8220;idling&#8221; on the Boxee home screen, one of the CPU&#8217;s threads is curiously always running at 100% load, though it is possible it is still indexing all of my media with it reporting &#8220;identifying&#8221; next to one of my sources. It has currently successfully identified 99% of my media requiring me to manually identify a handful of files, but this is perfectly acceptable considering the brilliant interface complete with covers and descriptions for all of my movies and TV shows. There is a slightly annoying wait when switching between the different areas of Boxee and sometimes a slight bit of lag when browsing through the media, but this could be down to it still indexing the content.</p>
<p>There appears to be plenty more to play with such as web content and applications, from what I have looked at, Flash video plays back fine in standard definition but HD Flash content is completely unwatchable &#8211; This is likely down to the lack of 64bit Linux support from Adobe. Other web based content such as the video made available within the Revision 3 application plays back perfectly, I&#8217;m pretty sure it&#8217;s HD too, but I couldn&#8217;t find an option to switch between the different encodings of their content.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.kriswillis.com/index.php/2010/06/27/revo-3610-htpc/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<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 [...]]]></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[Gadgets]]></category>
		<category><![CDATA[GNU Linux]]></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[Gadgets]]></category>
		<category><![CDATA[GNU Linux]]></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 [...]]]></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>
	</channel>
</rss>

