<?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>Piotr Zaniewicz &#187; Linux</title>
	<atom:link href="http://piotr.eldora.pl/category/linux/feed" rel="self" type="application/rss+xml" />
	<link>http://piotr.eldora.pl</link>
	<description>Ideas not to be forgotten...</description>
	<lastBuildDate>Sun, 25 Apr 2010 16:50:31 +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>Spamassassin + vpopmail + sa-learn + learning from IMAP folders</title>
		<link>http://piotr.eldora.pl/2009/05/17/spamassassin-vpopmail-sa-learn-learning-from-imap-folders</link>
		<comments>http://piotr.eldora.pl/2009/05/17/spamassassin-vpopmail-sa-learn-learning-from-imap-folders#comments</comments>
		<pubDate>Sat, 16 May 2009 22:37:33 +0000</pubDate>
		<dc:creator>Piotr Zaniewicz</dc:creator>
				<category><![CDATA[Linux]]></category>

		<guid isPermaLink="false">http://piotr.eldora.pl/?p=79</guid>
		<description><![CDATA[Below is a quick solution to making spamassassin learn from specific IMAP folders. Script represents a daily cron script and I just used sudo vpopmail (has to be the same as your spamd user) to simplify things. You probably should use user specific crontab&#8230;

1
2
3
4
5
#!/bin/bash
for F in `find /home/vpopmail/domains -type d -name '.Junk' -print`;
do sudo -H [...]]]></description>
			<content:encoded><![CDATA[<p>Below is a quick solution to making spamassassin learn from specific IMAP folders. Script represents a daily cron script and I just used <em>sudo vpopmail</em> (has to be the same as your spamd user) to simplify things. You probably should use user specific crontab&#8230;</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
</pre></td><td class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #666666; font-style: italic;">#!/bin/bash</span>
<span style="color: #000000; font-weight: bold;">for</span> F <span style="color: #000000; font-weight: bold;">in</span> <span style="color: #000000; font-weight: bold;">`</span><span style="color: #c20cb9; font-weight: bold;">find</span> <span style="color: #000000; font-weight: bold;">/</span>home<span style="color: #000000; font-weight: bold;">/</span>vpopmail<span style="color: #000000; font-weight: bold;">/</span>domains <span style="color: #660033;">-type</span> d <span style="color: #660033;">-name</span> <span style="color: #ff0000;">'.Junk'</span> -print<span style="color: #000000; font-weight: bold;">`</span>;
<span style="color: #000000; font-weight: bold;">do</span> <span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #660033;">-H</span> <span style="color: #660033;">-u</span> vpopmail <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>bin<span style="color: #000000; font-weight: bold;">/</span>sa-learn <span style="color: #660033;">--spam</span> <span style="color: #007800;">$F</span><span style="color: #000000; font-weight: bold;">/</span>cur<span style="color: #000000; font-weight: bold;">/*</span> <span style="color: #000000; font-weight: bold;">&amp;&gt;</span> <span style="color: #000000; font-weight: bold;">/</span>dev<span style="color: #000000; font-weight: bold;">/</span>null;
<span style="color: #c20cb9; font-weight: bold;">rm</span> <span style="color: #660033;">-f</span> <span style="color: #007800;">$F</span><span style="color: #000000; font-weight: bold;">/</span>cur<span style="color: #000000; font-weight: bold;">/*</span>;
<span style="color: #000000; font-weight: bold;">done</span>;</pre></td></tr></table></div>

]]></content:encoded>
			<wfw:commentRss>http://piotr.eldora.pl/2009/05/17/spamassassin-vpopmail-sa-learn-learning-from-imap-folders/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>FPDF polskie wolne czcionki</title>
		<link>http://piotr.eldora.pl/2009/01/19/fpdf-polskie-wolne-czcionki</link>
		<comments>http://piotr.eldora.pl/2009/01/19/fpdf-polskie-wolne-czcionki#comments</comments>
		<pubDate>Mon, 19 Jan 2009 11:13:26 +0000</pubDate>
		<dc:creator>Piotr Zaniewicz</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Web]]></category>
		<category><![CDATA[linux fpdf gpl wolne]]></category>

		<guid isPermaLink="false">http://piotr.eldora.pl/?p=39</guid>
		<description><![CDATA[Postanowiłem wreszcie trochę uporządkować czcionki używane do generowania dokumentów pdf oraz obrazków wykorzystujących czcionki ttf. Załączam zestaw gotowej do zainstalowania czytelnej czcionki z pakietu liberation-fonts. Które są upowszechnione na licencji GPL.
Pobierz
]]></description>
			<content:encoded><![CDATA[<p>Postanowiłem wreszcie trochę uporządkować czcionki używane do generowania dokumentów pdf oraz obrazków wykorzystujących czcionki ttf. Załączam zestaw gotowej do zainstalowania czytelnej czcionki z pakietu <a href="https://fedorahosted.org/liberation-fonts/">liberation-fonts</a>. Które są upowszechnione na licencji GPL.</p>
<p><a href="http://piotr.eldora.pl/weblog/wp-content/uploads/2009/01/fonttar.bz2">Pobierz</a></p>
]]></content:encoded>
			<wfw:commentRss>http://piotr.eldora.pl/2009/01/19/fpdf-polskie-wolne-czcionki/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Odmiana imion php mysql</title>
		<link>http://piotr.eldora.pl/2009/01/12/odmiana-imion-php-mysql</link>
		<comments>http://piotr.eldora.pl/2009/01/12/odmiana-imion-php-mysql#comments</comments>
		<pubDate>Mon, 12 Jan 2009 03:26:57 +0000</pubDate>
		<dc:creator>Piotr Zaniewicz</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[imiona]]></category>
		<category><![CDATA[mysql]]></category>
		<category><![CDATA[odmiona]]></category>
		<category><![CDATA[php]]></category>

		<guid isPermaLink="false">http://piotr.eldora.pl/?p=28</guid>
		<description><![CDATA[Postanowiłem udostępnić uzupełniony zbiór odmian polskich imion dla bazy MySQL.
Plik jest gotowy do importu do bazy MySQL, zawiera imiona,  odmianę, płeć oraz ilość sylab występujących w imieniu. Można go wykorzystać na przykład w skryptach php wysyłających życzenia urodzinowe lub pozdrowienia.
W przypadku braku odmiany, proszę wpisać w komentarzach to uzupełnię.
]]></description>
			<content:encoded><![CDATA[<p>Postanowiłem udostępnić uzupełniony zbiór <a href="http://piotr.eldora.pl/bazy-danych-kody-pocztowe-imiona-panstwa">odmian polskich imion</a> dla bazy MySQL.</p>
<p>Plik jest gotowy do importu do bazy MySQL, zawiera imiona,  odmianę, płeć oraz ilość sylab występujących w imieniu. Można go wykorzystać na przykład w skryptach php wysyłających życzenia urodzinowe lub pozdrowienia.</p>
<p>W przypadku braku odmiany, proszę wpisać w komentarzach to uzupełnię.</p>
]]></content:encoded>
			<wfw:commentRss>http://piotr.eldora.pl/2009/01/12/odmiana-imion-php-mysql/feed</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>localhost.customs or localhost:1001</title>
		<link>http://piotr.eldora.pl/2007/09/17/localhostcustoms</link>
		<comments>http://piotr.eldora.pl/2007/09/17/localhostcustoms#comments</comments>
		<pubDate>Mon, 17 Sep 2007 18:12:32 +0000</pubDate>
		<dc:creator>Piotr Zaniewicz</dc:creator>
				<category><![CDATA[Linux]]></category>

		<guid isPermaLink="false">http://piotr.eldora.pl/2007/09/17/localhostcustoms</guid>
		<description><![CDATA[Well, just recently I discovered an error in my Apache2 log file saying:

127.0.0.1 &#8211; - [17/Sep/2007:20:10:32 +0200] &#8220;GET /&#8221; 400 466

Well, that is a SSL log, so I am working to figure out what it really is&#8230;
Ok, &#8220;tshark -i lo -S -V &#62; dump.shark&#8221; command comes in handy to see the packets, and here is [...]]]></description>
			<content:encoded><![CDATA[<p>Well, just recently I discovered an error in my Apache2 log file saying:</p>
<blockquote>
<blockquote type="cite"><p>127.0.0.1 &#8211; - [17/Sep/2007:20:10:32 +0200] &#8220;GET /&#8221; 400 466</p></blockquote>
</blockquote>
<p>Well, that is a SSL log, so I am working to figure out what it really is&#8230;</p>
<p>Ok, &#8220;<em><a href="http://www.wireshark.org/" title="Wireshark" target="_blank"><strong>tshark</strong></a> -i lo -S -V &gt; dump.shark</em>&#8221; command comes in handy to see the packets, and here is what we get:</p>
<blockquote>
<blockquote type="cite"><p> Internet Protocol, Src: 127.0.0.1 (127.0.0.1), Dst: 127.0.0.1 (127.0.0.1)<br />
Version: 4<br />
&lt;cut&gt;<br />
Source: 127.0.0.1 (127.0.0.1)<br />
Destination: 127.0.0.1 (127.0.0.1)<br />
Transmission Control Protocol, Src Port: 53612 (53612), Dst Port: customs (1001), Seq: 1, Ack: 1, Len: 155<br />
Source port: 53612 (53612)<br />
Destination port: customs (1001)<br />
Sequence number: 1    (relative sequence number)<br />
[Next sequence number: 156    (relative sequence number)]<br />
Acknowledgement number: 1    (relative ack number)<br />
Header length: 32 bytes<br />
Flags: 0&#215;18 (PSH, ACK)<br />
0&#8230; &#8230;. = Congestion Window Reduced (CWR): Not set<br />
.0.. &#8230;. = ECN-Echo: Not set<br />
..0. &#8230;. = Urgent: Not set<br />
&#8230;1 &#8230;. = Acknowledgment: Set<br />
&#8230;. 1&#8230; = Push: Set<br />
&#8230;. .0.. = Reset: Not set<br />
&#8230;. ..0. = Syn: Not set<br />
&#8230;. &#8230;0 = Fin: Not set<br />
Window size: 32800 (scaled)<br />
Checksum: 0xfec3 [incorrect, should be 0x14e9 (maybe caused by checksum offloading?)]<br />
Options: (12 bytes)<br />
NOP<br />
NOP<br />
Timestamps: TSval 289375346, TSecr 289375346<br />
Data (155 bytes)0000  47 45 54 20 2f 20 48 54 54 50 2f 31 2e 30 0d 0a   GET / HTTP/1.0..<br />
0070  28 69 6e 74   (int<br />
0080  65 72 6e 61 6c 20 64 75 6d 6d 79 20 63 6f 6e 6e   ernal dummy conn<br />
0090  65 63 74 69 6f 6e 29 0d 0a 0d 0a                  ection)&#8230;.</p></blockquote>
</blockquote>
<p>Looks like a known error of dummy connections, but a bit different one, since Apache2 didn&#8217;t speak SSL to its SSL server, so no proper &#8220;GET&#8221; request has been logged &#8211; just info about the 400 error.</p>
<p>The way I fixed it was to to increase the number of &#8220;MaxSpareServers&#8221; to &#8220;10&#8243; in my Apache2 configuration file. I don&#8217;t need more&#8230;</p>
]]></content:encoded>
			<wfw:commentRss>http://piotr.eldora.pl/2007/09/17/localhostcustoms/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Using sed to change strings in multiple files</title>
		<link>http://piotr.eldora.pl/2007/09/15/using-sed-to-change-strings-in-multiple-files</link>
		<comments>http://piotr.eldora.pl/2007/09/15/using-sed-to-change-strings-in-multiple-files#comments</comments>
		<pubDate>Sat, 15 Sep 2007 19:56:01 +0000</pubDate>
		<dc:creator>Piotr Zaniewicz</dc:creator>
				<category><![CDATA[Linux]]></category>

		<guid isPermaLink="false">http://piotr.eldora.pl/2007/09/15/using-sed-to-change-strings-in-multiple-files</guid>
		<description><![CDATA[Ok, one more tip for today, which makes it very simple to change text within multiple files.
Say for example that you want to change Bush to Kerry in 50+ files ending with &#8220;html&#8221;.
OK, now you could edit them, but it is too much of a hustle. Instead let&#8217;s use sed and some bash scripting:


for F [...]]]></description>
			<content:encoded><![CDATA[<p>Ok, one more tip for today, which makes it very simple to change text within multiple files.<br />
Say for example that you want to change <em>Bush</em> to <em>Kerry</em> in 50+ files ending with &#8220;html&#8221;.<br />
OK, now you could edit them, but it is too much of a hustle. Instead let&#8217;s use <strong>sed</strong> and some bash scripting:</p>
<blockquote>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">for</span> F <span style="color: #000000; font-weight: bold;">in</span> <span style="color: #000000; font-weight: bold;">`</span><span style="color: #c20cb9; font-weight: bold;">find</span> .<span style="color: #000000; font-weight: bold;">/</span> <span style="color: #660033;">-type</span> f <span style="color: #660033;">-name</span> <span style="color: #ff0000;">'*.html'</span> -print<span style="color: #000000; font-weight: bold;">`</span>;
<span style="color: #000000; font-weight: bold;">do</span> <span style="color: #c20cb9; font-weight: bold;">mv</span> <span style="color: #007800;">$F</span> <span style="color: #007800;">$F</span>.tmp;
<span style="color: #c20cb9; font-weight: bold;">sed</span> <span style="color: #ff0000;">'s/Bush/Kerry/g'</span> <span style="color: #007800;">$F</span>.tmp <span style="color: #000000; font-weight: bold;">&gt;</span> <span style="color: #007800;">$F</span>;
<span style="color: #c20cb9; font-weight: bold;">rm</span> <span style="color: #007800;">$F</span>.tmp;
<span style="color: #000000; font-weight: bold;">done</span>;</pre></div></div>

</blockquote>
<p>Be careful however, when changing &#8220;&lt;&#8221; or &#8220;&gt;&#8221; or any other character that has to be escaped! You have to escape it using a backslash &#8211; &#8220;\&#8221;. So for example to escape a &#8220;&lt;&#8221; you would write &#8220;\&lt;&#8221;. SIMPLE, right?</p>
<p>Questions?  Here is a <a href="http://piotr.eldora.pl/weblog/wp-content/uploads/2007/09/change_sedsh.zip" title="Sed string changing script that I used">sed string changing script that I used</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://piotr.eldora.pl/2007/09/15/using-sed-to-change-strings-in-multiple-files/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Unzip, untar, unpack all archives</title>
		<link>http://piotr.eldora.pl/2007/09/15/unzip-untar-unpack-all-archives</link>
		<comments>http://piotr.eldora.pl/2007/09/15/unzip-untar-unpack-all-archives#comments</comments>
		<pubDate>Sat, 15 Sep 2007 19:13:54 +0000</pubDate>
		<dc:creator>Piotr Zaniewicz</dc:creator>
				<category><![CDATA[Linux]]></category>

		<guid isPermaLink="false">http://piotr.eldora.pl/2007/09/15/unzip-untar-unpack-all-archives</guid>
		<description><![CDATA[Once I came to a point of having downloaded 20+ tar.gz files and facing a need of finding an efficient way to extract them. If you are having such a problem then this simple solution will help:


for F in `find ./ -type f -name '*tar.gz' -print`;
do tar xvzf $F;
done;


What it does is for every file [...]]]></description>
			<content:encoded><![CDATA[<p>Once I came to a point of having downloaded 20+ tar.gz files and facing a need of finding an efficient way to extract them. If you are having such a problem then this simple solution will help:</p>
<blockquote>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">for</span> F <span style="color: #000000; font-weight: bold;">in</span> <span style="color: #000000; font-weight: bold;">`</span><span style="color: #c20cb9; font-weight: bold;">find</span> .<span style="color: #000000; font-weight: bold;">/</span> <span style="color: #660033;">-type</span> f <span style="color: #660033;">-name</span> <span style="color: #ff0000;">'*tar.gz'</span> -print<span style="color: #000000; font-weight: bold;">`</span>;
<span style="color: #000000; font-weight: bold;">do</span> <span style="color: #c20cb9; font-weight: bold;">tar</span> xvzf <span style="color: #007800;">$F</span>;
<span style="color: #000000; font-weight: bold;">done</span>;</pre></div></div>

</blockquote>
<p>What it does is for every file ending with &#8220;<em>tar.gz</em>&#8221; found in current folder &#8220;<em>./</em>&#8221; it executes a command &#8220;<em>tar xvzf</em>&#8220;, which unpacks the archive. Very simple but also VERY useful. Try with unzip and other commands.<br />
Yes, you may delete files after unpacking by adding &#8220;<em>rm $F;</em>&#8221; after the tar statement.<br />
However, it is always good to keep the original source!</p>
]]></content:encoded>
			<wfw:commentRss>http://piotr.eldora.pl/2007/09/15/unzip-untar-unpack-all-archives/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
