<?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.6 - http://www.s9y.org/</generator>
    
    

<item>
    <title>Dateien mit Leerzeichen im Namen verarbeiten</title>
    <link>http://spielwiese.la-evento.com/xelasblog/archives/60-Dateien-mit-Leerzeichen-im-Namen-verarbeiten.html</link>
            <category>Bash Snippets</category>
    
    <comments>http://spielwiese.la-evento.com/xelasblog/archives/60-Dateien-mit-Leerzeichen-im-Namen-verarbeiten.html#comments</comments>
    <wfw:comment>http://spielwiese.la-evento.com/xelasblog/wfwcomment.php?cid=60</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=60</wfw:commentRss>
    

    <author>nospam@example.com (Xela)</author>
    <content:encoded>
    Konkretes Beispiel: es soll auf die Schnelle ein Stapel wav Dateien mit &lt;em&gt;ffmpeg&lt;/em&gt; in mp3 konvertiert werden, die Dateinamen haben aber leider ein Leerzeichen (Track 1.wav usw.).&lt;br /&gt;
Die L&amp;ouml;sung: die Umgebungsvariable IFS (&lt;em&gt;Internal Field Separator&lt;/em&gt;) umschreiben.&lt;br /&gt;
Hinweis: der Ordner &amp;quot;mp3&amp;quot; muss nat&amp;uuml;rlich vorher von Hand angelegt werden.&lt;br /&gt;
&lt;br /&gt;
Folgendes scheitert am Leerzeichen:&lt;font face=&quot;Arial&quot; size=&quot;2&quot;&gt;&lt;span style=&quot;&quot;&gt;&lt;br /&gt;
&lt;div class=&quot;geshi&quot;&gt;&lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;for&lt;/span&gt; f &lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;in&lt;/span&gt; *.wav; &lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;do&lt;/span&gt; ffmpeg -i &lt;span style=&quot;color: #ff0000;&quot;&gt;&amp;quot;$f&amp;quot;&lt;/span&gt; &lt;span style=&quot;color: #ff0000;&quot;&gt;&amp;quot;../mp3/${f}.mp3&amp;quot;&lt;/span&gt;; &lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;done&lt;/span&gt;;&lt;/div&gt;
&lt;br /&gt;
&lt;/span&gt;&lt;/font&gt;Wenn ich vorher aber die IFS Variable auf Zeilenumbruch setze, klappt es&lt;font face=&quot;Arial&quot; size=&quot;2&quot;&gt;&lt;span style=&quot;&quot;&gt;:&lt;br /&gt;
&lt;div class=&quot;geshi&quot;&gt;&lt;span style=&quot;color: #007800;&quot;&gt;IFS=&lt;/span&gt;&lt;span style=&quot;color: #ff0000;&quot;&gt;&#039; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;br /&gt;
&#039;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;for&lt;/span&gt; f &lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;in&lt;/span&gt; *.wav; &lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;do&lt;/span&gt; ffmpeg -i &lt;span style=&quot;color: #ff0000;&quot;&gt;&amp;quot;$f&amp;quot;&lt;/span&gt; &lt;span style=&quot;color: #ff0000;&quot;&gt;&amp;quot;../mp3/${f}.mp3&amp;quot;&lt;/span&gt;; &lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;done&lt;/span&gt;;&lt;/div&gt;
&lt;br /&gt;
&lt;/span&gt;&lt;/font&gt;Danach sollte IFS wieder auf den urspr&amp;uuml;nglichen Wert, also Leerzeichen, gesetzt werden:&lt;br /&gt;
&lt;font face=&quot;Arial&quot; size=&quot;2&quot;&gt;&lt;span style=&quot;&quot;&gt;
&lt;div class=&quot;geshi&quot;&gt;&lt;span style=&quot;color: #007800;&quot;&gt;IFS=&lt;/span&gt;&lt;span style=&quot;color: #ff0000;&quot;&gt;&#039; &#039;&lt;/span&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;/span&gt;&lt;/font&gt; 
    </content:encoded>

    <pubDate>Mon, 02 Jan 2012 12:15:31 +0100</pubDate>
    <guid isPermaLink="false">http://spielwiese.la-evento.com/xelasblog/archives/60-guid.html</guid>
    
</item>
<item>
    <title>Memory Verbrauch addiert nach Prozessname</title>
    <link>http://spielwiese.la-evento.com/xelasblog/archives/61-Memory-Verbrauch-addiert-nach-Prozessname.html</link>
            <category>Bash Snippets</category>
    
    <comments>http://spielwiese.la-evento.com/xelasblog/archives/61-Memory-Verbrauch-addiert-nach-Prozessname.html#comments</comments>
    <wfw:comment>http://spielwiese.la-evento.com/xelasblog/wfwcomment.php?cid=61</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=61</wfw:commentRss>
    

    <author>nospam@example.com (Xela)</author>
    <content:encoded>
    Mithilfe folgender Codewurst kann der Memoryverbrauch nach Prozessnamen addiert aufgelistet werden:&lt;br /&gt;
