<?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>Chaos Engine &#187; BSD</title>
	<atom:link href="http://dev.modmancer.com/index.php/category/bsd/feed/" rel="self" type="application/rss+xml" />
	<link>http://dev.modmancer.com</link>
	<description>Sometimes I drink to forget.. but then I forget to drink..</description>
	<lastBuildDate>Mon, 06 Feb 2012 16:11:00 +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>Crossplatform QueryPerformanceTimer</title>
		<link>http://dev.modmancer.com/index.php/2010/09/26/crossplatform-queryperformancetimer/</link>
		<comments>http://dev.modmancer.com/index.php/2010/09/26/crossplatform-queryperformancetimer/#comments</comments>
		<pubDate>Sun, 26 Sep 2010 10:25:32 +0000</pubDate>
		<dc:creator>akiko</dc:creator>
				<category><![CDATA[BSD]]></category>
		<category><![CDATA[C++]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Unix]]></category>
		<category><![CDATA[Win32]]></category>
		<category><![CDATA[QueryPerformanceTimer]]></category>

		<guid isPermaLink="false">http://dev.modmancer.com/?p=101</guid>
		<description><![CDATA[Here is a simple way to get high precision timer on both Linux and Windows (can&#8217;t remember where I saw parts of this code, but I hope wrapping it up and spreading it won&#8217;t make the author angry) : cross_platform_timer.h cross_platform_timer.cpp I added few helper wrappers to make the life easier, you can get current [...]]]></description>
			<content:encoded><![CDATA[<p>Here is a simple way to get high precision timer on both Linux and Windows (can&#8217;t remember where I saw parts of this code, but I hope wrapping it up and spreading it won&#8217;t make the author angry) :</p>
<p><a href="http://www.modmancer.com/downloads/dev_blog/cross_platform_timer.h">cross_platform_timer.h</a><br />
<a href="http://www.modmancer.com/downloads/dev_blog/cross_platform_timer.cpp">cross_platform_timer.cpp</a></p>
<p>I added few helper wrappers to make the life easier, you can get current time in microseconds or milliseconds by calling:</p>
<pre>//! Returns current time in milisecs or microsecs.

//! \param micro Returns micro seconds if set to true.
double timer_get(bool micro = false);</pre>
<p>Or you can get elapsed time by calling:</p>
<pre name="code" class="html">timer_start();

// Your code here..

// Get elapsed time in milliseconds.
double dt = timer_stop();</pre>
]]></content:encoded>
			<wfw:commentRss>http://dev.modmancer.com/index.php/2010/09/26/crossplatform-queryperformancetimer/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>POUND &#8211; Reverse proxy and load-balancer</title>
		<link>http://dev.modmancer.com/index.php/2010/07/03/pound-reverse-proxy-and-load-balancer/</link>
		<comments>http://dev.modmancer.com/index.php/2010/07/03/pound-reverse-proxy-and-load-balancer/#comments</comments>
		<pubDate>Sat, 03 Jul 2010 12:27:26 +0000</pubDate>
		<dc:creator>riddler</dc:creator>
				<category><![CDATA[BSD]]></category>
		<category><![CDATA[Loadbalancing]]></category>
		<category><![CDATA[Server]]></category>
		<category><![CDATA[loadbalancer]]></category>
		<category><![CDATA[pound]]></category>
		<category><![CDATA[reverse_proxy]]></category>
		<category><![CDATA[webservers]]></category>

		<guid isPermaLink="false">http://dev.modmancer.com/?p=67</guid>
		<description><![CDATA[Scaling up. For most people a nightmare area. What? How? Where? It usually comes down to how much money are you willing to spend and what is it that you actually need. Here is free as in free beer solution for all you geekz out there who need a simple load balancer and reverse proxy&#8230; [...]]]></description>
			<content:encoded><![CDATA[<p>Scaling up. For most people a nightmare area. What? How? Where? It usually comes down to how much money are you willing to spend and what is it that you actually need. Here is free as in free beer solution for all you geekz out there who need a simple load balancer and reverse proxy&#8230; oh and to allow for a convenient SSL wrapper for those Web servers that do not offer it natively. Guess you could go for nginx if you want &#8211; after using it for over a year it&#8217;s too bloated for what was needed. Pound came up as a far better solution.</p>
<p><span id="more-67"></span><br />
So, let&#8217;s say you have a small server farm that consists of one FreeBSD machine that acts as a firewall/router and a several GNU/Linux machines in the backend which act as web servers distributing some content. We&#8217;re not going to go as deep as to research what is going on on those machines. All we want here is that our users come through the firewall and get served.</p>
<p>Let&#8217;s install pound first:</p>
<p><em>cd /usr/ports/www/pound &amp;&amp; make install clean</em></p>
<p>Once installation is done open Pound&#8217;s configuration file (usually does not exist so just fire up your fav editor and create /usr/local/etc/pound.cfg). For very simple load balancer use the following configuration file:</p>
<p><em>Control  &#8220;/var/run/pound&#8221;<br />
ListenHTTP<br />
Address 0.0.0.0<br />
Port 80<br />
xHTTP 0<br />
LogLevel 2<br />
End</em></p>
<p><em>Service<br />
HeadRequire &#8220;Host:.*mysite.com.*&#8221;<br />
BackEnd<br />
Address 10.0.0.2<br />
Port    80<br />
End<br />
End</em></p>
<p>And that&#8217;s it. Start Pound by issuing: <strong>/usr/local/etc/rc.d/pound start</strong> and see how your content gets served. There is a variety of things you can do with Pound. My suggestion is to check: <a title="Pound" href="http://www.apsis.ch/pound/" target="_blank">http://www.apsis.ch/pound/</a> for details &#8211; their documentation is pretty short but very clear.</p>
]]></content:encoded>
			<wfw:commentRss>http://dev.modmancer.com/index.php/2010/07/03/pound-reverse-proxy-and-load-balancer/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Lighttpd and (network.c.529) SSL error</title>
		<link>http://dev.modmancer.com/index.php/2010/05/23/lighttpd-and-network-c-529-ssl-error/</link>
		<comments>http://dev.modmancer.com/index.php/2010/05/23/lighttpd-and-network-c-529-ssl-error/#comments</comments>
		<pubDate>Sun, 23 May 2010 12:05:11 +0000</pubDate>
		<dc:creator>riddler</dc:creator>
				<category><![CDATA[BSD]]></category>
		<category><![CDATA[Security]]></category>
		<category><![CDATA[Sysadmin]]></category>
		<category><![CDATA[error]]></category>
		<category><![CDATA[HTTPS]]></category>
		<category><![CDATA[lighttpd]]></category>
		<category><![CDATA[ssl]]></category>

		<guid isPermaLink="false">http://dev.modmancer.com/?p=42</guid>
		<description><![CDATA[I just realized that the latest Lighttpd you may find in FreeBSD ports (and in all Linux distros actually) is a bit buggy. Apparently there is an error in network.c which will crash your HTTPS. Once you upgrade and restart Lighty you&#8217;ll get something like this: 2010-03-05 10:23:01: (network.c.529) SSL: error:00000000:lib(0):func(0):reason(0) And that&#8217;s it. Lighty [...]]]></description>
			<content:encoded><![CDATA[<p>I just realized that the latest <a title="Lighttpd" href="http://www.lighttpd.net" target="_blank">Lighttpd</a> you may find in FreeBSD ports (and in all  Linux distros actually) is a bit buggy. Apparently there is an error in  network.c which will crash your HTTPS.<br />
<span id="more-42"></span><br />
Once you upgrade and restart  Lighty you&#8217;ll get something like this:</p>
<pre>2010-03-05 10:23:01: (network.c.529) SSL: error:00000000:lib(0):func(0):reason(0)</pre>
<p>And that&#8217;s it. Lighty will die. Well, here is a quick fix till new  port is released:</p>
<pre>cd /usr/ports/www/lighttpd
make install clean then Ctrl + C when it starts configuring
cd work/lighttpd-1..26/src/
rm network.c
fetch http://redmine.lighttpd.net/projects/lighttpd/repository/revisions/2716/
raw/branches/lighttpd-1.4.x/src/network.c
cd ../../ &amp;&amp; make install clean
</pre>
<p>And that&#8217;s it. It will fix the issue.</p>
]]></content:encoded>
			<wfw:commentRss>http://dev.modmancer.com/index.php/2010/05/23/lighttpd-and-network-c-529-ssl-error/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>

