<?xml version="1.0" encoding="utf-8" ?>

<rss version="2.0" 
   xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
   xmlns:admin="http://webns.net/mvcb/"
   xmlns:dc="http://purl.org/dc/elements/1.1/"
   xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
   xmlns:wfw="http://wellformedweb.org/CommentAPI/"
   xmlns:content="http://purl.org/rss/1.0/modules/content/"
   >
<channel>
    <title>xela's Linux Blog - Bash Snippets</title>
    <link>http://spielwiese.la-evento.com/xelasblog/</link>
    <description>My little place on the web...</description>
    <dc:language>de</dc:language>
    <generator>Serendipity 1.5.2 - http://www.s9y.org/</generator>
    
    

<item>
    <title>Kleine Spamassassin Rule gegen Pillenlinks im Mailheader</title>
    <link>http://spielwiese.la-evento.com/xelasblog/archives/47-Kleine-Spamassassin-Rule-gegen-Pillenlinks-im-Mailheader.html</link>
            <category>Bash Snippets</category>
    
    <comments>http://spielwiese.la-evento.com/xelasblog/archives/47-Kleine-Spamassassin-Rule-gegen-Pillenlinks-im-Mailheader.html#comments</comments>
    <wfw:comment>http://spielwiese.la-evento.com/xelasblog/wfwcomment.php?cid=47</wfw:comment>

    <slash:comments>0</slash:comments>
    <wfw:commentRss>http://spielwiese.la-evento.com/xelasblog/rss.php?version=2.0&amp;type=comments&amp;cid=47</wfw:commentRss>
    

    <author>nospam@example.com (Xela)</author>
    <content:encoded>
    Lustig, zur Zeit l&amp;auml;uft eine Spamwelle, bei der  die Pillenlinks (Viagra, Cialis...) im &amp;quot;From&amp;quot; des Mailheaders untergebracht werden. Der Textteil der Mails ist dann nur sinnfreie Buchstabensuppe.&lt;br /&gt;
Da war ja mal wieder jemand kreativ. &lt;img src=&quot;http://spielwiese.la-evento.com/xelasblog/templates/default/img/emoticons/wink.png&quot; alt=&quot;;-)&quot; style=&quot;display: inline; vertical-align: bottom;&quot; class=&quot;emoticon&quot; /&gt;&lt;br /&gt;
Im Allgemeinen werden die Mails von Spamassassin gut aussortiert. Falls das doch nicht der Fall w&amp;auml;re, hilft folgende Rule in der local.cf:
&lt;div class=&quot;geshi&quot;&gt;header &amp;#160; &amp;#160;MINIVIAG &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; From =~ /&lt;span style=&quot;color: rgb(102, 204, 102);&quot;&gt;(&lt;/span&gt;Viagra|Levitra|Cialis&lt;span style=&quot;color: rgb(102, 204, 102);&quot;&gt;)&lt;/span&gt; .*www\.&lt;span style=&quot;color: rgb(102, 204, 102);&quot;&gt;[&lt;/span&gt;a-z0-9&lt;span style=&quot;color: rgb(102, 204, 102);&quot;&gt;]&lt;/span&gt;&lt;span style=&quot;color: rgb(102, 204, 102);&quot;&gt;{&lt;/span&gt;&lt;span style=&quot;color: rgb(204, 102, 204);&quot;&gt;4&lt;/span&gt;,&lt;span style=&quot;color: rgb(204, 102, 204);&quot;&gt;8&lt;/span&gt;&lt;span style=&quot;color: rgb(102, 204, 102);&quot;&gt;}&lt;/span&gt;\.&lt;span style=&quot;color: rgb(102, 204, 102);&quot;&gt;(&lt;/span&gt;com|net|org&lt;span style=&quot;color: rgb(102, 204, 102);&quot;&gt;)&lt;/span&gt;/i&lt;br /&gt;
describe &amp;#160;MINIVIAG &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; Viagra link im from&lt;br /&gt;
score &amp;#160; &amp;#160; MINIVIAG &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span style=&quot;color: rgb(204, 102, 204);&quot;&gt;2.0&lt;/span&gt;&lt;/div&gt;
&lt;strong&gt;Update:&lt;/strong&gt; Da bessere ich gleich noch mal nach.
&lt;div class=&quot;geshi&quot;&gt;header &amp;#160; &amp;#160;MINIVIAG &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; From =~ /&lt;span style=&quot;color: rgb(102, 204, 102);&quot;&gt;(&lt;/span&gt;Viagra|Levitra|Cialis|Tamiflu&lt;span style=&quot;color: rgb(102, 204, 102);&quot;&gt;)&lt;/span&gt; .*www\.&lt;span style=&quot;color: rgb(102, 204, 102);&quot;&gt;[&lt;/span&gt;a-z0-9-&lt;span style=&quot;color: rgb(102, 204, 102);&quot;&gt;]&lt;/span&gt;&lt;span style=&quot;color: rgb(102, 204, 102);&quot;&gt;{&lt;/span&gt;&lt;span style=&quot;color: rgb(204, 102, 204);&quot;&gt;4&lt;/span&gt;,&lt;span style=&quot;color: rgb(204, 102, 204);&quot;&gt;8&lt;/span&gt;&lt;span style=&quot;color: rgb(102, 204, 102);&quot;&gt;}&lt;/span&gt;\.&lt;span style=&quot;color: rgb(102, 204, 102);&quot;&gt;(&lt;/span&gt;com|net|org&lt;span style=&quot;color: rgb(102, 204, 102);&quot;&gt;)&lt;/span&gt;/i&lt;br /&gt;
describe &amp;#160;MINIVIAG &amp;#160; &amp;#160; &amp;#160; &amp;#160;&amp;#160;&amp;#160; Pillenlink im from&lt;br /&gt;
score &amp;#160; &amp;#160; MINIVIAG &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span style=&quot;color: rgb(204, 102, 204);&quot;&gt;2.0&lt;/span&gt;&lt;/div&gt;
&lt;br /&gt; 
    </content:encoded>

    <pubDate>Fri, 29 Jan 2010 17:05:42 +0100</pubDate>
    <guid isPermaLink="false">http://spielwiese.la-evento.com/xelasblog/archives/47-guid.html</guid>
    
