<?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>David Hrbáč</title>
	<atom:link href="http://www.hrbac.cz/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.hrbac.cz</link>
	<description>Just another WordPress weblog</description>
	<lastBuildDate>Mon, 30 Aug 2010 08:08:44 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>avgd stops listening on port 54322</title>
		<link>http://www.hrbac.cz/2010/08/avgd-stops-listening-on-port-54322/</link>
		<comments>http://www.hrbac.cz/2010/08/avgd-stops-listening-on-port-54322/#comments</comments>
		<pubDate>Mon, 30 Aug 2010 08:08:44 +0000</pubDate>
		<dc:creator>David Hrbáč</dc:creator>
				<category><![CDATA[mailing]]></category>

		<guid isPermaLink="false">http://www.hrbac.cz/?p=226</guid>
		<description><![CDATA[Last days I&#8217;m experiencing avgd not responding. Avgd stops to listen on port 54322, amavisd-new timeouts on talking to AV. Mails are being held and queue is slowly increasing its number. It&#8217;s strange, that I&#8217;m experiencing it not only on one production system&#8230;

Aug 29 04:59:46 rakosnicek amavis&#91;25940&#93;: &#40;25940-01-5&#41; &#40;!&#41;AVG Anti-Virus av-scanner FAILED: run_av error: Too [...]]]></description>
			<content:encoded><![CDATA[<p>Last days I&#8217;m experiencing avgd not responding. Avgd stops to listen on port 54322, amavisd-new timeouts on talking to AV. Mails are being held and queue is slowly increasing its number. It&#8217;s strange, that I&#8217;m experiencing it not only on one production system&#8230;</p>

<div class="wp_syntax"><div class="code"><pre class="vim" style="font-family:monospace;">Aug <span style="color: #000000; font-weight:bold;">29</span> 04<span style="color: #000000;">:</span><span style="color: #000000; font-weight:bold;">59</span><span style="color: #000000;">:</span><span style="color: #000000; font-weight:bold;">46</span> rakosnicek amavis<span style="color: #000000;">&#91;</span><span style="color: #000000; font-weight:bold;">25940</span><span style="color: #000000;">&#93;</span><span style="color: #000000;">:</span> <span style="color: #000000;">&#40;</span><span style="color: #000000; font-weight:bold;">25940</span><span style="color: #000000;">-</span>01<span style="color: #000000;">-</span><span style="color: #000000; font-weight:bold;">5</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#40;</span><span style="color: #000000;">!</span><span style="color: #000000;">&#41;</span>AVG Anti<span style="color: #000000;">-</span>Virus av<span style="color: #000000;">-</span>scanner FAILED<span style="color: #000000;">:</span> run_av error<span style="color: #000000;">:</span> Too many retries to talk to 127<span style="color: #000000;">.</span>0<span style="color: #000000;">.</span>0<span style="color: #000000;">.</span>1<span style="color: #000000;">:</span><span style="color: #000000; font-weight:bold;">54322</span> <span style="color: #000000;">&#40;</span>timed
out<span style="color: #000000;">&#41;</span> at <span style="color: #000000;">&#40;</span><span style="color: #25BB4D;">eval</span> <span style="color: #000000; font-weight:bold;">111</span><span style="color: #000000;">&#41;</span> <span style="color: #25BB4D;">line</span> 373<span style="color: #000000;">.</span>\n</pre></div></div>

<p>It seems working after changing a little bit AVG configuration with following values:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">avgcfgctl <span style="color: #660033;">-w</span> Default.setup.features.antispam=<span style="color: #c20cb9; font-weight: bold;">false</span>
avgcfgctl <span style="color: #660033;">-w</span> Default.tcpd.avg.limiter_start=<span style="color: #000000;">150</span>
avgcfgctl <span style="color: #660033;">-w</span> Default.tcpd.avg.limiter_stop=<span style="color: #000000;">200</span>
avgcfgctl <span style="color: #660033;">-w</span> Default.tcpd.avg.timeout=<span style="color: #000000;">5000</span>
avgcfgctl <span style="color: #660033;">-w</span> Default.tcpd.smtp.enabled=<span style="color: #c20cb9; font-weight: bold;">false</span>
avgctl <span style="color: #660033;">--restart</span>=tcpd</pre></div></div>

]]></content:encoded>
			<wfw:commentRss>http://www.hrbac.cz/2010/08/avgd-stops-listening-on-port-54322/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Firefox 3.6.2 and Thunderbird 3.0.3 for CentOS 5.4</title>
		<link>http://www.hrbac.cz/2010/03/firefox-3-6-2-and-thunderbird-3-0-3-for-centos-5-4/</link>
		<comments>http://www.hrbac.cz/2010/03/firefox-3-6-2-and-thunderbird-3-0-3-for-centos-5-4/#comments</comments>
		<pubDate>Wed, 24 Mar 2010 09:08:58 +0000</pubDate>
		<dc:creator>David Hrbáč</dc:creator>
				<category><![CDATA[CentOS 5.x]]></category>

		<guid isPermaLink="false">http://www.hrbac.cz/?p=217</guid>
		<description><![CDATA[It&#8217;s a quite long time I have announced Firefox 3.6 and Thunderbird 3.0 packages for CentOS 5.  Announcement has been submitted via CentOS mail-list. See http://lists.centos.org/pipermail/centos-devel/2010-February/005416.html and http://lists.centos.org/pipermail/centos/2010-February/090418.html.
Packages have been tested by users and have been always within the testing repository only. Today I&#8217;m pushing new firefox 3.6.2 into the stable repository together with xulrunner, [...]]]></description>
			<content:encoded><![CDATA[<p>It&#8217;s a quite long time I have announced Firefox 3.6 and Thunderbird 3.0 packages for CentOS 5.  Announcement has been submitted via CentOS mail-list. See <a href="http://lists.centos.org/pipermail/centos-devel/2010-February/005416.html">http://lists.centos.org/pipermail/centos-devel/2010-February/005416.html</a> and <a href="http://lists.centos.org/pipermail/centos/2010-February/090418.html">http://lists.centos.org/pipermail/centos/2010-February/090418.html</a>.</p>
<p>Packages have been tested by users and have been always within the testing repository only. Today I&#8217;m pushing new firefox 3.6.2 into the stable repository together with xulrunner, mozilla-filesystem, and thunderbird. Packages are to be found here:</p>
<p><a href="http://fs12.vsb.cz/hrb33/el5/hrb/stable/i386/repoview/">http://fs12.vsb.cz/hrb33/el5/hrb/stable/i386/repoview/</a></p>
<p><a href="http://fs12.vsb.cz/hrb33/el5/hrb/stable/x86_64/repoview/">http://fs12.vsb.cz/hrb33/el5/hrb/stable/x86_64/repoview/</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.hrbac.cz/2010/03/firefox-3-6-2-and-thunderbird-3-0-3-for-centos-5-4/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Nagios and dpt-i2o-raidutils, raidutil check</title>
		<link>http://www.hrbac.cz/2010/02/nagios-and-dpt-i2o-raidutils-raidutil-check/</link>
		<comments>http://www.hrbac.cz/2010/02/nagios-and-dpt-i2o-raidutils-raidutil-check/#comments</comments>
		<pubDate>Fri, 05 Feb 2010 08:24:49 +0000</pubDate>
		<dc:creator>David Hrbáč</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://www.hrbac.cz/?p=206</guid>
		<description><![CDATA[We do check our production boxes with hardware raid cards on raid status. We are using our script to call raidutil, which is running fine, but not under nagios user. Permissions for the files are as follows:

-rwxr-xr-x 1 root root 254708 Aug 20  2008 raideng
-rwxr-xr-x 1 root root 255880 Aug 20  2008 raidutil

Solution [...]]]></description>
			<content:encoded><![CDATA[<p>We do check our production boxes with hardware raid cards on raid status. We are using our script to call raidutil, which is running fine, but not under nagios user. Permissions for the files are as follows:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #660033;">-rwxr-xr-x</span> <span style="color: #000000;">1</span> root root <span style="color: #000000;">254708</span> Aug <span style="color: #000000;">20</span>  <span style="color: #000000;">2008</span> raideng
<span style="color: #660033;">-rwxr-xr-x</span> <span style="color: #000000;">1</span> root root <span style="color: #000000;">255880</span> Aug <span style="color: #000000;">20</span>  <span style="color: #000000;">2008</span> raidutil</pre></div></div>

<p>Solution is to add proper rights to utils with:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">chmod</span> u+s raid<span style="color: #000000; font-weight: bold;">*</span></pre></div></div>

<p>It should look like this:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #660033;">-rwxr-xr-x</span> <span style="color: #000000;">1</span> root root <span style="color: #000000;">254708</span> Aug <span style="color: #000000;">20</span>  <span style="color: #000000;">2008</span> raideng
<span style="color: #660033;">-rwxr-xr-x</span> <span style="color: #000000;">1</span> root root <span style="color: #000000;">255880</span> Aug <span style="color: #000000;">20</span>  <span style="color: #000000;">2008</span> raidutil</pre></div></div>

]]></content:encoded>
			<wfw:commentRss>http://www.hrbac.cz/2010/02/nagios-and-dpt-i2o-raidutils-raidutil-check/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Sed to correct path lines</title>
		<link>http://www.hrbac.cz/2010/02/sed-to-correct-path-lines/</link>
		<comments>http://www.hrbac.cz/2010/02/sed-to-correct-path-lines/#comments</comments>
		<pubDate>Thu, 04 Feb 2010 12:22:56 +0000</pubDate>
		<dc:creator>David Hrbáč</dc:creator>
				<category><![CDATA[regular expressions]]></category>
		<category><![CDATA[sed]]></category>

		<guid isPermaLink="false">http://www.hrbac.cz/?p=196</guid>
		<description><![CDATA[Sed one-liner to change correct paths. Before:

php_admin_value open_basedir /srv/www/www.domena.tld/www

After:

php_admin_value open_basedir /srv/www/www.domena.tld

Sed script:

sed -i &#34;s/\(.*\)php_admin_value open_basedir \(.*\)\/www$/\1php_admin_value open_basedir \2/g&#34; /etc/httpd/conf/httpd.conf

]]></description>
			<content:encoded><![CDATA[<p>Sed one-liner to change correct paths. Before:</p>

<div class="wp_syntax"><div class="code"><pre class="apache" style="font-family:monospace;"><span style="color: #00007f;">php_admin_value</span> open_basedir /srv/www/www.domena.tld/www</pre></div></div>

<p>After:</p>

<div class="wp_syntax"><div class="code"><pre class="apache" style="font-family:monospace;"><span style="color: #00007f;">php_admin_value</span> open_basedir /srv/www/www.domena.tld</pre></div></div>

<p>Sed script:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">sed</span> <span style="color: #660033;">-i</span> <span style="color: #ff0000;">&quot;s/\(.*\)php_admin_value open_basedir \(.*\)\/www$/\1php_admin_value open_basedir \2/g&quot;</span> <span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>httpd<span style="color: #000000; font-weight: bold;">/</span>conf<span style="color: #000000; font-weight: bold;">/</span>httpd.conf</pre></div></div>

]]></content:encoded>
			<wfw:commentRss>http://www.hrbac.cz/2010/02/sed-to-correct-path-lines/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Upgrade DAViCal 0.9.7.2 to 0.9.8</title>
		<link>http://www.hrbac.cz/2010/02/upgrade-davical-0-9-7-2-to-0-9-8/</link>
		<comments>http://www.hrbac.cz/2010/02/upgrade-davical-0-9-7-2-to-0-9-8/#comments</comments>
		<pubDate>Wed, 03 Feb 2010 09:54:31 +0000</pubDate>
		<dc:creator>David Hrbáč</dc:creator>
				<category><![CDATA[CentOS]]></category>

		<guid isPermaLink="false">http://www.hrbac.cz/?p=189</guid>
		<description><![CDATA[DAViCal upgrade is quite easy:

&#91;root@fs12 html&#93; wget http://debian.mcmillan.net.nz/packages/davical/davical_0.9.8.orig.tar.gz
&#91;root@fs12 html&#93; tar xvzf davical_0.9.8.orig.tar.gz
&#91;root@fs12 html&#93; cd davical-0.9.8.orig/dba
&#91;root@fs12 dba&#93; su postgres
bash-3.00$ ./update-davical-database 
The database is version 8.1 currently at revision 1.2.5.
Applying patch 1.2.6.sql ... succeeded.
Applying patch 1.2.7.sql ... succeeded.
Successfully applied 2 patches.
Supported locales updated.
Updated view: dav_principal.sql applied.
CalDAV functions updated.
RRULE functions updated.
Database permissions updated.
bash-3.00$ exit
&#91;root@fs12 html&#93; ln -s davical-0.9.8.orig [...]]]></description>
			<content:encoded><![CDATA[<p>DAViCal upgrade is quite easy:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #7a0874; font-weight: bold;">&#91;</span>root<span style="color: #000000; font-weight: bold;">@</span>fs12 html<span style="color: #7a0874; font-weight: bold;">&#93;</span> <span style="color: #c20cb9; font-weight: bold;">wget</span> http:<span style="color: #000000; font-weight: bold;">//</span>debian.mcmillan.net.nz<span style="color: #000000; font-weight: bold;">/</span>packages<span style="color: #000000; font-weight: bold;">/</span>davical<span style="color: #000000; font-weight: bold;">/</span>davical_0.9.8.orig.tar.gz
<span style="color: #7a0874; font-weight: bold;">&#91;</span>root<span style="color: #000000; font-weight: bold;">@</span>fs12 html<span style="color: #7a0874; font-weight: bold;">&#93;</span> <span style="color: #c20cb9; font-weight: bold;">tar</span> xvzf davical_0.9.8.orig.tar.gz
<span style="color: #7a0874; font-weight: bold;">&#91;</span>root<span style="color: #000000; font-weight: bold;">@</span>fs12 html<span style="color: #7a0874; font-weight: bold;">&#93;</span> <span style="color: #7a0874; font-weight: bold;">cd</span> davical-0.9.8.orig<span style="color: #000000; font-weight: bold;">/</span>dba
<span style="color: #7a0874; font-weight: bold;">&#91;</span>root<span style="color: #000000; font-weight: bold;">@</span>fs12 dba<span style="color: #7a0874; font-weight: bold;">&#93;</span> <span style="color: #c20cb9; font-weight: bold;">su</span> postgres
bash-<span style="color: #000000;">3.00</span>$ .<span style="color: #000000; font-weight: bold;">/</span>update-davical-database 
The database is version <span style="color: #000000;">8.1</span> currently at revision 1.2.5.
Applying <span style="color: #c20cb9; font-weight: bold;">patch</span> 1.2.6.sql ... succeeded.
Applying <span style="color: #c20cb9; font-weight: bold;">patch</span> 1.2.7.sql ... succeeded.
Successfully applied <span style="color: #000000;">2</span> patches.
Supported locales updated.
Updated view: dav_principal.sql applied.
CalDAV functions updated.
RRULE functions updated.
Database permissions updated.
bash-<span style="color: #000000;">3.00</span>$ <span style="color: #7a0874; font-weight: bold;">exit</span>
<span style="color: #7a0874; font-weight: bold;">&#91;</span>root<span style="color: #000000; font-weight: bold;">@</span>fs12 html<span style="color: #7a0874; font-weight: bold;">&#93;</span> <span style="color: #c20cb9; font-weight: bold;">ln</span> <span style="color: #660033;">-s</span> davical-0.9.8.orig davical</pre></div></div>

<p>That&#8217;s all.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.hrbac.cz/2010/02/upgrade-davical-0-9-7-2-to-0-9-8/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Zoner Antivirus with Amavisd-new</title>
		<link>http://www.hrbac.cz/2010/02/zoner-antivirus-with-amavisd-new/</link>
		<comments>http://www.hrbac.cz/2010/02/zoner-antivirus-with-amavisd-new/#comments</comments>
		<pubDate>Mon, 01 Feb 2010 21:05:04 +0000</pubDate>
		<dc:creator>David Hrbáč</dc:creator>
				<category><![CDATA[mailing]]></category>

		<guid isPermaLink="false">http://www.hrbac.cz/?p=157</guid>
		<description><![CDATA[Today I have decided to test Amavisd-new with free Zoner Antivirus for Linux. First of all you have to download the package, (test it), install, and change the ownership. Then edit the configuration.

wget http://update.zonerantivirus.com/download/zav-1.2.2-redhat-i586.rpm --nodeps
rpm -Uhv zav-1.2.2-redhat-i586.rpm --test
rpm -Uhv zav-1.2.2-redhat-i586.rpm
chown amavis: /opt/zav -R
chown amavis: /var/run/zav -R
vi /etc/zav/zavd.conf

So, we have changed the ownership. Now we have [...]]]></description>
			<content:encoded><![CDATA[<p>Today I have decided to test Amavisd-new with free Zoner Antivirus for Linux. First of all you have to download the package, (test it), install, and change the ownership. Then edit the configuration.</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">wget</span> http:<span style="color: #000000; font-weight: bold;">//</span>update.zonerantivirus.com<span style="color: #000000; font-weight: bold;">/</span>download<span style="color: #000000; font-weight: bold;">/</span>zav-1.2.2-redhat-i586.rpm <span style="color: #660033;">--nodeps</span>
rpm <span style="color: #660033;">-Uhv</span> zav-1.2.2-redhat-i586.rpm <span style="color: #660033;">--test</span>
rpm <span style="color: #660033;">-Uhv</span> zav-1.2.2-redhat-i586.rpm
<span style="color: #c20cb9; font-weight: bold;">chown</span> amavis: <span style="color: #000000; font-weight: bold;">/</span>opt<span style="color: #000000; font-weight: bold;">/</span>zav <span style="color: #660033;">-R</span>
<span style="color: #c20cb9; font-weight: bold;">chown</span> amavis: <span style="color: #000000; font-weight: bold;">/</span>var<span style="color: #000000; font-weight: bold;">/</span>run<span style="color: #000000; font-weight: bold;">/</span>zav <span style="color: #660033;">-R</span>
<span style="color: #c20cb9; font-weight: bold;">vi</span> <span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>zav<span style="color: #000000; font-weight: bold;">/</span>zavd.conf</pre></div></div>

<p>So, we have changed the ownership. Now we have to change the daemon user to <strong>amavis </strong>too.</p>

<div class="wp_syntax"><div class="code"><pre class="vim" style="font-family:monospace;"># user under which to run the daemon
ZAVD_USER               = <span style="color: #C5A22D;">&quot;amavis&quot;</span>
ZAVD_GROUP              = <span style="color: #C5A22D;">&quot;amavis&quot;</span>
# Your license key <span style="color: #804040;">for</span> accessing ZAV update
UPDATE_KEY              = <span style="color: #C5A22D;">&quot;11111-22222-SAMPLE-33333-44444&quot;</span></pre></div></div>

<p>We can start and update ZAV with:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>init.d<span style="color: #000000; font-weight: bold;">/</span>zavd start
<span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>init.d<span style="color: #000000; font-weight: bold;">/</span>zavd update</pre></div></div>

<p>Finally we have to change Amavisd-new configuration by adding the following:</p>

<div class="wp_syntax"><div class="code"><pre class="vim" style="font-family:monospace;"> ### http<span style="color: #000000;">://</span>www<span style="color: #000000;">.</span>grisoft<span style="color: #000000;">.</span><span style="color: #668080;">com</span><span style="color: #000000;">/</span>
 <span style="color: #000000;">&#91;</span><span style="color: #C5A22D;">'Zoner Anti-Virus'</span>,
#  <span style="color: #C5A22D;">'/opt/zav/bin/zavcli'</span>, <span style="color: #C5A22D;">'-z /var/run/zav/zavd.sock {}'</span>,
  <span style="color: #C5A22D;">'/opt/zav/bin/zavcli'</span>, <span style="color: #C5A22D;">' {}'</span>,
  <span style="color: #000000;">&#91;</span><span style="color: #000000; font-weight:bold;">0</span>,<span style="color: #000000; font-weight:bold;">1</span>,<span style="color: #000000; font-weight:bold;">2</span>,<span style="color: #000000; font-weight:bold;">3</span>,<span style="color: #000000; font-weight:bold;">4</span><span style="color: #000000;">&#93;</span>, <span style="color: #000000;">&#91;</span><span style="color: #000000; font-weight:bold;">5</span>,<span style="color: #000000; font-weight:bold;">6</span>,<span style="color: #000000; font-weight:bold;">7</span>,<span style="color: #000000; font-weight:bold;">11</span><span style="color: #000000;">&#93;</span>,
  qr<span style="color: #000000;">/^.*:</span>\ <span style="color: #000000;">&#40;</span>SUSPICIOUS<span style="color: #000000;">|</span>PROBINFECTED<span style="color: #000000;">|</span>INFECTED<span style="color: #000000;">&#41;</span>\ \<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">.*</span><span style="color: #000000;">&#41;</span>\<span style="color: #000000;">&#41;</span><span style="color: #000000;">$/</span>
<span style="color: #000000;">&#93;</span></pre></div></div>

]]></content:encoded>
			<wfw:commentRss>http://www.hrbac.cz/2010/02/zoner-antivirus-with-amavisd-new/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Send file as attachment from commnad line</title>
		<link>http://www.hrbac.cz/2010/01/send-file-as-attachment-from-commnad-line/</link>
		<comments>http://www.hrbac.cz/2010/01/send-file-as-attachment-from-commnad-line/#comments</comments>
		<pubDate>Mon, 18 Jan 2010 13:04:28 +0000</pubDate>
		<dc:creator>David Hrbáč</dc:creator>
				<category><![CDATA[bash]]></category>
		<category><![CDATA[mailing]]></category>

		<guid isPermaLink="false">http://www.hrbac.cz/?p=145</guid>
		<description><![CDATA[There&#8217;s an easy way of sending files as attachment from command line:

uuencode file name &#124; mail -s &#34;Subject&#34; &#34;to@tld.cz&#34;  -- -ffrom@tld.cz

Yes, there is double hyphen and -f before the from email address.
]]></description>
			<content:encoded><![CDATA[<p>There&#8217;s an easy way of sending files as attachment from command line:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">uuencode <span style="color: #c20cb9; font-weight: bold;">file</span> name <span style="color: #000000; font-weight: bold;">|</span> mail <span style="color: #660033;">-s</span> <span style="color: #ff0000;">&quot;Subject&quot;</span> <span style="color: #ff0000;">&quot;to@tld.cz&quot;</span>  <span style="color: #660033;">--</span> -ffrom<span style="color: #000000; font-weight: bold;">@</span>tld.cz</pre></div></div>

<p>Yes, there is double hyphen and -f before the from email address.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.hrbac.cz/2010/01/send-file-as-attachment-from-commnad-line/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>pure-ftpd with geoip</title>
		<link>http://www.hrbac.cz/2009/10/pure-ftpd-with-geoip/</link>
		<comments>http://www.hrbac.cz/2009/10/pure-ftpd-with-geoip/#comments</comments>
		<pubDate>Fri, 16 Oct 2009 15:31:48 +0000</pubDate>
		<dc:creator>David Hrbáč</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://www.hrbac.cz/?p=94</guid>
		<description><![CDATA[During the last few weeks we are experiencing compromised FTP accounts within our production. These accounts seem to be stolen from infected Windows client machines, infected by malware or trojans. As far as I know the issues, everyone of them is using Total Commander&#8230; TC seems to save the credentials in plain text form, unencrypted. [...]]]></description>
			<content:encoded><![CDATA[<p>During the last few weeks we are experiencing compromised FTP accounts within our production. These accounts seem to be stolen from infected Windows client machines, infected by malware or trojans. As far as I know the issues, everyone of them is using Total Commander&#8230; TC seems to save the credentials in plain text form, unencrypted. Fine.</p>
<p>I have been going through pure-ftpd log to gather ips that had been used to upload files. I&#8217;ve found that most of them were outside our country, China, Romania, Russia, etc. So I decided to limit users set and allow only ips from Czech Republic. I wanted to go with iptables geoip module, which is working very fine. But I have found geoip patch for pure-ftpd. I have corrected it a little bit and finally created RPM packages for Centos4/5. You can find the packages within my repository. Feel free to use&#8230;</p>
<h3>Packages</h3>
<p><a href="http://fs12.vsb.cz/hrb33/el5/hrb/stable/i386/repoview/pure-ftpd.html">http://fs12.vsb.cz/hrb33/el5/hrb/stable/i386/repoview/pure-ftpd.html</a><br />
<a href="http://fs12.vsb.cz/hrb33/el5/hrb/stable/x86_64/repoview/pure-ftpd.html">http://fs12.vsb.cz/hrb33/el5/hrb/stable/x86_64/repoview/pure-ftpd.html</a></p>
<p><a href="http://fs12.vsb.cz/hrb33/el4/hrb/stable/i386/repoview/pure-ftpd.html">http://fs12.vsb.cz/hrb33/el4/hrb/stable/i386/repoview/pure-ftpd.html</a><br />
<a href="http://fs12.vsb.cz/hrb33/el4/hrb/stable/x86_64/repoview/pure-ftpd.html"> http://fs12.vsb.cz/hrb33/el4/hrb/stable/x86_64/repoview/pure-ftpd.html</a></p>
<h3>The patch</h3>

<div class="wp_syntax"><div class="code"><pre class="c" style="font-family:monospace;">diff <span style="color: #339933;">-</span>ur pure<span style="color: #339933;">-</span>ftpd<span style="color: #339933;">-</span>1.0.22<span style="color: #339933;">/</span>src<span style="color: #339933;">/</span>ftpd.<span style="color: #202020;">c</span> pure<span style="color: #339933;">-</span>ftpd<span style="color: #339933;">-</span>1.0.22<span style="color: #339933;">-</span>geoip<span style="color: #339933;">/</span>src<span style="color: #339933;">/</span>ftpd.<span style="color: #202020;">c</span>
<span style="color: #339933;">---</span> pure<span style="color: #339933;">-</span>ftpd<span style="color: #339933;">-</span>1.0.22<span style="color: #339933;">/</span>src<span style="color: #339933;">/</span>ftpd.<span style="color: #202020;">c</span> <span style="color: #0000dd;">2009</span><span style="color: #339933;">-</span><span style="color:#800080;">09</span><span style="color: #339933;">-</span><span style="color: #0000dd;">17</span> <span style="color:#800080;">09</span><span style="color: #339933;">:</span><span style="color: #0000dd;">38</span><span style="color: #339933;">:</span><span style="color:#800080;">04.000000000</span> <span style="color: #339933;">+</span><span style="color: #208080;">0200</span>
<span style="color: #339933;">+++</span> pure<span style="color: #339933;">-</span>ftpd<span style="color: #339933;">-</span>1.0.22<span style="color: #339933;">-</span>geoip<span style="color: #339933;">/</span>src<span style="color: #339933;">/</span>ftpd.<span style="color: #202020;">c</span>   <span style="color: #0000dd;">2009</span><span style="color: #339933;">-</span><span style="color:#800080;">09</span><span style="color: #339933;">-</span><span style="color: #0000dd;">17</span> <span style="color:#800080;">09</span><span style="color: #339933;">:</span><span style="color: #0000dd;">34</span><span style="color: #339933;">:</span><span style="color:#800080;">03.000000000</span> <span style="color: #339933;">+</span><span style="color: #208080;">0200</span>
@@ <span style="color: #339933;">-</span><span style="color: #0000dd;">34</span><span style="color: #339933;">,</span><span style="color: #0000dd;">6</span> <span style="color: #339933;">+</span><span style="color: #0000dd;">34</span><span style="color: #339933;">,</span><span style="color: #0000dd;">8</span> @@
 <span style="color: #339933;"># include &quot;osx-extensions.h&quot;</span>
 <span style="color: #339933;">#endif</span>
&nbsp;
<span style="color: #339933;">+</span><span style="color: #339933;">#include &quot;GeoIP.h&quot;</span>
<span style="color: #339933;">+</span>
 <span style="color: #339933;">#ifdef WITH_GSSAPI</span>
 <span style="color: #339933;"># include &quot;auth_gssapi.h&quot;</span>
 <span style="color: #339933;">#endif</span>
@@ <span style="color: #339933;">-</span><span style="color: #0000dd;">4818</span><span style="color: #339933;">,</span><span style="color: #0000dd;">7</span> <span style="color: #339933;">+</span><span style="color: #0000dd;">4820</span><span style="color: #339933;">,</span><span style="color: #0000dd;">7</span> @@
 die<span style="color: #009900;">&#40;</span><span style="color: #0000dd;">421</span><span style="color: #339933;">,</span> LOG_ERR<span style="color: #339933;">,</span> MSG_GETPEERNAME <span style="color: #ff0000;">&quot;: %s&quot;</span> <span style="color: #339933;">,</span> strerror<span style="color: #009900;">&#40;</span>errno<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
 <span style="color: #009900;">&#125;</span>
 fourinsix<span style="color: #009900;">&#40;</span><span style="color: #339933;">&amp;</span>amp<span style="color: #339933;">;</span>peer<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #339933;">-</span>    <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span>checkvalidaddr<span style="color: #009900;">&#40;</span><span style="color: #339933;">&amp;</span>amp<span style="color: #339933;">;</span>peer<span style="color: #009900;">&#41;</span> <span style="color: #339933;">==</span> <span style="color: #0000dd;">0</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
<span style="color: #339933;">+</span>    <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span>checkvalidaddr<span style="color: #009900;">&#40;</span><span style="color: #339933;">&amp;</span>amp<span style="color: #339933;">;</span>peer<span style="color: #009900;">&#41;</span> <span style="color: #339933;">==</span> <span style="color: #0000dd;">0</span> <span style="color: #339933;">||</span> STORAGE_FAMILY<span style="color: #009900;">&#40;</span>ctrlconn<span style="color: #009900;">&#41;</span> <span style="color: #339933;">!=</span> AF_INET<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
 die<span style="color: #009900;">&#40;</span><span style="color: #0000dd;">425</span><span style="color: #339933;">,</span> LOG_ERR<span style="color: #339933;">,</span> MSG_INVALID_IP<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
 <span style="color: #009900;">&#125;</span>
 <span style="color: #339933;">#ifndef DONT_LOG_IP</span>
@@ <span style="color: #339933;">-</span><span style="color: #0000dd;">4854</span><span style="color: #339933;">,</span><span style="color: #0000dd;">6</span> <span style="color: #339933;">+</span><span style="color: #0000dd;">4856</span><span style="color: #339933;">,</span><span style="color: #0000dd;">37</span> @@
 <span style="color: #339933;">*</span>host <span style="color: #339933;">=</span> <span style="color: #ff0000;">'?'</span><span style="color: #339933;">;</span>
 host<span style="color: #009900;">&#91;</span><span style="color: #0000dd;">1</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> <span style="color: #0000dd;">0</span><span style="color: #339933;">;</span>
 <span style="color: #339933;">#endif</span>
<span style="color: #339933;">+</span>    <span style="color: #b1b100;">do</span> <span style="color: #009900;">&#123;</span>
<span style="color: #339933;">+</span>        <span style="color: #993333;">char</span> line<span style="color: #009900;">&#91;</span>LINE_MAX<span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
<span style="color: #339933;">+</span>        GeoIP <span style="color: #339933;">*</span>gi<span style="color: #339933;">;</span>
<span style="color: #339933;">+</span>        <span style="color: #993333;">const</span> <span style="color: #993333;">char</span> <span style="color: #339933;">*</span>country<span style="color: #339933;">;</span>
<span style="color: #339933;">+</span>        <span style="color: #993333;">char</span> <span style="color: #339933;">*</span>sep<span style="color: #339933;">;</span>
<span style="color: #339933;">+</span>        <span style="color: #993333;">int</span> found <span style="color: #339933;">=</span> <span style="color: #0000dd;">0</span><span style="color: #339933;">;</span>
<span style="color: #339933;">+</span>        FILE <span style="color: #339933;">*</span>fp<span style="color: #339933;">;</span>
<span style="color: #339933;">+</span>
<span style="color: #339933;">+</span>        gi <span style="color: #339933;">=</span> GeoIP_new<span style="color: #009900;">&#40;</span>GEOIP_STANDARD<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #339933;">+</span>        country <span style="color: #339933;">=</span> GeoIP_country_code_by_name<span style="color: #009900;">&#40;</span>gi<span style="color: #339933;">,</span> host<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #339933;">+</span>        <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span>country <span style="color: #339933;">==</span> NULL <span style="color: #339933;">||</span> <span style="color: #339933;">*</span>country <span style="color: #339933;">==</span> <span style="color: #0000dd;">0</span> <span style="color: #339933;">||</span>
<span style="color: #339933;">+</span>            <span style="color: #339933;">!</span><span style="color: #009900;">&#40;</span>fp <span style="color: #339933;">=</span> fopen<span style="color: #009900;">&#40;</span>CONFDIR <span style="color: #ff0000;">&quot;/pureftpd-restricted-countries.txt&quot;</span><span style="color: #339933;">,</span> <span style="color: #ff0000;">&quot;r&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
<span style="color: #339933;">+</span>            <span style="color: #000000; font-weight: bold;">break</span><span style="color: #339933;">;</span>
<span style="color: #339933;">+</span>        <span style="color: #009900;">&#125;</span>
<span style="color: #339933;">+</span>        <span style="color: #b1b100;">while</span> <span style="color: #009900;">&#40;</span>fgets<span style="color: #009900;">&#40;</span>line<span style="color: #339933;">,</span> <span style="color: #993333;">sizeof</span> line<span style="color: #339933;">,</span> fp<span style="color: #009900;">&#41;</span> <span style="color: #339933;">!=</span> NULL<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
<span style="color: #339933;">+</span>            <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #339933;">*</span>line <span style="color: #339933;">==</span> <span style="color: #ff0000;">'#'</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
<span style="color: #339933;">+</span>                <span style="color: #b1b100;">continue</span><span style="color: #339933;">;</span>
<span style="color: #339933;">+</span>            <span style="color: #009900;">&#125;</span>
<span style="color: #339933;">+</span>            <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #009900;">&#40;</span>sep <span style="color: #339933;">=</span> strchr<span style="color: #009900;">&#40;</span>line<span style="color: #339933;">,</span> <span style="color: #ff0000;">'<span style="color: #000099; font-weight: bold;">\n</span>'</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">!=</span> NULL<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
<span style="color: #339933;">+</span>                <span style="color: #339933;">*</span>sep <span style="color: #339933;">=</span> <span style="color: #0000dd;">0</span><span style="color: #339933;">;</span>
<span style="color: #339933;">+</span>            <span style="color: #009900;">&#125;</span>
<span style="color: #339933;">+</span>            <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span>strcasecmp<span style="color: #009900;">&#40;</span>line<span style="color: #339933;">,</span> country<span style="color: #009900;">&#41;</span> <span style="color: #339933;">==</span> <span style="color: #0000dd;">0</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
<span style="color: #339933;">+</span>                found<span style="color: #339933;">++;</span>
<span style="color: #339933;">+</span>                <span style="color: #000000; font-weight: bold;">break</span><span style="color: #339933;">;</span>
<span style="color: #339933;">+</span>            <span style="color: #009900;">&#125;</span>
<span style="color: #339933;">+</span>        <span style="color: #009900;">&#125;</span>
<span style="color: #339933;">+</span>        fclose<span style="color: #009900;">&#40;</span>fp<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #339933;">+</span>        <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span>found <span style="color: #339933;">==</span> <span style="color: #0000dd;">0</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
<span style="color: #339933;">+</span>            die<span style="color: #009900;">&#40;</span><span style="color: #0000dd;">425</span><span style="color: #339933;">,</span> LOG_ERR<span style="color: #339933;">,</span> MSG_INVALID_IP<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #339933;">+</span>        <span style="color: #009900;">&#125;</span>
<span style="color: #339933;">+</span>    <span style="color: #009900;">&#125;</span> <span style="color: #b1b100;">while</span><span style="color: #009900;">&#40;</span><span style="color: #0000dd;">0</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
 iptropize<span style="color: #009900;">&#40;</span><span style="color: #339933;">&amp;</span>amp<span style="color: #339933;">;</span>peer<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
 logfile<span style="color: #009900;">&#40;</span>LOG_INFO<span style="color: #339933;">,</span> MSG_NEW_CONNECTION<span style="color: #339933;">,</span> host<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
diff <span style="color: #339933;">-</span>ur pure<span style="color: #339933;">-</span>ftpd<span style="color: #339933;">-</span>1.0.22<span style="color: #339933;">/</span>src<span style="color: #339933;">/</span>Makefile.<span style="color: #202020;">am</span> pure<span style="color: #339933;">-</span>ftpd<span style="color: #339933;">-</span>1.0.22<span style="color: #339933;">-</span>geoip<span style="color: #339933;">/</span>src<span style="color: #339933;">/</span>Makefile.<span style="color: #202020;">am</span>
<span style="color: #339933;">---</span> pure<span style="color: #339933;">-</span>ftpd<span style="color: #339933;">-</span>1.0.22<span style="color: #339933;">/</span>src<span style="color: #339933;">/</span>Makefile.<span style="color: #202020;">am</span>    <span style="color: #0000dd;">2006</span><span style="color: #339933;">-</span><span style="color: #208080;">04</span><span style="color: #339933;">-</span><span style="color: #0000dd;">25</span> <span style="color: #0000dd;">10</span><span style="color: #339933;">:</span><span style="color: #0000dd;">15</span><span style="color: #339933;">:</span><span style="color:#800080;">54.000000000</span> <span style="color: #339933;">+</span><span style="color: #208080;">0200</span>
<span style="color: #339933;">+++</span> pure<span style="color: #339933;">-</span>ftpd<span style="color: #339933;">-</span>1.0.22<span style="color: #339933;">-</span>geoip<span style="color: #339933;">/</span>src<span style="color: #339933;">/</span>Makefile.<span style="color: #202020;">am</span>      <span style="color: #0000dd;">2009</span><span style="color: #339933;">-</span><span style="color:#800080;">09</span><span style="color: #339933;">-</span><span style="color: #0000dd;">17</span> <span style="color:#800080;">09</span><span style="color: #339933;">:</span><span style="color: #0000dd;">37</span><span style="color: #339933;">:</span><span style="color:#800080;">14.000000000</span> <span style="color: #339933;">+</span><span style="color: #208080;">0200</span>
@@ <span style="color: #339933;">-</span><span style="color: #0000dd;">16</span><span style="color: #339933;">,</span><span style="color: #0000dd;">7</span> <span style="color: #339933;">+</span><span style="color: #0000dd;">16</span><span style="color: #339933;">,</span><span style="color: #0000dd;">7</span> @@
&nbsp;
 pure_ftpd_LDADD <span style="color: #339933;">=</span> \
        ..<span style="color: #339933;">/</span>puredb<span style="color: #339933;">/</span>src<span style="color: #339933;">/</span>libpuredb_read.<span style="color: #202020;">a</span> \
<span style="color: #339933;">-</span>       @LDAP_SSL_LIBS@ @GETLOADAVG_LIBS@ @BONJOUR_LDADD@
<span style="color: #339933;">+</span>       @LDAP_SSL_LIBS@ @GETLOADAVG_LIBS@ @BONJOUR_LDADD@ <span style="color: #339933;">-</span>lGeoIP
&nbsp;
 pure_ftpd_CFLAGS <span style="color: #339933;">=</span> <span style="color: #339933;">-</span>DINCLUDE_IO_WRAPPERS<span style="color: #339933;">=</span><span style="color: #0000dd;">1</span>
&nbsp;
diff <span style="color: #339933;">-</span>ur pure<span style="color: #339933;">-</span>ftpd<span style="color: #339933;">-</span>1.0.22<span style="color: #339933;">/</span>src<span style="color: #339933;">/</span>Makefile.<span style="color: #202020;">in</span> pure<span style="color: #339933;">-</span>ftpd<span style="color: #339933;">-</span>1.0.22<span style="color: #339933;">-</span>geoip<span style="color: #339933;">/</span>src<span style="color: #339933;">/</span>Makefile.<span style="color: #202020;">in</span>
<span style="color: #339933;">---</span> pure<span style="color: #339933;">-</span>ftpd<span style="color: #339933;">-</span>1.0.22<span style="color: #339933;">/</span>src<span style="color: #339933;">/</span>Makefile.<span style="color: #202020;">in</span>    <span style="color: #0000dd;">2006</span><span style="color: #339933;">-</span><span style="color: #208080;">04</span><span style="color: #339933;">-</span><span style="color: #0000dd;">25</span> <span style="color: #0000dd;">10</span><span style="color: #339933;">:</span><span style="color: #0000dd;">45</span><span style="color: #339933;">:</span><span style="color:#800080;">12.000000000</span> <span style="color: #339933;">+</span><span style="color: #208080;">0200</span>
<span style="color: #339933;">+++</span> pure<span style="color: #339933;">-</span>ftpd<span style="color: #339933;">-</span>1.0.22<span style="color: #339933;">-</span>geoip<span style="color: #339933;">/</span>src<span style="color: #339933;">/</span>Makefile.<span style="color: #202020;">in</span>      <span style="color: #0000dd;">2009</span><span style="color: #339933;">-</span><span style="color:#800080;">09</span><span style="color: #339933;">-</span><span style="color: #0000dd;">17</span> <span style="color:#800080;">09</span><span style="color: #339933;">:</span><span style="color: #0000dd;">35</span><span style="color: #339933;">:</span><span style="color:#800080;">43.000000000</span> <span style="color: #339933;">+</span><span style="color: #208080;">0200</span>
@@ <span style="color: #339933;">-</span><span style="color: #0000dd;">221</span><span style="color: #339933;">,</span><span style="color: #0000dd;">7</span> <span style="color: #339933;">+</span><span style="color: #0000dd;">221</span><span style="color: #339933;">,</span><span style="color: #0000dd;">7</span> @@
 target_alias <span style="color: #339933;">=</span> @target_alias@
 pure_ftpd_LDADD <span style="color: #339933;">=</span> \
        ..<span style="color: #339933;">/</span>puredb<span style="color: #339933;">/</span>src<span style="color: #339933;">/</span>libpuredb_read.<span style="color: #202020;">a</span> \
<span style="color: #339933;">-</span>       @LDAP_SSL_LIBS@ @GETLOADAVG_LIBS@ @BONJOUR_LDADD@
<span style="color: #339933;">+</span>       @LDAP_SSL_LIBS@ @GETLOADAVG_LIBS@ @BONJOUR_LDADD@ <span style="color: #339933;">-</span>lGeoIP
&nbsp;
 pure_ftpd_CFLAGS <span style="color: #339933;">=</span> <span style="color: #339933;">-</span>DINCLUDE_IO_WRAPPERS<span style="color: #339933;">=</span><span style="color: #0000dd;">1</span>
 pure_ftpd_SOURCES <span style="color: #339933;">=</span> \</pre></div></div>

]]></content:encoded>
			<wfw:commentRss>http://www.hrbac.cz/2009/10/pure-ftpd-with-geoip/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>AVG 8.5 with Amavisd-new</title>
		<link>http://www.hrbac.cz/2009/10/avg-8-5-with-amavisd-new/</link>
		<comments>http://www.hrbac.cz/2009/10/avg-8-5-with-amavisd-new/#comments</comments>
		<pubDate>Tue, 13 Oct 2009 13:35:31 +0000</pubDate>
		<dc:creator>David Hrbáč</dc:creator>
				<category><![CDATA[mailing]]></category>

		<guid isPermaLink="false">http://www.hrbac.cz/?p=124</guid>
		<description><![CDATA[Amavisd-new is  a quite powerful tool capable to co-operate with a large amount of AV scanners. Today I have decided to test it with free AVG Antivirus for Linux. First of all you have to download the package, (test it), install, and change the ownership. Then edit the configuration.

wget http://download.avgfree.com/filedir/inst/avg85flx-r287-a2632.i386.rpm
rpm -Uhv avg85flx-r287-a2632.i386.rpm --test
rpm -Uhv [...]]]></description>
			<content:encoded><![CDATA[<p>Amavisd-new is  a quite powerful tool capable to co-operate with a large amount of AV scanners. Today I have decided to test it with free AVG Antivirus for Linux. First of all you have to download the package, (test it), install, and change the ownership. Then edit the configuration.</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">wget</span> http:<span style="color: #000000; font-weight: bold;">//</span>download.avgfree.com<span style="color: #000000; font-weight: bold;">/</span>filedir<span style="color: #000000; font-weight: bold;">/</span>inst<span style="color: #000000; font-weight: bold;">/</span>avg85flx-r287-a2632.i386.rpm
rpm <span style="color: #660033;">-Uhv</span> avg85flx-r287-a2632.i386.rpm <span style="color: #660033;">--test</span>
rpm <span style="color: #660033;">-Uhv</span> avg85flx-r287-a2632.i386.rpm
<span style="color: #c20cb9; font-weight: bold;">chown</span> amavis: <span style="color: #000000; font-weight: bold;">/</span>opt<span style="color: #000000; font-weight: bold;">/</span>avg <span style="color: #660033;">-R</span>
<span style="color: #c20cb9; font-weight: bold;">vi</span> <span style="color: #000000; font-weight: bold;">/</span>opt<span style="color: #000000; font-weight: bold;">/</span>avg<span style="color: #000000; font-weight: bold;">/</span>avg8<span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>init.d<span style="color: #000000; font-weight: bold;">/</span>avgdinit.conf</pre></div></div>

<p>So, we have changed the ownership. Now we have to change the daemon user to <strong>amavis </strong>too.</p>

<div class="wp_syntax"><div class="code"><pre class="vim" style="font-family:monospace;"># user under which to run the daemon
SUSER=amavis</pre></div></div>

<p>We can start AVG with:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>init.d<span style="color: #000000; font-weight: bold;">/</span>avgd start</pre></div></div>

<p>Finally we have to change Amavisd-new configuration by commenting out  AVG section and changing the port:</p>

<div class="wp_syntax"><div class="code"><pre class="vim" style="font-family:monospace;"> ### http<span style="color: #000000;">://</span>www<span style="color: #000000;">.</span>grisoft<span style="color: #000000;">.</span><span style="color: #668080;">com</span><span style="color: #000000;">/</span>
 <span style="color: #000000;">&#91;</span><span style="color: #C5A22D;">'AVG Anti-Virus'</span>,
   \<span style="color: #000000;">&amp;</span>amp;ask_daemon, <span style="color: #000000;">&#91;</span><span style="color: #C5A22D;">&quot;SCAN {}<span style="">\n</span>&quot;</span>, <span style="color: #C5A22D;">'127.0.0.1:54322'</span><span style="color: #000000;">&#93;</span>,
   qr<span style="color: #000000;">/^</span><span style="color: #000000; font-weight:bold;">200</span><span style="color: #000000;">/</span>, qr<span style="color: #000000;">/^</span><span style="color: #000000; font-weight:bold;">403</span><span style="color: #000000;">/</span>, qr<span style="color: #000000;">/^</span><span style="color: #000000; font-weight:bold;">403</span> <span style="color: #000000;">.*?:</span> <span style="color: #000000;">&#40;</span><span style="color: #000000;">&#91;</span><span style="color: #000000;">^</span>\r\n<span style="color: #000000;">&#93;</span><span style="color: #000000;">+</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">/</span> <span style="color: #000000;">&#93;</span>,</pre></div></div>

]]></content:encoded>
			<wfw:commentRss>http://www.hrbac.cz/2009/10/avg-8-5-with-amavisd-new/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Benchmarking php with apc, memcached</title>
		<link>http://www.hrbac.cz/2009/09/benchmarking-php-with-apc-memcached/</link>
		<comments>http://www.hrbac.cz/2009/09/benchmarking-php-with-apc-memcached/#comments</comments>
		<pubDate>Wed, 23 Sep 2009 07:56:43 +0000</pubDate>
		<dc:creator>David Hrbáč</dc:creator>
				<category><![CDATA[php]]></category>

		<guid isPermaLink="false">http://www.hrbac.cz/?p=101</guid>
		<description><![CDATA[As we are very extensively using  techniques to speed up web applications we build or host, I&#8217;d like to share some benchmarks. One of our clients is running site on our machines which is using SOAP/WSDL to get data. The application is extremely  slow, result are very poor.
Apache is able to server this [...]]]></description>
			<content:encoded><![CDATA[<p>As we are very extensively using  techniques to speed up web applications we build or host, I&#8217;d like to share some benchmarks. One of our clients is running site on our machines which is using SOAP/WSDL to get data. The application is extremely  slow, result are very poor.</p>
<p>Apache is able to server this webapp within cca 23 pages per second, which is bad. Here are the ab results:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #7a0874; font-weight: bold;">&#91;</span>root<span style="color: #000000; font-weight: bold;">@</span>webmel4 ~<span style="color: #7a0874; font-weight: bold;">&#93;</span><span style="color: #666666; font-style: italic;"># ab -n 400 -c 5 http://beta.somedomain.cz/</span>
This is ApacheBench, Version 2.0.41-dev <span style="color: #000000; font-weight: bold;">&amp;</span>lt;<span style="color: #007800;">$Revision</span>: <span style="color: #000000;">1.141</span> $<span style="color: #000000; font-weight: bold;">&amp;</span>gt; apache-<span style="color: #000000;">2.0</span>
Copyright <span style="color: #7a0874; font-weight: bold;">&#40;</span>c<span style="color: #7a0874; font-weight: bold;">&#41;</span> <span style="color: #000000;">1996</span> Adam Twiss, Zeus Technology Ltd, http:<span style="color: #000000; font-weight: bold;">//</span>www.zeustech.net<span style="color: #000000; font-weight: bold;">/</span>
Copyright <span style="color: #7a0874; font-weight: bold;">&#40;</span>c<span style="color: #7a0874; font-weight: bold;">&#41;</span> <span style="color: #000000;">1998</span>-<span style="color: #000000;">2002</span> The Apache Software Foundation, http:<span style="color: #000000; font-weight: bold;">//</span>www.apache.org<span style="color: #000000; font-weight: bold;">/</span>
&nbsp;
Benchmarking beta.somedomain.cz <span style="color: #7a0874; font-weight: bold;">&#40;</span>be patient<span style="color: #7a0874; font-weight: bold;">&#41;</span>
Completed <span style="color: #000000;">100</span> requests
Completed <span style="color: #000000;">200</span> requests
Completed <span style="color: #000000;">300</span> requests
Finished <span style="color: #000000;">400</span> requests
&nbsp;
Server Software:        Apache
Server Hostname:        beta.somedomain.cz
Server Port:            <span style="color: #000000;">80</span>
&nbsp;
Document Path:          <span style="color: #000000; font-weight: bold;">/</span>
Document Length:        <span style="color: #000000;">45829</span> bytes
&nbsp;
Concurrency Level:      <span style="color: #000000;">5</span>
Time taken <span style="color: #000000; font-weight: bold;">for</span> tests:   <span style="color: #000000;">17.637183</span> seconds
Complete requests:      <span style="color: #000000;">400</span>
Failed requests:        <span style="color: #000000;">0</span>
Write errors:           <span style="color: #000000;">0</span>
Total transferred:      <span style="color: #000000;">18473376</span> bytes
HTML transferred:       <span style="color: #000000;">18348354</span> bytes
Requests per second:    <span style="color: #000000;">22.68</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span><span style="color: #666666; font-style: italic;">#/sec] (mean)</span>
Time per request:       <span style="color: #000000;">220.465</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span>ms<span style="color: #7a0874; font-weight: bold;">&#93;</span> <span style="color: #7a0874; font-weight: bold;">&#40;</span>mean<span style="color: #7a0874; font-weight: bold;">&#41;</span>
Time per request:       <span style="color: #000000;">44.093</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span>ms<span style="color: #7a0874; font-weight: bold;">&#93;</span> <span style="color: #7a0874; font-weight: bold;">&#40;</span>mean, across all concurrent requests<span style="color: #7a0874; font-weight: bold;">&#41;</span>
Transfer rate:          <span style="color: #000000;">1022.84</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span>Kbytes<span style="color: #000000; font-weight: bold;">/</span>sec<span style="color: #7a0874; font-weight: bold;">&#93;</span> received
&nbsp;
Connection Times <span style="color: #7a0874; font-weight: bold;">&#40;</span>ms<span style="color: #7a0874; font-weight: bold;">&#41;</span>
              min  mean<span style="color: #7a0874; font-weight: bold;">&#91;</span>+<span style="color: #000000; font-weight: bold;">/</span>-sd<span style="color: #7a0874; font-weight: bold;">&#93;</span> median   max
Connect:        <span style="color: #000000;">6</span>    <span style="color: #000000;">6</span>   <span style="color: #000000;">0.2</span>      <span style="color: #000000;">6</span>       <span style="color: #000000;">9</span>
Processing:   <span style="color: #000000;">176</span>  <span style="color: #000000;">212</span>  <span style="color: #000000;">26.1</span>    <span style="color: #000000;">207</span>     <span style="color: #000000;">380</span>
Waiting:      <span style="color: #000000;">142</span>  <span style="color: #000000;">172</span>  <span style="color: #000000;">21.4</span>    <span style="color: #000000;">169</span>     <span style="color: #000000;">277</span>
Total:        <span style="color: #000000;">182</span>  <span style="color: #000000;">218</span>  <span style="color: #000000;">26.1</span>    <span style="color: #000000;">213</span>     <span style="color: #000000;">386</span>
&nbsp;
Percentage of the requests served within a certain <span style="color: #000000; font-weight: bold;">time</span> <span style="color: #7a0874; font-weight: bold;">&#40;</span>ms<span style="color: #7a0874; font-weight: bold;">&#41;</span>
  <span style="color: #000000;">50</span><span style="color: #000000; font-weight: bold;">%</span>    <span style="color: #000000;">213</span>
  <span style="color: #000000;">66</span><span style="color: #000000; font-weight: bold;">%</span>    <span style="color: #000000;">221</span>
  <span style="color: #000000;">75</span><span style="color: #000000; font-weight: bold;">%</span>    <span style="color: #000000;">225</span>
  <span style="color: #000000;">80</span><span style="color: #000000; font-weight: bold;">%</span>    <span style="color: #000000;">230</span>
  <span style="color: #000000;">90</span><span style="color: #000000; font-weight: bold;">%</span>    <span style="color: #000000;">252</span>
  <span style="color: #000000;">95</span><span style="color: #000000; font-weight: bold;">%</span>    <span style="color: #000000;">272</span>
  <span style="color: #000000;">98</span><span style="color: #000000; font-weight: bold;">%</span>    <span style="color: #000000;">290</span>
  <span style="color: #000000;">99</span><span style="color: #000000; font-weight: bold;">%</span>    <span style="color: #000000;">325</span>
 <span style="color: #000000;">100</span><span style="color: #000000; font-weight: bold;">%</span>    <span style="color: #000000;">386</span> <span style="color: #7a0874; font-weight: bold;">&#40;</span>longest request<span style="color: #7a0874; font-weight: bold;">&#41;</span></pre></div></div>

<p>We decided to implement memcached which means some small code rewrite, which is quite simple.  After that apache serves the pages within the 47 pages per second. Nice but still poor.</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #7a0874; font-weight: bold;">&#91;</span>root<span style="color: #000000; font-weight: bold;">@</span>webmel4 ~<span style="color: #7a0874; font-weight: bold;">&#93;</span><span style="color: #666666; font-style: italic;"># ab -n 400 -c 5 http://beta.somedomain.cz/</span>
This is ApacheBench, Version 2.0.41-dev <span style="color: #000000; font-weight: bold;">&amp;</span>lt;<span style="color: #007800;">$Revision</span>: <span style="color: #000000;">1.141</span> $<span style="color: #000000; font-weight: bold;">&amp;</span>gt; apache-<span style="color: #000000;">2.0</span>
Copyright <span style="color: #7a0874; font-weight: bold;">&#40;</span>c<span style="color: #7a0874; font-weight: bold;">&#41;</span> <span style="color: #000000;">1996</span> Adam Twiss, Zeus Technology Ltd, http:<span style="color: #000000; font-weight: bold;">//</span>www.zeustech.net<span style="color: #000000; font-weight: bold;">/</span>
Copyright <span style="color: #7a0874; font-weight: bold;">&#40;</span>c<span style="color: #7a0874; font-weight: bold;">&#41;</span> <span style="color: #000000;">1998</span>-<span style="color: #000000;">2002</span> The Apache Software Foundation, http:<span style="color: #000000; font-weight: bold;">//</span>www.apache.org<span style="color: #000000; font-weight: bold;">/</span>
&nbsp;
Benchmarking beta.somedomain.cz <span style="color: #7a0874; font-weight: bold;">&#40;</span>be patient<span style="color: #7a0874; font-weight: bold;">&#41;</span>
Completed <span style="color: #000000;">100</span> requests
Completed <span style="color: #000000;">200</span> requests
Completed <span style="color: #000000;">300</span> requests
Finished <span style="color: #000000;">400</span> requests
&nbsp;
Server Software:        Apache
Server Hostname:        beta.somedomain.cz
Server Port:            <span style="color: #000000;">80</span>
&nbsp;
Document Path:          <span style="color: #000000; font-weight: bold;">/</span>
Document Length:        <span style="color: #000000;">11128</span> bytes
&nbsp;
Concurrency Level:      <span style="color: #000000;">5</span>
Time taken <span style="color: #000000; font-weight: bold;">for</span> tests:   <span style="color: #000000;">8.403883</span> seconds
Complete requests:      <span style="color: #000000;">400</span>
Failed requests:        <span style="color: #000000;">0</span>
Write errors:           <span style="color: #000000;">0</span>
Total transferred:      <span style="color: #000000;">4579944</span> bytes
HTML transferred:       <span style="color: #000000;">4455233</span> bytes
Requests per second:    <span style="color: #000000;">47.60</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span><span style="color: #666666; font-style: italic;">#/sec] (mean)</span>
Time per request:       <span style="color: #000000;">105.049</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span>ms<span style="color: #7a0874; font-weight: bold;">&#93;</span> <span style="color: #7a0874; font-weight: bold;">&#40;</span>mean<span style="color: #7a0874; font-weight: bold;">&#41;</span>
Time per request:       <span style="color: #000000;">21.010</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span>ms<span style="color: #7a0874; font-weight: bold;">&#93;</span> <span style="color: #7a0874; font-weight: bold;">&#40;</span>mean, across all concurrent requests<span style="color: #7a0874; font-weight: bold;">&#41;</span>
Transfer rate:          <span style="color: #000000;">532.13</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span>Kbytes<span style="color: #000000; font-weight: bold;">/</span>sec<span style="color: #7a0874; font-weight: bold;">&#93;</span> received
&nbsp;
Connection Times <span style="color: #7a0874; font-weight: bold;">&#40;</span>ms<span style="color: #7a0874; font-weight: bold;">&#41;</span>
              min  mean<span style="color: #7a0874; font-weight: bold;">&#91;</span>+<span style="color: #000000; font-weight: bold;">/</span>-sd<span style="color: #7a0874; font-weight: bold;">&#93;</span> median   max
Connect:        <span style="color: #000000;">4</span>    <span style="color: #000000;">5</span>   <span style="color: #000000;">1.2</span>      <span style="color: #000000;">6</span>      <span style="color: #000000;">16</span>
Processing:    <span style="color: #000000;">45</span>   <span style="color: #000000;">98</span>  <span style="color: #000000;">40.8</span>     <span style="color: #000000;">88</span>     <span style="color: #000000;">249</span>
Waiting:       <span style="color: #000000;">37</span>   <span style="color: #000000;">81</span>  <span style="color: #000000;">34.0</span>     <span style="color: #000000;">73</span>     <span style="color: #000000;">218</span>
Total:         <span style="color: #000000;">51</span>  <span style="color: #000000;">104</span>  <span style="color: #000000;">40.7</span>     <span style="color: #000000;">94</span>     <span style="color: #000000;">253</span>
&nbsp;
Percentage of the requests served within a certain <span style="color: #000000; font-weight: bold;">time</span> <span style="color: #7a0874; font-weight: bold;">&#40;</span>ms<span style="color: #7a0874; font-weight: bold;">&#41;</span>
  <span style="color: #000000;">50</span><span style="color: #000000; font-weight: bold;">%</span>     <span style="color: #000000;">94</span>
  <span style="color: #000000;">66</span><span style="color: #000000; font-weight: bold;">%</span>    <span style="color: #000000;">113</span>
  <span style="color: #000000;">75</span><span style="color: #000000; font-weight: bold;">%</span>    <span style="color: #000000;">131</span>
  <span style="color: #000000;">80</span><span style="color: #000000; font-weight: bold;">%</span>    <span style="color: #000000;">139</span>
  <span style="color: #000000;">90</span><span style="color: #000000; font-weight: bold;">%</span>    <span style="color: #000000;">165</span>
  <span style="color: #000000;">95</span><span style="color: #000000; font-weight: bold;">%</span>    <span style="color: #000000;">177</span>
  <span style="color: #000000;">98</span><span style="color: #000000; font-weight: bold;">%</span>    <span style="color: #000000;">205</span>
  <span style="color: #000000;">99</span><span style="color: #000000; font-weight: bold;">%</span>    <span style="color: #000000;">231</span>
 <span style="color: #000000;">100</span><span style="color: #000000; font-weight: bold;">%</span>    <span style="color: #000000;">253</span> <span style="color: #7a0874; font-weight: bold;">&#40;</span>longest request<span style="color: #7a0874; font-weight: bold;">&#41;</span></pre></div></div>

<p>Finally we decided to add <a href="http://pecl.php.net/package/APC">apc php cache</a>. Speed up is quite better cca 130 pages per second.</p>

<div class="wp_syntax"><div class="code"><pre class="bach" style="font-family:monospace;">[root@webmel4 ~]# ab -n 400 -c 5 http://beta.somedomain.cz/
This is ApacheBench, Version 2.0.41-dev &amp;lt;$Revision: 1.141 $&amp;gt; apache-2.0
Copyright (c) 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/
Copyright (c) 1998-2002 The Apache Software Foundation, http://www.apache.org/
&nbsp;
Benchmarking beta.somedomain.cz (be patient)
Completed 100 requests
Completed 200 requests
Completed 300 requests
Finished 400 requests
&nbsp;
Server Software:        Apache
Server Hostname:        beta.somedomain.cz
Server Port:            80
&nbsp;
Document Path:          /
Document Length:        11128 bytes
&nbsp;
Concurrency Level:      5
Time taken for tests:   3.70608 seconds
Complete requests:      400
Failed requests:        0
Write errors:           0
Total transferred:      4584288 bytes
HTML transferred:       4459266 bytes
Requests per second:    130.27 [#/sec] (mean)
Time per request:       38.383 [ms] (mean)
Time per request:       7.677 [ms] (mean, across all concurrent requests)
Transfer rate:          1457.69 [Kbytes/sec] received
&nbsp;
Connection Times (ms)
              min  mean[+/-sd] median   max
Connect:        6    6   0.2      6       9
Processing:    21   31   8.2     30      83
Waiting:       14   23   7.9     22      76
Total:         27   37   8.2     36      89
&nbsp;
Percentage of the requests served within a certain time (ms)
  50%     36
  66%     39
  75%     41
  80%     43
  90%     47
  95%     51
  98%     60
  99%     78
 100%     89 (longest request)</pre></div></div>

<p>So, as you can see, there are ways to speedup the web apps not mentioning that the app itself can be better. We have seen the code and it seems to me that the programmer did not optimize anything within the code.</p>

<table id="wp-table-reloaded-id-1-no-1" class="wp-table-reloaded wp-table-reloaded-id-1">
<thead>
	<tr class="row-1 odd">
		<th class="column-1">technology</th><th class="column-2">requests per sec</th><th class="column-3">speed</th>
	</tr>
</thead>
<tbody>
	<tr class="row-2 even">
		<td class="column-1">php</td><td class="column-2">22.68</td><td class="column-3">100%</td>
	</tr>
	<tr class="row-3 odd">
		<td class="column-1">php+memcachedphp</td><td class="column-2">47.6</td><td class="column-3">210%</td>
	</tr>
	<tr class="row-4 even">
		<td class="column-1">+memcached+apc</td><td class="column-2">130.27</td><td class="column-3">574%</td>
	</tr>
</tbody>
</table>

<p>Benchmarks were run against CentOS 4.8 machine running:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">httpd-2.0.52-41.ent.4.centos4
memcached-1.4.1-2.el4.hrb
php-5.1.6-3.el4s1.10
php-pecl-apc-3.0.19-1.el4.hrb
php-pecl-memcache-3.0.4-3.el4.hrb</pre></div></div>

<p>You can find non distribution packages within my repos.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.hrbac.cz/2009/09/benchmarking-php-with-apc-memcached/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>