&lt;div class=&quot;geshi&quot;&gt;&lt;span style=&quot;color: #c20cb9; font-weight: bold;&quot;&gt;ps&lt;/span&gt; -e -o comm,rss --no-heading|&lt;strong&gt;awk&lt;/strong&gt; &lt;span style=&quot;color: #ff0000;&quot;&gt;&#039;{arr[$1]+=$2} END {for (i in arr) {printf(&amp;quot;%15s &amp;quot;, i); printf(&amp;quot;%6s \n&amp;quot;, arr[i]);}}&#039;&lt;/span&gt;|&lt;strong&gt;grep&lt;/strong&gt; -v &lt;span style=&quot;color: #ff0000;&quot;&gt;&#039; 0&#039;&lt;/span&gt;|&lt;strong&gt;sort&lt;/strong&gt; -nr -k2&lt;/div&gt;
&lt;br /&gt;
Kleine Variante - wenn wir die Hauptverbraucher ohnehin schon kennen, konzentrieren wir uns auf die:&lt;br /&gt;
&lt;div class=&quot;geshi&quot;&gt;&lt;span style=&quot;color: #c20cb9; font-weight: bold;&quot;&gt;ps&lt;/span&gt; -C amavisd-new,clamd,apache2,mysqld -o comm,rss --no-heading|&lt;strong&gt;awk&lt;/strong&gt; &lt;span style=&quot;color: #ff0000;&quot;&gt;&#039;{arr[$1]+=$2} END {for (i in arr) {printf(&amp;quot;%15s &amp;quot;, i); printf(&amp;quot;%6s \n&amp;quot;, arr[i]);}}&#039;&lt;/span&gt;|&lt;strong&gt;grep&lt;/strong&gt; -v &lt;span style=&quot;color: #ff0000;&quot;&gt;&#039; 0&#039;&lt;/span&gt;|&lt;strong&gt;sort&lt;/strong&gt; -nr -k2&lt;/div&gt;
&lt;br /&gt; &lt;br /&gt;&lt;a href=&quot;http://spielwiese.la-evento.com/xelasblog/archives/61-Memory-Verbrauch-addiert-nach-Prozessname.html#extended&quot;&gt;&quot;Memory Verbrauch addiert nach Prozessname&quot; vollständig lesen&lt;/a&gt;
    </content:encoded>

    <pubDate>Tue, 03 Jan 2012 15:02:05 +0100</pubDate>
    <guid isPermaLink="false">http://spielwiese.la-evento.com/xelasblog/archives/61-guid.html</guid>
    
</item>
<item>
    <title>Munin ip_ Plugin mit Ubuntu's ufw</title>
    <link>http://spielwiese.la-evento.com/xelasblog/archives/54-Munin-ip_-Plugin-mit-Ubuntus-ufw.html</link>
            <category>Bash Snippets</category>
    
    <comments>http://spielwiese.la-evento.com/xelasblog/archives/54-Munin-ip_-Plugin-mit-Ubuntus-ufw.html#comments</comments>
    <wfw:comment>http://spielwiese.la-evento.com/xelasblog/wfwcomment.php?cid=54</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=54</wfw:commentRss>
    

    <author>nospam@example.com (Xela)</author>
    <content:encoded>
    Das Munin Monitoring Paket auf Ubuntu LTS (10.04, lucid) bringt unter anderem ein nettes Plugin zum iptables basierten Traffic Monitoring mit: &lt;strong&gt;ip_&lt;/strong&gt;&lt;br /&gt;
Nett ist es deshalb, weil es die getrennte Traffic&amp;uuml;berwachung pro IP Adresse erm&amp;ouml;glicht.&lt;br /&gt;
So kann z.B. auch der ipv4 und ipv6 Traffic auf dem selben Interface sch&amp;ouml;n auseinander sortiert werden.&lt;br /&gt;
&lt;br /&gt;
Weniger sch&amp;ouml;n: das Plugin ist mit von Haus aus schon am Server laufenden Firewalls, auch der ufw (Uncomplicated FireWall), nicht kompatibel.&lt;br /&gt;
&lt;br /&gt;
Im folgenden Beispiel wird gezeigt, wie es trotzdem klappt:&lt;br /&gt;
&lt;br /&gt;
&lt;ol&gt;
    &lt;li&gt;Plugin aktivieren (verlinken)&lt;/li&gt;
    &lt;li&gt;Plugin konfigurieren&lt;/li&gt;
    &lt;li&gt;ufw before.rules anpassen&lt;/li&gt;
    &lt;li&gt;Plugin testen&lt;/li&gt;
    &lt;li&gt;Munin durchstarten&lt;/li&gt;
&lt;/ol&gt;
&lt;br /&gt;
Voraussetzung ist: ufw und Munin laufen bereits einwandfrei und ipv6 ist am System und auch in der Firewall aktiv. &lt;br /&gt;&lt;a href=&quot;http://spielwiese.la-evento.com/xelasblog/archives/54-Munin-ip_-Plugin-mit-Ubuntus-ufw.html#extended&quot;&gt;&quot;Munin ip_ Plugin mit Ubuntu&#039;s ufw&quot; vollständig lesen&lt;/a&gt;
    </content:encoded>

    <pubDate>Tue, 28 Jun 2011 12:27:33 +0200</pubDate>
    <guid isPermaLink="false">http://spielwiese.la-evento.com/xelasblog/archives/54-guid.html</guid>
    