</item>
<item>
    <title>Mailheader decodieren mit Hilfe von perl</title>
    <link>http://spielwiese.la-evento.com/xelasblog/archives/46-Mailheader-decodieren-mit-Hilfe-von-perl.html</link>
            <category>Bash Snippets</category>
    
    <comments>http://spielwiese.la-evento.com/xelasblog/archives/46-Mailheader-decodieren-mit-Hilfe-von-perl.html#comments</comments>
    <wfw:comment>http://spielwiese.la-evento.com/xelasblog/wfwcomment.php?cid=46</wfw:comment>

    <slash:comments>1</slash:comments>
    <wfw:commentRss>http://spielwiese.la-evento.com/xelasblog/rss.php?version=2.0&amp;type=comments&amp;cid=46</wfw:commentRss>
    

    <author>nospam@example.com (Xela)</author>
    <content:encoded>
    Spamfilter k&amp;ouml;nnen auf Wunsch die aussortierten Mails am Server speichern. An sich sieht man es den Mails schon am Betreff an, ob sie tats&amp;auml;chlich spam oder doch ham (und in diesem Fall eventuell ein false positive) sind.&lt;br /&gt;
Allerdings m&amp;uuml;ssen non-ascii Teile des Mailheaders passend encodiert sein, was das Lesen teilweise unm&amp;ouml;glich macht.&lt;br /&gt;
&lt;br /&gt;
Ein paar Beispiele:&lt;br /&gt;
=?iso-8859-1?Q?Hall=F6chen?=&lt;br /&gt;
=?UTF-8?Q?Hall=C3=B6chen?=&lt;br /&gt;
=?UTF-8?B?SGFsbMO2Y2hlbg==?=&lt;br /&gt;
=?iso-2022-jp?B?GyRCOiNHLyRiSSwkOiRkJGo/ayQyJGsbKEIhIRskQkcvS3ZBMCRO?=&lt;br /&gt;
=?GB2312?B?0rvSubzkyMM1MDDN8sjLudjXosT6svrGt7XEzfjC59Oq?=&lt;br /&gt;
&lt;br /&gt;
Da sind diverse encodings, mal in quoted printable, mal in base64. Allen gemeinsam ist die schwere Lesbarkeit.&lt;br /&gt;
&lt;br /&gt;
Mailheader oder Teile davon kann man am einfachsten mit perl decodieren:
&lt;div class=&quot;geshi&quot;&gt;&lt;span style=&quot;color: rgb(122, 8, 116); font-weight: bold;&quot;&gt;echo&lt;/span&gt; &lt;span style=&quot;color: rgb(255, 0, 0);&quot;&gt;&#039;=?UTF-8?B?SGFsbMO2Y2hlbg==?=&#039;&lt;/span&gt; | &lt;span style=&quot;color: rgb(194, 12, 185); font-weight: bold;&quot;&gt;perl&lt;/span&gt; -MEncode -ne &lt;span style=&quot;color: rgb(255, 0, 0);&quot;&gt;&#039;print encode(&amp;quot;utf8&amp;quot;,decode(&amp;quot;MIME-Header&amp;quot;,$_))&#039;&lt;/span&gt;&lt;/div&gt;
Obiges Beispiel decodiert nicht einfach nur den Header, sondern encodiert auch gleich in UTF-8 (default w&amp;auml;re iso).&lt;br /&gt;
&lt;br /&gt;
Aber auch ganze Unterordner voller Spammails k&amp;ouml;nnen durchsucht werden:
&lt;div class=&quot;geshi&quot;&gt;&lt;span style=&quot;color: rgb(194, 12, 185); font-weight: bold;&quot;&gt;ls&lt;/span&gt; -1t | &lt;span style=&quot;color: rgb(194, 12, 185); font-weight: bold;&quot;&gt;head&lt;/span&gt; &lt;span style=&quot;color: rgb(0, 0, 0);&quot;&gt;-20&lt;/span&gt; | &lt;span style=&quot;color: rgb(194, 12, 185); font-weight: bold;&quot;&gt;xargs&lt;/span&gt; &lt;span style=&quot;color: rgb(194, 12, 185); font-weight: bold;&quot;&gt;grep&lt;/span&gt; &lt;span style=&quot;color: rgb(255, 0, 0);&quot;&gt;&#039;^Subject: =?&#039;&lt;/span&gt; | &lt;span style=&quot;color: rgb(194, 12, 185); font-weight: bold;&quot;&gt;perl&lt;/span&gt; -MEncode -ne &lt;span style=&quot;color: rgb(255, 0, 0);&quot;&gt;&#039;print encode(&amp;quot;utf8&amp;quot;,decode(&amp;quot;MIME-Header&amp;quot;,$_))&#039;&lt;/span&gt;&lt;/div&gt;
Dieses Beispiel durchsucht die neuesten 20 Mails im Ordner nach encodierten Subjects und gibt diese decodiert als UTF-8 aus.&lt;br /&gt;
Nicht encodierte Teile sind &amp;uuml;brigens gar kein Problem.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt; 
    </content:encoded>

    <pubDate>Wed, 06 Jan 2010 15:38:53 +0100</pubDate>
    <guid isPermaLink="false">http://spielwiese.la-evento.com/xelasblog/archives/46-guid.html</guid>
    
