<?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>treibsand.com &#187; Unix</title>
	<atom:link href="http://www.treibsand.com/tag/unix/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.treibsand.com</link>
	<description></description>
	<lastBuildDate>Tue, 27 Dec 2011 12:46:03 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3</generator>
		<item>
		<title>NFS Server unter Solaris 10</title>
		<link>http://www.treibsand.com/2009/11/17/nfs-server-unter-solaris-10/</link>
		<comments>http://www.treibsand.com/2009/11/17/nfs-server-unter-solaris-10/#comments</comments>
		<pubDate>Tue, 17 Nov 2009 10:50:06 +0000</pubDate>
		<dc:creator>Toast</dc:creator>
				<category><![CDATA[Unix]]></category>
		<category><![CDATA[Administration]]></category>
		<category><![CDATA[NFS]]></category>
		<category><![CDATA[Server]]></category>
		<category><![CDATA[Solaris]]></category>

		<guid isPermaLink="false">http://www.treibsand.com/?p=395</guid>
		<description><![CDATA[Solaris ist ein wunderbares Betriebssystem, allerdings schaut man grundsätzlich erstmal in die Röhre, wenn man z.B. von FreeBSD kommt. Neulich brauchte ich einen NFS Server auf einem Solaris System und war zuerst etwas verwirrt wie es konfiguriert wird&#8230; Die Konfiguration unterscheidet sich ziemlich von der unter FreeBSD, so dass erst mal die Handbücher gewälzt werden [...]]]></description>
			<content:encoded><![CDATA[<p>Solaris ist ein wunderbares Betriebssystem, allerdings schaut man grundsätzlich erstmal in die Röhre, wenn man z.B. von FreeBSD kommt. Neulich brauchte ich einen NFS Server auf einem Solaris System und war zuerst etwas verwirrt wie es konfiguriert wird&#8230;</p>
<p><span id="more-395"></span><br />
Die Konfiguration unterscheidet sich ziemlich von der unter FreeBSD, so dass erst mal die Handbücher gewälzt werden mussten.</p>
<p>Als erstes sollte der NFS Service gestartet werden&#8230;</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">svcadm <span style="color: #660033;">-v</span> <span style="color: #7a0874; font-weight: bold;">enable</span> <span style="color: #660033;">-r</span> network<span style="color: #000000; font-weight: bold;">/</span>nfs<span style="color: #000000; font-weight: bold;">/</span>server</pre></div></div>

<p>Danach ist die NFS Freigabe nötig, bei FreeBSD stehen die in <em>/etc/exports</em>, unter Solaris allerdings in <em>/etc/dfs/dfstab</em>. Eine Freigabe kann man allerdings auch auf der Konsole machen:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">share <span style="color: #660033;">-F</span> nfs <span style="color: #660033;">-o</span> rw <span style="color: #000000; font-weight: bold;">/</span><span style="color: #7a0874; font-weight: bold;">export</span></pre></div></div>

<p>Diese Methode überlebt allerdings keinen Reboot, so dass für eine permanente Freigabe die Zeile in der Datei <em>/etc/dfs/dfstab</em> eingetragen werden sollte.</p>
<p>Wenn auch der Benutzer <em>root</em> auf den NFS Clients verwendet werden soll, dann muss dies explizit freigegeben werden:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">share <span style="color: #660033;">-F</span> nfs <span style="color: #660033;">-o</span> rw,<span style="color: #007800;">root</span>=host1:host2 <span style="color: #000000; font-weight: bold;">/</span><span style="color: #7a0874; font-weight: bold;">export</span></pre></div></div>

<p>Die Option <em>root=access_list</em> legt fest von welchem Host der Benutzer <em>root</em> für die Freigabe Zugriff hat.</p>
<p>Um die Freigabe auf dem anderen System zu mounten, reicht der Befehl:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">mount</span> <span style="color: #660033;">-F</span> nfs server:<span style="color: #000000; font-weight: bold;">/</span><span style="color: #7a0874; font-weight: bold;">export</span> <span style="color: #000000; font-weight: bold;">/</span>mount_point</pre></div></div>

<p>Um das Volumen dauerhaft auf dem Client einzubinden, muss dies in der Datei <em>/etc/vfstab</em> definiert werden:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">server:<span style="color: #000000; font-weight: bold;">/</span><span style="color: #7a0874; font-weight: bold;">export</span>   -   <span style="color: #000000; font-weight: bold;">/</span>mount_point   nfs   -   <span style="color: #c20cb9; font-weight: bold;">yes</span>    rw,soft</pre></div></div>

<p>Also eigentlich gar nicht so schwer&#8230;man muss nur wissen, wo man alles nachlesen kann <img src='http://www.treibsand.com/wp-includes/images/smilies/icon_wink.gif' alt=';-)' class='wp-smiley' /> </p>
<p>Alle Sun Administration Handücher können übrigens unter <a href="http://docs.sun.com/app/docs/coll/47.16?l=de">http://docs.sun.com/app/docs/coll/47.16?l=de</a> gefunden werden.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.treibsand.com/2009/11/17/nfs-server-unter-solaris-10/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Medienserver für Playstation 3</title>
		<link>http://www.treibsand.com/2009/02/09/medienserver-fur-playstation-3/</link>
		<comments>http://www.treibsand.com/2009/02/09/medienserver-fur-playstation-3/#comments</comments>
		<pubDate>Mon, 09 Feb 2009 11:11:07 +0000</pubDate>
		<dc:creator>Toast</dc:creator>
				<category><![CDATA[Einfach cool]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[MediaTomb]]></category>
		<category><![CDATA[Playstation 3]]></category>
		<category><![CDATA[Unix]]></category>
		<category><![CDATA[UPnP]]></category>
		<category><![CDATA[uShare]]></category>

		<guid isPermaLink="false">http://www.treibsand.com/?p=246</guid>
		<description><![CDATA[Kaum hab ich Full-HD auf der Xbox mit XBMC am laufen, kauf ich mir eine Playstation 3 und merke, dass die genauso gut als MediaCenter geeignet ist&#8230; Es gibt nur einige Unterschiede, bei XBMC ist es ja eigentlich gedacht, dass die Inhalt auf der XBox selber liegen, es geht aber auch anders. Die Playstation 3 [...]]]></description>
			<content:encoded><![CDATA[<p>Kaum hab ich Full-HD auf der Xbox mit XBMC am laufen, kauf ich mir eine Playstation 3 und merke, dass die genauso gut als MediaCenter geeignet ist&#8230;</p>
<p><span id="more-246"></span><br />
Es gibt nur einige Unterschiede, bei XBMC ist es ja eigentlich gedacht, dass die Inhalt auf der XBox selber liegen, es geht aber auch anders. Die Playstation 3 erwartet einen UPnP MediaServer. Unter Linux/Unix ist das kein großes Problem. In den FreeBSD Ports finden sich z.B. 2 Programme, <a href="http://ushare.geexbox.org">uShare</a> und <a href="http://mediatomb.cc">MediaTomb</a>. Beide Programme machen nichts anderes, als konfigurierte Dateien/Verzeichnisse auf der Festplatte per UPnP im Netzwerk bereitzustellen.</p>
<p>Ich hab mir beide angeschaut, und muss sagen, dass mir uShare mehr zusagt. Hier kann man einfach in der Konfigurationsdatei mehrere Verzeichnisse angeben, welchen dann rekursiv exportiert werden. Fertig. Bei MediaTomb muss man dies über ein Webinterface (welches wirklich hässlich ist) machen, ausserdem braucht MediaTomb noch eine Datenbank, entweder MySQL oder SQLite. Ein weitere Nachteil ist, dass bei MediaTomb nur die Dateien per UPnP bereitgestellt werden, d.h. die Ordnerstruktur ist dann auf der Playstation 3 nicht mehr sichtbar.</p>
<p>Alles ist aber nicht Gold was glänzt&#8230;das hab ich gemerkt, als ich auf der Playstation eine Matroska Datei anschauen wollte. Die Playstation kann das Format nämlich nicht. Hierfür hilft aber ein kleines Shell Script, mit welchem das Video z.B. in AVI umgewandelt werden kann:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #666666; font-style: italic;">#!/usr/local/bin/bash</span>
&nbsp;
<span style="color: #007800;">INPUT</span>=<span style="color: #ff0000;">&quot;$1&quot;</span>
<span style="color: #007800;">OUTPUT</span>=<span style="color: #ff0000;">&quot;$2&quot;</span>
<span style="color: #007800;">VIDEO_CODEC</span>=<span style="color: #ff0000;">&quot;mpeg2video&quot;</span>
<span style="color: #007800;">VIDEO_FPS</span>=<span style="color: #000000; font-weight: bold;">`</span>mkvinfo <span style="color: #007800;">$1</span> <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #c20cb9; font-weight: bold;">grep</span> <span style="color: #660033;">-A</span> <span style="color: #000000;">10</span> <span style="color: #ff0000;">'Codec ID: V_MPEG4'</span> <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #c20cb9; font-weight: bold;">grep</span> <span style="color: #660033;">-w</span> fps <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #c20cb9; font-weight: bold;">awk</span> <span style="color: #ff0000;">'{print $6}'</span> <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #c20cb9; font-weight: bold;">cut</span> <span style="color: #660033;">-d</span><span style="color: #ff0000;">'('</span> -f2<span style="color: #000000; font-weight: bold;">`</span>
&nbsp;
mkvinfo <span style="color: #007800;">$INPUT</span> <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #c20cb9; font-weight: bold;">grep</span> <span style="color: #660033;">-qE</span> <span style="color: #ff0000;">'Codec ID.*DTS'</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">if</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span> <span style="color: #007800;">$?</span> <span style="color: #660033;">-eq</span> <span style="color: #000000;">0</span> <span style="color: #7a0874; font-weight: bold;">&#93;</span>; <span style="color: #000000; font-weight: bold;">then</span>
  <span style="color: #007800;">AUDIO_CODEC</span>=<span style="color: #ff0000;">&quot;ac3&quot;</span>
  <span style="color: #007800;">AUDIO_BITRATE</span>=<span style="color: #ff0000;">&quot;-ab 640k&quot;</span>
  <span style="color: #007800;">AUDIO_FREQ</span>=<span style="color: #ff0000;">&quot;-ar 48000&quot;</span>
  <span style="color: #007800;">AUDIO_CHANNELS</span>=<span style="color: #ff0000;">&quot;-ac 6&quot;</span>
<span style="color: #000000; font-weight: bold;">else</span>
  <span style="color: #007800;">AUDIO_CODEC</span>=<span style="color: #ff0000;">&quot;copy&quot;</span>
  <span style="color: #007800;">AUDIO_BITRATE</span>=<span style="color: #ff0000;">&quot;&quot;</span>
  <span style="color: #007800;">AUDIO_FREQ</span>=<span style="color: #ff0000;">&quot;&quot;</span>
  <span style="color: #007800;">AUDIO_CHANNELS</span>=<span style="color: #ff0000;">&quot;&quot;</span>
<span style="color: #000000; font-weight: bold;">fi</span>
&nbsp;
<span style="color: #007800;">FORMAT</span>=<span style="color: #ff0000;">&quot;dvd&quot;</span>
&nbsp;
<span style="color: #c20cb9; font-weight: bold;">ffmpeg</span> <span style="color: #660033;">-threads</span> <span style="color: #000000;">8</span> <span style="color: #660033;">-i</span> <span style="color: #ff0000;">&quot;<span style="color: #007800;">${INPUT}</span>&quot;</span> <span style="color: #660033;">-vcodec</span> <span style="color: #800000;">${VIDEO_CODEC}</span> \
  <span style="color: #660033;">-r</span> <span style="color: #800000;">${VIDEO_FPS}</span> <span style="color: #660033;">-sameq</span> <span style="color: #660033;">-acodec</span> <span style="color: #007800;">$AUDIO_CODEC</span> <span style="color: #007800;">$AUDIO_BITRATE</span> <span style="color: #007800;">$AUDIO_FREQ</span> <span style="color: #007800;">$AUDIO_CHANNELS</span> \
  <span style="color: #660033;">-scodec</span> copy <span style="color: #660033;">-f</span> <span style="color: #800000;">${FORMAT}</span> - <span style="color: #000000; font-weight: bold;">&gt;</span> <span style="color: #ff0000;">&quot;<span style="color: #007800;">${OUTPUT}</span>&quot;</span> <span style="color: #000000;">2</span><span style="color: #000000; font-weight: bold;">&gt;/</span>dev<span style="color: #000000; font-weight: bold;">/</span>null</pre></div></div>

<p>Hierfür braucht man mkvtoolnix und ffmpeg. Im Großen und Ganzen muss ich aber sagen, meine XBox wird bald entsorgt. Wieso soll ich auch 2 Konsolen rumstehen haben, wenn alles auch die Playstation kann?</p>
]]></content:encoded>
			<wfw:commentRss>http://www.treibsand.com/2009/02/09/medienserver-fur-playstation-3/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Mit GMime E-Mails parsen</title>
		<link>http://www.treibsand.com/2009/01/19/mit-gmime-e-mails-parsen/</link>
		<comments>http://www.treibsand.com/2009/01/19/mit-gmime-e-mails-parsen/#comments</comments>
		<pubDate>Mon, 19 Jan 2009 15:40:38 +0000</pubDate>
		<dc:creator>Toast</dc:creator>
				<category><![CDATA[Coding]]></category>
		<category><![CDATA[C]]></category>
		<category><![CDATA[GMime]]></category>
		<category><![CDATA[Mail]]></category>
		<category><![CDATA[Unix]]></category>

		<guid isPermaLink="false">http://www.treibsand.com/2009/01/19/mit-gmime-e-mails-parsen/</guid>
		<description><![CDATA[Habt ihr schon mal versucht mit C E-Mails zu parsen? Das kann ziemlich ekelhaft werden. Abhilfe schafft die GMime Library. GMime baut auf GLib auf und bietet eine Vielzahl an Funktionen um E-Mails zu parsen bzw. einzelne Teile zu extrahieren. Will man z.B. den Body einer E-Mails auslesen, und feststellen, ob es sich hierbei um [...]]]></description>
			<content:encoded><![CDATA[<p>Habt ihr schon mal versucht mit C E-Mails zu parsen? Das kann ziemlich ekelhaft werden.<br />
Abhilfe schafft die <a href="http://spruce.sourceforge.net/gmime/">GMime</a> Library.</p>
<p><span id="more-186"></span><br />
GMime baut auf GLib auf und bietet eine Vielzahl an Funktionen um E-Mails<br />
zu parsen bzw. einzelne Teile zu extrahieren. Will man z.B. den Body einer E-Mails auslesen, und feststellen, ob es sich hierbei um HTML Code handelt, dann könnte man es wie folgt machen:</p>

<div class="wp_syntax"><div class="code"><pre class="c" style="font-family:monospace;"><span style="color: #339933;">#include &lt;stdio.h&gt;</span>
<span style="color: #339933;">#include &lt;fcntl.h&gt;</span>
<span style="color: #339933;">#include &lt;glib.h&gt;</span>
<span style="color: #339933;">#include &lt;gmime/gmime.h&gt;</span>
&nbsp;
<span style="color: #993333;">int</span> main <span style="color: #009900;">&#40;</span><span style="color: #993333;">int</span> argc<span style="color: #339933;">,</span> <span style="color: #993333;">char</span> <span style="color: #993333;">const</span> <span style="color: #339933;">*</span>argv<span style="color: #009900;">&#91;</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
	gboolean is_html<span style="color: #339933;">;</span>
	GMimeMessage <span style="color: #339933;">*</span>message<span style="color: #339933;">;</span>
	GMimeParser <span style="color: #339933;">*</span>parser<span style="color: #339933;">;</span>
	GMimeStream <span style="color: #339933;">*</span>stream<span style="color: #339933;">;</span>
	<span style="color: #993333;">char</span> <span style="color: #339933;">*</span>body<span style="color: #339933;">;</span>
	<span style="color: #993333;">int</span> fd<span style="color: #339933;">,</span> i <span style="color: #339933;">=</span> <span style="color: #0000dd;">1</span><span style="color: #339933;">;</span>
&nbsp;
	<span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span>argc <span style="color: #339933;">&lt;</span> <span style="color: #0000dd;">2</span><span style="color: #009900;">&#41;</span>
		<span style="color: #b1b100;">return</span> <span style="color: #0000dd;">0</span><span style="color: #339933;">;</span>
&nbsp;
	g_mime_init <span style="color: #009900;">&#40;</span><span style="color: #0000dd;">0</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #009900;">&#40;</span>fd <span style="color: #339933;">=</span> open <span style="color: #009900;">&#40;</span>argv<span style="color: #009900;">&#91;</span>i<span style="color: #009900;">&#93;</span><span style="color: #339933;">,</span> O_RDONLY<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">==</span> <span style="color: #339933;">-</span><span style="color: #0000dd;">1</span><span style="color: #009900;">&#41;</span>
		<span style="color: #b1b100;">return</span> <span style="color: #0000dd;">0</span><span style="color: #339933;">;</span>
&nbsp;
	stream <span style="color: #339933;">=</span> g_mime_stream_fs_new <span style="color: #009900;">&#40;</span>fd<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	parser <span style="color: #339933;">=</span> g_mime_parser_new_with_stream <span style="color: #009900;">&#40;</span>stream<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	g_object_unref <span style="color: #009900;">&#40;</span>stream<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
	message <span style="color: #339933;">=</span> g_mime_parser_construct_message <span style="color: #009900;">&#40;</span>parser<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
	body <span style="color: #339933;">=</span> g_mime_message_get_body <span style="color: #009900;">&#40;</span>message<span style="color: #339933;">,</span> FALSE<span style="color: #339933;">,</span> <span style="color: #339933;">&amp;</span>is_html<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	fprintf <span style="color: #009900;">&#40;</span>stdout<span style="color: #339933;">,</span> <span style="color: #ff0000;">&quot;Testing get_body (looking for html...%s)<span style="color: #000099; font-weight: bold;">\n</span><span style="color: #000099; font-weight: bold;">\n</span>%s<span style="color: #000099; font-weight: bold;">\n</span><span style="color: #000099; font-weight: bold;">\n</span>&quot;</span><span style="color: #339933;">,</span>
		body <span style="color: #339933;">&amp;&amp;</span> is_html <span style="color: #339933;">?</span> <span style="color: #ff0000;">&quot;found&quot;</span> <span style="color: #339933;">:</span> <span style="color: #ff0000;">&quot;not found&quot;</span><span style="color: #339933;">,</span>
		body <span style="color: #339933;">?</span> body <span style="color: #339933;">:</span> <span style="color: #ff0000;">&quot;No message body found&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
	g_free <span style="color: #009900;">&#40;</span>body<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
	<span style="color: #b1b100;">return</span> <span style="color: #0000dd;">0</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span></pre></div></div>

<p>Kompiliert wird das Programm mit</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">gcc</span> <span style="color: #660033;">-g</span> <span style="color: #660033;">-Wall</span> <span style="color: #000000; font-weight: bold;">`</span>pkg-config <span style="color: #660033;">--cflags</span> gmime-<span style="color: #000000;">2.0</span> glib-<span style="color: #000000;">2.0</span><span style="color: #000000; font-weight: bold;">`</span> <span style="color: #000000; font-weight: bold;">`</span>pkg-config <span style="color: #660033;">--libs</span> gmime-<span style="color: #000000;">2.0</span>  glib-<span style="color: #000000;">2.0</span><span style="color: #000000; font-weight: bold;">`</span> test.c <span style="color: #660033;">-o</span> <span style="color: #7a0874; font-weight: bold;">test</span></pre></div></div>

<p>Als erstes Argument muss der Pfad zur E-Mail angegeben werden.</p>
<p>Bei der Verwendung von GMime bin ich aber leider auch über einen Bug gestolpert. Will man die Absender<br />
Adresse einer E-Mail auslesen, und diese ist z.B. angegeben mit <em>J. Doe <doe@example.com></em>,<br />
dann vermurkst GMime die Adresse und liefert <em>J.Doe</em>. Das ist nur der Fall, wenn<br />
die Adresse nicht in Anführungszeichen ist und einen Punkt enthält. Das Problem macht die<br />
Funktion <em>internet_address_parse_string()</em>. Noch habe ich nicht die aktuelle Version<br />
von GMime ausprobiert, ob es da auch noch auftritt.</p>
<p>Aber grundsätzlich kann man sagen, dass GMime eine hervorragende Library ist, um in C E-Mails<br />
zu parsen. GMime wird z.B. auch von <a href="http://www.dbmail.org">DBMail</a> verwendet.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.treibsand.com/2009/01/19/mit-gmime-e-mails-parsen/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>FreeBSD aktualisieren</title>
		<link>http://www.treibsand.com/2009/01/18/freebsd-aktualisieren/</link>
		<comments>http://www.treibsand.com/2009/01/18/freebsd-aktualisieren/#comments</comments>
		<pubDate>Sun, 18 Jan 2009 18:43:25 +0000</pubDate>
		<dc:creator>Toast</dc:creator>
				<category><![CDATA[Unix]]></category>
		<category><![CDATA[FreeBSD]]></category>

		<guid isPermaLink="false">http://www.treibsand.com/2009/01/18/freebsd-aktualisieren/</guid>
		<description><![CDATA[Jeder Administrator, welcher schon mal ein make world unter FreeBSD gemacht hat, weiss wie lange es dauert das System zu aktualisieren bzw. wie umständlich es ist. Hier hilft das Tool freebsd-update. Es handelt sich hierbei um ein Shell Script, welches seit FreeBSD 6.4 mitgeliefert wird. Mit diesem Script kann das ganze System (ausgenommen Ports natürlich) [...]]]></description>
			<content:encoded><![CDATA[<p>Jeder Administrator, welcher schon mal ein make world unter <a href="http://www.freebsd.org">FreeBSD</a> gemacht hat, weiss<br />
wie lange es dauert das System zu aktualisieren bzw. wie umständlich es ist. Hier hilft das Tool freebsd-update.</p>
<p><span id="more-175"></span><br />
Es handelt sich hierbei um ein Shell Script, welches seit FreeBSD 6.4 mitgeliefert wird. Mit diesem Script kann<br />
das ganze System (ausgenommen Ports natürlich) einfach geupdatet werden.</p>
<p>FreeBSD wird dabei nicht aus den Quellen neu gebaut, es werden Binaries verwendet, und hier wird auch nur<br />
die x86 Architektur bedient. Weitere Vorraussetzung ist, dass das System ein Release ist, also z.B. 7.1-RELEASE.<br />
Systeme, welche vorher mit make world geupdatet wurden kann freebsd-update nicht analysieren.</p>
<p>Um z.B. aktuelle Sicherheitsupdates zu installieren reicht:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">freebsd-update fetch
freebsd-update <span style="color: #c20cb9; font-weight: bold;">install</span></pre></div></div>

<p>Darauf hin untersucht freebsd-update das System und sucht für dieses Release neue Updates. Diese werden<br />
dann installiert, sofern nötig muss der Rechner rebootet werden.</p>
<p>Soll das ganze System auf ein neues Release geupdatet werden, dann muss dieses explizit angegeben werden.</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">freebsd-update <span style="color: #660033;">-r</span> <span style="color: #000000;">7.1</span>-RELEASE upgrade
freebsd-update <span style="color: #c20cb9; font-weight: bold;">install</span></pre></div></div>

<p>Bei Release Updates muss der Rechner rebootet werden, da ein neuer GENERIC Kernel installiert wird. Sobald<br />
man allerdings einen selbst gebautet Kernel verwendet, wird das ganze etwas komplizierter. Dieser muss dann<br />
natürlich nochmal gegen die neuen Sourcen gebaut werden. freebsd-update weisst aber darauf hin. Nach einem Update auf ein neues Release muss man noch alle Ports gegen das neue Basissystem bauen.</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">portupgrade <span style="color: #660033;">-af</span></pre></div></div>

<p>Hier hat es wieder der Admin einfach, welcher nur Packages verwendet <img src='http://www.treibsand.com/wp-includes/images/smilies/icon_wink.gif' alt=';-)' class='wp-smiley' /> </p>
<p>Allgemein ist freebsd-update ein wunderbares Tool, um ein System relativ einfach aktuell zu halten. Vor kurzem<br />
hat es mir dabei geholfen, ein FreeBSd 6.2 auf 7.1 zu aktualisieren. Dabei kam es zu keinem Problem. Übrigens,<br />
mergemaster fällt mit freebsd-update auch weg <img src='http://www.treibsand.com/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://www.treibsand.com/2009/01/18/freebsd-aktualisieren/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>OpenLDAP Replikation</title>
		<link>http://www.treibsand.com/2007/03/19/openldap_replikation/</link>
		<comments>http://www.treibsand.com/2007/03/19/openldap_replikation/#comments</comments>
		<pubDate>Mon, 19 Mar 2007 14:35:42 +0000</pubDate>
		<dc:creator>Toast</dc:creator>
				<category><![CDATA[Unix]]></category>
		<category><![CDATA[LDAP]]></category>

		<guid isPermaLink="false">http://test.treibsand.com/?p=76</guid>
		<description><![CDATA[Kaum wächst ein LDAP Verzeichnis stark, muss man sich Gedanken darüber machen, ob der Server dafür eigentlich noch ausreichend Performance hat. OpenLDAP bietet zum Glück mit slurpd die geeigneten Mittel um ein Verzeichnis auf einen anderen Server zu replizieren. In meinem Setup wollte ich nur einen LDAP Server, welcher alle Schreibzugriffe bearbeitet und somit der [...]]]></description>
			<content:encoded><![CDATA[<p>Kaum wächst ein LDAP Verzeichnis stark, muss man sich Gedanken darüber machen, ob der Server dafür eigentlich noch ausreichend Performance hat. OpenLDAP bietet zum Glück mit slurpd die geeigneten Mittel um ein Verzeichnis auf einen anderen Server zu replizieren. </p>
<p><span id="more-76"></span><br />
In meinem Setup wollte ich nur einen LDAP Server, welcher alle Schreibzugriffe bearbeitet und somit der eigentliche Master-Server ist. Alle anderen LDAP Server sind nur noch für Lesezugriffe da.</p>
<p>Für den Master müssen nur folgende Zeilen in die slapd.conf eintragen werden:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">replica <span style="color: #007800;">host</span>=HOSTNAME-REPLICA-SERVER:<span style="color: #000000;">389</span>
        <span style="color: #007800;">suffix</span>=<span style="color: #ff0000;">&quot;LDAP-SUFFIX&quot;</span>
        <span style="color: #007800;">binddn</span>=<span style="color: #ff0000;">&quot;DN-MANAGER&quot;</span>
        <span style="color: #007800;">credentials</span>=PASSWORT
        <span style="color: #007800;">bindmethod</span>=simple</pre></div></div>

<p>Für jeden Slave Server muss eine replica host Direktive vorhanden sein. </p>
<p>Die Slave Server lassen sich sogar noch einfach konfigurieren&#8230;</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">updatedn        <span style="color: #ff0000;">&quot;DN-MANAGER&quot;</span>
updateref     ldap:<span style="color: #000000; font-weight: bold;">//</span>HOSTNAME-MASTER:<span style="color: #000000;">389</span></pre></div></div>

<p>Durch updateref leitet der Slave alle Update- bzw. Schreib-Request zum Master weiter.</p>
<p>So simpel kann eine Replikation eingerichtet werden <img src='http://www.treibsand.com/wp-includes/images/smilies/icon_wink.gif' alt=';-)' class='wp-smiley' />  </p>
]]></content:encoded>
			<wfw:commentRss>http://www.treibsand.com/2007/03/19/openldap_replikation/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>ProFTP mit SQLite Backend</title>
		<link>http://www.treibsand.com/2006/08/03/proftp-mit-sqlite-backend/</link>
		<comments>http://www.treibsand.com/2006/08/03/proftp-mit-sqlite-backend/#comments</comments>
		<pubDate>Thu, 03 Aug 2006 21:28:38 +0000</pubDate>
		<dc:creator>Toast</dc:creator>
				<category><![CDATA[Unix]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[ProFTP]]></category>
		<category><![CDATA[SQLite]]></category>

		<guid isPermaLink="false">http://test.treibsand.com/2009/01/15/proftp-mit-sqlite-backend/</guid>
		<description><![CDATA[Was tun, wenn man einige User für einen FTP Server hat, allerdings keine Systembenutzer einrichten möchte? Der freie FTP Server ProFTP unterstützt zwar MySQL Und PostgreSQL Backends, aber die sind gar nicht nötig, wenn es nur um eine Handvoll von Benutzern geht. Da ProFTP selber über eine Modul Schnittstelle verfügt ist es kein Problem diese [...]]]></description>
			<content:encoded><![CDATA[<p>Was tun, wenn man einige User für einen FTP Server hat, allerdings keine Systembenutzer einrichten möchte? Der freie FTP Server ProFTP unterstützt zwar MySQL Und PostgreSQL Backends, aber die sind gar nicht nötig, wenn es nur um eine Handvoll von Benutzern geht.</p>
<p><span id="more-9"></span><br />
Da ProFTP selber über eine Modul Schnittstelle verfügt ist es kein Problem diese Funktionalität einzubauen. Unter http://www.castaglia.org/proftpd/modules/mod_sql_sqlite.html gibt es genau für diesen Fall ein passendes Modul <img src='http://www.treibsand.com/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> </p>
<p>Sobald das Modul mit einkompiliert ist, kann das Backend in der proftpd.conf wie folgt angesprochen werden:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&lt;</span>IfModule mod_sql_sqlite.c<span style="color: #000000; font-weight: bold;">&gt;</span>
  SQLConnectInfo <span style="color: #000000; font-weight: bold;">/</span>pfad<span style="color: #000000; font-weight: bold;">/</span>zu<span style="color: #000000; font-weight: bold;">/</span>ftpd.db
<span style="color: #000000; font-weight: bold;">&lt;/</span>IfModule<span style="color: #000000; font-weight: bold;">&gt;</span></pre></div></div>

<p>Mehr ist für die Verbindung zur Datenbank nicht nötig. Da ProFTP selber schon eine Schnittstelle für SQL hat, kann die Abfrage der Benutzer mit mod_sql gemacht werden. Eine Anleitung hierfür ist unter http://www.castaglia.org/proftpd/modules/mod_sql.html zu finden.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.treibsand.com/2006/08/03/proftp-mit-sqlite-backend/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Mehrere Monitore mit Synergy</title>
		<link>http://www.treibsand.com/2006/04/02/mehrere-monitore-mit-synergy/</link>
		<comments>http://www.treibsand.com/2006/04/02/mehrere-monitore-mit-synergy/#comments</comments>
		<pubDate>Sun, 02 Apr 2006 20:13:39 +0000</pubDate>
		<dc:creator>Toast</dc:creator>
				<category><![CDATA[Einfach cool]]></category>
		<category><![CDATA[KVM]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[OS X]]></category>
		<category><![CDATA[Synergy]]></category>
		<category><![CDATA[Unix]]></category>

		<guid isPermaLink="false">http://test.treibsand.com/?p=3</guid>
		<description><![CDATA[Wie kann man mehrere Rechner gleichzeitig betreiben, ohne mehrere Tastaturen und Mäuse? Teure KVM Hardware Lösungen habe auch ihre Grenzen, ausserdem muss man meistens irgendeinen Schalter auf der Box betätigen, um die Systeme umzuschalten. Und was ist, wenn man alle Systeme gleichzeitig sehen will?  Als ich mir vor einiger Zeit meinen ersten Mac kaufte, stand [...]]]></description>
			<content:encoded><![CDATA[<p>Wie kann man mehrere Rechner gleichzeitig betreiben, ohne mehrere Tastaturen und Mäuse? Teure KVM Hardware Lösungen habe auch ihre Grenzen, ausserdem muss man meistens irgendeinen Schalter auf der Box betätigen, um die Systeme umzuschalten. Und was ist, wenn man alle Systeme gleichzeitig sehen will? </p>
<p><span id="more-3"></span><br />
Als ich mir vor einiger Zeit meinen ersten Mac kaufte, stand ich vor einem kleinem Problem. Ich hatte bisher 2 Rechner und 2 TFTs. Ein Rechner war eine Unix Maschine, welche beide TFTs fuer Dual-Head benutzte. Der Zweite war Windows zum spielen. Beide Rechner haben sich den 1. TFT, Maus und Tastatur über einen KVM Switch geteilt. Nur der 2. TFT wir direkt in den Unix Rechner angeschlossen. Da der Mac mini keinen 2. Video Ausgang hatte, musste ich natürlich mein Dual-Head aufgeben. Der KVM Switch kam aber auch nicht mehr in Frage, da ich ja dann einen Monitor übrig hätte. Also begab ich mich auf die Suche <img src='http://www.treibsand.com/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' />  </p>
<p>Schliesslich entdeckte ich das Programm <a href="http://synergy2.sourceforge.net/" target="_blank">Synergy</a>. Hierbei handelt es sich um eine Software KVM Lösung. Der Trick bei der Sache ist, dass es komplett übers Netzwerk funktioniert. Vorraussetzung ist, dass jeder Rechner einen eigenen Monitor hat. Ein Rechner dient als Server, zu welchem sich alle Clients verbinden und das Signal für Maus und Tastatur bekommen. Es ist absolut belanglos wieviel Rechner sich an den Server anmelden. Bei mir ist Synergy so konfiguriert, dass der linke TFT Mac OSX ist und der Rechte Windows. Ein Umschalten, wie bei herkömmlichen KVM Lösungen gibt es hier nicht. Wenn ich auf den Windows Rechner will, ziehe ich einfach die Maus im OSX ganz nach rechts, der Zeiger springt automatisch auf den Windows Desktop (!). Es ist, als ob Windows und OSX miteinander verschmälzen und ein System werden <img src='http://www.treibsand.com/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' />  </p>
<p>Das ganze ist natürlich nicht nur auf Windows bzw. Mac OSX beschrängt. Synergy unterstützt ausserdem noch alle gängigen Unix und Linux Systeme. Was noch recht interessant ist, ist die Tatsache, dass man zwischen den Systemen sogar Cut-N-Paste machen kann. </p>
<p>Hier nun meine Konfiguration als Beispiel:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">section: screens
        mac:
        windows:
end
&nbsp;
section: links
        mac:
                right = windows
        windows:
                left = mac
end
&nbsp;
section: options
        keystroke<span style="color: #7a0874; font-weight: bold;">&#40;</span>control+left<span style="color: #7a0874; font-weight: bold;">&#41;</span> = switchInDirection<span style="color: #7a0874; font-weight: bold;">&#40;</span>left<span style="color: #7a0874; font-weight: bold;">&#41;</span>
        keystroke<span style="color: #7a0874; font-weight: bold;">&#40;</span>control+right<span style="color: #7a0874; font-weight: bold;">&#41;</span> = switchInDirection<span style="color: #7a0874; font-weight: bold;">&#40;</span>right<span style="color: #7a0874; font-weight: bold;">&#41;</span>
        keystroke<span style="color: #7a0874; font-weight: bold;">&#40;</span>control+f12,toggle<span style="color: #7a0874; font-weight: bold;">&#41;</span> = lockCursorToScreen
        relativeMouseMoves = <span style="color: #c20cb9; font-weight: bold;">true</span>
end</pre></div></div>

<p>Dies definiert 2 Computer, links der Mac mini, und rechts der Windows Rechner. Es gibt zusätzlich noch ein paar Shortcuts, CTRL-left, um per Tastatur auf den linken Rechner zu wechseln und CTRL-right für die andere Richtung. Ausserdem ist CTRL-F12 noch definiert, dies sperrt den aktuellen Bildschirm, damit die Maus nicht auf das andere System wechseln kann. Würde ich jedem empfehlen, der Spiele spielt <img src='http://www.treibsand.com/wp-includes/images/smilies/icon_wink.gif' alt=';-)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://www.treibsand.com/2006/04/02/mehrere-monitore-mit-synergy/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

