<?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>Playing on the frontier &#187; Uncategorized</title>
	<atom:link href="http://siphon9.net/loune/category/uncategorized/feed/" rel="self" type="application/rss+xml" />
	<link>http://siphon9.net/loune</link>
	<description></description>
	<lastBuildDate>Wed, 18 May 2011 12:10:37 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Javascript ArrayBuffer &#8211; Binary handling in javascript</title>
		<link>http://siphon9.net/loune/2011/05/javascript-arraybuffer-binary-handling-in-javascript/</link>
		<comments>http://siphon9.net/loune/2011/05/javascript-arraybuffer-binary-handling-in-javascript/#comments</comments>
		<pubDate>Wed, 18 May 2011 10:52:35 +0000</pubDate>
		<dc:creator>Loune</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://siphon9.net/loune/?p=291</guid>
		<description><![CDATA[As javascript and HTML5 venture into applications never contemplated, there was one basic feature sorely missing from its API line up. The feature I&#8217;m talking about is of course native support for binary. Currently, if you want to manipulate binary in javascript, you have to make do with an array of numbers to store each [...]]]></description>
			<content:encoded><![CDATA[<p>As javascript and HTML5 venture into applications never <a href="http://bellard.org/jslinux/">contemplated</a>, there was one basic feature sorely missing from its API line up. The feature I&#8217;m talking about is of course native support for binary. Currently, if you want to manipulate binary in javascript, you have to make do with an array of numbers to store each byte in the &#8220;byte array&#8221;. This was horribly ineffecient given that each byte of number type probably occupied 4 or 8 bytes, so you would be using 4 or 8 times the space. Another alternative is to use base64, but that meant your binary blob was 33% larger and was only good for serialisation and storage.</p>
<p>This changed however, with the advent of WebGL, the straw that broke the camels back. WebGL required efficient processing of byte arrays which herald the creation of the <a href="http://www.khronos.org/registry/webgl/specs/1.0/#ARRAYBUFFER">ArrayBuffer</a>. Although designed for WebGL, the ArrayBuffer can be used anywhere in your javascript. WebGL is currently available for Firefox 4 and Chrome. The ArrayBuffer allows you to allocate a opaque chunk of memory. To manipulate the buffer, we have to &#8220;cast&#8221; or map the array to a <a href="http://www.khronos.org/registry/typedarray/specs/1.0/">Typed Array</a>. There are various typed arrays such as Int16Array, Float32Array, but the one that interests us is probably Uint8Array, allowing us to view our ArrayBuffer as a byte array.</p>
<pre class="brush: jscript; title: ; notranslate">
var buf = new ArrayBuffer(1024);
var bytes = new Uint8Array(buf);
for (var i = 0; i &lt; bytes.length; i++) {
  bytes[i] = 0xFF;
}
</pre>
<p>The Typed Array may seem like a foreign concept in a dynamic-typed language such as javascript, but it&#8217;s neccesarry to provide good performance for binary handling. If you try to assign a Uint8Array element a number greater than 255, it will be truncated, and if you put a string, it&#8217;ll become 0, proving that this is more than just your average JS array.</p>
<p>Already there is talk of using these in HTML File API and Web Sockets API. WebSockets currently only support plain text UTF-8 frames, which means you can&#8217;t talk binary over the wire. Given that a lot of exisiting protocols are binary, this was a severely limitation. A web based proxy <a href="https://github.com/kanaka/websockify">websockify</a> that proxies native protocols into websocket frames needs the base64 each frame. Array Buffer support would allow us to do away the base64 overhead.</p>
]]></content:encoded>
			<wfw:commentRss>http://siphon9.net/loune/2011/05/javascript-arraybuffer-binary-handling-in-javascript/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>MythWeb and Flash streaming</title>
		<link>http://siphon9.net/loune/2011/02/mythweb-and-flash-streaming/</link>
		<comments>http://siphon9.net/loune/2011/02/mythweb-and-flash-streaming/#comments</comments>
		<pubDate>Sun, 13 Feb 2011 04:54:35 +0000</pubDate>
		<dc:creator>Loune</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[flash]]></category>
		<category><![CDATA[mythtv]]></category>
		<category><![CDATA[mythweb]]></category>

		<guid isPermaLink="false">http://siphon9.net/loune/?p=285</guid>
		<description><![CDATA[For a while I&#8217;ve heard of this mythical flash streaming that is now supposedly built into MythWeb. However I have yet to see it anywhere in the website. What gives? So I decided to get to the bottom of this. There&#8217;s a wiki article on MythTV web which describe how it&#8217;s done, but it&#8217;s said [...]]]></description>
			<content:encoded><![CDATA[<p>For a while I&#8217;ve heard of this mythical flash streaming that is now supposedly built into MythWeb. However I have yet to see it anywhere in the website. What gives? So I decided to get to the bottom of this. There&#8217;s a <a href="http://www.mythtv.org/wiki/stream_mythtv_recordings_from_mythweb_using_flash_video">wiki article</a> on MythTV web which describe how it&#8217;s done, but it&#8217;s said to be outdated and pointed to <a href="http://www.mythtv.org/wiki/MythWeb">MythWeb&#8217;s wiki page</a>, which only mentions it&#8217;s been rewritten to enable Flash streaming. So how do I enable it?</p>
<p>After digging in source and finding various shenanigans with the WebFLV_on variable, the answer revealed itself in the preference pages of MythWeb (Settings &gt; MythWeb &gt; Video Playback). There is a tick box to &#8220;Enable Video playback&#8221;. However, it says it requires ffmpeg with mp3 support.</p>
<p>I&#8217;m using gentoo so installing ffmpeg was just a matter of emerge -av ffmpeg. After installing, I can finally tick the &#8220;Enable Video Playback&#8221;. However arriving at the preference pages and tried playing on the flash player, a new stumbling block appeared. It says that the pl/stream/bla/bla.flv is not found. Navigating to it manually revealed a 500 Internal Server Error.</p>
<p>Since I&#8217;m using Lighttpd, I discovered that it has a deficiency logging CGI errors. The error.log was useless and I ended up running Lighttpd in non-daemon mode (/usr/sbin/lighttpd -D -f /etc/lighttpd/lighttpd.conf) and looked at the errors spat out on to the console. Turns out that it requires Math::Round which I haven&#8217;t installed.</p>
<p>The story is actually a bit more cumbersome as before everything I needed to enable CGI on lighttpd for perl to work and to get around a streaming path issue, I modified $stream_url in /includes/defines.php to not double slash on my root, but I know everyone just wants to see what I wanted to see when I embarked on this journey &#8211; a screenshot of it in action:</p>
<p><a href="http://siphon9.net/loune/wp-content/uploads/2011/02/flash.jpg"><img class="alignnone size-medium wp-image-287" title="flash" src="http://siphon9.net/loune/wp-content/uploads/2011/02/flash-300x168.jpg" alt="" width="300" height="168" /></a></p>
<p>It&#8217;s by no means perfect with video being low quality, lack of seeking and some high CPU usage &#8211; but it works!</p>
]]></content:encoded>
			<wfw:commentRss>http://siphon9.net/loune/2011/02/mythweb-and-flash-streaming/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Match any character including new line in Javascript Regexp</title>
		<link>http://siphon9.net/loune/2011/02/match-any-character-including-new-line-in-javascript-regexp/</link>
		<comments>http://siphon9.net/loune/2011/02/match-any-character-including-new-line-in-javascript-regexp/#comments</comments>
		<pubDate>Wed, 02 Feb 2011 11:37:25 +0000</pubDate>
		<dc:creator>Loune</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[hacks]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[regex]]></category>

		<guid isPermaLink="false">http://siphon9.net/loune/?p=272</guid>
		<description><![CDATA[It seems like the dot character in Javascript&#8217;s regular expressions matches any character except new line and no number of modifiers could change that. Sometimes you just want to match everything and there&#8217;s a couple of ways to do that. You can pick an obscure character and apply a don&#8217;t match character range with it [...]]]></description>
			<content:encoded><![CDATA[<p>It seems like the dot character in Javascript&#8217;s regular expressions matches any character except new line and no number of modifiers could change that. Sometimes you just want to match everything and there&#8217;s a couple of ways to do that.</p>
<p>You can pick an obscure character and apply a don&#8217;t match character range with it ie <code>[^`]+</code>. This is not true match any character though. Or you can try <code>[.\r\n]+</code> which doesn&#8217;t seem to work at all. <code>(?:\r|\n|.)+</code> works fine, but as you&#8217;ll find out soon, it is notoriously slow as each time you use it, you are creating a new 3 way branching point because of the brackets.</p>
<p>The perfect way I&#8217;ve found is actually a nicer variation of the first idea:<br />
<strong>[^]+</strong><br />
Which means &#8216;don&#8217;t match no characters&#8217;, a double negative that can re-read as &#8216;match any character&#8217;. Hacky, but works perfectly.</p>
]]></content:encoded>
			<wfw:commentRss>http://siphon9.net/loune/2011/02/match-any-character-including-new-line-in-javascript-regexp/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Avahi, setrlimit NPROC and lxc</title>
		<link>http://siphon9.net/loune/2011/02/avahi-setrlimit-nproc-and-lxc/</link>
		<comments>http://siphon9.net/loune/2011/02/avahi-setrlimit-nproc-and-lxc/#comments</comments>
		<pubDate>Wed, 02 Feb 2011 11:27:10 +0000</pubDate>
		<dc:creator>Loune</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[avahi]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[lxc]]></category>

		<guid isPermaLink="false">http://siphon9.net/loune/?p=267</guid>
		<description><![CDATA[Over the weekend I installed Avahi (the open source bonjour equivalent) and bumped into a strange error while trying to restart the service. /var/log/message says chroot.c: fork() failed: Resource temporarily unavailable. Searching the interwebs revealed it is an issue with LXC and setrlimit. The setrlimit call can limit set cetain limitations on processes. One such [...]]]></description>
			<content:encoded><![CDATA[<p>Over the weekend I installed Avahi (the open source bonjour equivalent) and bumped into a strange error while trying to restart the service. /var/log/message says <code>chroot.c: fork() failed: Resource temporarily unavailable</code>. Searching the interwebs revealed it is an issue with LXC and setrlimit.</p>
<p>The setrlimit call can limit set cetain limitations on processes. One such limitation is NPROC, the number of processes that can have the same UID. Using setrlimit NPROC can enhance security by preventing unexpected forking, like when an attacker is trying spawn a new process. However, the server I am running on uses LXC, and avahi is installed on the host. In LXC, the containers themselves have isolation between one another, but the host sees all processes. The PIDs of container processes are remapped but their UIDs stay the same. Thus, you will get UID collisions where user 102 of container can refer to say <code>ntp</code>, while 102 of host can refer to <code>avahi</code>. Because the host sees and accounts for all processes, setrlimit on avahi (102) of say 3 processes will also count existing processes in containers with UID 102 (such as ntp) and thus breach the limit and unable to spawn.</p>
<p>The only way to solve this is to edit avahi.conf and set rlimit-nproc or just disable rlimits altogether using the <code>--no-rlimits</code> switch.</p>
<p>I guess as LXC and control groups becomes more common, developers will need to adjust their assumptions about users and processes.</p>
]]></content:encoded>
			<wfw:commentRss>http://siphon9.net/loune/2011/02/avahi-setrlimit-nproc-and-lxc/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>List of Sandy Bridge LGA1155 H67/P67 motherboards that support VT-d</title>
		<link>http://siphon9.net/loune/2011/01/list-of-sandy-bridge-lga1155-h67p67-motherboards-that-support-vt-d/</link>
		<comments>http://siphon9.net/loune/2011/01/list-of-sandy-bridge-lga1155-h67p67-motherboards-that-support-vt-d/#comments</comments>
		<pubDate>Fri, 21 Jan 2011 10:07:49 +0000</pubDate>
		<dc:creator>Loune</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[sandy bridge]]></category>
		<category><![CDATA[vt-d]]></category>

		<guid isPermaLink="false">http://siphon9.net/loune/?p=264</guid>
		<description><![CDATA[Since publishing my rant a few days ago, I&#8217;ve discovered a few more motherboards which CLAIM to support VT-d (Intel Virtualization Technology for Directed-IO). Of course you need a non-K flavour of Sandy Bridge CPU as well (ie i5-2400, i5-2500, i7-2600). So here&#8217;s the list so far, which I&#8217;ll update as I find more: Intel [...]]]></description>
			<content:encoded><![CDATA[<p>Since <a href="http://siphon9.net/loune/2011/01/sandy-bridge-woes-lga1155-p67h67-and-vt-d-io-virtualization/">publishing my rant</a> a few days ago, I&#8217;ve discovered a few more motherboards which CLAIM to support VT-d (Intel Virtualization Technology for Directed-IO). Of course you need a non-K flavour of Sandy Bridge CPU as well (ie i5-2400, i5-2500, i7-2600).</p>
<p>So here&#8217;s the list so far, which I&#8217;ll update as I find more:</p>
<ul>
<li>Intel DP67BG (<strong>Confirmed, see comment by Michael</strong>)</li>
<li>ASRock P67 (All of them, last time I checked &#8211; i.e. Pro, Fatal1ty) (Seems to be bogus according to Brian)</li>
<li>ASRock H67M (And all variants)</li>
<li>Foxconn H67S and variants</li>
<li>Foxconn P67A</li>
<li>ASUS P8H67-V and P8P67? (See below)</li>
<li>BIOSTAR TP67XE and variants</li>
<li>BIOSTAR TH67XE and variants</li>
</ul>
<p>There&#8217;s a good chance that if one of the H67/P67 boards from the same manufacturer (i.e. ASRock and Foxconn) have VT-d, all variants have it too. You can check by searching VT-d in the product manual.</p>
<p>Update 6/02/2011 &#8211; Latest Asus P8P67 manual (E6307) shows the VT-d option under &#8220;System Agent Configuration&#8221;. Is this a new addition or something I missed before I&#8217;m not sure. Quick check of other Asus boards ie P8P67 EVO or P8H67-M indicates they don&#8217;t have it. Exception is P8H67-V which seemed to have it from the beginning. It seems there&#8217;s hope for those with Asus boards.</p>
<p>Update 24/03/2011 &#8211; None of the boards except for the Intel one seems to support VT-d even if they claim to. There are continuing claims that P67/H67 doesn&#8217;t support VT-d.</p>
]]></content:encoded>
			<wfw:commentRss>http://siphon9.net/loune/2011/01/list-of-sandy-bridge-lga1155-h67p67-motherboards-that-support-vt-d/feed/</wfw:commentRss>
		<slash:comments>54</slash:comments>
		</item>
		<item>
		<title>Sandy Bridge Woes &#8211; LGA1155 P67/H67 and VT-d (I/O Virtualization)</title>
		<link>http://siphon9.net/loune/2011/01/sandy-bridge-woes-lga1155-p67h67-and-vt-d-io-virtualization/</link>
		<comments>http://siphon9.net/loune/2011/01/sandy-bridge-woes-lga1155-p67h67-and-vt-d-io-virtualization/#comments</comments>
		<pubDate>Wed, 19 Jan 2011 12:42:50 +0000</pubDate>
		<dc:creator>Loune</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[intel]]></category>
		<category><![CDATA[iommu]]></category>
		<category><![CDATA[sandy bridge]]></category>
		<category><![CDATA[vt-d]]></category>

		<guid isPermaLink="false">http://siphon9.net/loune/?p=249</guid>
		<description><![CDATA[I recently upgraded my home server from an old Athlon X2 to the latest and finest from intel, namely the new Sandy bridge processors. These new processors come with a relatively new technology called VT-d or (Intel Virtualisation Technology with Directed I/O). It&#8217;s also called an IOMMU. This feature like the more common VT-x provides [...]]]></description>
			<content:encoded><![CDATA[<p>I recently upgraded my home server from an old Athlon X2 to the latest and finest from intel, namely the new Sandy bridge processors. These new processors come with a relatively new technology called VT-d or (Intel Virtualisation Technology with Directed I/O). It&#8217;s also called an <a href="http://en.wikipedia.org/wiki/IOMMU">IOMMU</a>. This feature like the more common VT-x provides hardware support to improve virtualisation. VT-d does to PCI devices what VT-x does for the CPU, by virtualising and allowing remapping of the DMA. Basically, what it means is that you can now freely assign different PCI connected devices (like graphics card, USB host controllers) to your Virtual Machines. A use case would be to give a VM a real graphics card so it doesn&#8217;t have to rely on the slow virtualised graphics adapter.</p>
<p>It&#8217;s been a bit of a <a href="http://software.intel.com/en-us/forums/showpost.php?p=103250">mystery</a> whether VT-d is a CPU technology or a chipset/motherboard technology, but it&#8217;s clear that, like VT-x, you need both to know about this technology to work. Since the advent of i7s, various people have asking the support for this technology only to find that the main blocker is getting the right motherboard. Some lucky folks have gotten it as far back as dying days of the Core 2 era. Most i5s and i7s CPUs claim support for VT-d, however motherboards of P55 and H55 that support this was few and far between. The only sure way to find out if your motherboard supports it is if you find the option &#8220;Enable I/O Virtualisation&#8221; in the Advanced Features section of your BIOS. The situation markedly improved when P57 and H57 came about with MSI and Asus boards displaying the option. MSI&#8217;s <a href="http://www.msi.com/product/mb/H57M-ED65.html">H57M-ED65</a> is one such board. If you look at the downloadable <a href="http://www.msi.com/product/mb/H57M-ED65.html#/?div=Manual">manual</a>, you&#8217;ll find the reference. Gigabyte is noticeably quiet on the matter. Armed with this knowledge I went out assuming that newer boards will follow the trend. How wrong was I.</p>
<p>There are special Sandy Bridge CPUs in the form of 250K and 260K. The K CPUs have a higher clock for the graphics, but sacrifices VT-d technology. Fortunately this is widely understood and reported, unlike last generation when confusion between VT, VT-x and VT-d reigned. What they failed to clarify was that, VT-d is unavailable in pretty much all P67/H67 chipsets. This means nobody can actually use VT-d anyway regardless of whether the CPU supports it or not. In fact, I don&#8217;t even know why Intel bother listing VT-d as a feature when support is so poor. Currently, the only sandy bridge (LGA1155) motherboard in existence, that <a href="http://www.intel.com/support/motherboards/desktop/sb/CS-030922.htm">supports VT-d</a> is Intel&#8217;s <a href="http://ark.intel.com/Product.aspx?id=50244">DP67BG</a>. I of course didn&#8217;t buy that board and as I&#8217;m building a server, I required integrated graphics and P67 doesn&#8217;t offer that. Only H67 does. As far as I can tell no H67 motherboard currently in existence has VT-d.</p>
<p>Anyway, this is my rant of the night.</p>
]]></content:encoded>
			<wfw:commentRss>http://siphon9.net/loune/2011/01/sandy-bridge-woes-lga1155-p67h67-and-vt-d-io-virtualization/feed/</wfw:commentRss>
		<slash:comments>10</slash:comments>
		</item>
		<item>
		<title>Dictionary Model Binder in ASP.NET MVC2 and MVC3</title>
		<link>http://siphon9.net/loune/2010/11/dictionary-model-binder-in-asp-net-mvc2-and-mvc3/</link>
		<comments>http://siphon9.net/loune/2010/11/dictionary-model-binder-in-asp-net-mvc2-and-mvc3/#comments</comments>
		<pubDate>Sun, 14 Nov 2010 07:51:49 +0000</pubDate>
		<dc:creator>Loune</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[aspnetmvc]]></category>
		<category><![CDATA[dotnet]]></category>

		<guid isPermaLink="false">http://siphon9.net/loune/?p=157</guid>
		<description><![CDATA[In a decidedly typical turn of events, Microsoft changed the API of BindModel in ASP.NET MVC 2 such that it breaks DefaultDictionaryBinder. No longer can you enumerate through the ValueProvider, instead you can only Get a value which you know the name of. I&#8217;ve updated the code to work with MVC2 and also tested it [...]]]></description>
			<content:encoded><![CDATA[<p>In a decidedly typical turn of events, Microsoft changed the API of BindModel in ASP.NET MVC 2 such that it breaks <a href="http://siphon9.net/loune/2009/12/a-intuitive-dictionary-model-binder-for-asp-net-mvc/">DefaultDictionaryBinder</a>. No longer can you enumerate through the ValueProvider, instead you can only Get a value which you know the name of. I&#8217;ve updated the code to work with MVC2 and also tested it with the new <a href="http://weblogs.asp.net/scottgu/archive/2010/11/09/announcing-the-asp-net-mvc-3-release-candidate.aspx">MVC 3 RC</a>.</p>
<p>The code is compatible with ASP.NET MVC 1, 2 and 3. To use it for ASP.NET MVC 1, just set the conditional compiler directive <code>ASPNETMVC1</code> and it will enable the MVC 1 code, otherwise it will work with MVC version 2 and 3.</p>
<p>The code is now up at github: <a href="https://github.com/loune/MVCStuff/blob/master/Extensions/DefaultDictionaryBinder.cs">DefaultDictionaryBinder.cs</a>.</p>
<p>There&#8217;s also an example MVC3 project showing the basic functionality of the Dictionary Binder: <a href="https://github.com/loune/MVCStuff/tree/master/Mvc3DictionaryExample/">link</a></p>
]]></content:encoded>
			<wfw:commentRss>http://siphon9.net/loune/2010/11/dictionary-model-binder-in-asp-net-mvc2-and-mvc3/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>Why is syslog-ng taking up 100% of CPU inside a lxc container</title>
		<link>http://siphon9.net/loune/2010/10/why-is-syslog-ng-taking-up-100-of-cpu-inside-a-lxc-container/</link>
		<comments>http://siphon9.net/loune/2010/10/why-is-syslog-ng-taking-up-100-of-cpu-inside-a-lxc-container/#comments</comments>
		<pubDate>Tue, 19 Oct 2010 11:02:17 +0000</pubDate>
		<dc:creator>Loune</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[gentoo]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[lxc]]></category>

		<guid isPermaLink="false">http://siphon9.net/loune/?p=182</guid>
		<description><![CDATA[While experimenting with LXC, the linux virtual container, which by the way is shaping up to be a viable replacement for openvz, I ran into an annoying issue of syslog-ng taking up 100% of CPU time inside the container. Stumped, I tried to add the -d flag to the syslog command line, but it did [...]]]></description>
			<content:encoded><![CDATA[<p>While experimenting with <a href="http://lxc.sourceforge.net/">LXC</a>, the linux virtual container, which by the way is shaping up to be a viable replacement for openvz, I ran into an annoying issue of syslog-ng taking up 100% of CPU time inside the container. Stumped, I tried to add the -d flag to the syslog command line, but it did not yield any clues.</p>
<p>Armed with strace, and attaching to the rouge process, the following spat out of the console again and again.</p>
<pre>
gettimeofday({1287484365, 501293}, NULL) = 0
lseek(8, 0, SEEK_END)                   = -1 ESPIPE (Illegal seek)
write(8, "Oct 19 19:39:57 login[439"..., 105) = -1 EAGAIN (Resource temporarily unavailable)
</pre>
<p>The key lines were lseek and write, both trying to write to file descriptor 8. To find out what fd 8 was, all I had to do was <code>ls -al /proc/7411/fd/8</code> &#8211; The culprit was /dev/tty12. Now having looked into syslog-ng.conf, I was reminded of the fact that <code>By default messages are logged to tty12...</code>. So it seems, tty12 is somehow denying access to syslog. Being in LXC, I decided to check out tty12 by doing <code>lxc-console -n container -t 12</code>. To my surprise, syslog-ng was instantly unclogged as log messages were released into console. It looked as if the tty12 buffer was clogged up.</p>
<p>Regardless of the reason, the easy fix is to stop syslog-ng logging to tty12 as I&#8217;m never going look at that far away console. Commenting the console_all lines, all was fixed. This would probably never have happened if I had used metalog :/</p>
]]></content:encoded>
			<wfw:commentRss>http://siphon9.net/loune/2010/10/why-is-syslog-ng-taking-up-100-of-cpu-inside-a-lxc-container/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Qemu/KVM sometimes not registering Mouse Clicks when used over VNC</title>
		<link>http://siphon9.net/loune/2010/10/qemukvm-sometimes-not-registering-mouse-clicks-when-used-over-vnc/</link>
		<comments>http://siphon9.net/loune/2010/10/qemukvm-sometimes-not-registering-mouse-clicks-when-used-over-vnc/#comments</comments>
		<pubDate>Tue, 12 Oct 2010 09:05:42 +0000</pubDate>
		<dc:creator>Loune</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[kvm]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[qemu]]></category>
		<category><![CDATA[vnc]]></category>

		<guid isPermaLink="false">http://siphon9.net/loune/?p=177</guid>
		<description><![CDATA[After setting up Qemu/KVM and VNC and fixing cursor positioning issues (with the -usbtablet option), I had an annoying issue of the VNC viewer (TightVNC in this case) sometimes missing mouse clicks. You would quickly click on a button and icon and nothing would happen. If you hold it for long enough, it will eventually [...]]]></description>
			<content:encoded><![CDATA[<p>After setting up Qemu/KVM and VNC and fixing cursor positioning issues (with the -usbtablet option), I had an annoying issue of the VNC viewer (TightVNC in this case) sometimes missing mouse clicks. You would quickly click on a button and icon and nothing would happen. If you hold it for long enough, it will eventually register. I don&#8217;t want to be holding my button for a second to make sure every click regsiters though.</p>
<p>After fiddling around with the options, I finally found the culprit. The option inside the VNC viewer &#8220;Emulate 3-buttons (with 2-button click)&#8221; seems to be the cause. Turning it off seems to make my mouse clicks reliable. No idea why though.</p>
]]></content:encoded>
			<wfw:commentRss>http://siphon9.net/loune/2010/10/qemukvm-sometimes-not-registering-mouse-clicks-when-used-over-vnc/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Getting the version number of your own Chrome Extension</title>
		<link>http://siphon9.net/loune/2010/07/getting-the-version-number-of-your-own-chrome-extension/</link>
		<comments>http://siphon9.net/loune/2010/07/getting-the-version-number-of-your-own-chrome-extension/#comments</comments>
		<pubDate>Thu, 15 Jul 2010 12:58:06 +0000</pubDate>
		<dc:creator>Loune</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[chrome]]></category>
		<category><![CDATA[crx]]></category>

		<guid isPermaLink="false">http://siphon9.net/loune/?p=163</guid>
		<description><![CDATA[Following on from yesterday&#8217;s post about getting the version number of your own firefox extension, what if you were now developing a Google Chrome extension and want the same thing? Google Chrome&#8217;s extension API is much more limited that Firefox&#8217;s. There&#8217;s no explicit extension-metadata-getting API that I know of. However, we do know that the [...]]]></description>
			<content:encoded><![CDATA[<p>Following on from yesterday&#8217;s post about <a href="/loune/2010/07/getting-your-firefox-extension-version-number/">getting the version number</a> of your own firefox extension, what if you were now developing a Google Chrome extension and want the same thing? Google Chrome&#8217;s extension API is much more limited that Firefox&#8217;s. There&#8217;s no explicit extension-metadata-getting API that I know of. However, we do know that the version information is tucked away in manifest.json. With this knowledge and coupled with a few friendly APIs (XMLHttpRequest &#038; JSON.parse) we can now have the equivalent function for chrome:</p>
<pre class="brush: jscript; title: ; notranslate">
function getVersion(callback) {
        var xmlhttp = new XMLHttpRequest();
        xmlhttp.open('GET', 'manifest.json');
        xmlhttp.onload = function (e) {
            var manifest = JSON.parse(xmlhttp.responseText);
            callback(manifest.version);
        }
        xmlhttp.send(null);
}

// to use
var version;
getVersion(function (ver) { version = ver; });
// version is populated after an indeterminate amount of time
</pre>
<p>As XMLHttpRequest is asynchronous, our method needs a callback to receive the version information. You can also get whatever other information you want in your mainfest.json. So there you go.</p>
]]></content:encoded>
			<wfw:commentRss>http://siphon9.net/loune/2010/07/getting-the-version-number-of-your-own-chrome-extension/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>