</item>
<item>
    <title>Diverse Maildienste auf der Kommandozeile testen</title>
    <link>http://spielwiese.la-evento.com/xelasblog/archives/45-Diverse-Maildienste-auf-der-Kommandozeile-testen.html</link>
            <category>Bash Snippets</category>
    
    <comments>http://spielwiese.la-evento.com/xelasblog/archives/45-Diverse-Maildienste-auf-der-Kommandozeile-testen.html#comments</comments>
    <wfw:comment>http://spielwiese.la-evento.com/xelasblog/wfwcomment.php?cid=45</wfw:comment>

    <slash:comments>0</slash:comments>
    <wfw:commentRss>http://spielwiese.la-evento.com/xelasblog/rss.php?version=2.0&amp;type=comments&amp;cid=45</wfw:commentRss>
    

    <author>nospam@example.com (Xela)</author>
    <content:encoded>
    Vertrauen ist gut, Kontrolle ist besser. Hier folgt eine Sammlung von Kommandozeilentests f&amp;uuml;r diverse Maildienste (smtp, pop, imap...)&lt;br /&gt;
&lt;br /&gt;
Wir gehen davon aus, dass der Mailserver erfolgreich installiert ist, in diesem Fall sei das Postfix mit Postgrey und Amavis, das Zertifikat wurde erstellt, die erforderlichen Dienste laufen und die gew&amp;uuml;nschten Ports sind in der Firewall ge&amp;ouml;ffnet. Die Dienste imap, imaps, pop3 und pop3s werden von Dovecot zur Verf&amp;uuml;gung gestellt.&lt;br /&gt;
Als Beispieldomain verwende ich &lt;strong&gt;dein.mailserver.net&lt;/strong&gt;, als Beispiel-IP &lt;strong&gt;1.2.3.4&lt;/strong&gt;, der Beispieluser (brauchen wir zum Testen der Dienste mit Login) hei&amp;szlig;t &lt;strong&gt;userlein&lt;/strong&gt; und er hat das Passwort &amp;quot;&lt;strong&gt;geheim&lt;/strong&gt;&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
Um es &amp;uuml;bersichtlicher zu machen, sind die einzugebenden Befehle gr&amp;uuml;n, die Antworten des Servers, auf die es besonders ankommt sind blau.&lt;br /&gt;
&lt;br /&gt;
Nun aber zu den Praxisbeipielen:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt; &lt;br /&gt;&lt;a href=&quot;http://spielwiese.la-evento.com/xelasblog/archives/45-Diverse-Maildienste-auf-der-Kommandozeile-testen.html#extended&quot;&gt;&quot;Diverse Maildienste auf der Kommandozeile testen&quot; vollständig lesen&lt;/a&gt;
    </content:encoded>

    <pubDate>Thu, 31 Dec 2009 14:27:26 +0100</pubDate>
    <guid isPermaLink="false">http://spielwiese.la-evento.com/xelasblog/archives/45-guid.html</guid>
    
</item>
<item>
    <title>Amavis, sa-learn und awl</title>
    <link>http://spielwiese.la-evento.com/xelasblog/archives/44-Amavis,-sa-learn-und-awl.html</link>
            <category>Bash Snippets</category>
    
    <comments>http://spielwiese.la-evento.com/xelasblog/archives/44-Amavis,-sa-learn-und-awl.html#comments</comments>
    <wfw:comment>http://spielwiese.la-evento.com/xelasblog/wfwcomment.php?cid=44</wfw:comment>

    <slash:comments>0</slash:comments>
    <wfw:commentRss>http://spielwiese.la-evento.com/xelasblog/rss.php?version=2.0&amp;type=comments&amp;cid=44</wfw:commentRss>
    

    <author>nospam@example.com (Xela)</author>
    <content:encoded>
    Gelegentlich flutscht auch mal ein Spammail durch den Amavis-Filter und landet damit ungewollt in der Autowhitelist, bzw. wird von Bayes f&amp;auml;lschlicherweise als sauber erkannt.&lt;br /&gt;
