<?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>Dave's Occasional Brainfart</title>
	<atom:link href="http://blog.kayosdesign.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.kayosdesign.com</link>
	<description>Just another WordPress weblog</description>
	<lastBuildDate>Sat, 08 May 2010 07:21:39 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>Solar Panels</title>
		<link>http://blog.kayosdesign.com/2010/05/08/solar-panels/</link>
		<comments>http://blog.kayosdesign.com/2010/05/08/solar-panels/#comments</comments>
		<pubDate>Sat, 08 May 2010 07:21:39 +0000</pubDate>
		<dc:creator>Dave</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://blog.kayosdesign.com/?p=210</guid>
		<description><![CDATA[]]></description>
			<content:encoded><![CDATA[<p><a href="http://blog.kayosdesign.com/wp-content/uploads/2010/05/100_0328.jpg"><img class="aligncenter size-medium wp-image-207" title="17 Panels #1" src="http://blog.kayosdesign.com/wp-content/uploads/2010/05/100_0328-300x225.jpg" alt="" width="300" height="225" /></a></p>
<p><a href="http://blog.kayosdesign.com/wp-content/uploads/2010/05/100_0329.jpg"><img class="aligncenter size-medium wp-image-208" title="17 Panels #2" src="http://blog.kayosdesign.com/wp-content/uploads/2010/05/100_0329-300x225.jpg" alt="" width="300" height="225" /></a></p>
<p><a href="http://blog.kayosdesign.com/wp-content/uploads/2010/05/100_0329.jpg"></a><a href="http://blog.kayosdesign.com/wp-content/uploads/2010/05/100_0330.jpg"><img class="aligncenter size-medium wp-image-209" title="17 Panels #3" src="http://blog.kayosdesign.com/wp-content/uploads/2010/05/100_0330-300x225.jpg" alt="" width="300" height="225" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.kayosdesign.com/2010/05/08/solar-panels/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Snakes revisited</title>
		<link>http://blog.kayosdesign.com/2010/04/27/snakes-revisited/</link>
		<comments>http://blog.kayosdesign.com/2010/04/27/snakes-revisited/#comments</comments>
		<pubDate>Tue, 27 Apr 2010 01:05:17 +0000</pubDate>
		<dc:creator>Dave</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://blog.kayosdesign.com/?p=203</guid>
		<description><![CDATA[Had the trees along the side of my house cut down and the guys doing the work brought me these as presents Picture doesn&#8217;t show it too clearly, but they are all from different snakes. The scales and size change in each one.]]></description>
			<content:encoded><![CDATA[<p>Had the trees along the side of my house cut down and the guys doing the work brought me these as presents</p>
<div id="attachment_204" class="wp-caption aligncenter" style="width: 310px"><a href="http://blog.kayosdesign.com/wp-content/uploads/2010/04/100_0322.jpg"><img class="size-medium wp-image-204" title="Skins" src="http://blog.kayosdesign.com/wp-content/uploads/2010/04/100_0322-300x225.jpg" alt="" width="300" height="225" /></a><p class="wp-caption-text">Three different snake skins - peg for scale.</p></div>
<p>Picture doesn&#8217;t show it too clearly, but they are all from different snakes. The scales and size change in each one.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.kayosdesign.com/2010/04/27/snakes-revisited/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>HTPC</title>
		<link>http://blog.kayosdesign.com/2010/04/26/htpc/</link>
		<comments>http://blog.kayosdesign.com/2010/04/26/htpc/#comments</comments>
		<pubDate>Mon, 26 Apr 2010 08:56:44 +0000</pubDate>
		<dc:creator>Dave</dc:creator>
				<category><![CDATA[Hardware]]></category>
		<category><![CDATA[Toys]]></category>

		<guid isPermaLink="false">http://blog.kayosdesign.com/?p=189</guid>
		<description><![CDATA[There are too many choices for a HTPC. I already have RAM &#38; SATA HDD so they are not included. Will probably get an SSD for the box at a later date. Have narrowed it down to the following Shiny Case Remote - Logitech Harmony 785 Advanced Universal Remote http://www.logitech.com/en-nz/remotes/universal_remotes/devices/370 U Keyboard - Logitech diNovo [...]]]></description>
			<content:encoded><![CDATA[<p>There are too many choices for a HTPC.</p>
<p>I already have RAM &amp; SATA HDD so they are not included. Will probably get an SSD for the box at a later date.</p>
<p>Have narrowed it down to the following</p>
<h2>Shiny Case</h2>
<p><strong>Remote </strong>- Logitech Harmony 785 Advanced Universal Remote</p>
<p><a href="http://www.logitech.com/en-nz/remotes/universal_remotes/devices/370">http://www.logitech.com/en-nz/remotes/universal_remotes/devices/370</a> <a href="http://www.umart.com.au/pro/products_listnew.phtml?id=10&amp;id2=&amp;&amp;bid=5&amp;sid=21250">U</a></p>
<p><strong>Keyboard </strong>- Logitech diNovo Cordless Mini Keyboard</p>
<p><a href="http://www.logitech.com/en-au/keyboards/keyboard/devices/3848">http://www.logitech.com/en-au/keyboards/keyboard/devices/3848</a> <a href="http://www.umart.com.au/pro/products_listnew.phtml?id=10&amp;id2=40&amp;bid=5&amp;sid=30535">U</a></p>
<p><strong>Case </strong>- Silverstone ML02B-MXR Slim MoDT Case</p>
<p><a href="http://www.silverstonetek.com/products/p_spec.php?pno=ml02&amp;area=usa" target="_blank">http://www.silverstonetek.com/products/p_spec.php?pno=ml02&amp;area=usa</a> <a href="http://www.umart.com.au/pro/products_listnew.phtml?id=10&amp;id2=139&amp;bid=5&amp;sid=31638" target="_blank">U</a></p>
<p><strong>Motherboard </strong>- Zotac IONITX-F-E ION N330 Dual Core PCIE</p>
<p><a href="http://www.zotacusa.com/zotac-ionitx-f-e-atom-n330-1-6ghz-dual-core-mini-itx-intel-motherboard.html" target="_blank">http://www.zotacusa.com/zotac-ionitx-f-e-atom-n330-1-6ghz-dual-core-mini-itx-intel-motherboard.html</a> <a href="http://www.umart.com.au/pro/products_listnew.phtml?id=10&amp;id2=107&amp;bid=5&amp;sid=51247" target="_blank">U</a></p>
<p><strong>Optical Drive</strong> &#8211; SONY AD7590S SATA Internal Slim DVD Burner(OEM) <a href="http://www.umart.com.au/pro/products_listnew.phtml?id=10&amp;id2=20&amp;bid=5&amp;sid=47239" target="_blank">U</a></p>
<p><strong>Tuner </strong>- Leadtek PCI-E PxDVR3200H Hybrid TV Tuner HDTV/AC3</p>
<p><a href="http://www.leadtek.com/eng/tv_tuner/overview.asp?lineid=6&amp;pronameid=377" target="_blank">http://www.leadtek.com/eng/tv_tuner/overview.asp?lineid=6&amp;pronameid=377</a> <a href="http://www.umart.com.au/pro/products_listnew.phtml?id=10&amp;id2=&amp;&amp;bid=5&amp;sid=31547" target="_blank">U</a></p>
<p><span style="text-decoration: underline;">Total Price &#8211; $1013</span></p>
<h2>Cheaper Alternative</h2>
<p>Replace the Case/Motherboard/ODD &amp; Tuner with a<br />
<strong></strong></p>
<p><strong>Case </strong>- ASRock ION330 NV ION GBL DVDRW HDMI BK</p>
<p><a href="http://www.asrock.com/nettop/spec/ion%20330.asp" target="_blank">http://www.asrock.com/nettop/spec/ion%20330.asp</a> <a href="http://www.umart.com.au/pro/products_listnew.phtml?id=10&amp;id2=70&amp;bid=5&amp;sid=52975" target="_blank">U</a></p>
<p><strong>Tuner </strong>- KWorld TV Tuner DVB-T HDTV USB <a href="http://www.umart.com.au/pro/products_listnew.phtml?id=10&amp;id2=&amp;&amp;bid=5&amp;sid=47758" target="_blank">U</a></p>
<p>Brings the price down to <span style="text-decoration: underline;">$628.00</span></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.kayosdesign.com/2010/04/26/htpc/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Solar Hot Water</title>
		<link>http://blog.kayosdesign.com/2010/03/22/solar-hot-water/</link>
		<comments>http://blog.kayosdesign.com/2010/03/22/solar-hot-water/#comments</comments>
		<pubDate>Mon, 22 Mar 2010 05:25:33 +0000</pubDate>
		<dc:creator>Dave</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://blog.kayosdesign.com/?p=163</guid>
		<description><![CDATA[Had solar hotwater installed today. With a Hills Solar 22 tube solar tube collector and a 250L tank. Theoretically we should reduce our power usage by ~40% according to the literature. Only time will tell.]]></description>
			<content:encoded><![CDATA[<p>Had solar hotwater installed today.</p>
<p style="text-align: center;"><img src="http://blog.kayosdesign.com/wp-content/uploads/2010/03/Tubes4-300x225.jpg" alt="" width="300" height="225" /> <img src="http://blog.kayosdesign.com/wp-content/uploads/2010/03/Tank4-225x300.jpg" alt="" width="225" height="300" /></p>
<p>With a Hills Solar <a href="http://www.hillssolar.com/arbitrage/pages/95" target="_blank">22 tube solar tube collector</a> and a 250L tank. Theoretically we should reduce our power usage by ~40% according to the literature. Only time will tell.</p>
<div id="attachment_164" class="wp-caption aligncenter" style="width: 310px"><a href="http://blog.kayosdesign.com/wp-content/uploads/2010/03/Manifold1.jpg"><img class="size-medium wp-image-164" title="Installing the manifold." src="http://blog.kayosdesign.com/wp-content/uploads/2010/03/Manifold1-300x225.jpg" alt="Installing the manifold." width="300" height="225" /></a><p class="wp-caption-text">Installing the manifold.</p></div>
<div id="attachment_165" class="wp-caption aligncenter" style="width: 310px"><a href="http://blog.kayosdesign.com/wp-content/uploads/2010/03/Manifold2.jpg"><img class="size-medium wp-image-165" title="The manifold installed." src="http://blog.kayosdesign.com/wp-content/uploads/2010/03/Manifold2-300x225.jpg" alt="" width="300" height="225" /></a><p class="wp-caption-text">The manifold installed.</p></div>
<div id="attachment_168" class="wp-caption aligncenter" style="width: 310px"><a href="http://blog.kayosdesign.com/wp-content/uploads/2010/03/Manifold5.jpg"><img class="size-medium wp-image-168" title="Installing the tubes" src="http://blog.kayosdesign.com/wp-content/uploads/2010/03/Manifold5-300x225.jpg" alt="" width="300" height="225" /></a><p class="wp-caption-text">Installing the tubes</p></div>
<div id="attachment_167" class="wp-caption aligncenter" style="width: 310px"><a href="http://blog.kayosdesign.com/wp-content/uploads/2010/03/Manifold4.jpg"><img class="size-medium wp-image-167" title="Installing the tubes" src="http://blog.kayosdesign.com/wp-content/uploads/2010/03/Manifold4-300x225.jpg" alt="" width="300" height="225" /></a><p class="wp-caption-text">Installing the tubes</p></div>
<div id="attachment_175" class="wp-caption aligncenter" style="width: 310px"><a href="http://blog.kayosdesign.com/wp-content/uploads/2010/03/Tubes4.jpg"><img class="size-medium wp-image-175" title="The tubes" src="http://blog.kayosdesign.com/wp-content/uploads/2010/03/Tubes4-300x225.jpg" alt="" width="300" height="225" /></a><p class="wp-caption-text">The tubes</p></div>
<div id="attachment_174" class="wp-caption aligncenter" style="width: 310px"><a href="http://blog.kayosdesign.com/wp-content/uploads/2010/03/Tubes3.jpg"><img class="size-medium wp-image-174" title="The tubes" src="http://blog.kayosdesign.com/wp-content/uploads/2010/03/Tubes3-300x225.jpg" alt="" width="300" height="225" /></a><p class="wp-caption-text">The tubes</p></div>
<div id="attachment_176" class="wp-caption aligncenter" style="width: 310px"><a href="http://blog.kayosdesign.com/wp-content/uploads/2010/03/Tubes5.jpg"><img class="size-medium wp-image-176" title="The tubes" src="http://blog.kayosdesign.com/wp-content/uploads/2010/03/Tubes5-300x225.jpg" alt="" width="300" height="225" /></a><p class="wp-caption-text">The tubes</p></div>
<div id="attachment_169" class="wp-caption aligncenter" style="width: 235px"><a href="http://blog.kayosdesign.com/wp-content/uploads/2010/03/Tank1.jpg"><img class="size-medium wp-image-169" title="The tank arrives" src="http://blog.kayosdesign.com/wp-content/uploads/2010/03/Tank1-225x300.jpg" alt="" width="225" height="300" /></a><p class="wp-caption-text">The tank arrives</p></div>
<div id="attachment_170" class="wp-caption aligncenter" style="width: 235px"><a href="http://blog.kayosdesign.com/wp-content/uploads/2010/03/Tank2.jpg"><img class="size-medium wp-image-170" title="Installing the tank" src="http://blog.kayosdesign.com/wp-content/uploads/2010/03/Tank2-225x300.jpg" alt="" width="225" height="300" /></a><p class="wp-caption-text">Installing the tank</p></div>
<div id="attachment_172" class="wp-caption aligncenter" style="width: 235px"><a href="http://blog.kayosdesign.com/wp-content/uploads/2010/03/Tank4.jpg"><img class="size-medium wp-image-172" title="The finished tank" src="http://blog.kayosdesign.com/wp-content/uploads/2010/03/Tank4-225x300.jpg" alt="" width="225" height="300" /></a><p class="wp-caption-text">The finished tank</p></div>
<p style="text-align: center;">
]]></content:encoded>
			<wfw:commentRss>http://blog.kayosdesign.com/2010/03/22/solar-hot-water/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Openfire/Jabber/FreePBX integration #2</title>
		<link>http://blog.kayosdesign.com/2010/01/06/openfirejabberfreepbx-integration-2/</link>
		<comments>http://blog.kayosdesign.com/2010/01/06/openfirejabberfreepbx-integration-2/#comments</comments>
		<pubDate>Wed, 06 Jan 2010 06:55:06 +0000</pubDate>
		<dc:creator>Dave</dc:creator>
				<category><![CDATA[Asterisk]]></category>
		<category><![CDATA[FreePBX]]></category>
		<category><![CDATA[Openfire]]></category>
		<category><![CDATA[VoIP]]></category>

		<guid isPermaLink="false">http://blog.kayosdesign.com/?p=133</guid>
		<description><![CDATA[Having played some more I&#8217;ve come up with the following solution &#8211; I&#8217;m not overly happy with it but it allows me to get what I wanted. All of the following occurs in extensions_override_freepbx.conf NOTE: This assumes you have gotten the Openfire Asterisk-IM plugin working and that you have jabber.conf configured correctly to talk to [...]]]></description>
			<content:encoded><![CDATA[<p>Having played some more I&#8217;ve come up with the following solution &#8211; I&#8217;m not overly happy with it but it allows me to get what I wanted.<br />
All of the following occurs in extensions_override_freepbx.conf<br />
<strong>NOTE:</strong> This assumes you have gotten the <a href="/category/linux/openfire/" title="View all posts filed under Openfire">Openfire</a> <a href="/category/voip/asterisk/" title="View all posts filed under Asterisk">Asterisk</a>-IM plugin working and that you have jabber.conf configured correctly to talk to your openfire server.</p>
<h3><a href="/category/voip/asterisk/" title="View all posts filed under Asterisk">Asterisk</a> obeying <a href="/category/linux/openfire/" title="View all posts filed under Openfire">Openfire</a> Status</h3>
<p>eg. When you mark yourself as away/DND inbound calls will be directed to Voicemail.</p>
<p>This inserts itself into the standard <a href="/category/voip/asterisk/freepbx/" title="View all posts filed under FreePBX">FreePBX</a> call queue for internal calls. I haven&#8217;t got an inbound link setup yet so I haven&#8217;t figured out how to get that bit working.</p>
<p>The jabber-notify block must contain every extension in the system this is to work on. It could be altered to return to the normal call path if a desired extension isn&#8217;t in the list &#8211; but I haven&#8217;t implemented that.</p>
<p>Basically a call to an extension picks up the appropriate jabber information and runs the macro &#8220;reach_user_with_presence&#8221;. There is probably some way to hook this into a db/ldap server so you don&#8217;t have to enter everyone in manually.</p>
<p>This then checks the users jabber status and if they are not available it jumps to their voicemail. Else it returns to the normal call path.</p>
<pre lang="bash">[from-internal]
include =&gt; jabber-notify

[jabber-notify]
;include =&gt; macro-reach_user_with_presence
exten =&gt; 10,1,Macro(reach_user_with_presence,user10@jabber.kayosdesign.com,${EXTEN})
exten =&gt; 11,1,Macro(reach_user_with_presence,user20@jabber.kayosdesign.com,${EXTEN})
exten =&gt; 12,1,Macro(reach_user_with_presence,user30@jabber.kayosdesign.com,${EXTEN})
exten =&gt; 13,1,Macro(reach_user_with_presence,user40@jabber.kayosdesign.com,${EXTEN})

[from-internal-original]
include =&gt; from-internal-xfer
include =&gt; bad-number

[macro-reach_user_with_presence]
; ${ARG1} is a jabber address such as test@jabber.server
; ${ARG2} is the voicemail box of the user

exten =&gt; s,1,jabberstatus(asterisk,${ARG1},STATUS)
;presence in will be 1-6.
;In order : Online, Chatty, Away, XAway, DND, Offline
;If not in roster variable will = 7
exten =&gt; s,n,gotoif($[$[${STATUS}]&lt;3]?available:unavailable) ;GotoIf(condition?label_if_true:label_if_false) ;exten =&gt; s,n(available),jabbersend(asterisk,${ARG2},"Call from ${CALLERID(name)} at number ${CALLERID(num)} on ${STRFTIME(,GMT-1,%A %B %d %G at %l:%M:%S %p)}")
exten =&gt; s,n(available),Goto(from-internal-original,${ARG2},1)
exten =&gt; s,n(unavailable),VoiceMail(${ARG2},u)
exten =&gt; s,1,Goto(from-internal-original,s,1)
exten =&gt; h,1,Macro(hangupcall)</pre>
<h3>Call groups being notified by jabber for inbound calls.</h3>
<p>We utilise the Counterpath Bria softphone. It&#8217;s a bit stupid and does not follow ALERT notifications such as  different ring tones.  As such there is no way for a user to know if an inbound call is implicitely for them or if it is coming in on the call group.</p>
<p>As such I hooked <a href="/category/voip/asterisk/" title="View all posts filed under Asterisk">Asterisk</a> into jabber to broadcast a message to all people in the call group. I don&#8217;t particularly like this as you cannot create call groups dynamically using the <a href="/category/voip/asterisk/freepbx/" title="View all posts filed under FreePBX">FreePBX</a> interface. If you do create one you <span style="text-decoration: underline;">MUST</span> rebuild this section appropriately. Basically all it does is override the default settings and sends out an IM to everyone listed (you have to add each individual in the group to the ext-group section), after that it returns to the setup created by <a href="/category/voip/asterisk/freepbx/" title="View all posts filed under FreePBX">FreePBX</a>.</p>
<pre>[ext-group]
exten =&gt; 330,1,jabbersend(asterisk,user10@jabber.kayosdesign.com,"Group call")
exten =&gt; 330,n,jabbersend(asterisk,user20@jabber.kayosdesign.com,"Group call")

exten =&gt; 330,n,Goto(ext-group-original,330,1)

[ext-group-original]
exten =&gt; 330,1,Macro(user-callerid,)
exten =&gt; 330,n,GotoIf($["foo${BLKVM_OVERRIDE}" = "foo"]?skipdb)
exten =&gt; 330,n,GotoIf($["${DB(${BLKVM_OVERRIDE})}" = "TRUE"]?skipov)
exten =&gt; 330,n(skipdb),Set(__NODEST=)
exten =&gt; 330,n,Set(__BLKVM_OVERRIDE=BLKVM/${EXTEN}/${CHANNEL})
exten =&gt; 330,n,Set(__BLKVM_BASE=${EXTEN})
exten =&gt; 330,n,Set(DB(${BLKVM_OVERRIDE})=TRUE)
exten =&gt; 330,n(skipov),Set(RRNODEST=${NODEST})
exten =&gt; 330,n(skipvmblk),Set(__NODEST=${EXTEN})
exten =&gt; 330,n,Set(RecordMethod=Group)
exten =&gt; 330,n,Macro(record-enable,11-13,${RecordMethod})
exten =&gt; 330,n,Set(RingGroupMethod=ringall)
exten =&gt; 330,n,Set(__ALERT_INFO='\\;info=ring_two')

exten =&gt; 330,n(DIALGRP),Macro(dial,20,${DIAL_OPTIONS},11-13)
exten =&gt; 330,n,Set(RingGroupMethod=)
exten =&gt; 330,n,GotoIf($["foo${RRNODEST}" != "foo"]?nodest)
exten =&gt; 330,n,Set(__NODEST=)
exten =&gt; 330,n,dbDel(${BLKVM_OVERRIDE})
exten =&gt; 330,n,Hangup
exten =&gt; 330,n(nodest),Noop(SKIPPING DEST, CALL CAME FROM Q/RG: ${RRNODEST})</pre>
]]></content:encoded>
			<wfw:commentRss>http://blog.kayosdesign.com/2010/01/06/openfirejabberfreepbx-integration-2/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>OpenLDAP &amp; Ubuntu Karmic for an LDAP Addressbook</title>
		<link>http://blog.kayosdesign.com/2010/01/06/openldap-ubuntu-karmic-for-an-ldap-addressbook/</link>
		<comments>http://blog.kayosdesign.com/2010/01/06/openldap-ubuntu-karmic-for-an-ldap-addressbook/#comments</comments>
		<pubDate>Wed, 06 Jan 2010 06:27:13 +0000</pubDate>
		<dc:creator>Dave</dc:creator>
				<category><![CDATA[Karmic Koala]]></category>
		<category><![CDATA[OpenLDAP]]></category>

		<guid isPermaLink="false">http://blog.kayosdesign.com/?p=125</guid>
		<description><![CDATA[With the advent of Ubuntu Karmic setting up OpenLDAP has gotten stupid and difficult. Below are the steps I used to get OpenLDAP working as an LDAP addressbook. NOTE: Change the domain to something appropriate for you. NOTE: This is not a step by step instruction manual. It&#8217;s for my edification so I can figure [...]]]></description>
			<content:encoded><![CDATA[<p>With the advent of <a href="/category/linux/ubuntu/" title="View all posts filed under Ubuntu">Ubuntu</a> Karmic setting up <a href="/category/linux/openldap/" title="View all posts filed under OpenLDAP">OpenLDAP</a> has gotten stupid and difficult.</p>
<p>Below are the steps I used to get <a href="/category/linux/openldap/" title="View all posts filed under OpenLDAP">OpenLDAP</a> working as an LDAP addressbook.</p>
<p><strong>NOTE:</strong> Change the domain to something appropriate for you.</p>
<p><strong>NOTE:</strong> This is not a step by step instruction manual. It&#8217;s for my edification so I can figure it out again later without perusing 30 odd different sites. It will require some thought and intelligence to use.</p>
<hr />
First start off by installing <a href="/category/linux/openldap/" title="View all posts filed under OpenLDAP">OpenLDAP</a></p>
<pre>apt-get install slapd ldap-utils</pre>
<p>This results in a basic setup of <a href="/category/linux/openldap/" title="View all posts filed under OpenLDAP">OpenLDAP</a> with bugger all configured, even the old school slapd.conf is missing. You need to install all the extra schemas and set up passwords yourself as the installer does nothing at all.</p>
<p>Next install some schemas</p>
<pre>ldapadd -Y EXTERNAL -H ldapi:/// -f /etc/ldap/schema/cosine.ldif
ldapadd -Y EXTERNAL -H ldapi:/// -f /etc/ldap/schema/inetorgperson.ldif
ldapadd -Y EXTERNAL -H ldapi:/// -f /etc/ldap/schema/nis.ldif</pre>
<p>NIS can be left out if you don&#8217;t intend on using the LDAP server for authentication.</p>
<p>The following ldif contains all the configuration to get a new database up and running, stash it in a file somewhere.</p>
<p>If you are not using NIS then leave out the shadowLastChange attribute. Also set the passwords to whatever you want using the slappasswd tool, or you can probably type a password in cleartext.</p>
<pre>
###########################################################
# DATABASE SETUP
###########################################################
# Load modules for database type
dn: cn=module{0},cn=config
objectClass: olcModuleList
cn: module{0}
olcModulePath: /usr/lib/ldap
olcModuleLoad: {0}back_hdb

# Create directory database
dn: olcDatabase=hdb,cn=config
objectClass: olcDatabaseConfig
objectClass: olcHdbConfig
olcDatabase: hdb
olcDbDirectory: /var/lib/ldap
olcSuffix: dc=kayosdesign,dc=com
olcRootDN: cn=admin,dc=kayosdesign,dc=com
olcRootPW: {SSHA}8QDckoodrIsXgv/BG43Hf5WAbgmzZYEf
olcAccess: {0}to attrs=userPassword,shadowLastChange by dn="cn=admin,dc=kayosdesign,dc=com" write by anonymous auth by self write by * none
olcAccess: {1}to dn.base="" by * read
olcAccess: {2}to * by dn="cn=admin,dc=kayosdesign,dc=com" write by * read
olcLastMod: TRUE
olcDbCheckpoint: 512 30
olcDbConfig: {0}set_cachesize 0 2097152 0
olcDbConfig: {1}set_lk_max_objects 1500
olcDbConfig: {2}set_lk_max_locks 1500
olcDbConfig: {3}set_lk_max_lockers 1500
olcDbIndex: uid pres,eq
olcDbIndex: cn,sn,mail pres,eq,approx,sub
olcDbIndex: objectClass eq

##########################################################
# DEFAULTS MODIFICATION
###########################################################
# Some of the defaults need to be modified in order to allow
# remote access to the LDAP config. Otherwise only root
# will have administrative access.
dn: cn=config
changetype: modify
delete: olcAuthzRegexp

dn: olcDatabase={-1}frontend,cn=config
changetype: modify
delete: olcAccess

dn: olcDatabase={0}config,cn=config
changetype: modify
add: olcRootPW
olcRootPW: {SSHA}8QDckoodrIsXgv/BG43Hf5WAbgmzZYEf

dn: olcDatabase={0}config,cn=config
changetype: modify
delete: olcAccess
</pre>
<p>Install this by using</p>
<pre>ldapadd -Y EXTERNAL -H ldapi:/// -f /root/db.ldif</pre>
<p>Now create an ldif for an admin user</p>
<pre>
# Root of the LDAP tree
dn: dc=kayosdesign,dc=com
objectClass: dcObject
objectClass: organization
o: kayosdesign.com
dc: kayosdesign
description: Tree Root

#LDAP admin
dn: cn=admin,dc=kayosdesign,dc=com
objectClass: simpleSecurityObject
objectClass: organizationalRole
cn: admin
userPassword: {SSHA}8QDckoodrIsXgv/BG43Hf5WAbgmzZYEf
description: LDAP administrator account</pre>
<p>Insert this into the directory with the following</p>
<pre>
ldapadd -x -D cn=admin,dc=home,dc=com -W -f /root/base.ldif
</pre>
<p>You should now be able to search the directory</p>
<pre>ldapsearch -xLLL -b cn=config -D cn=admin,cn=config -W
ldapsearch -xLLL -b cn=config -D cn=admin,cn=config -W olcDatabase={1}hdb
ldapsearch -xLLL -b dc=home,dc=com</pre>
<p>Once the above is working you can now move on to creating the Addressbook.</p>
<p>Create yet another ldif file with data such as</p>
<pre># Addressbook branch
dn: ou=addressbook,dc=kayosdesign,dc=com
objectClass: organizationalUnit
ou: addressbook
description: LDAP Addressbook

# Addressbook entry
dn: cn=Test Account+mail=test@kayosdesign.com,ou=addressbook,dc=kayosdesign,dc=com
objectClass: person
objectClass: organizationalPerson
objectClass: inetOrgPerson
givenName: Test
sn: Account
cn: Test Account
mail: test@kayosdesign.com
homePhone: 1234567
telephoneNumber: 76543421
fax: 01928374
mobile: 44556677
street: 1 Street
l: MyTown
st: MyState
postalCode: 666
title: Grand Poo Bah
o: Snorks Anonymous</pre>
<p>Insert the entry into the directory with the following</p>
<pre>ldapadd -x -D cn=admin,dc=kayosdesign,dc=com -W -f /root/addressbook.ldif</pre>
<p>You can now hook whatever addressbook system you want into the LDAP server using the BaseDN</p>
<pre>ou=addressbook,dc=kayosdesign,dc=com</pre>
]]></content:encoded>
			<wfw:commentRss>http://blog.kayosdesign.com/2010/01/06/openldap-ubuntu-karmic-for-an-ldap-addressbook/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Torchlight Gems</title>
		<link>http://blog.kayosdesign.com/2010/01/05/torchlightgems/</link>
		<comments>http://blog.kayosdesign.com/2010/01/05/torchlightgems/#comments</comments>
		<pubDate>Tue, 05 Jan 2010 06:14:02 +0000</pubDate>
		<dc:creator>Dave</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://blog.kayosdesign.com/?p=116</guid>
		<description><![CDATA[I spent too much time playing Torchlight Below is a table showing all the different socketable gems that can be upgraded. td { border: 1px solid black; } Deep Flow Pure Life Eyeball Core Fire Cold Skull Cracked 1 Armor Degraded/+2 Dexterity +3 Electric Damage/+2 Electrical Resistance +4 Damage/+3 Armor +3 Poison Damage/+2 Poison Resistance [...]]]></description>
			<content:encoded><![CDATA[<p>I spent too much time playing Torchlight</p>
<p>Below is a table showing all the different socketable gems that can be upgraded.</p>
<style>td { border: 1px solid black; }</style>
<table style="font-size: 50%; text-align: left; border: 1px solid black;">
<tbody>
<tr>
<td></td>
<td>Deep</td>
<td>Flow</td>
<td>Pure</td>
<td>Life</td>
<td>Eyeball</td>
<td>Core</td>
<td>Fire</td>
<td>Cold</td>
<td>Skull</td>
</tr>
<tr>
<td>Cracked</td>
<td>1 Armor Degraded/+2 Dexterity</td>
<td>+3 Electric Damage/+2 Electrical Resistance</td>
<td>+4 Damage/+3 Armor</td>
<td>+3 Poison Damage/+2 Poison Resistance</td>
<td>2 Mana Stolen/+2 Magic</td>
<td>2 Health per Second/+2 Strength</td>
<td>+3 Fire Damage/+3 Fire Resistance</td>
<td>+3 Ice Damage/+3 Ice Resistance</td>
<td>1 Health Stolen/+2 Defense</td>
</tr>
<tr>
<td>Dull</td>
<td>3 Armor Degraded/+3 Dexterity</td>
<td>+6 Electric Damage/+4 Electrical Resistance</td>
<td>+9 Damage/+5 Armor</td>
<td>+6 Poison Damage/+4 Poison Resistance</td>
<td>3 Mana Stolen/+3 Magic</td>
<td>4 Health per Second/+3 Strength</td>
<td>+6 Fire Damage/+4 Fire Resistance</td>
<td>+6 Ice Damage/+4 Ice Resistance</td>
<td>5 Health Stolen/+3 Defense</td>
</tr>
<tr>
<td>Discoloured</td>
<td>6 Armor Degraded/+4 Dexterity</td>
<td>+9 Electric Damage/+7 Electrical Resistance</td>
<td>+14 Damage/+9 Armor</td>
<td>+9 Poison Damage/+7 Poison Resistance</td>
<td>5 Mana Stolen/+4 Magic</td>
<td>6 Health per Second/+4 Strength</td>
<td>+9 Fire Damage/+7 Fire Resistance</td>
<td>+9 Ice Damage/+7 Ice Resistance</td>
<td>10 Health Stolen/+4 Defense</td>
</tr>
<tr>
<td>-</td>
<td>10 Armor Degraded/+5 Dexterity</td>
<td>+12 Electric Damage/+10 Electrical Resistance</td>
<td>+18 Damage/+12 Armor</td>
<td>+12 Poison Damage/+10 Poison Resistance</td>
<td>6 Mana Stolen/+5 Magic</td>
<td>8 Health per Second/+5 Strength</td>
<td>+12 Fire Damage/+10 Fire Resistance</td>
<td>+12 Ice Damage/+10 Ice Resistance</td>
<td>14 Health Stolen/+5 Defense</td>
</tr>
<tr>
<td>Cut</td>
<td>14 Armor Degraded/+6 Dexterity</td>
<td>+16 Electric Damage/+13 Electrical Resistance</td>
<td>+24 Damage/+16 Armor</td>
<td>+16 Poison Damage/+13 Poison Resistance</td>
<td>8 Mana Stolen/+6 Magic</td>
<td>10 Health per Second/+6 Strength</td>
<td>+16 Fire Damage/+13 Fire Resistance</td>
<td>+16 Ice Damage/+13 Ice Resistance</td>
<td>19 Health Stolen/+6 Defense</td>
</tr>
<tr>
<td>Polished</td>
<td>19 Armor Degraded/+7 Dexterity</td>
<td>+19 Electric Damage/+15 Electrical Resistance</td>
<td>+28 Damage/+19 Armor</td>
<td>+19 Poison Damage/+15 Poison Resistance</td>
<td>9 Mana Stolen/+7 Magic</td>
<td>11 Health per Second/+7 Strength</td>
<td>+19 Fire Damage/+15 Fire Resistance</td>
<td>+19 Ice Damage/+15 Ice Resistance</td>
<td>23 Health Stolen/+7 Defense</td>
</tr>
<tr>
<td>Star</td>
<td>25 Armor Degraded/+9 Dexterity</td>
<td>+22 Electric Damage/+19 Electrical Resistance</td>
<td>+33 Damage/+23 Armor</td>
<td>+22 Poison Damage/+19 Poison Resistance</td>
<td>11 Mana Stolen/+9 Magic</td>
<td>13 Health per Second/+9 Strength</td>
<td>+22 Fire Damage/+19 Fire Resistance</td>
<td>+22 Ice Damage/+19 Ice Resistance</td>
<td>28 Health Stolen/+9 Defense</td>
</tr>
<tr>
<td>Flawless</td>
<td>31 Armor Degraded/+10 Dexterity</td>
<td>+25 Electric Damage/+21 Electrical Resistance</td>
<td>+38 Damage/+26 Armor</td>
<td>+25 Poison Damage/+21 Poison Resistance</td>
<td>12 Mana Stolen/+10 Magic</td>
<td>15 Health per Second/+10 Strength</td>
<td>+25 Fire Damage/+21 Fire Resistance</td>
<td>+25 Ice Damage/+21 Ice Resistance</td>
<td>32 Health Stolen/+10 Defense</td>
</tr>
<tr>
<td>Perfected</td>
<td>39 Armor Degraded/+11 Dexterity</td>
<td>+29 Electric Damage/+24 Electrical Resistance</td>
<td>+43 Damage/+30 Armor</td>
<td>+29 Poison Damage/+24 Poison Resistance</td>
<td>14 Mana Stolen/+11 Magic</td>
<td>17 Health per Second/+11 Strength</td>
<td>+29 Fire Damage/+24 Fire Resistance</td>
<td>+29 Ice Damage/+24 Ice Resistance</td>
<td>37 Health Stolen/+11 Defense</td>
</tr>
<tr>
<td>Named</td>
<td>48 Armor Degraded/+12 Dexterity</td>
<td>+33 Electric Damage/+28 Electrical Resistance</td>
<td>+49 Damage/+34 Armor</td>
<td>+33 Poison Damage/+28 Poison Resistance</td>
<td>15 Mana Stolen/+12 Magic</td>
<td>19 Health per Second/+12 Strength</td>
<td>+33 Fire Damage/+28 Fire Resistance</td>
<td>+33 Ice Damage/+28 Ice Resistance</td>
<td>42 Health Stolen/+12 Defense</td>
</tr>
<tr>
<td></td>
<td>The Grand Depths Ember Shard</td>
<td>The Eternal Flow-Ember Shard</td>
<td>The Infinite Pure Ember Shard</td>
<td>The Spire City Life Ember Shard</td>
<td>Etlitch&#8217;s Eyeball</td>
<td>The Sea Kings Core Ember Shard</td>
<td>The Fire Queen Fire Ember Shard</td>
<td>The Earthstar Cold Ember Shard</td>
<td>The Pirates Skull</td>
</tr>
</tbody>
</table>
]]></content:encoded>
			<wfw:commentRss>http://blog.kayosdesign.com/2010/01/05/torchlightgems/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Asterisk &#8211; Jabber integration</title>
		<link>http://blog.kayosdesign.com/2009/12/31/asterisk-jabber-integration/</link>
		<comments>http://blog.kayosdesign.com/2009/12/31/asterisk-jabber-integration/#comments</comments>
		<pubDate>Thu, 31 Dec 2009 00:03:33 +0000</pubDate>
		<dc:creator>Dave</dc:creator>
				<category><![CDATA[Asterisk]]></category>
		<category><![CDATA[FreePBX]]></category>
		<category><![CDATA[Openfire]]></category>
		<category><![CDATA[VoIP]]></category>

		<guid isPermaLink="false">http://blog.kayosdesign.com/?p=112</guid>
		<description><![CDATA[I have a test server running Asterisk &#38; Openfire. Integrating Openfire to Asterisk was pretty simple using the Asterisk-IM plugin. It is configured and working using the documentation provided by Openfire. No when someone receives/makes a call Openfire updates their IM status to &#8220;On the phone&#8221;. However, it does not appear to be bi-directional eg. [...]]]></description>
			<content:encoded><![CDATA[<p>I have a test server running <a href="/category/voip/asterisk/" title="View all posts filed under Asterisk">Asterisk</a> &amp; <a href="/category/linux/openfire/" title="View all posts filed under Openfire">Openfire</a>. Integrating <a href="/category/linux/openfire/" title="View all posts filed under Openfire">Openfire</a> to <a href="/category/voip/asterisk/" title="View all posts filed under Asterisk">Asterisk</a> was pretty simple using the <a href="/category/voip/asterisk/" title="View all posts filed under Asterisk">Asterisk</a>-IM plugin.</p>
<p>It is configured and working using the documentation provided by <a href="/category/linux/openfire/" title="View all posts filed under Openfire">Openfire</a>. No when someone receives/makes a call <a href="/category/linux/openfire/" title="View all posts filed under Openfire">Openfire</a> updates their IM status to &#8220;On the phone&#8221;.</p>
<p>However, it does not appear to be bi-directional eg. Setting jabber status to DND does not tell <a href="/category/voip/asterisk/" title="View all posts filed under Asterisk">Asterisk</a> to send your calls to voicemail.</p>
<p>Having played with the config I now have bi directional communication between asterisk/openfire working within the <a href="/category/voip/asterisk/freepbx/" title="View all posts filed under FreePBX">FreePBX</a> framework.</p>
<p>The code below will check extensions to see what their status is in jabber before passing the call on to them.</p>
<p>If they are flagged as available, the server will send them an IM telling them about the incoming call &amp; then pass the call through.</p>
<p>If they are not available, the server will direct the incoming call to voicemail.</p>
<p>editing extensions_custom.conf you need the following</p>
<pre>[from-internal-custom]
include =&gt; macro-reach_user_with_presence
exten =&gt; 10,1,Macro(reach_user_with_presence,SIP/10,test@jabber.server,${EXTEN})
[macro-reach_user_with_presence]
; ${ARG1} is a destination such as SIP/10
; ${ARG2} is a jabber address such as test@jabber.server
; ${ARG3} is the voicemail box of the user

exten =&gt; s,1,jabberstatus(asterisk,${ARG2},STATUS)
;presence in will be 1-6.
;In order : Online, Chatty, Away, XAway, DND, Offline
;If not in roster variable will = 7
exten =&gt; s,n,gotoif($[$[${STATUS}]&lt;3]?available:unavailable)
;GotoIf(condition?label_if_true:label_if_false)
exten =&gt; s,n(available),jabbersend(asterisk,${ARG2},"Call from ${CALLERID(name)} at number ${CALLERID(num)} on ${STRFTIME(,GMT-1,%A %B %d %G at %l:%M:%S %p)}")
exten =&gt; s,n,Goto(from-trunk,${ARG3},1)
exten =&gt; s,n(unavailable),VoiceMail(${ARG3},u)</pre>
]]></content:encoded>
			<wfw:commentRss>http://blog.kayosdesign.com/2009/12/31/asterisk-jabber-integration/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Integrating Jabber into Asterisk with FreePBX</title>
		<link>http://blog.kayosdesign.com/2009/12/31/integrating-jabber-into-asterisk-with-freepbx/</link>
		<comments>http://blog.kayosdesign.com/2009/12/31/integrating-jabber-into-asterisk-with-freepbx/#comments</comments>
		<pubDate>Wed, 30 Dec 2009 23:58:48 +0000</pubDate>
		<dc:creator>Dave</dc:creator>
				<category><![CDATA[Asterisk]]></category>
		<category><![CDATA[FreePBX]]></category>

		<guid isPermaLink="false">http://blog.kayosdesign.com/?p=109</guid>
		<description><![CDATA[I was poking around with Asterisk trying to hook it into an Openfire XMPP server and get Asterisk to send IMs when various events happen. I have Asterisk set up as a Jabber client by setting the following in jabber.conf [asterisk] type=client serverhost=jabber.server username=asterisk@jabber.server/AsteriskServer secret=password port=5222 usetls=yes usesasl=yes statusmessage="Asterisk Test Server" The more interesting part [...]]]></description>
			<content:encoded><![CDATA[<p>I was poking around with <a href="/category/voip/asterisk/" title="View all posts filed under Asterisk">Asterisk</a> trying to hook it into an <a href="/category/linux/openfire/" title="View all posts filed under Openfire">Openfire</a> XMPP server and get <a href="/category/voip/asterisk/" title="View all posts filed under Asterisk">Asterisk</a> to send IMs when various events happen.</p>
<p>I have <a href="/category/voip/asterisk/" title="View all posts filed under Asterisk">Asterisk</a> set up as a Jabber client by setting the following in jabber.conf</p>
<pre>[asterisk]
type=client
serverhost=jabber.server
username=asterisk@jabber.server/<a href="/category/voip/asterisk/" title="View all posts filed under Asterisk">Asterisk</a>Server
secret=password
port=5222
usetls=yes
usesasl=yes
statusmessage="<a href="/category/voip/asterisk/" title="View all posts filed under Asterisk">Asterisk</a> Test Server"</pre>
<p>The more interesting part came when trying to get <a href="/category/voip/asterisk/" title="View all posts filed under Asterisk">Asterisk</a> to send messages to Jabber clients for incoming calls. I found a lot of information on the web on how to do it, but not where to put the config when you&#8217;re using <a href="/category/voip/asterisk/freepbx/" title="View all posts filed under FreePBX">FreePBX</a>.  It turned out to be fairly simple in the end.</p>
<p>Editing the extensions_custom.conf put int he following code.</p>
<pre>[from-internal-custom]
exten =&gt; 10,1,jabbersend(asterisk,user@jabber.server,"Call from ${CALLERID(name)} at number ${CALLERID(num)} on ${STRFTIME(,GMT-1,%A %B %d %G at %l:%M:%S %p)}")
exten =&gt; _X!,n,Goto(from-trunk,${EXTEN},1)</pre>
<p>This sends an IM to user@jabber.server whenever they get an incoming call.</p>
<p>It could probably be improved to look up the appropriate user for the extension with a DB lookup (which means you&#8217;d only need one bit of code for all extensions) but I wouldn&#8217;t have a clue how to go about it.</p>
<p>The next step is to identify when an incoming call is for that extension in particular or if it&#8217;s a ring group.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.kayosdesign.com/2009/12/31/integrating-jabber-into-asterisk-with-freepbx/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>MySQL ErrorNo 121</title>
		<link>http://blog.kayosdesign.com/2009/12/29/mysql-errorno-121/</link>
		<comments>http://blog.kayosdesign.com/2009/12/29/mysql-errorno-121/#comments</comments>
		<pubDate>Tue, 29 Dec 2009 11:39:05 +0000</pubDate>
		<dc:creator>Dave</dc:creator>
				<category><![CDATA[MySQL]]></category>
		<category><![CDATA[Web Development]]></category>

		<guid isPermaLink="false">http://blog.kayosdesign.com/?p=105</guid>
		<description><![CDATA[MySQL has a helpful error &#8220;Can&#8217;t create table (errno: 121)&#8221; which doesn&#8217;t seem to be documented anywhere except in forums. Turns out this error is caused by InnoDB tables throwing an error when it detects duplicate foreign key names. Basically, every foreign key has to have a unique name for InnoDB to function correctly.]]></description>
			<content:encoded><![CDATA[<p><a href="/category/web-development/mysql/" title="View all posts filed under MySQL">MySQL</a> has a helpful error &#8220;Can&#8217;t create table (errno: 121)&#8221; which doesn&#8217;t seem to be documented anywhere except in forums.</p>
<p>Turns out this error is caused by InnoDB tables throwing an error when it detects duplicate foreign key names.</p>
<p>Basically, every foreign key has to have a unique name for InnoDB to function correctly.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.kayosdesign.com/2009/12/29/mysql-errorno-121/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