</item>
<item>
    <title>Ruckzuck ein neues git Repo anlegen</title>
    <link>http://spielwiese.la-evento.com/xelasblog/archives/52-Ruckzuck-ein-neues-git-Repo-anlegen.html</link>
            <category>Bash Snippets</category>
    
    <comments>http://spielwiese.la-evento.com/xelasblog/archives/52-Ruckzuck-ein-neues-git-Repo-anlegen.html#comments</comments>
    <wfw:comment>http://spielwiese.la-evento.com/xelasblog/wfwcomment.php?cid=52</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=52</wfw:commentRss>
    

    <author>nospam@example.com (Xela)</author>
    <content:encoded>
    Kurzer &amp;Uuml;berblick, bei folgendem Setup:&lt;br /&gt;
Auf dem Server gibt&#039;s den User &amp;quot;git&amp;quot;, der sich via ssh mit Zertifikat verbinden kann. In dessen home liegen alle Repositories.&lt;br /&gt;
Der Server sei hier &amp;quot;myserver.com&amp;quot; genannt, der ssh Port sei 12345.&lt;br /&gt;
&lt;br /&gt;
Eingeloggt als root auf dem &lt;strong&gt;Server&lt;/strong&gt; (als User git eingeloggt f&amp;auml;llt das &amp;quot;su&amp;quot; weg):&lt;br /&gt;
&lt;div class=&quot;geshi&quot;&gt;&lt;span style=&quot;color: #c20cb9; font-weight: bold;&quot;&gt;su&lt;/span&gt; git&lt;br /&gt;
&lt;span style=&quot;color: #c20cb9; font-weight: bold;&quot;&gt;mkdir&lt;/span&gt; &lt;span style=&quot;color: #7a0874; font-weight: bold;&quot;&gt;test&lt;/span&gt;.git&lt;br /&gt;
&lt;span style=&quot;color: #7a0874; font-weight: bold;&quot;&gt;cd&lt;/span&gt; &lt;span style=&quot;color: #7a0874; font-weight: bold;&quot;&gt;test&lt;/span&gt;.git&lt;br /&gt;
git --bare init&lt;br /&gt;
&lt;span style=&quot;color: #7a0874; font-weight: bold;&quot;&gt;exit&lt;/span&gt;&lt;/div&gt;
Somit ist das leere repo am Server angelegt.&lt;br /&gt;
&lt;br /&gt;
Danach bei mir &lt;strong&gt;lokal&lt;/strong&gt; in einem Ordner, in dem ich schon ein wenig gecodet habe:&lt;br /&gt;
&lt;div class=&quot;geshi&quot;&gt;git init&lt;br /&gt;
git add testfile.txt&lt;br /&gt;
git commit -m &lt;span style=&quot;color: #ff0000;&quot;&gt;&#039;added one testfile&#039;&lt;/span&gt;&lt;br /&gt;
git remote add origin &lt;span style=&quot;color: #c20cb9; font-weight: bold;&quot;&gt;ssh&lt;/span&gt;://git@myserver.com:&lt;span style=&quot;color: #000000;&quot;&gt;12345&lt;/span&gt;/home/git/&lt;span style=&quot;color: #7a0874; font-weight: bold;&quot;&gt;test&lt;/span&gt;.git&lt;br /&gt;
git push origin master&lt;/div&gt;
&lt;br /&gt;
Gesetzt den Fall, dass das Repository zus&amp;auml;tzlich zu ssh noch &amp;uuml;ber http(s) zur Verf&amp;uuml;gung gestellt wird, auf dem &lt;strong&gt;Server&lt;/strong&gt;:&lt;br /&gt;
&lt;div class=&quot;geshi&quot;&gt;&lt;span style=&quot;color: #c20cb9; font-weight: bold;&quot;&gt;su&lt;/span&gt; git&lt;br /&gt;
&lt;span style=&quot;color: #7a0874; font-weight: bold;&quot;&gt;cd&lt;/span&gt; &lt;span style=&quot;color: #7a0874; font-weight: bold;&quot;&gt;test&lt;/span&gt;.git/hooks/&lt;br /&gt;
&lt;span style=&quot;color: #c20cb9; font-weight: bold;&quot;&gt;mv&lt;/span&gt; post-update.sample post-update&lt;br /&gt;
git update-server-info&lt;br /&gt;
&lt;span style=&quot;color: #7a0874; font-weight: bold;&quot;&gt;exit&lt;/span&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;br /&gt; 
    </content:encoded>

    <pubDate>Thu, 16 Jun 2011 12:48:05 +0200</pubDate>
    <guid isPermaLink="false">http://spielwiese.la-evento.com/xelasblog/archives/52-guid.html</guid>
    
</item>

</channel>
</rss>