Mit zwei Kommandos kann das richtig gestellt werden.&lt;br /&gt;
Amavis l&amp;auml;uft als unprivilegierter User (in diesem Fall als vscan), damit sa-learn und spamassassin f&amp;uuml;r den richtigen Filter funktionieren, rufen wir die Kommandos mit sudo auf (als root):&lt;br /&gt;
&lt;div class=&quot;geshi&quot;&gt;&lt;span style=&quot;color: rgb(194, 12, 185); font-weight: bold;&quot;&gt;sudo&lt;/span&gt; -u vscan &lt;strong&gt;spamassassin&lt;/strong&gt; --remove-addr-from-whitelist spammer@doofe-domain.net&lt;/div&gt;
...entfernt die Email Adresse aus der Whitelist.
&lt;div class=&quot;geshi&quot;&gt;&lt;span style=&quot;color: rgb(194, 12, 185); font-weight: bold;&quot;&gt;sudo&lt;/span&gt; -u vscan &lt;strong&gt;sa-learn&lt;/strong&gt; --spam spammail.eml&lt;/div&gt;
...trainiert Bayes auf das vormals durchgeflutschte Mail (hier spammail.eml).&lt;br /&gt;
&lt;br /&gt;
Das kann nat&amp;uuml;rlich auch gleich getestet werden:
&lt;div class=&quot;geshi&quot;&gt;&lt;span style=&quot;color: rgb(194, 12, 185); font-weight: bold;&quot;&gt;sudo&lt;/span&gt; -u vscan &lt;strong&gt;spamassassin&lt;/strong&gt; -L -D &amp;lt; spammail.eml&lt;/div&gt;
Siehe da, Bayes vergibt jetzt 3.5 Punkte, AWL ist v&amp;ouml;llig verschwunden.&lt;br /&gt;
&lt;br /&gt; 
    </content:encoded>

    <pubDate>Thu, 31 Dec 2009 11:50:32 +0100</pubDate>
    <guid isPermaLink="false">http://spielwiese.la-evento.com/xelasblog/archives/44-guid.html</guid>
    
</item>
<item>
    <title>Floats vergleichen in der Bash</title>
    <link>http://spielwiese.la-evento.com/xelasblog/archives/43-Floats-vergleichen-in-der-Bash.html</link>
            <category>Bash Snippets</category>
    
    <comments>http://spielwiese.la-evento.com/xelasblog/archives/43-Floats-vergleichen-in-der-Bash.html#comments</comments>
    <wfw:comment>http://spielwiese.la-evento.com/xelasblog/wfwcomment.php?cid=43</wfw:comment>

    <slash:comments>0</slash:comments>
    <wfw:commentRss>http://spielwiese.la-evento.com/xelasblog/rss.php?version=2.0&amp;type=comments&amp;cid=43</wfw:commentRss>
    

    <author>nospam@example.com (Xela)</author>
    <content:encoded>
    Die Bash (test) kann an sich nur Ganzzahlen vergleichen, &amp;uuml;bergibt man eine Flie&amp;szlig;kommazahl, f&amp;uuml;hrt das zu einem Fehler.
