<?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"
	>

<channel>
	<title>tech notes</title>
	<atom:link href="http://bsd.dischaos.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://bsd.dischaos.com</link>
	<description>just some random</description>
	<pubDate>Fri, 11 Jul 2008 14:37:47 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.6</generator>
	<language>en</language>
			<item>
		<title>OpenBSD interface groups - manual carp failover.</title>
		<link>http://bsd.dischaos.com/2008/07/11/openbsd-interface-groups-manual-carp-failover/</link>
		<comments>http://bsd.dischaos.com/2008/07/11/openbsd-interface-groups-manual-carp-failover/#comments</comments>
		<pubDate>Fri, 11 Jul 2008 11:31:19 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
		<category><![CDATA[bsd]]></category>

		<category><![CDATA[carp]]></category>

		<category><![CDATA[failover]]></category>

		<category><![CDATA[openbsd]]></category>

		<guid isPermaLink="false">http://bsd.dischaos.com/?p=24</guid>
		<description><![CDATA[This is something new I&#8217;ve just learned that only exists on OpenBSD. Up until today I thought that the only way to manually failover a carp setup was to down the carp interface on the master.
It looks like there is an easier way of doing it on OpenBSD. In fact OpenBSD uses this feature itself [...]]]></description>
			<content:encoded><![CDATA[<p>This is something new I&#8217;ve just learned that only exists on OpenBSD. Up until today I thought that the only way to manually failover a carp setup was to down the carp interface on the master.</p>
<p>It looks like there is an easier way of doing it on OpenBSD. In fact OpenBSD uses this feature itself during the boot process. Just before setting up all interfaces it &#8220;demotes&#8221; all carp interfaces so they won&#8217;t become master interfaces for their ip addresses until all enabled system daemons, pf, ipsec etc have been configured and started. After that the whole carp group of interfaces is put back to the neutral state and they can become master interfaces (if there is no advskew set on them).</p>
<p>How is it done?</p>
<p>OpenBSD has this concept of groups of interfaces. It&#8217;s easy to spot it when you do ifconfig:</p>
<p># ifconfig<br />
lo0: flags=8049&lt;UP,LOOPBACK,RUNNING,MULTICAST&gt; mtu 33208<br />
<strong> groups: lo</strong><br />
inet 127.0.0.1 netmask 0xff000000<br />
inet6 ::1 prefixlen 128<br />
inet6 fe80::1%lo0 prefixlen 64 scopeid 0&#215;3<br />
vic0: flags=8843&lt;UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST&gt; mtu 1500<br />
lladdr 00:0c:29:9c:5e:57<br />
<strong>groups: egress</strong><br />
media: Ethernet autoselect<br />
status: active<br />
inet 172.21.33.5 netmask 0xffffff00 broadcast 172.21.33.255<br />
inet6 fe80::20c:29ff:fe9c:5e57%vic0 prefixlen 64 scopeid 0&#215;1<br />
enc0: flags=0&lt;&gt; mtu 1536<br />
carp0: flags=8803&lt;UP,BROADCAST,SIMPLEX,MULTICAST&gt; mtu 1500<br />
lladdr 00:00:00:00:00:00<br />
<strong>groups: carp</strong></p>
<p>Each interface has its own default group (or groups). The default group for all carp interfaces is&#8230; the carp group! You can create your own groups and add interfaces to them. An interface can belong to multiple groups. Here&#8217;s how to create a new group and add carp0 to it:</p>
<p># ifconfig carp0 group mygroup<br />
# ifconfig carp0<br />
carp0: flags=8803&lt;UP,BROADCAST,SIMPLEX,MULTICAST&gt; mtu 1500<br />
lladdr 00:00:00:00:00:00<br />
<strong>groups: carp mygroup</strong></p>
<p>and here is how to remove it <img src='http://bsd.dischaos.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p># ifconfig carp0 -group mygroup<br />
# ifconfig carp0<br />
carp0: flags=8803&lt;UP,BROADCAST,SIMPLEX,MULTICAST&gt; mtu 1500<br />
lladdr 00:00:00:00:00:00<br />
<strong> groups: carp</strong></p>
<p>All groups have this additional property called the demote count which is used by carp during the master election process. Using this property you can demote a group of interfaces:</p>
<p># ifconfig -g carp carpdemote 128</p>
<p>and promote it back:</p>
<p># ifconfig -g carp -carpdemote 128</p>
<p>and you can see the current value:</p>
<p># ifconfig -g carp<br />
carp: carp demote count 0</p>
<p>So how is this better than downing all your carp interfaces by doing something like this:</p>
<p>for i in `ls /etc/hostname.carp*`; do echo $i | awk -F. &#8216;{print $2}&#8217; | xargs -I% ifconfig % down; done</p>
<p>When you down your carp interface they no longer take part in the whole &#8220;carp process&#8221;. Basically since they are down they no longer advertise their presence and cannot be elected as masters. So if your backup server dies and all carp interfaces on your master are down you loose your connectivity.</p>
<p>Carp demote counter acts in a bit similar way to advskew but has higher precendence over it. So a carp interface with advskew set to 0 and demote counter set to 10 will be ranked lower (and become slave) than another carp interface with advskew 100 and demote counter set to 0.</p>
<p>Plus, by logically groupping carp interfaces you can failover only one group at a time, and when you have a lot of interfaces this is certainly easier then using ifconfig down.</p>
]]></content:encoded>
			<wfw:commentRss>http://bsd.dischaos.com/2008/07/11/openbsd-interface-groups-manual-carp-failover/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Jabber servers with support for flash clients</title>
		<link>http://bsd.dischaos.com/2008/07/07/jabber-servers-with-support-for-flash-based-clients/</link>
		<comments>http://bsd.dischaos.com/2008/07/07/jabber-servers-with-support-for-flash-based-clients/#comments</comments>
		<pubDate>Mon, 07 Jul 2008 16:16:06 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
		<category><![CDATA[bsd]]></category>

		<category><![CDATA[flash]]></category>

		<category><![CDATA[flash client]]></category>

		<category><![CDATA[jabber]]></category>

		<guid isPermaLink="false">http://bsd.dischaos.com/?p=22</guid>
		<description><![CDATA[Flash clients don&#8217;t comply with the XMPP protocol. This is due to some limitation/security features in the flash itself. The problems are:

flash sends null terminated stanzas and expects the same from the server
opening stream header is a bit different than expected. In case of a flash client it&#8217;s:
&#60;flash:stream xmlns='jabber:client' xmlns:stream='http://etherx.jabber.org/streams' id='' from='' /&#62;


There are currently [...]]]></description>
			<content:encoded><![CDATA[<p>Flash clients don&#8217;t comply with the XMPP protocol. This is due to some limitation/security features in the flash itself. The problems are:</p>
<ul>
<li>flash sends null terminated stanzas and expects the same from the server</li>
<li>opening stream header is a bit different than expected. In case of a flash client it&#8217;s:
<pre>&lt;flash:stream xmlns='jabber:client' xmlns:stream='http://etherx.jabber.org/streams' id='' from='' /&gt;</pre>
</li>
</ul>
<p>There are currently only two jabber servers I could find with support for this:</p>
<ul>
<li>openfire, which is obvious since they also provide a flash based jabber client with their jabber server solution</li>
<li>ejabber with this <a title="ejabberd flash patch" href="https://support.process-one.net/secure/attachment/12150/flash-xml-ejabberd-2.0.0.patch" target="_blank">patch</a> applied. After patching ejabber needs to be recompiled with the &#8211;enable-flash-plugin option passed to the configure script.</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://bsd.dischaos.com/2008/07/07/jabber-servers-with-support-for-flash-based-clients/feed/</wfw:commentRss>
		</item>
		<item>
		<title>running FreeBSD under VMware</title>
		<link>http://bsd.dischaos.com/2008/07/02/running-freebsd-under-vmware/</link>
		<comments>http://bsd.dischaos.com/2008/07/02/running-freebsd-under-vmware/#comments</comments>
		<pubDate>Wed, 02 Jul 2008 15:52:08 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
		<category><![CDATA[bsd]]></category>

		<category><![CDATA[freebsd]]></category>

		<category><![CDATA[vmware]]></category>

		<guid isPermaLink="false">http://bsd.dischaos.com/?p=20</guid>
		<description><![CDATA[Although FreeBSD runs under VMware  and there&#8217;s even an option for it in the GUI management tool, it doesn&#8217;t run perfectly.
timekeeping
The first problem with FreeBSD under VMware is time synchronisation. After running FreeBSD for a few minutes you&#8217;ll notice that its timer is completely out of sync comparing with the host&#8217;s timer. This is mainly [...]]]></description>
			<content:encoded><![CDATA[<p>Although FreeBSD runs under VMware  and there&#8217;s even an option for it in the GUI management tool, it doesn&#8217;t run perfectly.</p>
<p><strong>timekeeping</strong></p>
<p>The first problem with FreeBSD under VMware is time synchronisation. After running FreeBSD for a few minutes you&#8217;ll notice that its timer is completely out of sync comparing with the host&#8217;s timer. This is mainly due to the nature of virtualization provided by VMware connected with FreeBSD&#8217;s kernel tick value.</p>
<p>By default the kernel ticks every 1/1000 second which is too frequently for VMware based virtualized environment. The number of ticks per second can be adjusted either by adding <strong>HZ=100</strong> to your kernel config file and recompiling it or by adding <strong>kern.hz=100</strong> to <em>/boot/loader.conf</em> and rebooting your server.</p>
<p>100 is just a suggested value (it actually used to be the default value in older versions of FreeBSD) but something smaller than that, like 50 or 20, might work better for you.</p>
<p>on top of these changes you should also run ntpd!</p>
<p><strong>network performance</strong></p>
<p>Network performance can be tuned a bit by using a different ethernet card emulation in your VMware. So instead of using a driver for an AMD card, change it to the em driver for Intel cards. This requires editing the .vmx file describing your virtual server and adding:</p>
<div class="codesnip-container" >ethernet0.virtualDev=&#8221;e1000&#8243;</div>
<p>You have to restart your virtual server for these changes to take place.</p>
]]></content:encoded>
			<wfw:commentRss>http://bsd.dischaos.com/2008/07/02/running-freebsd-under-vmware/feed/</wfw:commentRss>
		</item>
		<item>
		<title>reverse ftp-proxy with pf and OpenBSD</title>
		<link>http://bsd.dischaos.com/2008/07/01/reverse-ftp-proxy-with-pf-and-openbsd/</link>
		<comments>http://bsd.dischaos.com/2008/07/01/reverse-ftp-proxy-with-pf-and-openbsd/#comments</comments>
		<pubDate>Tue, 01 Jul 2008 16:15:46 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
		<category><![CDATA[bsd]]></category>

		<category><![CDATA[ftp-proxy]]></category>

		<category><![CDATA[openbsd]]></category>

		<category><![CDATA[pf]]></category>

		<guid isPermaLink="false">http://bsd.dischaos.com/?p=19</guid>
		<description><![CDATA[Imagine you have a FTP server behind your NAT/firewall server and you want to (or rather have to, because why would you really _want_ to do it?) give access to this FTP from outside world.
As FTP is a really crazy old protocol it&#8217;s not as easy as with HTTP or POP3 where you only have [...]]]></description>
			<content:encoded><![CDATA[<p>Imagine you have a FTP server behind your NAT/firewall server and you want to (or rather have to, because why would you really _want_ to do it?) give access to this FTP from outside world.</p>
<p>As FTP is a really crazy old protocol it&#8217;s not as easy as with HTTP or POP3 where you only have to redirect one port. With FTP there are actually two connections established, one on port 21 which is used to control the FTP session and is used to send commands, and the other connection is used to transfer data. The problem is with the other connection, which doesn&#8217;t usually have one set port that it would use, instead it&#8217;s port is negotiated everytime you want to download something. So what you need is a tool that will open and redirect ports needed for data session based on what&#8217;s being negotiated in the control session.</p>
<p>Here&#8217;s how to do it on OpenBSD using ftp-proxy and a few simple pf rules.</p>
<p>My internal network is 172.21.33.0/24 and my gateway&#8217;s IP on this network is 172.21.33.1. FTP server&#8217;s IP is 172.21.33.5. First, we have to set up ftp-proxy daemon in reverse-proxy mode. It&#8217;s option -R with FTP server&#8217;s IP, so add</p>
<pre>ftpprooxy_flags="-R 172.21.33.5"</pre>
<p>to <em>/etc/rc.conf.local</em> and starting the deamon manually (it will start automatically after the next reboot)</p>
<pre># /usr/sbin/ftp-proxy -R 172.21.33.5</pre>
<p>Now all you have to do is to edit your <em>/etc/pf.conf</em> file and add</p>
<pre>rdr-anchor "ftp-proxy/*"
rdr pass on $ext_if proto tcp from any to $ext_if port 21 -&gt; 127.0.0.1 port 8021</pre>
<p>before your redirection rules</p>
<pre>nat-anchor "ftp-proxy/*"</pre>
<p>before your nat rules</p>
<p>and finally, before your filtering rules:</p>
<pre>anchor "ftp-proxy/*"</pre>
<p>pf will use these anchors to dynamically create rules needed for new FTP sessions. That&#8217;s it, reload pf and test everything.</p>
]]></content:encoded>
			<wfw:commentRss>http://bsd.dischaos.com/2008/07/01/reverse-ftp-proxy-with-pf-and-openbsd/feed/</wfw:commentRss>
		</item>
		<item>
		<title>symfony object_select_tag options</title>
		<link>http://bsd.dischaos.com/2008/06/27/symfony-object_select_tag-options/</link>
		<comments>http://bsd.dischaos.com/2008/06/27/symfony-object_select_tag-options/#comments</comments>
		<pubDate>Fri, 27 Jun 2008 16:13:02 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
		<category><![CDATA[php]]></category>

		<category><![CDATA[symfony]]></category>

		<guid isPermaLink="false">http://bsd.dischaos.com/?p=18</guid>
		<description><![CDATA[I couldn&#8217;t find on symfony&#8217;s website what options you can pass to the object_select_tag function. It&#8217;s definition looks like this:
function object_select_tag($object, $method, $options = array(), $default_value = null)
and options can be:

peer_method - peer method you want to use to fetch options. useful for sorting, limiting output etc.
text_method - method used to display labels for your [...]]]></description>
			<content:encoded><![CDATA[<p>I couldn&#8217;t find on symfony&#8217;s website what options you can pass to the object_select_tag function. It&#8217;s definition looks like this:</p>
<blockquote><p>function object_select_tag($object, $method, $options = array(), $default_value = null)</p></blockquote>
<p>and options can be:</p>
<ul>
<li>peer_method - peer method you want to use to fetch options. useful for sorting, limiting output etc.</li>
<li>text_method - method used to display labels for your options</li>
<li>include_custom - your customized option</li>
<li>include_title - creates a title for the whole selection based on the name of the called method</li>
<li>include_blank - adds blank (&#8221;") option to your select tag</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://bsd.dischaos.com/2008/06/27/symfony-object_select_tag-options/feed/</wfw:commentRss>
		</item>
		<item>
		<title>creating web services with wso2 wsf/php</title>
		<link>http://bsd.dischaos.com/2008/06/04/creating-web-services-with-wso2-wsfphp/</link>
		<comments>http://bsd.dischaos.com/2008/06/04/creating-web-services-with-wso2-wsfphp/#comments</comments>
		<pubDate>Wed, 04 Jun 2008 15:48:46 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
		<category><![CDATA[php]]></category>

		<category><![CDATA[web services]]></category>

		<category><![CDATA[wso2]]></category>

		<guid isPermaLink="false">http://bsd.dischaos.com/?p=17</guid>
		<description><![CDATA[I&#8217;m not sure if it&#8217;s the best way of doing it, but this method of creating web services with wso2 works for me. A bonus here is that it doesn&#8217;t involve creating or modyfying any XML/WSDL files as all this is autogenerated or handled by the framework itself.
This example service will return N random digits [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;m not sure if it&#8217;s the best way of doing it, but this method of creating web services with wso2 works for me. A bonus here is that it doesn&#8217;t involve creating or modyfying any XML/WSDL files as all this is autogenerated or handled by the framework itself.</p>
<p>This example service will return N random digits from a given range.</p>
<p><strong>wsdl autogeneration</strong></p>
<p>wso2 has a nice feature of generating wsdl files based on service configuration. It can do even better than that - it can generate a wsdl file for your service based on the comments you use for functions that describe your service. Of course these comments have to be in a special format, but this format is nothing else than dotproject-style comments that can be used to automatically document your code. Here is an example, it doesn&#8217;t implement anything yet, it&#8217;s only used to generate a wsdl definition. To avoid URL changes in the service location specified in the generated wsdl I&#8217;m creating it in random/index.php in my web server&#8217;s root directory, which will be replaced by the service implementation later on:</p>
<div class="codesnip-container" >
<div class="codesnip" style="font-family: monospace;"><span class="kw2">&lt;?php</span><br />
<span class="coMULTI">/**<br />
* @namespace http://server.com/random<br />
*/</span><br />
<span class="kw2">class</span> RandomNumber<br />
<span class="br0">&#123;</span><br />
<span class="coMULTI">/**<br />
* @var integer $number<br />
*/</span><br />
<span class="kw2">public</span> <span class="re0">$number</span>;<br />
<span class="br0">&#125;</span></p>
<p><span class="coMULTI">/**<br />
* @param integer $num number of random digits<br />
* @param integer $min minimum random number<br />
* @param integer $max maximum random number<br />
* @return array of object RandomNumber $numbers array of random numbers generated<br />
*/</span><br />
<span class="kw2">function</span> getRandom<span class="br0">&#40;</span><span class="re0">$num</span>, <span class="re0">$min</span>, <span class="re0">$max</span><span class="br0">&#41;</span><br />
<span class="br0">&#123;</span><br />
<span class="kw1">return</span> <span class="kw2">new</span> RandomNumber<span class="br0">&#40;</span><span class="br0">&#41;</span>;<br />
<span class="br0">&#125;</span></p>
<p><span class="re0">$service</span> = <span class="kw2">new</span> WSService<span class="br0">&#40;</span><a href="http://www.php.net/array"><span class="kw3">array</span></a><span class="br0">&#40;</span><span class="st0">&quot;operations&quot;</span> =&gt; <a href="http://www.php.net/array"><span class="kw3">array</span></a><span class="br0">&#40;</span><span class="st0">&quot;getRandom&quot;</span><span class="br0">&#41;</span><span class="br0">&#41;</span><span class="br0">&#41;</span>;<br />
<span class="re0">$service</span>-&gt;<span class="me1">reply</span><span class="br0">&#40;</span><span class="br0">&#41;</span>;<br />
<span class="kw2">?&gt;</span></div>
</div>
<p>When you access http://server.com/random/?wsdl you&#8217;ll get your wsdl file generated for the service documented above. Save it in your services directory as random.wsdl.</p>
<p><strong>service and client autogeneration</strong></p>
<p>Now we can use this file to generate both a service template and a sample client template.</p>
<p>In wso2-php package there is a file called wsdl2php.php. Use it to generate both templates:</p>
<pre>&gt; php wsdl2php.php -s random.wsdl &gt; server.php
&gt; php wsdl2php.php random.wsdl &gt; client.php</pre>
<p>you can keep a copy of your index.php file used to generate the wsdl file and replace it with the generated server.php</p>
<pre>&gt; cp index.php generate.php; mv server.php index.php</pre>
<p><strong>service implementation</strong></p>
<p>At this point you can implement your service, edit your index.php file, read the comments there, and add this simple implementation to the getRandom function:</p>
<div class="codesnip-container" >
<div class="codesnip" style="font-family: monospace;"><span class="re0">$response</span> = <span class="kw2">new</span> getRandomResponse<span class="br0">&#40;</span><span class="br0">&#41;</span>;<br />
<span class="kw1">for</span> <span class="br0">&#40;</span><span class="re0">$i</span> = <span class="nu0">1</span>; <span class="re0">$i</span> &gt;= <span class="re0">$input</span>-&gt;<span class="me1">num</span>; <span class="re0">$i</span>++<span class="br0">&#41;</span> <span class="br0">&#123;</span><br />
&nbsp; <span class="re0">$n</span> = <span class="kw2">new</span> RandomNumber<span class="br0">&#40;</span><span class="br0">&#41;</span>;<br />
&nbsp; <span class="re0">$n</span>-&gt;<span class="me1">number</span> = <a href="http://www.php.net/rand"><span class="kw3">rand</span></a><span class="br0">&#40;</span><span class="re0">$input</span>-&gt;<span class="me1">min</span>, <span class="re0">$input</span>-&gt;<span class="me1">max</span><span class="br0">&#41;</span>;<br />
&nbsp; <span class="re0">$response</span>-&gt;<span class="me1">numbers</span><span class="br0">&#91;</span><span class="br0">&#93;</span> = <span class="re0">$n</span>;<br />
<span class="br0">&#125;</span><br />
<span class="kw1">return</span> <span class="re0">$response</span>;</div>
</div>
<p><strong>implementation of a sample client</strong></p>
<p>and now modify your client to test it, under //TODO fill in the class fields of $input to match your business logic add:</p>
<div class="codesnip-container" >
<div class="codesnip" style="font-family: monospace;"><span class="re0">$input</span>-&gt;<span class="me1">num</span> = <span class="nu0">10</span>;<br />
<span class="re0">$input</span>-&gt;<span class="me1">min</span> = <span class="nu0">1</span>;<br />
<span class="re0">$input</span>-&gt;<span class="me1">max</span> = <span class="nu0">100</span>;</div>
</div>
<p>and implement the business logic to consume your response:</p>
<div class="codesnip-container" >
<div class="codesnip" style="font-family: monospace;"><span class="kw1">foreach</span> <span class="br0">&#40;</span><span class="re0">$response</span>-&gt;<span class="me1">numbers</span> <span class="kw1">as</span> <span class="re0">$n</span><span class="br0">&#41;</span> <span class="br0">&#123;</span><br />
&nbsp; <a href="http://www.php.net/printf"><span class="kw3">printf</span></a><span class="br0">&#40;</span><span class="st0">&quot;%d&quot;</span>, <span class="re0">$n</span>-&gt;<span class="me1">number</span><span class="br0">&#41;</span>;<br />
<span class="br0">&#125;</span></div>
</div>
<p>Start client.php in your browser - you should be able to see 10 randomly generated numbers <img src='http://bsd.dischaos.com/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /></p>
]]></content:encoded>
			<wfw:commentRss>http://bsd.dischaos.com/2008/06/04/creating-web-services-with-wso2-wsfphp/feed/</wfw:commentRss>
		</item>
		<item>
		<title>WSO web services framework on FreeBSD</title>
		<link>http://bsd.dischaos.com/2008/05/14/wso-web-services-framework-on-freebsd/</link>
		<comments>http://bsd.dischaos.com/2008/05/14/wso-web-services-framework-on-freebsd/#comments</comments>
		<pubDate>Wed, 14 May 2008 13:22:33 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
		<category><![CDATA[bsd]]></category>

		<category><![CDATA[php]]></category>

		<category><![CDATA[freebsd]]></category>

		<category><![CDATA[web services]]></category>

		<category><![CDATA[wso]]></category>

		<guid isPermaLink="false">http://bsd.dischaos.com/?p=16</guid>
		<description><![CDATA[Update (2008-06-04): This patch also works with the latest (1.3.1) version of wsf/php.
WSO is a web services framework I&#8217;ve been recently playing with. There are versions of it for C, php, ruby, perl, and some other languages&#8230; The php version comes as a php module that needs to be compiled from source (or installed as [...]]]></description>
			<content:encoded><![CDATA[<p>Update (2008-06-04): This patch also works with the latest (1.3.1) version of wsf/php.</p>
<p><a title="wso" href="http://wso2.org/" target="_blank">WSO</a> is a web services framework I&#8217;ve been recently playing with. There are versions of it for C, php, ruby, perl, and some other languages&#8230; The php version comes as a php module that needs to be compiled from source (or installed as a package if you&#8217;re running a linux distribution that has it) and added to your php configuration.</p>
<p>The source code compiles under windows, linux and OS X but needs some patching to work under FreeBSD.</p>
<p>you&#8217;ll need libxml2, libiconv, zlib and sqlite (or mysql) libraries installed from ports.</p>
<p>Here is how to do it:</p>
<pre># fetch http://dist.wso2.org/products/wsf/php/1.2.1/wso2-wsf-php-src-1.2.1.tar.gz
# fetch http://bsd.dischaos.com/files/wso2-1.2.1-freebsd.patch
# tar xvfz wso2-wsf-php-src-1.2.1.tar.gz
# patch -p0 &lt; wso2-1.2.1-freebsd.patch
# setenv CPATH /usr/local/include
# setenv LD_LIBRARY_PATH /usr/local/lib
# cd wso2-wsf-php-src-1.2.1
# ./configure LDFLAGS="-lcompat" &amp;&amp; make &amp;&amp; make install
</pre>
<p>now just add wo.so extension to your /usr/local/etc/php/extensions. You&#8217;ll probably also need xml and xsl php extensions to have everything in wo working. Also, I copied the scripts directory from the wso2 package to /usr/local/share/wso2 and added this directory to include_path.</p>
]]></content:encoded>
			<wfw:commentRss>http://bsd.dischaos.com/2008/05/14/wso-web-services-framework-on-freebsd/feed/</wfw:commentRss>
		</item>
		<item>
		<title>ezmlm-idx + postfix quick and dirty howto</title>
		<link>http://bsd.dischaos.com/2008/05/07/ezmlm-idx-postfix-quick-and-dirty-howto/</link>
		<comments>http://bsd.dischaos.com/2008/05/07/ezmlm-idx-postfix-quick-and-dirty-howto/#comments</comments>
		<pubDate>Wed, 07 May 2008 20:31:33 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
		<category><![CDATA[bsd]]></category>

		<category><![CDATA[ezmlm]]></category>

		<category><![CDATA[freebsd]]></category>

		<category><![CDATA[postfix]]></category>

		<category><![CDATA[qmail]]></category>

		<guid isPermaLink="false">http://bsd.dischaos.com/?p=3</guid>
		<description><![CDATA[One of my servers has recently died. When I was installed the server around 7 years ago, qmail was a very trendy alternative to the &#8220;bad and insecure&#8221; sendmail,  FreeBSD&#8217;s default MTA. Now, after a few years have passed, qmail is no longer so trendy and chicks don&#8217;t dig it as they used to&#8230; [...]]]></description>
			<content:encoded><![CDATA[<p>One of my servers has recently died. When I was installed the server around 7 years ago, qmail was a very trendy alternative to the &#8220;bad and insecure&#8221; sendmail,  FreeBSD&#8217;s default MTA. Now, after a few years have passed, qmail is no longer so trendy and chicks don&#8217;t dig it as they used to&#8230; So while reinstalling the server I knew I had to choose something different than qmail. It&#8217;s not that I don&#8217;t like qmail anymore but after spending some time with postfix, especially after integrating it with things like clamav, dspam and other different extensions I think it&#8217;s just easier to manage. So the real reason was - i wanted all these nice toys I had with other postfix installations and I wanted them quickly and without all that hacking around and patching patches I would have to do with qmail.</p>
<p>Moving email accounts between qmail and postfix is not a hard task. They both support Maildir format so getting this part working was quick and painless. The only problem I had with moving this mail installation was what to do with my ezmlm based mailing list. So this is how to make qmail and postfix live happily under one roof.</p>
<p><strong>Install all required ports</strong></p>
<p>I installed these ports (my local versions in brackets, note that it&#8217;s a bit old installation now):</p>
<ul>
<li>mail/qmail (1.03_6)</li>
<li>mail/qmail-contrib (0.1_1)</li>
<li>mail/ezmlm-idx (0.40_4)</li>
<li>mail/postfix (2.4.6,1)</li>
</ul>
<p><strong>Configure postfix</strong></p>
<p>add qmail transport to master.cf:</p>
<pre>qmail unix - n n - - pipe flags=R user=qmailq argv=/var/qmail/bin/sendmail ${recipient}</pre>
<p>and in main.cf define transport configuration file with perl regex syntax:</p>
<pre>transport_maps = pcre:/usr/local/etc/postfix/pcre_transport</pre>
<p>now, add all your mailing lists to pcre_transport file so they get delivered via the qmail transport. An example for lists eztest@server.com and otherlist@server.com would look like this:</p>
<pre>/eztest(-[a-z]+)?@server.com/ qmail:
/otherlist(-[a-z]+)?@server.com/ qmail:
</pre>
<p><strong>Set up qmail</strong></p>
<p>Just make a standard port installation but <strong>do not</strong> enable qmail as your default MTA, after all, you want it to be postfix, right?</p>
<p>After starting everything you can test it</p>
<p>create a new mailing list:</p>
<pre># ezmlm-make ~alias/eztest ~alias/.qmail-eztest eztest server.com
# chown -R alias ~alias/eztest
</pre>
<p>add a test user:</p>
<pre># ezmlm-sub ~alias/eztest user@example.com
</pre>
<p>And that&#8217;s it. <img src='http://bsd.dischaos.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> Of course your list probably needs some changes in the configuration files (~alias/eztest/) but this is all well documented in ezmlm(5)</p>
]]></content:encoded>
			<wfw:commentRss>http://bsd.dischaos.com/2008/05/07/ezmlm-idx-postfix-quick-and-dirty-howto/feed/</wfw:commentRss>
		</item>
		<item>
		<title>OpenBSD 4.3 on the Soekris net 5501</title>
		<link>http://bsd.dischaos.com/2008/05/01/openbsd-43-on-the-soekris-net-5501/</link>
		<comments>http://bsd.dischaos.com/2008/05/01/openbsd-43-on-the-soekris-net-5501/#comments</comments>
		<pubDate>Thu, 01 May 2008 10:51:49 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
		<category><![CDATA[bsd]]></category>

		<category><![CDATA[net 5501]]></category>

		<category><![CDATA[openbsd]]></category>

		<category><![CDATA[soekris]]></category>

		<guid isPermaLink="false">http://bsd.dischaos.com/2008/05/01/openbsd-43-on-the-soekris-net-5501/</guid>
		<description><![CDATA[OpenBSD 4.3 has just been released. I&#8217;ve just tested installing it on a net 5501. The installation procedure is exactly the same as  for OpenBSD 4.2 described here. The only exception is that I couldn&#8217;t find pxeboot on the install43.iso file downloaded from ftp.openbsd.org (I&#8217;ll check if it&#8217;s on the original CDs when they arrive). [...]]]></description>
			<content:encoded><![CDATA[<p>OpenBSD 4.3 has just been released. I&#8217;ve just tested installing it on a net 5501. The installation procedure is exactly the same as  for OpenBSD 4.2 described <a href="http://bsd.dischaos.com/2008/04/28/running-openbsd-42-on-the-soekris-net-5501/">here</a>. The only exception is that I couldn&#8217;t find pxeboot on the install43.iso file downloaded from ftp.openbsd.org (I&#8217;ll check if it&#8217;s on the original CDs when they arrive). It&#8217;s not a problem as one from a previous release works fine.</p>
<p>Currently I can&#8217;t really find any improvements in 4.3 that would be especially useful on net 5501 as it was the case with 4.2 and net 4501 (performance improvements to pf and many updates to sis(4)). However one nice thing is a new snmp daemon in the base system. This could we quite useful when tracking usage statistics on routers with, for example <a href="http://www.network-weathermap.com">network weathermap </a></p>
]]></content:encoded>
			<wfw:commentRss>http://bsd.dischaos.com/2008/05/01/openbsd-43-on-the-soekris-net-5501/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Running OpenBSD 4.2 on the Soekris net 5501</title>
		<link>http://bsd.dischaos.com/2008/04/28/running-openbsd-42-on-the-soekris-net-5501/</link>
		<comments>http://bsd.dischaos.com/2008/04/28/running-openbsd-42-on-the-soekris-net-5501/#comments</comments>
		<pubDate>Mon, 28 Apr 2008 14:25:33 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
		<category><![CDATA[bsd]]></category>

		<category><![CDATA[net 5501]]></category>

		<category><![CDATA[openbsd]]></category>

		<category><![CDATA[soekris]]></category>

		<guid isPermaLink="false">http://bsd.dischaos.com/2008/04/28/running-openbsd-42-on-the-soekris-net-5501/</guid>
		<description><![CDATA[Why OpenBSD?
A bit of explanation first. I did some test installations of FreeBSD 6.x on an older Soekris net 4801 box and found out, to my surprise, that it wasn&#8217;t running as fast and stable as OpenBSD. Additionally, comparing to OpenBSD, installing FreeBSD over PXE on Soekris was a bit of a nightmare.
Instructions
Console connection
As Soekris [...]]]></description>
			<content:encoded><![CDATA[<p><img class="alignleft" style="border: 0pt none; margin: 5px; float: left;" src="http://bsd.dischaos.com/files/soekris_net5501.jpg" alt="soekirs net 5501" width="323" height="243" /><strong>Why OpenBSD?</strong></p>
<p>A bit of explanation first. I did some test installations of FreeBSD 6.x on an older Soekris net 4801 box and found out, to my surprise, that it wasn&#8217;t running as fast and stable as OpenBSD. Additionally, comparing to OpenBSD, installing FreeBSD over PXE on Soekris was a bit of a nightmare.</p>
<p><strong>Instructions</strong></p>
<p><strong>Console connection</strong></p>
<p>As Soekris boxes don&#8217;t come with VGA cards the only way to access and configure them is through a console cable. I&#8217;m using a standard console cable connected to my FreeBSD box. The only non standard thing is the default console speed which in Soekris is set up to 19200. So to get it working under FreeBSD you need to do:</p>
<p><em># cu -s 19200 -l /dev/cuad0</em></p>
<p>If you reboot your Soekris now you should be able to see something like:</p>
<pre>comBIOS ver. 1.33  20070103  Copyright (C) 2000-2007 Soekris Engineering.
net5501
0512 Mbyte Memory                        CPU Geode LX 500 Mhz
Pri Mas  CF CARD 2GB                     LBA Xlt 983-64-63  1982 Mbyte

Slot   Vend Dev  ClassRev Cmd  Stat CL LT HT  Base1    Base2   Int

-------------------------------------------------------------------
0:01:2 1022 2082 10100000 0006 0220 08 00 00 A0000000 00000000 10
0:06:0 1106 3053 02000096 0117 0210 08 40 00 0000E101 A0004000 11
0:07:0 1106 3053 02000096 0117 0210 08 40 00 0000E201 A0004100 05
0:08:0 1106 3053 02000096 0117 0210 08 40 00 0000E301 A0004200 09
0:09:0 1106 3053 02000096 0117 0210 08 40 00 0000E401 A0004300 12
0:20:0 1022 2090 06010003 0009 02A0 08 40 80 00006001 00006101
0:20:2 1022 209A 01018001 0005 02A0 08 00 00 00000000 00000000
0:21:0 1022 2094 0C031002 0006 0230 08 00 80 A0005000 00000000 15
0:21:1 1022 2095 0C032002 0006 0230 08 00 00 A0006000 00000000 15

1 Seconds to automatic boot.   Press Ctrl-P for entering Monitor.

Intel UNDI, PXE-2.0 (build 082)

Copyright (C) 1997,1998,1999  Intel Corporation

VIA Rhine III Management Adapter v2.43 (2005/12/15)

CLIENT MAC ADDR: 00 00 24 DE AD AA</pre>
<p>And your system will start a PXE boot. At this point, copy your MAC address (in this case 00:00:24:DE:AD:AA) as you may need it in the next step.</p>
<p><strong>DHCP</strong></p>
<p>I&#8217;m using a ports based installation of isc-dhcp3-server running on FreeBSD.</p>
<p>To boot your soekris box over PXE you need to set up a DHCP server to send tftp server details. I&#8217;m doing it by creating a separate host configuration for my soekris.</p>
<pre>host soekris {
hardware ethernet 00:00:24:DE:AD:AA;
option tftp-server-name "10.0.0.1";
option root-path "10.0.0.1:/tftpboot";
next-server 10.0.0.1;
filename "pxeboot";
option    routers 10.0.0.1;
}</pre>
<p>What it does is it tells the Soekris box that it should use a tftp server at 10.0.0.1 and fetch and run the pxeboot file from it.</p>
<p><strong>TFTP</strong></p>
<p>I&#8217;m running a tftp server on my FreeBSD on 10.0.0.1. To set it up just comment out this line in your <em>/etc/inetd.conf</em>:</p>
<p><em>tftp    dgram    udp    wait    root    /usr/libexec/tftpd    tftpd -l -s /tftpboot</em></p>
<p>Now you have to enable inetd in your <em>/etc/rc.conf</em> and start it (<em>/etc/rc.d/inetd start</em>)</p>
<p>At this point you have your tftp ready, now it&#8217;s time to prepare all the files needed to install OpenBSD. Mount your OpenBSD installation CD (or an ISO of it) and do the following on your TFTP server:</p>
<pre># cd /tftpboot
# mkdir 4.2 etc
# cp /mnt/cdrom/4.2/i386/bsd.rd /mnt/cdrom/4.2/i386/pxeboot .
# cp -Rv /mnt/cdrom/4.2/i386 4.2/</pre>
<p>and finally create a /tftpboot/etc/boot.conf file with the following content:</p>
<pre>set tty com0
stty com0 19200
set image /4.2/i386/bsd.rd</pre>
<p><strong>Installation</strong></p>
<p>At this moment, after rebooting your Soekris it should fetch OpenBSD kernel image and ram disk and start the installation process. Follow it as you would do normally ( http://openbsd.org/faq/faq4.html ) with only these exceptions:</p>
<ul>
<li>do not create a swap partition if you are using a CF card, unless you really know what you&#8217;re doing.</li>
<li>answer  <strong>yes</strong> when asked &#8220;<em>change the default console to com0&#8243;</em></li>
<li>answer  <strong>19200</strong> when asked &#8220;<em>Which one should com0 use?</em>&#8221; about the speed of your com0 console</li>
</ul>
<p>after installing all required packages and finishing the whole process you should have a working OpenBSD installation on your Soekris.</p>
<p>There is only one last thing to be done. By default Soekris boots via PXE first and then uses its primary IDE drive (your CF card in this case) . You can either comment out the soekris section in your DHCP configuration or change the default boot order in Soekris BIOS. To do that reboot the Soekris, hit ctrl+p to enter Monitor and type:</p>
<p><em>set BootDrive=80 81 F0 FF</em></p>
]]></content:encoded>
			<wfw:commentRss>http://bsd.dischaos.com/2008/04/28/running-openbsd-42-on-the-soekris-net-5501/feed/</wfw:commentRss>
		</item>
	</channel>
</rss>
