<?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>herbertm.ca</title>
	<atom:link href="http://blog.herbertm.ca/feed" rel="self" type="application/rss+xml" />
	<link>http://blog.herbertm.ca</link>
	<description></description>
	<lastBuildDate>Mon, 30 May 2011 18:49:41 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
		<item>
		<title>net-snmp 5.6.1 with lm_sensors</title>
		<link>http://blog.herbertm.ca/archives/363</link>
		<comments>http://blog.herbertm.ca/archives/363#comments</comments>
		<pubDate>Mon, 30 May 2011 18:33:36 +0000</pubDate>
		<dc:creator>Herb</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[arch]]></category>
		<category><![CDATA[cacti]]></category>
		<category><![CDATA[pkgbuild]]></category>

		<guid isPermaLink="false">http://blog.herbertm.ca/?p=363</guid>
		<description><![CDATA[The default net-snmp binary builds don&#8217;t come with lm_sensors MIBs configured. If you want to add sensor graphs (voltage, fans, temperatures) to your cacti graph trees, you&#8217;ll have to build net-snmp from source and enable the lm_sensors MIBs when configuring. First, install lm_sensors and configure using sensors-detect. Once you are able to see sensor data [...]]]></description>
			<content:encoded><![CDATA[<p></p><p>The default <a href="http://net-snmp.sourceforge.net/">net-snmp</a> binary builds don&#8217;t come with <a href="http://www.lm-sensors.org/">lm_sensors</a> MIBs configured. If you want to add sensor graphs (voltage, fans, temperatures) to your cacti graph trees, you&#8217;ll have to build net-snmp from source and enable the lm_sensors <span class="caps">MIB</span>s when configuring.</p>

<p>First, install lm_sensors and configure using <code>sensors-detect</code>. Once you are able to see sensor data by running <code>sensors</code> move on with installing net-snmp.</p>

<p><span class="caps">PKGBUILD </span>(Arch Linux)</p>


<pre>
# Maintainer: Eric Belanger &lt;eric &lt;at&gt; archlinux.org&gt;
# Contributor: Herbert Molenda &lt;me &lt;at&gt; herbertm.ca&gt;

pkgname=net-snmp
pkgver=5.6.1
pkgrel=2
pkgdesc=&quot;net-snmp with lm_sensors MIB&quot;
arch=('i686' 'x86_64')
url=&quot;http://www.net-snmp.org/&quot;
license=('custom')
depends=('openssl' 'tcp_wrappers' 'libnl' 'lm_sensors')
makedepends=('setuptools')
optdepends=('perl-term-readkey: for snmpcheck application' 
            'perl-tk: for snmpcheck and tkmib applications'
            'python2: for the python modules')
provides=('ucd-snmp')
options=('!libtool' '!makeflags' '!emptydirs')
source=(&quot;http://downloads.sourceforge.net/sourceforge/${pkgname}/${pkgname}-${pkgver}.tar.gz&quot;
        'snmpd.rc')
md5sums=('b4e30ead5783b0bb1d280172c6095ea4'
         '9f0d13676ba1fae1eb7eb178edd85b43')
sha1sums=('45bbf1295253d5379a5d1efd918593160387fd00' '2c679b564a2c319d9ce2714a9776aa0e6d89c60a')

build() {
  cd &quot;${srcdir}/${pkgname}-${pkgver}&quot;
  sed -i -e &quot;s:\(install --basedir=\$\$dir\):\1 --root='${pkgdir}':&quot; Makefile.in
  ./configure --prefix=/usr --sysconfdir=/etc --mandir=/usr/share/man \
    --enable-ucd-snmp-compatibility --enable-ipv6 --with-libwrap --with-python-modules \
    --with-default-snmp-version=&quot;3&quot; --with-sys-contact=&quot;root@localhost&quot; \
    --with-sys-location=&quot;Unknown&quot; --with-logfile=&quot;/var/log/snmpd.log&quot; \
    --with-mib-modules=&quot;host misc/ipfwacc ucd-snmp/diskio tunnel ucd-snmp/dlmod ucd-snmp/lmsensorsMib&quot; \
    --with-persistent-directory=&quot;/var/net-snmp&quot; \
    PYTHONPROG=/usr/bin/python2
  make NETSNMP_DONT_CHECK_VERSION=1 LDFLAGS+=&quot;-Wl,-lsensors&quot;
}

package() {
  cd &quot;${srcdir}/${pkgname}-${pkgver}&quot;
  make DESTDIR=&quot;${pkgdir}&quot; INSTALL_PREFIX=&quot;${pkgdir}&quot; INSTALLDIRS=vendor install
  install -D -m755 &quot;${srcdir}/snmpd.rc&quot; &quot;${pkgdir}/etc/rc.d/snmpd&quot;
  install -D -m644 COPYING &quot;${pkgdir}/usr/share/licenses/${pkgname}/COPYING&quot;
}
&lt;/me&gt;&lt;/eric&gt;</pre>]]></content:encoded>
			<wfw:commentRss>http://blog.herbertm.ca/archives/363/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Mercurial Central Repository with fastcgi and nginx</title>
		<link>http://blog.herbertm.ca/archives/334</link>
		<comments>http://blog.herbertm.ca/archives/334#comments</comments>
		<pubDate>Thu, 04 Mar 2010 20:23:41 +0000</pubDate>
		<dc:creator>Herb</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[Internet]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[fastcgi]]></category>
		<category><![CDATA[mercurial]]></category>
		<category><![CDATA[nginx]]></category>

		<guid isPermaLink="false">http://blog.herbertm.ca/?p=334</guid>
		<description><![CDATA[Documentation in this arena being slim, I felt it would be helpful to write a short article on my configuration. FastCGI examples are generally documented in about two or three blog posts on the subject, all of which have become dated. For the basic ground work take a look at streamhacker. Firstly, the fastcgi process [...]]]></description>
			<content:encoded><![CDATA[<p></p><p>Documentation in this arena being slim, I felt it would be helpful to write a short article on my configuration. FastCGI examples are generally documented in about <a href="http://www.dikant.de/2009/07/29/running-mercurial-with-fastcgi-in-nginx/">two</a> or <a href="http://geeksharp.com/2010/01/20/mercurial-web-with-fastcgi-nginx/">three</a> blog posts on the subject, all of which have become dated. For the basic ground work take a look at <a href="http://streamhacker.com/2009/07/28/how-to-deploy-hgwebdir-fcgi-behind-nginx-with-fab/comment-page-1">streamhacker</a>.</p>

<p>Firstly, the fastcgi process is unaware whether you are using <span class="caps">HTTP </span>or <span class="caps">HTTPS, </span>another fastcgi_param must be passed to solve the following error:</p>


<pre>
searching for changes
ssl required
</pre>




<pre>
fastcgi_param   HTTPS           on;
</pre>



<p>If you are having the following error, and you have ensured that <span class="caps">HTTPS </span>is functioning and allow_push = username is specified in the repo&#8217;s <em>.hg/hgrc</em>:</p>


<pre>
searching for changes
27 changesets found
abort: authorization failed
</pre>



<p>Then the fastcgi process isn&#8217;t receiving the username from nginx. Ensure that the following lines are added to your nginx config:</p>


<pre>
fastcgi_param   AUTH_USER       $remote_user;
fastcgi_param   REMOTE_USER     $remote_user;
</pre>



<p>Nginx is also liable to spit out a:</p>


<pre>413 Request Entity Too Large</pre>


<p>on your first major commit. This is because the max_body_size is set low by default and is unacceptable for a mercurial application. Ensure to add and modify this line to your needs:</p>


<pre>
client_max_body_size    100M;
</pre>


<p><strong>my entire nginx vhost.conf</strong></p>


<pre>
server {
    listen      443;
    server_name hg.DOMAIN.COM;

    ssl                  on;
    ssl_certificate      server.crt;
    ssl_certificate_key  server.key;
    ssl_session_timeout  5m;
    ssl_protocols  SSLv2 SSLv3 TLSv1;
    ssl_ciphers  ALL:!ADH:!EXPORT56:RC4+RSA:+HIGH:+MEDIUM:+LOW:+SSLv2:+EXP;
    ssl_prefer_server_ciphers   on;

        # Increase transfer size to accommodate large pushes
        client_max_body_size    100M;

        location / {
                auth_basic &quot;Restricted Access&quot;;
                auth_basic_user_file /repo/sites/hg.DOMAIN.COM/mercurial_passwd;
                fastcgi_pass    127.0.0.1:9001;
                fastcgi_param   PATH_INFO       $fastcgi_script_name;
                fastcgi_param   AUTH_USER       $remote_user;
                fastcgi_param   REMOTE_USER     $remote_user;
                fastcgi_param   QUERY_STRING    $query_string;
                fastcgi_param   REQUEST_METHOD  $request_method;
                fastcgi_param   CONTENT_TYPE    $content_type;
                fastcgi_param   CONTENT_LENGTH  $content_length;
                fastcgi_param   SERVER_PROTOCOL $server_protocol;
                fastcgi_param   SERVER_PORT     $server_port;
                fastcgi_param   SERVER_NAME     $server_name;
                fastcgi_param   HTTPS           on;
        }
        location ~ /\.ht {
            deny  all;
        }
}
</pre>]]></content:encoded>
			<wfw:commentRss>http://blog.herbertm.ca/archives/334/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>mercurial clone from ssh with spaces</title>
		<link>http://blog.herbertm.ca/archives/331</link>
		<comments>http://blog.herbertm.ca/archives/331#comments</comments>
		<pubDate>Tue, 23 Feb 2010 20:45:54 +0000</pubDate>
		<dc:creator>Herb</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[mercurial]]></category>

		<guid isPermaLink="false">http://blog.herbertm.ca/?p=331</guid>
		<description><![CDATA[hg clone ssh://user@host/path/to/repo Is simple enough&#8230; But what about when you have a repo called &#8220;big repo&#8221;. Took me a while to figure out (with ssh verbosity) that a combination of the regular special character &#8216;\&#8217; and quotes is required for hg to call the right ssh command. hg clone &#34;ssh://user@host/path/to/big\ repo&#34;]]></description>
			<content:encoded><![CDATA[<p></p><pre>
hg clone ssh://user@host/path/to/repo
</pre>


<p>Is simple enough&#8230;</p>

<p>But what about when you have a repo called &#8220;big repo&#8221;. Took me a while to figure out (with ssh verbosity) that a combination of the regular special character &#8216;\&#8217; and quotes is required for hg to call the right ssh command.</p>


<pre>
hg clone &quot;ssh://user@host/path/to/big\ repo&quot;
</pre>]]></content:encoded>
			<wfw:commentRss>http://blog.herbertm.ca/archives/331/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>A Simple Test</title>
		<link>http://blog.herbertm.ca/archives/327</link>
		<comments>http://blog.herbertm.ca/archives/327#comments</comments>
		<pubDate>Sat, 13 Feb 2010 01:16:40 +0000</pubDate>
		<dc:creator>Herb</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[Linux]]></category>

		<guid isPermaLink="false">http://blog.herbertm.ca/?p=327</guid>
		<description><![CDATA[A simple test this evening between two FreeBSD 8.0-RELEASE machines. OpenVPN 2.1.1 compile from ports (source). gen2 i386, Pentium 4 2.0GHz 2.0GB circa 2003 [root@gen2 /usr/ports/security/openvpn]# make install real 4m11.491s user 1m46.402s sys 0m26.863s blackbox i386, Athlon Thunderbird 1.0GHz 512MB circa 2001 [root@blackbox /usr/ports/security/openvpn]# make install real 6m9.970s user 3m15.515s sys 0m43.739s]]></description>
			<content:encoded><![CDATA[<p></p><p>A simple test this evening between two FreeBSD 8.0-RELEASE machines. OpenVPN 2.1.1 compile from ports (source).</p>

<p><strong>gen2</strong> <em>i386, Pentium 4 2.0GHz 2.0GB circa 2003</em></p>


<pre>
[root@gen2 /usr/ports/security/openvpn]# make install
real	4m11.491s
user	1m46.402s
sys	0m26.863s
</pre>



<p><strong>blackbox</strong> <em>i386, Athlon Thunderbird 1.0GHz 512MB circa 2001</em></p>


<pre>
[root@blackbox /usr/ports/security/openvpn]# make install
real	6m9.970s
user	3m15.515s
sys	0m43.739s
</pre>]]></content:encoded>
			<wfw:commentRss>http://blog.herbertm.ca/archives/327/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>FreeBSD 8.0 ZFS Tuning</title>
		<link>http://blog.herbertm.ca/archives/315</link>
		<comments>http://blog.herbertm.ca/archives/315#comments</comments>
		<pubDate>Sat, 06 Feb 2010 19:43:33 +0000</pubDate>
		<dc:creator>Herb</dc:creator>
				<category><![CDATA[Linux]]></category>

		<guid isPermaLink="false">http://blog.herbertm.ca/?p=315</guid>
		<description><![CDATA[I recently migrated my RAID-5 home storage array to RAIDZ using ZFS on FreeBSD 8.0-RELEASE. FreeBSD&#8217;s latest release includes ZFS v13 with many tuning patches, making ZFS not only more stable but easier to tune. It is noted that on 64-bit systems with over 2GB RAM, default auto-tuning settings will be quite stable. However in [...]]]></description>
			<content:encoded><![CDATA[<p></p><p>I recently migrated my <span class="caps">RAID</span>-5 home storage array to <a href="http://en.wikipedia.org/wiki/Non-standard_RAID_levels#RAID-Z"><span class="caps">RAIDZ</span></a> using <span class="caps">ZFS </span>on FreeBSD 8.0-RELEASE. FreeBSD&#8217;s latest release includes <span class="caps">ZFS </span>v13 with many tuning patches, making <span class="caps">ZFS </span>not only more stable but easier to tune.</p>

<p>It is noted that on 64-bit systems with over 2GB <span class="caps">RAM, </span>default auto-tuning settings will be quite stable. However in any other configuration some tuning is still necessary to achieve a stable system.</p>

<p>On 32-bit you still have to compile a custom kernel per these <a href="http://www.freebsd.org/doc/handbook/kernelconfig-building.html">instructions</a>. If it is your first time compiling a custom kernel, don&#8217;t worry it is a very short procedure. Kernel <span class="caps">KVA</span>_PAGES (virtual address space) must be increased to allow for <span class="caps">ZFS </span>to use more kernel memory. The setting for this value depends on other userland applications that will be running on the server, and how much memory they require. <span class="caps">KVA</span>_PAGES value must be a multiple of 4 and that is how you can determine the kernel memory allocation, in my case:</p>


<pre>
KVA_PAGES=384 -&gt; 384 * 4 -&gt; 1536MB (1.5GB)
</pre>



<p>System configuration:</p>


<pre>
FreeBSD/i386 8.0 (Pentium 4)
2GB RAM
965GB ZFS RAID-Z over 3 drives
</pre>



<p>The general guideline I followed for setting tuning values was:</p>


<pre>
vm.kmem_size -&gt; 1/2 of total RAM
vm.kmem_size_max -&gt; 1/2 of total RAM
vfs.zfs.arc_max -&gt; 1/2 of vm.kmem_size_max
</pre>



<p>However when testing at high transfer load (1000mbit <span class="caps">LAN</span>) with arc_max set to 512MB I still experienced kernel panics. I still suggest starting at 1/2 of kmem_size and working down from there. </p>

<p>Final stable tuning values:</p>


<pre>
# /boot/loader.conf
vm.kmem_size=&quot;1024M&quot;
vm.kmem_size_max=&quot;1024M&quot;
vfs.zfs.arc_max=&quot;256M&quot;

# /etc/sysctl.conf
kern.maxvnodes=&quot;400000&quot;

# Custom Kernel Options
options    KVA_PAGES=384    # increase kernel virtual address space for ZFS
</pre>]]></content:encoded>
			<wfw:commentRss>http://blog.herbertm.ca/archives/315/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Archive Password Recovery</title>
		<link>http://blog.herbertm.ca/archives/344</link>
		<comments>http://blog.herbertm.ca/archives/344#comments</comments>
		<pubDate>Thu, 21 Jan 2010 18:18:58 +0000</pubDate>
		<dc:creator>Herb</dc:creator>
				<category><![CDATA[Linux]]></category>

		<guid isPermaLink="false">http://blog.herbertm.ca/?p=344</guid>
		<description><![CDATA[<br />
<b>Fatal error</b>:  Allowed memory size of 33554432 bytes exhausted (tried to allocate 7680 bytes) in <b>/home/herbertm/public_html/blog/wp-content/plugins/textile-2/class/Textile.php(3245) : runtime-created function</b> on line <b>1</b><br />