&lt;div class=&quot;geshi&quot;&gt;&lt;span style=&quot;color: rgb(0, 0, 0); font-weight: bold;&quot;&gt;if&lt;/span&gt; &lt;span style=&quot;color: rgb(122, 8, 116); font-weight: bold;&quot;&gt;[&lt;/span&gt; &lt;span style=&quot;color: rgb(0, 0, 0);&quot;&gt;12.3&lt;/span&gt; -gt &lt;span style=&quot;color: rgb(0, 0, 0);&quot;&gt;12&lt;/span&gt; &lt;span style=&quot;color: rgb(122, 8, 116); font-weight: bold;&quot;&gt;]&lt;/span&gt;; &lt;span style=&quot;color: rgb(0, 0, 0); font-weight: bold;&quot;&gt;then&lt;/span&gt; &lt;span style=&quot;color: rgb(122, 8, 116); font-weight: bold;&quot;&gt;echo&lt;/span&gt; &lt;span style=&quot;color: rgb(255, 0, 0);&quot;&gt;&#039;&amp;gt;&#039;&lt;/span&gt;; &lt;span style=&quot;color: rgb(0, 0, 0); font-weight: bold;&quot;&gt;fi&lt;/span&gt;&lt;br /&gt;
bash: &lt;span style=&quot;color: rgb(122, 8, 116); font-weight: bold;&quot;&gt;[&lt;/span&gt;: &lt;span style=&quot;color: rgb(0, 0, 0);&quot;&gt;12.3&lt;/span&gt;: integer expression expected&lt;/div&gt;
M&amp;ouml;chte man doch schnell mal zwei floats vergleichen, geht das ganz einfach mit &lt;strong&gt;bc&lt;/strong&gt;. Zuerst interaktiv:
&lt;pre&gt;
xela@linux:~&amp;gt; bc
bc 1.06
Copyright 1991-1994, 1997, 1998, 2000 Free Software Foundation, Inc.
This is free software with ABSOLUTELY NO WARRANTY.
For details type `warranty&#039;.
if (10.123 &amp;gt; 10.1119) 1 else 0
1
quit
&lt;/pre&gt;
Um diese Art Test in einem Skript verwenden zu k&amp;ouml;nnen, nehmen wir &amp;quot;echo&amp;quot; zum &amp;Uuml;bergeben an bc:
&lt;div class=&quot;geshi&quot;&gt;&lt;span style=&quot;color: rgb(0, 0, 0); font-weight: bold;&quot;&gt;if&lt;/span&gt; &lt;span style=&quot;color: rgb(122, 8, 116); font-weight: bold;&quot;&gt;[&lt;/span&gt; $&lt;span style=&quot;color: rgb(122, 8, 116); font-weight: bold;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: rgb(122, 8, 116); font-weight: bold;&quot;&gt;echo&lt;/span&gt; &lt;span style=&quot;color: rgb(255, 0, 0);&quot;&gt;&amp;quot;if (19 &amp;gt;= 19.00000) 1 else 0&amp;quot;&lt;/span&gt; | &lt;span style=&quot;color: rgb(194, 12, 185); font-weight: bold;&quot;&gt;bc&lt;/span&gt;&lt;span style=&quot;color: rgb(122, 8, 116); font-weight: bold;&quot;&gt;)&lt;/span&gt; -eq &lt;span style=&quot;color: rgb(0, 0, 0);&quot;&gt;1&lt;/span&gt; &lt;span style=&quot;color: rgb(122, 8, 116); font-weight: bold;&quot;&gt;]&lt;/span&gt; ; &lt;span style=&quot;color: rgb(0, 0, 0); font-weight: bold;&quot;&gt;then&lt;/span&gt; &lt;span style=&quot;color: rgb(122, 8, 116); font-weight: bold;&quot;&gt;echo&lt;/span&gt; gr&amp;ouml;&amp;szlig;ergleich; &lt;span style=&quot;color: rgb(0, 0, 0); font-weight: bold;&quot;&gt;else&lt;/span&gt; &lt;span style=&quot;color: rgb(122, 8, 116); font-weight: bold;&quot;&gt;echo&lt;/span&gt; kleiner; &lt;span style=&quot;color: rgb(0, 0, 0); font-weight: bold;&quot;&gt;fi&lt;/span&gt;&lt;/div&gt;
Wichtig dabei ist das &amp;quot;&lt;strong&gt;else 0&lt;/strong&gt;&amp;quot;, damit &lt;em&gt;auf alle F&amp;auml;lle&lt;/em&gt; ein Integer (Ganzzahl) zur&amp;uuml;ckgegeben wird, den &lt;strong&gt;test&lt;/strong&gt; (also &lt;strong&gt;[&lt;/strong&gt; ) dann vergleichen kann.&lt;br /&gt;
So richtig Sinn macht das klarerweise erst mit Variablen:
&lt;div class=&quot;geshi&quot;&gt;&lt;span style=&quot;color: rgb(0, 120, 0);&quot;&gt;a=&lt;/span&gt;&lt;span style=&quot;color: rgb(255, 0, 0);&quot;&gt;&#039;3.333&#039;&lt;/span&gt;; &lt;span style=&quot;color: rgb(0, 120, 0);&quot;&gt;b=&lt;/span&gt;&lt;span style=&quot;color: rgb(255, 0, 0);&quot;&gt;&#039;3.2176&#039;&lt;/span&gt;; if &lt;span style=&quot;color: rgb(122, 8, 116); font-weight: bold;&quot;&gt;[&lt;/span&gt; $&lt;span style=&quot;color: rgb(122, 8, 116); font-weight: bold;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: rgb(122, 8, 116); font-weight: bold;&quot;&gt;echo&lt;/span&gt; &lt;span style=&quot;color: rgb(255, 0, 0);&quot;&gt;&amp;quot;if (${a} &amp;gt; &amp;#160;${b}) 1 else 0&amp;quot;&lt;/span&gt; | &lt;span style=&quot;color: rgb(194, 12, 185); font-weight: bold;&quot;&gt;bc&lt;/span&gt;&lt;span style=&quot;color: rgb(122, 8, 116); font-weight: bold;&quot;&gt;)&lt;/span&gt; -eq &lt;span style=&quot;color: rgb(0, 0, 0);&quot;&gt;1&lt;/span&gt; &lt;span style=&quot;color: rgb(122, 8, 116); font-weight: bold;&quot;&gt;]&lt;/span&gt; ; &lt;span style=&quot;color: rgb(0, 0, 0); font-weight: bold;&quot;&gt;then&lt;/span&gt; &lt;span style=&quot;color: rgb(122, 8, 116); font-weight: bold;&quot;&gt;echo&lt;/span&gt; gr&amp;ouml;&amp;szlig;er; &lt;span style=&quot;color: rgb(0, 0, 0); font-weight: bold;&quot;&gt;else&lt;/span&gt; &lt;span style=&quot;color: rgb(122, 8, 116); font-weight: bold;&quot;&gt;echo&lt;/span&gt; kleiner; &lt;span style=&quot;color: rgb(0, 0, 0); font-weight: bold;&quot;&gt;fi&lt;/span&gt;&lt;/div&gt;
&lt;br /&gt; 
    </content:encoded>

    <pubDate>Sun, 20 Dec 2009 15:50:24 +0100</pubDate>
    <guid isPermaLink="false">http://spielwiese.la-evento.com/xelasblog/archives/43-guid.html</guid>
    
</item>
<item>
    <title>ffmpeg Schrifteffekt mit vhook imlib2.so</title>
    <link>http://spielwiese.la-evento.com/xelasblog/archives/42-ffmpeg-Schrifteffekt-mit-vhook-imlib2.so.html</link>
            <category>Bash Snippets</category>
    
    <comments>http://spielwiese.la-evento.com/xelasblog/archives/42-ffmpeg-Schrifteffekt-mit-vhook-imlib2.so.html#comments</comments>
    <wfw:comment>http://spielwiese.la-evento.com/xelasblog/wfwcomment.php?cid=42</wfw:comment>

    <slash:comments>0</slash:comments>
    <wfw:commentRss>http://spielwiese.la-evento.com/xelasblog/rss.php?version=2.0&amp;type=comments&amp;cid=42</wfw:commentRss>
    

    <author>nospam@example.com (Xela)</author>
    <content:encoded>
    &lt;a href=&quot;http://ffmpeg.org/&quot;&gt;FFMPEG&lt;/a&gt; bietet ein paar d&amp;uuml;rftig dokumentierte Effekte, sogenannte vhooks. Einer davon ist imlib2.so. Zwar sind die vhooks zu nicht viel n&amp;uuml;tze, werden auch gar nicht mehr weiter entwickelt und sind in der Anwendung gr&amp;auml;&amp;szlig;lich kompliziert. Einen lustigen Effekt m&amp;ouml;chte ich euch aber nicht vorenthalten: eine Schrift, die etwas zeitverz&amp;ouml;gert &amp;uuml;bers Bild huscht und dabei langsam transparent wird.&lt;br /&gt;
&lt;div class=&quot;geshi&quot;&gt;ffmpeg -i input.flv -vhook &lt;span style=&quot;color: rgb(255, 0, 0);&quot;&gt;&#039;/usr/lib/vhook/imlib2.so -c white -x 250 -y H+(-1.8*N+80) -t Hallo! -A max(0,255-exp(N/16))&#039;&lt;/span&gt; -sameq -acodec copy output.flv&lt;/div&gt;
Ja, das ist eine mords Codewurst.&lt;br /&gt;
&lt;br /&gt;
Zuvor muss in der Shell noch die Variable FONTPATH gesetzt und exportiert werden, falls sie nicht gesetzt ist:
&lt;div class=&quot;geshi&quot;&gt;&lt;span style=&quot;color: rgb(0, 120, 0);&quot;&gt;FONTPATH=&lt;/span&gt;&lt;span style=&quot;color: rgb(255, 0, 0);&quot;&gt;&amp;quot;/usr/lib/jvm/java-1.6.0-sun-1.6.0/jre/lib/fonts/&amp;quot;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: rgb(122, 8, 116); font-weight: bold;&quot;&gt;export&lt;/span&gt; FONTPATH&lt;/div&gt;
Sonst findet ffmpeg die Schriften nicht. Obiger Ordner ist nur ein Beispiel, dort liegt bei mir zuf&amp;auml;llig die Schrift, die ffmpeg per default verwendet. Zwar kann das noch mit -f gesetzt werden, aber der Befehl ist auch so schon lang genug.&lt;br /&gt;
&lt;br /&gt;
Jetzt aber im Detail: &lt;br /&gt; &lt;br /&gt;&lt;a href=&quot;http://spielwiese.la-evento.com/xelasblog/archives/42-ffmpeg-Schrifteffekt-mit-vhook-imlib2.so.html#extended&quot;&gt;&quot;ffmpeg Schrifteffekt mit vhook imlib2.so&quot; vollständig lesen&lt;/a&gt;
    </content:encoded>

    <pubDate>Wed, 26 Aug 2009 16:43:13 +0200</pubDate>
    <guid isPermaLink="false">http://spielwiese.la-evento.com/xelasblog/archives/42-guid.html</guid>
    
</item>
<item>
    <title>Text formatieren in zenity</title>
    <link>http://spielwiese.la-evento.com/xelasblog/archives/40-Text-formatieren-in-zenity.html</link>
            <category>Bash Snippets</category>
    
    <comments>http://spielwiese.la-evento.com/xelasblog/archives/40-Text-formatieren-in-zenity.html#comments</comments>
    <wfw:comment>http://spielwiese.la-evento.com/xelasblog/wfwcomment.php?cid=40</wfw:comment>

    <slash:comments>1</slash:comments>
    <wfw:commentRss>http://spielwiese.la-evento.com/xelasblog/rss.php?version=2.0&amp;type=comments&amp;cid=40</wfw:commentRss>
    

    <author>nospam@example.com (Xela)</author>
    <content:encoded>
    &lt;strong&gt;Zenity&lt;/strong&gt; ist ein Programm, das GTK+ Dialoge anzeigt. Damit kann man Shellskripten ein GUI (Graphical User Interface) verpassen, was einigen Komfort f&amp;uuml;r den User bringt.&lt;br /&gt;
&lt;br /&gt;
Ein einfaches Beispiel:&lt;br /&gt;
&lt;div class=&quot;geshi&quot;&gt;&lt;strong&gt;zenity&lt;/strong&gt; --info --text &lt;span style=&quot;color: rgb(255, 0, 0);&quot;&gt;&amp;quot;sehr informativ&amp;quot;&lt;/span&gt;&lt;/div&gt;
&lt;br /&gt;
Zenity kann aber auch Fragen, Auswahllisten, Kalender, etc.&lt;br /&gt;
&lt;br /&gt;
Wenig bekannt ist, dass die Texte in den Dialogfenstern auch &lt;strong&gt;formatiert&lt;/strong&gt; werden k&amp;ouml;nnen. In der manpage von zenity steht auch gar nichts davon.&lt;br /&gt;
&lt;br /&gt;
Deshalb ein paar Beispiele:&lt;br /&gt;
&lt;div class=&quot;geshi&quot;&gt;&lt;strong&gt;zenity&lt;/strong&gt; --info --text &lt;span style=&quot;color: rgb(255, 0, 0);&quot;&gt;&amp;quot;&amp;lt;b&amp;gt;sehr&amp;lt;/b&amp;gt; &amp;lt;i&amp;gt;informativ&amp;lt;/i&amp;gt;&amp;quot;&lt;/span&gt;&lt;/div&gt;
&amp;lt;b&amp;gt;&amp;lt;/b&amp;gt; erzeugt fetten Text&lt;br /&gt;
&amp;lt;i&amp;gt;&amp;lt;/i&amp;gt; erzeugt kursiven Text&lt;br /&gt;
Verwendet wird offensichtlich eine HTML-&amp;auml;hniche Syntax mit Tags.&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;geshi&quot;&gt;&lt;strong&gt;zenity&lt;/strong&gt; --info --text &lt;span style=&quot;color: rgb(255, 0, 0);&quot;&gt;&#039;&amp;lt;span size=&amp;quot;xx-large&amp;quot;&amp;gt;Obacht!!!&amp;lt;/span&amp;gt;&lt;span style=&quot;color: rgb(0, 0, 153); font-weight: bold;&quot;&gt;\n&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 0, 153); font-weight: bold;&quot;&gt;\n&lt;/span&gt;Das ist extrem wichtig&#039;&lt;/span&gt;&lt;/div&gt;
large, larger, x-large und xx-large erzeugen gr&amp;ouml;&amp;szlig;eren Text&lt;br /&gt;
\n erzeugt einen Zeilenumbruch&lt;br /&gt;
Nat&amp;uuml;rlich kann man Text auch verkleinern mit small, smaller, x-small und xx-small.&lt;br /&gt;
&lt;br /&gt;
Auch farbiger Text ist m&amp;ouml;glich:&lt;br /&gt;
&lt;div class=&quot;geshi&quot;&gt;&lt;strong&gt;zenity&lt;/strong&gt; --info --text &lt;span style=&quot;color: rgb(255, 0, 0);&quot;&gt;&#039;&amp;lt;span color=&amp;quot;red&amp;quot;&amp;gt;roter&amp;lt;/span&amp;gt; und &amp;lt;span color=&amp;quot;blue&amp;quot;&amp;gt;blauer&amp;lt;/span&amp;gt; Text&#039;&lt;/span&gt;&lt;/div&gt;
Au&amp;szlig;erdem gehen die HTML-Tags &amp;lt;u&amp;gt;, &amp;lt;tt&amp;gt;, &amp;lt;sup&amp;gt;, &amp;lt;sub&amp;gt;, &amp;lt;s&amp;gt;, &amp;lt;big&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Mehr l&amp;auml;sst sich eventuell noch durch herumprobieren herausfinden.&lt;br /&gt;
Die Dokumentation zu den mit zenity verwendbaren Tags steckt wohl irgendwo tief im GTK+ Quelltext. &lt;img src=&quot;http://spielwiese.la-evento.com/xelasblog/templates/default/img/emoticons/wink.png&quot; alt=&quot;;-)&quot; style=&quot;display: inline; vertical-align: bottom;&quot; class=&quot;emoticon&quot; /&gt;&lt;br /&gt;
&lt;br /&gt; 
    </content:encoded>

    <pubDate>Fri, 31 Jul 2009 16:47:48 +0200</pubDate>
    <guid isPermaLink="false">http://spielwiese.la-evento.com/xelasblog/archives/40-guid.html</guid>
    
</item>
<item>
    <title>Datei mit gemischtem Encoding reparieren</title>
    <link>http://spielwiese.la-evento.com/xelasblog/archives/34-Datei-mit-gemischtem-Encoding-reparieren.html</link>
            <category>Bash Snippets</category>
    
    <comments>http://spielwiese.la-evento.com/xelasblog/archives/34-Datei-mit-gemischtem-Encoding-reparieren.html#comments</comments>
    <wfw:comment>http://spielwiese.la-evento.com/xelasblog/wfwcomment.php?cid=34</wfw:comment>

    <slash:comments>1</slash:comments>
    <wfw:commentRss>http://spielwiese.la-evento.com/xelasblog/rss.php?version=2.0&amp;type=comments&amp;cid=34</wfw:commentRss>
    

    <author>nospam@example.com (Xela)</author>
    <content:encoded>
    Textdateien haben ein Encoding, das ist in unseren Breiten meist entweder &lt;strong&gt;utf-8 oder iso-8859-1&lt;/strong&gt; (es gibt nat&amp;uuml;rlich noch bedeutend mehr). Ein gro&amp;szlig;es Problem entsteht, wenn Windows- und Linuxuser gemeinsam (deutschsprachige) Dateien bearbeiten. Dann kann es vorkommen, dass eine Textdatei sowohl utf-8, als auch iso-8859-1 Teile enth&amp;auml;lt. &lt;br /&gt;
Die Datei ist kaputt, Umlaute werden teilweise nicht mehr richtig angezeigt.&lt;br /&gt;
&lt;br /&gt;
Was tun? Normalerweise m&amp;uuml;sste sich jetzt jemand hinsetzen und den gesamten Text durcharbeiten.&lt;br /&gt;
Nein, wir Tricksen! &lt;img src=&quot;http://spielwiese.la-evento.com/xelasblog/templates/default/img/emoticons/wink.png&quot; alt=&quot;;-)&quot; style=&quot;display: inline; vertical-align: bottom;&quot; class=&quot;emoticon&quot; /&gt;&lt;br /&gt;
&lt;br /&gt;
Wir verwenden das Programm &lt;strong&gt;recode&lt;/strong&gt;, allerdings nicht direkt. Mit gemischtem Encoding kann recode nicht umgehen, sondern wir gehen den Umweg &amp;uuml;ber HTML-Entities.&lt;br /&gt;
&lt;br /&gt;
Wichtig: Folgendes findet auf einer Linuxkonsole mit $LANG=de_DE.UTF-8 statt:&lt;br /&gt;
&lt;br /&gt; &lt;br /&gt;&lt;a href=&quot;http://spielwiese.la-evento.com/xelasblog/archives/34-Datei-mit-gemischtem-Encoding-reparieren.html#extended&quot;&gt;&quot;Datei mit gemischtem Encoding reparieren&quot; vollständig lesen&lt;/a&gt;
    </content:encoded>

    <pubDate>Mon, 27 Apr 2009 17:03:37 +0200</pubDate>
    <guid isPermaLink="false">http://spielwiese.la-evento.com/xelasblog/archives/34-guid.html</guid>
    
</item>
<item>
    <title>Suchbegriffe aus Apache Logfile</title>
    <link>http://spielwiese.la-evento.com/xelasblog/archives/33-Suchbegriffe-aus-Apache-Logfile.html</link>
            <category>Bash Snippets</category>
    
    <comments>http://spielwiese.la-evento.com/xelasblog/archives/33-Suchbegriffe-aus-Apache-Logfile.html#comments</comments>
    <wfw:comment>http://spielwiese.la-evento.com/xelasblog/wfwcomment.php?cid=33</wfw:comment>

    <slash:comments>0</slash:comments>
    <wfw:commentRss>http://spielwiese.la-evento.com/xelasblog/rss.php?version=2.0&amp;type=comments&amp;cid=33</wfw:commentRss>
    

    <author>nospam@example.com (Xela)</author>
    <content:encoded>
    Zur Suchmaschinenoptimierung geh&amp;ouml;rt zuallererst die Diagnose: &lt;br /&gt;
Mit welchen Suchbegriffen kommen die Leute auf welche meiner Seiten. Die (Google-)Suchbegriffe sind Teil des Refererstrings im Apache Logfile. Das ist aber im Allgemeinen lang und un&amp;uuml;bersichtlich.&lt;br /&gt;
&lt;br /&gt;
Folgendes Bashskript extrahiert die gew&amp;uuml;nschten Daten aus Logfiles.&lt;br /&gt;
Voraussetzung: Leserechte auf das Logfile (z.B. access_log).&lt;br /&gt; &lt;br /&gt;&lt;a href=&quot;http://spielwiese.la-evento.com/xelasblog/archives/33-Suchbegriffe-aus-Apache-Logfile.html#extended&quot;&gt;&quot;Suchbegriffe aus Apache Logfile&quot; vollständig lesen&lt;/a&gt;
    </content:encoded>

    <pubDate>Sun, 26 Apr 2009 11:06:41 +0200</pubDate>
    <guid isPermaLink="false">http://spielwiese.la-evento.com/xelasblog/archives/33-guid.html</guid>
    
</item>
<item>
    <title>Geolocation Wrapper Skript für die Bash</title>
    <link>http://spielwiese.la-evento.com/xelasblog/archives/32-Geolocation-Wrapper-Skript-fuer-die-Bash.html</link>
            <category>Bash Snippets</category>
    
    <comments>http://spielwiese.la-evento.com/xelasblog/archives/32-Geolocation-Wrapper-Skript-fuer-die-Bash.html#comments</comments>
    <wfw:comment>http://spielwiese.la-evento.com/xelasblog/wfwcomment.php?cid=32</wfw:comment>

    <slash:comments>0</slash:comments>
    <wfw:commentRss>http://spielwiese.la-evento.com/xelasblog/rss.php?version=2.0&amp;type=comments&amp;cid=32</wfw:commentRss>
    

    <author>nospam@example.com (Xela)</author>
    <content:encoded>
    &lt;strong&gt;Geolocation&lt;/strong&gt; oder &lt;strong&gt;Geotargeting&lt;/strong&gt; ist das Schlie&amp;szlig;en auf den geographischen Standort aus einer IP-Adresse. Zwar kann wegen dynamisch zugeteilter IP&#039;s, der Verwendung von NAT oder Proxis usw., die Zuordnung nie 100%-ig genau sein, meist kommt man aber ungef&amp;auml;hr in die richtige Richtung (Provider, Netz...).&lt;br /&gt;
&lt;br /&gt;
F&amp;uuml;r besonders Neugierige gibt es auch die M&amp;ouml;glichkeit, die IP nicht nur einem Land, sondern einer Stadt zuzuordnen (incl. L&amp;auml;ngen- und Breitengrad). &lt;a href=&quot;http://www.maxmind.com/&quot;&gt;http://www.maxmind.com/&lt;/a&gt;, wo das Projekt &lt;strong&gt;GeoIP&lt;/strong&gt; zuhause ist, bietet zum Beispiel online so einen Dienst an. Noch praktischer w&amp;auml;re nat&amp;uuml;rlich ein lokales Shellskript. &lt;br /&gt;
&lt;br /&gt;
Und so wirds gemacht:&lt;br /&gt;
&lt;br /&gt; &lt;br /&gt;&lt;a href=&quot;http://spielwiese.la-evento.com/xelasblog/archives/32-Geolocation-Wrapper-Skript-fuer-die-Bash.html#extended&quot;&gt;&quot;Geolocation Wrapper Skript für die Bash&quot; vollständig lesen&lt;/a&gt;
    </content:encoded>

    <pubDate>Sat, 18 Apr 2009 14:53:55 +0200</pubDate>
    <guid isPermaLink="false">http://spielwiese.la-evento.com/xelasblog/archives/32-guid.html</guid>
    
</item>

</channel>
</rss>