<?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>Kettil&#039;s Blog</title>
	<atom:link href="http://blog.kettil.de/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.kettil.de</link>
	<description></description>
	<lastBuildDate>Tue, 24 Apr 2012 20:00:07 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>JavaScript Funktion mit dynamischen Parameter weiterleiten</title>
		<link>http://blog.kettil.de/2012/04/javascript-funktion-mit-dynamischen-parameter-weiterleiten/</link>
		<comments>http://blog.kettil.de/2012/04/javascript-funktion-mit-dynamischen-parameter-weiterleiten/#comments</comments>
		<pubDate>Tue, 17 Apr 2012 11:57:13 +0000</pubDate>
		<dc:creator>Kettil</dc:creator>
				<category><![CDATA[HTML]]></category>
		<category><![CDATA[Composite]]></category>
		<category><![CDATA[Event]]></category>
		<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[Pattern]]></category>

		<guid isPermaLink="false">http://blog.kettil.de/?p=289</guid>
		<description><![CDATA[Ich habe letzten eine Möglichkeit gesucht, für ein Event-System, Funktionen mit dynamischen Parametern weiterzuleiten. Meine vorherige Lösungen war, dass die Funktion mit einem Array aufgerufen wird, der die Parameter zusammenfasst. Mich hat es aber immer gestört, dass es auf die ersten Blick &#8230; <a href="http://blog.kettil.de/2012/04/javascript-funktion-mit-dynamischen-parameter-weiterleiten/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p style="text-align: justify;">Ich habe letzten eine Möglichkeit gesucht, für ein Event-System, Funktionen mit dynamischen Parametern weiterzuleiten. Meine vorherige Lösungen war, dass die Funktion mit einem Array aufgerufen wird, der die Parameter zusammenfasst. Mich hat es aber immer gestört, dass es auf die ersten Blick nicht möglich ist, zu sehen, welche Parameter die Funktion braucht/benutzt.</p>
<p>Das Beispiel ist vereinfacht und gekürzt:</p>
<pre class="brush: jscript; title: ; notranslate">
var event = function() {
	var events = {};

	// Nimmt ein Event entgegen
	this.add = function(name, eventFunction) {
    	events[name] = eventFunction;
	};

	// Führt alle Events aus
	this.action = function(data) {
		for (var x in events) {
			events[x](data);
		}
	};
};

// Initialisiert das erste Event-System
var event1 = new event();
// Initialisiert das zweite Event-System
var event2 = new event();

// Fügt die Events hinzu
event1.add('event1', function(data) {
	alert('Hallo '+data['name']+', du bist '+data['year']+' Jahre alt');
};
event2.add('event2', function(data) {
	alert('Arbeiter: '+data['name']+'; Status: '+data['status']);
};

// Führt alle Events mit den Parametern aus
event1.action({'name' : 'Hans', 'year'   : 45});
event2.action({'name' : 'Hans', 'status' : 'Mitarbeiter'});
</pre>
<p style="text-align: justify;">Wenn man mehrere verschiedene Event-Systeme hat, wird es schell unübersichtlich, welche Funktion welche Parameter im Array braucht. Gerade auch wenn man den Code vom Event-System nicht doppelt oder mehrfach haben möchte.</p>
<p style="text-align: justify;">Die Lösung ist die JavaScript Funktion &#8220;<em>.apply()</em>&#8220;, diese ist mit der PHP-Funktion &#8220;<em><a title="PHP-Funktion: call_user_func_array()" href="http://www.php.net/manual/de/function.call-user-func-array.php">call_user_func_array()</a></em>&#8221; vergleichbar. Die <em>.apply()</em>-Funktion ruft eine Funktion auf und übergibt ein Array als Parameter-Liste. Die Parameter einer Funktion kann man in JavaScript mit der Variable &#8220;<em>arguments</em>&#8221; auslesen. Diese Variable wird automatisch von jeder Funktion definiert und beinhaltet ein Array mit den Parametern. Der Index des Arrays ist die Postion des Parameters beim Aufruf.</p>
<p>Mit diesem Wissen, können wir das oben genannte Beispiel verbessern:</p>
<pre class="brush: jscript; title: ; notranslate">

var event = function() {
	var events = {};

	// Nimmt ein Event entgegen
	this.add = function(name, eventFunction) {
    	events[name] = eventFunction;
	};

	// Führt alle Events aus
	this.action = function() {
		for (var x in events) {
			events[x].apply(null, arguments);
		}
	};
};

// Initialisiert das erste Event-System
var event1 = new event();
// Initialisiert das zweite Event-System
var event2 = new event();

// Fügt die Events hinzu
event1.add('event1', function(name, year) {
	alert('Hallo '+name+', du bist '+year+' Jahre alt');
};
event2.add('event2', function(name, status) {
	alert('Arbeiter: '+name+'; Status: '+status);
};

// Führt alle Events mit den Parametern aus
event1.action('Hans', 45);
event2.action('Hans', 'Mitarbeiter');
</pre>
<p style="text-align: justify;">Mit dieser kleinen Änderung  ist der Code einfacherer zu lesen bzw. zu verstehen und man behält bei größeren Projekten besser die Übersicht.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.kettil.de/2012/04/javascript-funktion-mit-dynamischen-parameter-weiterleiten/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Telecomix: Der arabische Frühling&#8230;</title>
		<link>http://blog.kettil.de/2012/03/telecomix-der-arabische-fruhling/</link>
		<comments>http://blog.kettil.de/2012/03/telecomix-der-arabische-fruhling/#comments</comments>
		<pubDate>Tue, 20 Mar 2012 22:12:10 +0000</pubDate>
		<dc:creator>Kettil</dc:creator>
				<category><![CDATA[Politik]]></category>
		<category><![CDATA[Internet]]></category>
		<category><![CDATA[Medienmanipulation]]></category>
		<category><![CDATA[Medienrecht]]></category>
		<category><![CDATA[Überwachung]]></category>
		<category><![CDATA[Zensur]]></category>

		<guid isPermaLink="false">http://blog.kettil.de/?p=283</guid>
		<description><![CDATA[&#8220;Der arabische Frühling &#8230; und was bei uns angekommen ist&#8221; Anschau-Befehl (via)]]></description>
			<content:encoded><![CDATA[<p>&#8220;Der arabische Frühling &#8230; und was bei uns angekommen ist&#8221;</p>
<p><iframe src="http://www.youtube.com/embed/rM1L-vDn0_A?rel=0" frameborder="0" width="640" height="360"></iframe></p>
<p>Anschau-Befehl <img src='http://blog.kettil.de/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>(<a title="www.kanzleikompa.de" href="http://www.kanzleikompa.de/2012/03/12/telecomix/">via</a>)</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.kettil.de/2012/03/telecomix-der-arabische-fruhling/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>nginx, MySQL und PHP-FPM auf Mac OS X Lion installieren</title>
		<link>http://blog.kettil.de/2012/03/nginx-mysql-und-php-fpm-auf-os-x-lion-installieren/</link>
		<comments>http://blog.kettil.de/2012/03/nginx-mysql-und-php-fpm-auf-os-x-lion-installieren/#comments</comments>
		<pubDate>Sun, 11 Mar 2012 20:18:06 +0000</pubDate>
		<dc:creator>Kettil</dc:creator>
				<category><![CDATA[Mac]]></category>
		<category><![CDATA[HowTo]]></category>
		<category><![CDATA[Lion]]></category>
		<category><![CDATA[MySQL]]></category>
		<category><![CDATA[nginx]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[PHP-FPM]]></category>

		<guid isPermaLink="false">http://blog.kettil.de/?p=252</guid>
		<description><![CDATA[In dieser kleinen Anleitung möchte ich euch zeigen, wie ihr schnell und einfach auf dem Mac OS X Lion den Webserver nginx, den Datenbankserver MySQL, den PHP-Manager PHP-FPM und zusätzlich zum Abschluss noch phpmyadmin installieren könnt. Information Die Versionsnummer der &#8230; <a href="http://blog.kettil.de/2012/03/nginx-mysql-und-php-fpm-auf-os-x-lion-installieren/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p style="text-align: justify;">In dieser kleinen Anleitung möchte ich euch zeigen, wie ihr schnell und einfach auf dem Mac OS X Lion den Webserver <a title="nginx" href="http://wiki.nginx.org/">nginx</a>, den Datenbankserver <a title="MySQL" href="http://dev.mysql.com/">MySQL</a>, den PHP-Manager <a title="PHP-FPM" href="http://php-fpm.org/">PHP-FPM</a> und zusätzlich zum Abschluss noch <a title="phpmyadmin" href="http://www.phpmyadmin.net/">phpmyadmin</a> installieren könnt.</p>
<h1 style="text-align: justify;">Information</h1>
<blockquote>
<p style="text-align: justify;">Die Versionsnummer der einzelnen Programm haben sich bestimmt geändert und muss entsprechend geändert werden!</p>
<p style="text-align: justify;">Die Benutzung der Anleitung geschieht auf eigende Gefahr !!!</p>
</blockquote>
<h1>Vorbereitung</h1>
<p>Bevor wir los legen, müssen wir noch einige Tools installieren:</p>
<h2>Installation von Xcode</h2>
<p style="text-align: justify;">Im AppStore müssen wir uns <a title="Xcode" href="http://itunes.apple.com/de/app/xcode/id497799835?mt=12">Xcode</a> herunterladen und installieren. Dafür braucht ihr eine Apple ID! Nach dem Xcode installiert ist, müssen wir unter den Einstellungen ( Xcode -&gt; Preferences&#8230; ) im Reiter Downloads die &#8220;Command Line Tools&#8221; installieren.</p>
<p><a href="http://blog.kettil.de/wp-content/uploads/xcode_command_line_tools.jpg"><img class="aligncenter size-medium wp-image-253" title="Installation von Xcode Command Line Tools" src="http://blog.kettil.de/wp-content/uploads/xcode_command_line_tools-300x222.jpg" alt="" width="300" height="222" /></a></p>
<p>Ab jetzt bewegen wir uns nur noch im Terminal&#8230;</p>
<h2>Installation von Homebrew</h2>
<p style="text-align: justify;">Nach der Installation von Xcode &#8220;Command Line Tools&#8221;, können wir den Paket-Manager <a title="Homebrew" href="http://mxcl.github.com/homebrew/">Homebrew</a> installieren. Die Installation ist easy, einfach den folgenden Befehl in der Terminal.app ausführen:</p>
<pre class="brush: bash; title: ; notranslate">

/usr/bin/ruby -e &quot;$(/usr/bin/curl -fsSL https://raw.github.com/mxcl/homebrew/master/Library/Contributions/install_homebrew.rb)&quot;
</pre>
<p><span id="more-252"></span></p>
<p style="text-align: justify;">Bei den folgenden Installationen werden noch andere Programme mit installiert, die die Dienste brauchen.</p>
<h1>Installation von nginx</h1>
<p style="text-align: justify;">Die Installation von nginx ist genauso einfach wie von Homebrew.</p>
<pre class="brush: bash; title: ; notranslate">

brew install nginx
</pre>
<p style="text-align: justify;">Das wichtigste an der Installations-Ausgabe ist der folgende Abschnitt:</p>
<blockquote><p>In the interest of allowing you to run `nginx` without `sudo`, the default<br />
port is set to localhost:8080.</p>
<p>If you want to host pages on your local machine to the public, you should<br />
change that to localhost:80, and run `sudo nginx`. You&#8217;ll need to turn off<br />
any other web servers running port 80, of course.</p>
<p>You can start nginx automatically on login running as your user with:<br />
mkdir -p ~/Library/LaunchAgents<br />
cp /usr/local/Cellar/nginx/1.0.13/homebrew.mxcl.nginx.plist ~/Library/LaunchAgents/<br />
launchctl load -w ~/Library/LaunchAgents/homebrew.mxcl.nginx.plist</p>
<p>Though note that if running as your user, the launch agent will fail if you<br />
try to use a port below 1024 (such as http&#8217;s default of 80.)</p></blockquote>
<p style="text-align: justify;">Dies sagt, dass der Webserver unter dem Port 8080 läuft und nicht unter 80 laufen kann, da nginx nicht als root ausgeführt wird. Es sollte für die Entwicklung von Webseiten kein Problem sein, wenn der Webserver unter dem Port 8080 läuft.</p>
<p style="text-align: justify;">Damit nginx beim jeden Start bzw. Login automatisch startet, müssen wir ihm beim <em>launchctl</em> registrieren (die <em>Versionsnummern</em> kann sich ändern!).</p>
<pre class="brush: bash; title: ; notranslate">
mkdir -p ~/Library/LaunchAgents
cp /usr/local/Cellar/nginx/1.0.13/homebrew.mxcl.nginx.plist ~/Library/LaunchAgents/
launchctl load -w ~/Library/LaunchAgents/homebrew.mxcl.nginx.plist
</pre>
<p style="text-align: justify;">Die Konfigurationen liegen unter <em>/usr/local/etc/nginx/</em>, wobei <em>nginx.conf</em> die Hauptkonfigurationsdatei ist. Unter <em>/usr/local/Cellar/nginx/1.0.13/html/</em> liegt das Default-root Verzeichnis vom Webserver.</p>
<p style="text-align: justify;">Nützliche Befehle:</p>
<pre class="brush: bash; title: ; notranslate">
# Prüft die Syntax der Konfigurationsdateien
nginx -t
# Lädt die Konfigurationsdateien neu, ohne Neustart des Servers
nginx -s reload
</pre>
<p><a title="Konfigurationsbeispiele" href="http://wiki.nginx.org/Configuration">Beispiele für die Konfiguration vom nginx-Webserver</a> findet ihr auf dem <a title="nginx-Wiki" href="http://wiki.nginx.org/">nginx-Wiki</a>.</p>
<h1>Installation von MySQL</h1>
<p>Die Installation für den Datenbank-Server läuft wie bekannt ab:</p>
<pre class="brush: bash; title: ; notranslate">
brew install mysql
</pre>
<p>Wichtigsten Information der Installation</p>
<blockquote><p>Set up databases to run AS YOUR USER ACCOUNT with:<br />
unset TMPDIR<br />
mysql_install_db &#8211;verbose &#8211;user=`whoami` &#8211;basedir=&#8221;$(brew &#8211;prefix mysql)&#8221; &#8211;datadir=/usr/local/var/mysql &#8211;tmpdir=/tmp</p>
<p>To set up base tables in another folder, or use a different user to run<br />
mysqld, view the help for mysqld_install_db:<br />
mysql_install_db &#8211;help</p>
<p>and view the MySQL documentation:<br />
* http://dev.mysql.com/doc/refman/5.5/en/mysql-install-db.html<br />
* http://dev.mysql.com/doc/refman/5.5/en/default-privileges.html</p>
<p>To run as, for instance, user &#8220;mysql&#8221;, you may need to `sudo`:<br />
sudo mysql_install_db &#8230;options&#8230;</p>
<p>Start mysqld manually with:<br />
mysql.server start</p>
<p>Note: if this fails, you probably forgot to run the first two steps up above</p>
<p>A &#8220;/etc/my.cnf&#8221; from another install may interfere with a Homebrew-built<br />
server starting up correctly.</p>
<p>To connect:<br />
mysql -uroot</p>
<p>To launch on startup:<br />
* if this is your first install:<br />
mkdir -p ~/Library/LaunchAgents<br />
cp /usr/local/Cellar/mysql/5.5.19/homebrew.mxcl.mysql.plist ~/Library/LaunchAgents/<br />
launchctl load -w ~/Library/LaunchAgents/homebrew.mxcl.mysql.plist</p>
<p>* if this is an upgrade and you already have the homebrew.mxcl.mysql.plist loaded:<br />
launchctl unload -w ~/Library/LaunchAgents/homebrew.mxcl.mysql.plist<br />
cp /usr/local/Cellar/mysql/5.5.19/homebrew.mxcl.mysql.plist ~/Library/LaunchAgents/<br />
launchctl load -w ~/Library/LaunchAgents/homebrew.mxcl.mysql.plist</p>
<p>You may also need to edit the plist to use the correct &#8220;UserName&#8221;.</p></blockquote>
<p>Noch einige Nachbearbeitungen, wie oben im Text beschrieben. Zusätzlich kopieren wir noch die MySQL-Config-Datei.</p>
<pre class="brush: bash; title: ; notranslate">
cp /usr/local/Cellar/mysql/5.5.19/support-files/my-small.cnf /usr/local/etc/my.cnf
unset TMPDIR
mysql_install_db --verbose --user=`whoami` --basedir=&quot;$(brew --prefix mysql)&quot; --datadir=/usr/local/var/mysql --tmpdir=/tmp
</pre>
<p style="text-align: justify;">Wenn ihr die Storage-Engine InnoDB benutzen wollt, müsst ihr in der <em>my.cnf</em> die Zeilen <em>innodb_*</em> auskommentieren.</p>
<p>Der Dienst muss wieder beim <em>launchctl</em> registriert werden&#8230;</p>
<pre class="brush: bash; title: ; notranslate">
mkdir -p ~/Library/LaunchAgents
cp /usr/local/Cellar/mysql/5.5.19/homebrew.mxcl.mysql.plist ~/Library/LaunchAgents/
launchctl load -w ~/Library/LaunchAgents/homebrew.mxcl.mysql.plist
</pre>
<p>Und zum Schluss sichern wir die MySQL noch ab</p>
<pre class="brush: bash; title: ; notranslate">
mysql_secure_installation
</pre>
<p>Die Fragen können bzw. sollten alle mit <em>Yes</em> beantwortet werden.</p>
<h1>Vorbereitung: Installation von mcrypt und memcache (optional)</h1>
<p style="text-align: justify;">Die Abschnitt ist optional, aber gerade mcrypt sollte installiert werden und für größere Projekte auch memcache.</p>
<pre class="brush: bash; title: ; notranslate">
# Extension: crypt
brew install mcrypt mcrypt-php
# Extension: memchache
brew install memcached memcache-php
</pre>
<p>Zusammenfassung der mcrypt-Installation:</p>
<blockquote><p>To finish mcrypt-php installation, you need to add the<br />
following line into php.ini:<br />
extension=&#8221;/usr/local/Cellar/mcrypt-php/5.3.6/mcrypt.so&#8221;<br />
Then, restart your webserver and check in phpinfo if<br />
you&#8217;re able to see something about mcrypt</p></blockquote>
<p>Zusammenfassung der memcache-Installation</p>
<blockquote><p>You can enable memcached to automatically load on login with:<br />
mkdir -p ~/Library/LaunchAgents<br />
cp /usr/local/Cellar/memcached/1.4.13/homebrew.mxcl.memcached.plist ~/Library/LaunchAgents/<br />
launchctl load -w ~/Library/LaunchAgents/homebrew.mxcl.memcached.plist</p>
<p>If this is an upgrade and you already have the homebrew.mxcl.memcached.plist loaded:<br />
launchctl unload -w ~/Library/LaunchAgents/homebrew.mxcl.memcached.plist<br />
cp /usr/local/Cellar/memcached/1.4.13/homebrew.mxcl.memcached.plist ~/Library/LaunchAgents/<br />
launchctl load -w ~/Library/LaunchAgents/homebrew.mxcl.memcached.plist</p>
<p>Or start it manually:<br />
/usr/local/bin/memcached</p>
<p>Add &#8220;-d&#8221; to start it as a daemon.</p>
<p>&#8212;&#8212;</p>
<p>To finish mcrypt-php installation, you need to add the<br />
following line into php.ini:<br />
extension=&#8221;/usr/local/Cellar/mcrypt-php/5.3.6/mcrypt.so&#8221;<br />
Then, restart your webserver and check in phpinfo if<br />
you&#8217;re able to see something about mcrypt</p></blockquote>
<p style="text-align: justify;">Der memcached-Dienst muss beim launchctl registriert werden (siehe obige Beschreibung):</p>
<pre class="brush: bash; title: ; notranslate">
mkdir -p ~/Library/LaunchAgents
cp /usr/local/Cellar/memcached/1.4.13/homebrew.mxcl.memcached.plist ~/Library/LaunchAgents/
launchctl load -w ~/Library/LaunchAgents/homebrew.mxcl.memcached.plist
</pre>
<h1>Installation von PHP-FPM</h1>
<p style="text-align: justify;">Die letzte Installation ist ein bisschen komplexer als die vorherigen, da PHP nicht im Standard-Formula von Homebrew liegt.</p>
<pre class="brush: bash; title: ; notranslate">
brew install https://raw.github.com/josegonzalez/homebrew-php/master/Formula/php.rb --with-mysql --with-fpm --with-suhosin --with-imap
</pre>
<p>Zusammenfassung der Installation</p>
<blockquote><p>For 10.5 and Apache:<br />
Apache needs to run in 32-bit mode. You can either force Apache to start<br />
in 32-bit mode or you can thin the Apache executable.</p>
<p>To enable PHP in Apache add the following to httpd.conf and restart Apache:<br />
LoadModule php5_module /usr/local/Cellar/php/5.3.10/libexec/apache2/libphp5.so</p>
<p>The php.ini file can be found in:<br />
/usr/local/etc/php.ini</p>
<p>Development and head builds will use libedit in place of readline.</p>
<p>If you have installed the formula with &#8211;with-fpm, to launch php-fpm on startup:<br />
* If this is your first install:<br />
mkdir -p ~/Library/LaunchAgents<br />
cp /usr/local/Cellar/php/5.3.10/org.php-fpm.plist ~/Library/LaunchAgents/<br />
launchctl load -w ~/Library/LaunchAgents/org.php-fpm.plist</p>
<p>* If this is an upgrade and you already have the org.php-fpm.plist loaded:<br />
launchctl unload -w ~/Library/LaunchAgents/org.php-fpm.plist<br />
cp /usr/local/Cellar/php/5.3.10/org.php-fpm.plist ~/Library/LaunchAgents/<br />
launchctl load -w ~/Library/LaunchAgents/org.php-fpm.plist</p>
<p>You may also need to edit the plist to use the correct &#8220;UserName&#8221;.</p></blockquote>
<p style="text-align: justify;">Der Apache-Abschnitt ist für uns uninteressant, da wir ja nginx benutzen wollen. Bevor wir den Dienst bei launchctl registrieren müssen wir die Konfigurationsdatei noch verlinken.</p>
<pre class="brush: bash; title: ; notranslate">
cd /usr/local/Cellar/php/5.3.10/etc/ &amp;&amp; ln -s ../../../../etc/php-fpm.conf .
mkdir -p /usr/local/Cellar/php/5.3.10/var/log/
mkdir -p ~/Library/LaunchAgents
cp /usr/local/Cellar/php/5.3.10/org.php-fpm.plist ~/Library/LaunchAgents/
launchctl load -w ~/Library/LaunchAgents/org.php-fpm.plist
</pre>
<p>Nützliche Befehle:</p>
<pre class="brush: bash; title: ; notranslate">
# Prüft die Konfigurationsdateien
php-fpm -t
# Stoppt den Dienst (er wird vom launchctl gleich wieder gestartet!)
launchctl stop org.php-fpm
</pre>
<p>Die Konfigurationsdateien <em>php.ini</em> und <em>php-fpm.conf</em> liegen unter <em>/usr/local/etc</em>.</p>
<p style="text-align: justify;">Es müssen nun in der php.ini (am ende) die folgenden Zeilen hinzugefügt werden (wenn die Erweiterungen benutzt werden sollen).</p>
<pre class="brush: bash; title: ; notranslate">
extension=&quot;/usr/local/Cellar/memcache-php/2.2.6/memcache.so&quot;
extension=&quot;/usr/local/Cellar/mcrypt-php/5.3.6/mcrypt.so&quot;
</pre>
<h1>Zusätzlich: Installation von phpmyadmin</h1>
<p>Die Installation läuft wie immer ab:</p>
<pre class="brush: bash; title: ; notranslate">
brew install phpmyadmin
</pre>
<p>Zusammenfassung der Installation</p>
<blockquote><p>Note that this formula will NOT install mysql. It is not<br />
required since you might want to get connected to a remote<br />
database server.</p>
<p>Webserver configuration example (add this at the end of<br />
your /etc/apache2/httpd.conf for instance) :<br />
Alias /phpmyadmin /usr/local/share/phpmyadmin<br />
&lt;Directory /usr/local/share/phpmyadmin/&gt;<br />
Options Indexes FollowSymLinks MultiViews<br />
AllowOverride All<br />
Order allow,deny<br />
Allow from all<br />
&lt;/Directory&gt;<br />
Then, open http://localhost/phpmyadmin</p>
<p>More documentation : file:///usr/local/Cellar/phpmyadmin/3.4.7/share/phpmyadmin/Documentation.html</p></blockquote>
<p style="text-align: justify;">Den Apache2-Abschnitt können wir wieder ignorieren. Die Konfigurationsdatei (wenn benötig) liegt unter <em>/usr/local/Cellar/phpmyadmin/3.4.7/share/phpmyadmin/</em>.</p>
<p style="text-align: justify;">Hier ein Auszug meiner nginx-Konfiguration für phpmyadmin als Beispiel</p>
<pre class="brush: plain; title: ; notranslate">
server {
    listen 8080;
    server_name phpmyadmin.example.org;
    root /usr/local/share/phpmyadmin;

    charset utf-8;

    # Zugriffsbeschränkung
    allow 127.0.0.1;
    deny all;

    index  index.php;

    try_files $uri $uri/ $uri.php;

    location ~ \.php$ {
        # Verbindung zum PHP-FPM Dienst
        fastcgi_pass   127.0.0.1:9000;
        # PHP-FPM Optionen
        fastcgi_index  index.php;
        fastcgi_param  SCRIPT_FILENAME  $document_root$fastcgi_script_name;
        include        fastcgi_params;
    }
}
</pre>
<p style="text-align: justify;">Alle Dienste sind jetzt installiert. Als letztes müssen wir noch nginx und PHP-FPM konfigurieren, damit sie miteinander reden, was aber an sich kein Problem darstellen sollte. Ich werden auf die Konfiguration nicht näher eingehen. Wenn der Wunsch besteht, würde ich ein extra Artikel darüber schreiben, wie man die nginx und PHP-FPM miteinander verheiratet. <img src='http://blog.kettil.de/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://blog.kettil.de/2012/03/nginx-mysql-und-php-fpm-auf-os-x-lion-installieren/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>CSS Weiche für Bildschirmauflösung</title>
		<link>http://blog.kettil.de/2012/03/css-weiche-fur-bildschirmauflosung/</link>
		<comments>http://blog.kettil.de/2012/03/css-weiche-fur-bildschirmauflosung/#comments</comments>
		<pubDate>Tue, 06 Mar 2012 21:50:21 +0000</pubDate>
		<dc:creator>Kettil</dc:creator>
				<category><![CDATA[HTML]]></category>
		<category><![CDATA[CSS]]></category>
		<category><![CDATA[CSS3]]></category>

		<guid isPermaLink="false">http://blog.kettil.de/?p=216</guid>
		<description><![CDATA[Durch CSS-Weichen kann entsprechend der Auflösung vom Browser/Bildschirm bestimmten CSS-Code benutzt werden oder auch nicht. Der Vorteil gegenüber JavaScript ist, das dies auch funktioniert, wenn JavaScript deaktiviert ist. Dieser Beitrag ist eher eine Dokumentation für mich. Beispiele für die Verwendung &#8230; <a href="http://blog.kettil.de/2012/03/css-weiche-fur-bildschirmauflosung/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Durch CSS-Weichen kann entsprechend der Auflösung vom Browser/Bildschirm bestimmten CSS-Code benutzt werden oder auch nicht. Der Vorteil gegenüber JavaScript ist, das dies auch funktioniert, wenn JavaScript deaktiviert ist. Dieser Beitrag ist eher eine Dokumentation für mich.</p>
<p>Beispiele für die Verwendung von CSS-Weichen.</p>
<pre class="brush: css; title: ; notranslate">@media all and (orientation:portrait) {
	/* Hier der allgemeine CSS-Code für Geräte im Portrait Modus */
}

@media all and (orientation:landscape) {
	/* Hier der allgemeine CSS-Code für Geräte im Landscape Modus */
}

@media only screen and (min-device-width: 320px) and (max-device-width: 480px) {
	/* Hier der CSS Code für Smartphones wie z.B. iPhone, Android, WebOS, Windows Phone 7 Geräte o.Ä. */
}

/* Computer und Tablet CSS */
@media only screen and (min-device-width: 800px) {
	/* Hier der CSS-Code für Tablets und Computer ab einer mindest Bildschirm Weite von 800 Pixeln */
}

@media only screen and (device-width: 768px) {
	/* Hier der CSS-Code speziell für das iPad */
}

@media only screen and (device-width: 768px) and (orientation:portrait) {
	/* Hier der CSS-Code speziell für das iPad im Portrait Modus */
}</pre>
]]></content:encoded>
			<wfw:commentRss>http://blog.kettil.de/2012/03/css-weiche-fur-bildschirmauflosung/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>GeekTool einrichten</title>
		<link>http://blog.kettil.de/2012/02/geektool-einrichten/</link>
		<comments>http://blog.kettil.de/2012/02/geektool-einrichten/#comments</comments>
		<pubDate>Tue, 28 Feb 2012 20:45:28 +0000</pubDate>
		<dc:creator>Kettil</dc:creator>
				<category><![CDATA[Mac]]></category>
		<category><![CDATA[Bash]]></category>
		<category><![CDATA[GeekTool]]></category>

		<guid isPermaLink="false">http://blog.kettil.de/?p=193</guid>
		<description><![CDATA[Ich benutzte schon lange GeekTool auf dem Desktop, um mich unter anderen über das System zu informieren. Da es im Internet nicht einfach ist GeekTool-Skripte zu finden, wollte ich meine veröffentlichen. Die aktuellen Version der Skripte liegen auf github &#8220;GeekTool-Script-Collection&#8221;. &#8230; <a href="http://blog.kettil.de/2012/02/geektool-einrichten/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p style="text-align: justify;">Ich benutzte schon lange GeekTool auf dem Desktop, um mich unter anderen über das System zu informieren. Da es im Internet nicht einfach ist GeekTool-Skripte zu finden, wollte ich meine veröffentlichen.</p>
<p style="text-align: justify;">Die aktuellen Version der Skripte liegen auf <a title="GeekTool-Script-Collection" href="https://github.com/kettil/GeekTool-Script-Collection">github &#8220;GeekTool-Script-Collection&#8221;</a>. Zusätzlich liegen dort noch die Skript für das aktuelle Wetter und die Daten vom aktuellen Lied aus iTunes.</p>
<h2>System</h2>
<p style="text-align: justify;"><a href="http://blog.kettil.de/wp-content/uploads/geektool_status.jpg"><img class="alignright size-full wp-image-199" title="geektool_status" src="http://blog.kettil.de/wp-content/uploads/geektool_status.jpg" alt="" width="270" height="67" /></a>Der folgende Code-Schnippsel zeigt allgemeine Informationen über das System an:</p>
<ul>
<li>Laufzeit</li>
<li>Anzahl der eingeloggten Benutzer</li>
<li>Verteilung des Arbeitsspeicher (RAM)</li>
<li>Load Average</li>
<li>Zustand des Akkus</li>
</ul>
<div><span id="more-193"></span></div>
<pre class="brush: bash; title: ; notranslate">
#!/bin/bash
#
# Gibt die Festplattenbelegung zurück
#
# Author: Kjell Dießel
# Website: http://www.kettil.de
# License: CC-BY-SA 3.0 ( http://creativecommons.org/licenses/by-sa/3.0/de/ )
# ---------
#
# display options (show: 1; hidden: 0)
show_user=1
show_uptime=1
show_ram=1
show_load=1
show_battery=1
#
# ### No Change ###
#
# Create Table
system_table=$(
    # user
    if [ &quot;${show_user}&quot; = 1 ]; then
        system_user=$(/usr/bin/w -h | /usr/bin/wc -l | /usr/bin/sed -e 's/ //g')
        /bin/echo &quot;|Users:|${system_user}&quot;
    fi
    # uptime
    if [ &quot;${show_uptime}&quot; = 1 ]; then
        system_uptime=$(/usr/bin/uptime | /usr/bin/sed -e 's/.*up //;s/,...user.*//;s/1 day/1 Tag/;s/days/Tage/;s/hrs/Stunden/;s/:/ Stunden /;s/1 Stunden/1 Stunde/;s/^1 min/1 Minute/;s/mins/Minuten/;s/secs/Sekunden/;s/.*/&amp;/;s/,//g;s/.*[0-9]$/&amp; Minuten/')
        /bin/echo &quot;|Uptime:|${system_uptime}&quot;
    fi
    # Ram
    if [ &quot;${show_ram}&quot; = 1 ]; then
        system_ram=$(/usr/bin/top -l 1 | /usr/bin/awk '/PhysMem/ {print &quot;Used: &quot; $8 &quot; / Free: &quot; $10}')
        /bin/echo &quot;|Memory:|${system_ram}&quot;
    fi
    # load averages
    if [ &quot;${show_load}&quot; = 1 ]; then
        system_load=$(/usr/bin/uptime | /usr/bin/sed -e 's/^.*load averages: //' -e 's/,/./g' | /usr/bin/awk '{print $1 &quot; / &quot; $2 &quot; / &quot; $3}')
        /bin/echo &quot;|Load:|${system_load}&quot;
    fi
    # battery
    if [ &quot;${show_battery}&quot; = 1 ]; then
        system_battery=$(/usr/sbin/ioreg -l | /usr/bin/grep -i 'capacity' | /usr/bin/tr '\n' ' | ' | /usr/bin/awk '{printf (&quot;%.2f%%&quot;, $10/$5 * 100)}')
        /bin/echo &quot;|Battery:|${system_battery}&quot;
    fi
)
# Output
/bin/echo &quot;${system_table}&quot; | /usr/bin/column -c 2 -s &quot;|&quot; -t
</pre>
<h2>CPU-Auslastung</h2>
<p style="text-align: justify;"><a href="http://blog.kettil.de/wp-content/uploads/geektool_auslastung.jpg"><img class="alignright size-full wp-image-195" title="geektool_auslastung" src="http://blog.kettil.de/wp-content/uploads/geektool_auslastung.jpg" alt="" width="349" height="168" /></a>Dieser Code-Schnippsel listet die 12 CPU-Hungrigsten Programm auf und deren Arbeitsspeicher-Benutzung. Mein System hat 4 CPUs und hat deshalb in der Summe 400% zu Verfügung, also pro CPU 100%.</p>
<pre class="brush: bash; title: ; notranslate">
#!/bin/bash
#
# Zeigt die 13 größten Resourcen-Verbraucher
#
# Author: Kjell Dießel
# Website: http://www.kettil.de
# License: CC-BY-SA 3.0 ( http://creativecommons.org/licenses/by-sa/3.0/de/ )
# ---------
#
# ### No Change ###
#
# shows the 13 highest resource consumers
/bin/echo &quot; CPU Memory Command&quot;
/bin/echo &quot;$(/bin/ps -arcx -o %cpu,rss,command | /usr/bin/awk '
    {
        if (FNR             printf(&quot; %5.1f%% &quot;, $1);
            printf(&quot; %6.1fMB &quot;, $2 / 1024);
            for (i = 3; i                 printf(&quot;%s &quot;, $i);
            }
            printf(&quot;\n&quot;);
        }
     }'
)&quot;
</pre>
<h2>Netzwerk</h2>
<p style="text-align: justify;"><a href="http://blog.kettil.de/wp-content/uploads/geektool_netzwerk1.jpg"><img class="alignright size-full wp-image-201" title="geektool_netzwerk" src="http://blog.kettil.de/wp-content/uploads/geektool_netzwerk1.jpg" alt="" width="305" height="99" /></a>Der Code-Schnipsel gibt die aktuelle IP-Adresse vom LAN- und WLAN-Interface und optional die externe IP-Adresse (dies setzt ein Server voraus, wo ein PHP-Skript aufgerufen wird). Oberes Beispiel im Bild.</p>
<pre class="brush: bash; title: ; notranslate">
#!/bin/bash
#
# Gibt die IP Addressen vom Mac zurück
#
# Author:  Kjell Dießel
# Website: http://www.kettil.de
# License: CC-BY-SA 3.0 ( http://creativecommons.org/licenses/by-sa/3.0/de/ )
# ---------
#
# command example:
# ./networkStatus &quot;http://www.example.com/ip.php&quot;
#
# Website, where only the external IP address will be given back
#
# Example of a PHP file: &lt;!--?php echo $_SERVER['REMOTE_ADDR'];&lt;br ?--&gt;# ---------
#
# list of Interface
network_interface=(&quot;en0&quot; &quot;en1&quot;)
#
# list of Name from Interface
network_name=(&quot;Ethernet&quot; &quot;Wireless&quot;)
#
# ### No Change ###
#
# Variable
network_extern=&quot;${1}&quot;
#
# Create Table
network_table=$(
    # local IP address from computer
    for (( i=0; i        /bin/echo -n &quot;|${network_name[i]}:&quot;
        ip=$(/sbin/ifconfig &quot;${network_interface[i]}&quot; | /usr/bin/grep &quot;inet &quot; | /usr/bin/grep -v 127.0.0.1 | /usr/bin/awk '{print $2}')
        if [ &quot;${ip}&quot; != &quot;&quot; ]; then
            /bin/echo -n &quot;|${ip}&quot;
        else
            /bin/echo -n &quot;|OFFLINE&quot;
        fi
        /bin/echo &quot;&quot;
    done
    # external IP address
    if [ &quot;${network_extern}&quot; != &quot;&quot; ]; then
        ip=$(/usr/bin/curl --silent &quot;${network_extern}&quot; | /usr/bin/grep -E &quot;[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}&quot;)
        /bin/echo -n &quot;|External:&quot;
        if [ &quot;${ip}&quot; != &quot;&quot; ]; then
            /bin/echo -n &quot;|${ip}&quot;
        else
            /bin/echo -n &quot;|OFFLINE&quot;
        fi
    fi
)
# Output
/bin/echo &quot;${network_table}&quot; | /usr/bin/column -c 2 -s &quot;|&quot; -t
</pre>
<p>Das folgende Skript gibt den Traffic über das entsprechende Interface zurück. Im obigen Beispiel-Bild sind es die beiden unteren Text-Ausgaben.</p>
<pre class="brush: bash; title: ; notranslate">
#!/bin/bash
#
# Gibt den aktuellen Traffic vom entsprechenden Network-Interface
#
# Author:  Kjell Dießel
# Website: http://www.kettil.de
# License: CC-BY-SA 3.0 ( http://creativecommons.org/licenses/by-sa/3.0/de/ )
# ---------
#
# command example:
# ./networkTraffic &quot;en0&quot; &quot;Ethernet&quot;
# ./networkTraffic &quot;en1&quot; &quot;Wireless&quot;
# ---------
#
# ### No Change ###
#
# Variable
network_interface=&quot;${1}&quot;
network_name=&quot;${2}&quot;

# whether the interface is passed
if [ &quot;${network_interface}&quot; = &quot;&quot; ]; then
    /bin/echo &quot;missing or wrong Parameter&quot;
    exit -1
fi

# get the current number of bytes input
function getBytesInput()
{
    /bin/echo &quot;$(/usr/sbin/netstat -ib | /usr/bin/grep -e &quot;${1}&quot; -m 1 | /usr/bin/awk '{print $7}')&quot;
}

# get the current number of bytes output
function getBytesOutput()
{
    /bin/echo &quot;$(/usr/sbin/netstat -ib | /usr/bin/grep -e &quot;${1}&quot; -m 1 | /usr/bin/awk '{print $10}')&quot;
}

# convert bytes to kilobytes or kilobytes in megabytes
function convertBytes()
{
    /bin/echo $(/bin/echo &quot;scale=2; ${1}/1024;&quot; | /usr/bin/bc | /usr/bin/sed -e 's/^\./0./' -e 's/^\([^\.]*\)$/\1.00/' -e 's/\(.*\)\.\([0-9]\)$/\1.\20/')
}

# get the current number of bytes in and bytes out
network_input=$(getBytesInput &quot;${network_interface}&quot;)
network_output=$(getBytesOutput &quot;${network_interface}&quot;)
#wait one second
/bin/sleep 1
# get the number of bytes in and out one second later and find
# the difference between bytes in and out during that one second
network_input=$(/bin/expr $(getBytesInput &quot;${network_interface}&quot;) - ${network_input})
network_output=$(/bin/expr $(getBytesOutput &quot;${network_interface}&quot;) - ${network_output})

# convert bytes to kilobytes
network_input=$(convertBytes &quot;${network_input}&quot;)
network_output=$(convertBytes &quot;${network_output}&quot;)

# unit of input: megabytes or kilobytes
if [ ${#network_input} -gt 6 ]; then
    network_input=$(convertBytes &quot;${network_input}&quot;)
    unit_input=&quot;M&quot;
else
    unit_input=&quot;K&quot;
fi
# unit of output: megabytes or kilobytes
if [ ${#network_output} -gt 6 ]; then
    network_output=$(convertBytes &quot;${network_output}&quot;)
    unit_output=&quot;M&quot;
else
    unit_output=&quot;K&quot;
fi

# cosmetic
network_input=$(/bin/echo &quot;${network_input}&quot;   | /usr/bin/sed -e 's/^\([0-9]\.[0-9]*\)$/  \1/' -e 's/^\([0-9][0-9]\.[0-9]*\)$/ \1/')
network_output=$(/bin/echo &quot;${network_output}&quot; | /usr/bin/sed -e 's/^\([0-9]\.[0-9]*\)$/  \1/' -e 's/^\([0-9][0-9]\.[0-9]*\)$/ \1/')

# print the results
if [ &quot;${network_name}&quot; != &quot;&quot; ]; then
    /bin/echo &quot;${network_name}&quot;
fi
/bin/echo &quot;IN:  ${network_input} ${unit_input}Bytes/s&quot;
/bin/echo &quot;OUT: ${network_output} ${unit_output}Bytes/s&quot;
</pre>
<h2>Festplatte</h2>
<p><a href="http://blog.kettil.de/wp-content/uploads/geektool_hdd.jpg"><img class="alignright size-full wp-image-196" title="geektool_hdd" src="http://blog.kettil.de/wp-content/uploads/geektool_hdd.jpg" alt="" width="222" height="100" /></a>Das Skript zeigt die Festplatten-Kapazitäten an.</p>
<pre class="brush: bash; title: ; notranslate">
#!/bin/bash
#
# Gibt die Festplattenbelegung zurück
#
# Author:  Kjell Dießel
# Website: http://www.kettil.de
# License: CC-BY-SA 3.0 ( http://creativecommons.org/licenses/by-sa/3.0/de/ )
# ---------
#
# display options (show: 1; hidden: 0)
show_size=0
show_used=0
show_free=1
show_capa=1
#
# ### No Change ###
#
# Pad a string to a certain length with another string
function str_pad()
{
    pad_key=&quot;${1}&quot;
    pad_value=&quot;${2}&quot;
    i=$(/bin/expr $(/bin/echo &quot;${pad_key}&quot; | /usr/bin/wc -c) - $(/bin/echo &quot;${pad_value}&quot; | /usr/bin/wc -c))
    while [ ${i} -gt 0 ]; do
        pad_value=&quot;_${pad_value}&quot;
        i=$(/bin/expr ${i} - 1)
    done
    /bin/echo &quot;${pad_value}&quot;
}
#
# Create Table
hdd_table=$(
    # table legende
    /bin/echo -n &quot;|Volume&quot;
    if [ &quot;${show_size}&quot; = 1 ]; then
        /bin/echo -n &quot;|Size&quot;
    else
        show_size=0
    fi
    if [ &quot;${show_used}&quot; = 1 ]; then
        /bin/echo -n &quot;|Used&quot;
    else
        show_used=0
    fi
    if [ &quot;${show_free}&quot; = 1 ]; then
        /bin/echo -n &quot;|Free&quot;
    else
        show_free=0
    fi
    if [ &quot;${show_capa}&quot; = 1 ]; then
        /bin/echo -n &quot;|Capacity&quot;
    else
        show_capa=0
    fi
    /bin/echo &quot;&quot;
    #
    # HDD
    /bin/ls /Volumes/ | /usr/bin/grep -v &quot;WD SmartWare&quot; | /usr/bin/grep -v &quot;MobileBackups&quot; | while read HDD; do
        status=$(/bin/df -H /Volumes/&quot;${HDD}&quot;)
        # Name
        /bin/echo -n &quot;|${HDD}&quot;
        # Size
        if [ &quot;${show_size}&quot; = 1 ]; then
            /bin/echo -n &quot;|$(str_pad &quot;Size&quot; $(/bin/echo ${status} | /usr/bin/awk '{print $9}'))&quot;
        fi
        # Used
        if [ &quot;${show_used}&quot; = 1 ]; then
        /bin/echo -n &quot;|$(str_pad &quot;Used&quot; $(/bin/echo ${status} | /usr/bin/awk '{print $10}'))&quot;
        fi
        # Avail
        if [ &quot;${show_free}&quot; = 1 ]; then
        /bin/echo -n &quot;|$(str_pad &quot;Free&quot; $(/bin/echo ${status} | /usr/bin/awk '{print $11}'))&quot;
        fi
        # Capacity
        if [ &quot;${show_capa}&quot; = 1 ]; then
        /bin/echo -n &quot;|$(str_pad &quot;Capacity&quot; $(/bin/echo ${status} | /usr/bin/awk '{print $12}'))&quot;
        fi
        /bin/echo &quot;&quot;
    done
)
# clear table
hdd_table=$(/bin/echo &quot;${hdd_table}&quot; | /usr/bin/sed 's/BOOTCAMP/Windows 7/g' | /usr/bin/sed 's/_/ /g' | /usr/bin/sed 's/ |/|/g')
# count column
hdd_column=$(/bin/expr 1 + ${show_size} + ${show_free} + ${show_free} + ${show_capa})
# Output
/bin/echo &quot;${hdd_table}&quot; | /usr/bin/column -c ${hdd_column} -s &quot;|&quot; -t
</pre>
<h2>Kalender</h2>
<p style="text-align: justify;"><a href="http://blog.kettil.de/wp-content/uploads/geektool_kalender.jpg"><img class="aligncenter size-full wp-image-197" title="geektool_kalender" src="http://blog.kettil.de/wp-content/uploads/geektool_kalender.jpg" alt="" width="877" height="42" /></a>Der erste Code-Schnippsel zeigt die Tage des aktuellen Monat (ohne den aktuellen Tag) waagerecht an und der zweite Code-Schnippsel ergänzt die Anzeige um den aktuellen Tag.</p>
<pre class="brush: bash; title: ; notranslate">
#!/bin/bash
#
# Gibt für den horizontalen Kalender die Tage des aktuellen
# Monat ohne den aktuellen Tag zurück
#
# Author:  Kjell Dießel
# Website: http://www.kettil.de
# License: CC-BY-SA 3.0 ( http://creativecommons.org/licenses/by-sa/3.0/de/ )
# ---------
#
# ### No Change ###
#
# Read Data
today=$(/bin/date +%e)
month=$(/bin/date +%m)
year=$(/bin/date +%Y)
#
# transformation: &quot;02&quot; =&gt; &quot;2&quot;
if [ &quot;${today}&quot; -lt 10 ]; then
    today=${today:1:1}
fi
#
# Days of month
if [ &quot;${month}&quot; = &quot;02&quot; ]; then
    if [ $(/bin/expr ${year} % 400) = 0 ] || ( [ $(/bin/expr ${year} % 4) = 0 ] &amp;&amp; [ $(/bin/expr ${year} % 100) != 0 ] ); then
        monthDays=29
    else
        monthDays=28
    fi
elif [[ &quot;${month}&quot; == &quot;04&quot; || &quot;${month}&quot; == &quot;06&quot; || &quot;${month}&quot; == &quot;09&quot; || &quot;${month}&quot; == &quot;11&quot; ]]; then
    monthDays=30
else
    monthDays=31
fi
#
# Weekday
for (( i=1; i    if [ &quot;${i}&quot; -eq &quot;${today}&quot; ]; then
        /bin/echo -n &quot;    &quot;
    else
        if [ &quot;${i}&quot; -lt 10 ]; then
            dateString=&quot;${month}0${i}0001${year}&quot;
        else
            dateString=&quot;${month}${i}0001${year}&quot;
        fi
        /bin/echo -n &quot;$(/bin/date -j ${dateString} +%a)  &quot;
    fi
done
/bin/echo &quot;&quot;
#
# Day
for (( i=1; iFür den aktuellen Tag:
1 #!/bin/bash # # Gibt für den horizontalen Kalender den aktuellen Tag zurück # # Author:  Kjell Dießel # Website: http://www.kettil.de # License: CC-BY-SA 3.0 ( http://creativecommons.org/licenses/by-sa/3.0/de/ ) # --------- # # ### No Change ### # # Read Data today=$(/bin/date +%e) month=$(/bin/date +%m) year=$(/bin/date +%Y) # # transformation: &quot;02&quot; =&gt; &quot;2&quot;
if [ &quot;${today}&quot; -lt 10 ]; then
    today=${today:1:1}
fi
#
# Days of month
if [ &quot;${month}&quot; = &quot;02&quot; ]; then
    if [ $(/bin/expr ${year} % 400) = 0 ] || ( [ $(/bin/expr ${year} % 4) = 0 ] &amp;&amp; [ $(/bin/expr ${year} % 100) != 0 ] ); then
        monthDays=29
    else
        monthDays=28
    fi
elif [[ &quot;${month}&quot; == &quot;04&quot; || &quot;${month}&quot; == &quot;06&quot; || &quot;${month}&quot; == &quot;09&quot; || &quot;${month}&quot; == &quot;11&quot; ]]; then
    monthDays=30
else
    monthDays=31
fi
#
# Weekday
for (( i=1; i    if [ &quot;${i}&quot; -ne &quot;${today}&quot; ]; then
        /bin/echo -n &quot;    &quot;
    else
        if [ &quot;${i}&quot; -lt 10 ]; then
            dateString=&quot;${month}0${i}0001${year}&quot;
        else
            dateString=&quot;${month}${i}0001${year}&quot;
        fi
        /bin/echo -n &quot;$(/bin/date -j ${dateString} +%a)  &quot;
    fi
done
/bin/echo &quot;&quot;
#
# Day
for (( i=1; i    if [ &quot;${i}&quot; -ne &quot;${today}&quot; ]; then
        /bin/echo -n &quot;    &quot;
    else
        if [ &quot;${i}&quot; -lt 10 ]; then
            /bin/echo -n &quot;0&quot;
        fi
        /bin/echo -n &quot;${i}  &quot;
    fi
done
</pre>
<h2>Skript-Ideen</h2>
<p>Wenn du noch andere Skript-Ideen hast, kannst du sie mir ja als Kommentar mitteilen...</p>
<p>Eine Liste aller Skripte liegen auf <a title="GeekTool-Script-Collection" href="https://github.com/kettil/GeekTool-Script-Collection">github "GeekTool-Script-Collection"</a></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.kettil.de/2012/02/geektool-einrichten/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Linkpool [2]</title>
		<link>http://blog.kettil.de/2012/01/linkpool-2/</link>
		<comments>http://blog.kettil.de/2012/01/linkpool-2/#comments</comments>
		<pubDate>Tue, 31 Jan 2012 13:32:15 +0000</pubDate>
		<dc:creator>Kettil</dc:creator>
				<category><![CDATA[Linkpool]]></category>
		<category><![CDATA[Canvas]]></category>
		<category><![CDATA[HTML5]]></category>
		<category><![CDATA[Icons]]></category>
		<category><![CDATA[ReWrite]]></category>
		<category><![CDATA[Slides]]></category>

		<guid isPermaLink="false">http://blog.kettil.de/?p=210</guid>
		<description><![CDATA[Slides über mod_rewrite (Navigieren in den Slides mit Space, Pfeilentasten) http://www.handcode.de/talks/phpug-mod_rewrite-201201/ Vortrag per HTML5 erstellen http://code.google.com/p/html5slides/ Browser auf HTML5/CSS3 Fähigkeit prüfen http://html5please.us/ http://css3test.com/ Icons-Library http://thenounproject.com/ HTML5 Canvas reference http://canvas.quaese.de/ Bilder/PDF von Webseiten erstellen http://code.google.com/p/wkhtmltopdf/ http://www.phpgangsta.de/screenshots-von-webseiten-erstellen-mit-php &#8211; Kleine Anleitung]]></description>
			<content:encoded><![CDATA[<p>Slides über mod_rewrite (Navigieren in den Slides mit Space, Pfeilentasten)</p>
<ul>
<li><a title="mod_rewrite Slides" href="http://www.handcode.de/talks/phpug-mod_rewrite-201201/">http://www.handcode.de/talks/phpug-mod_rewrite-201201/</a></li>
</ul>
<p>Vortrag per HTML5 erstellen</p>
<ul>
<li><a title="Vortrag per HTML5 erstellen" href="http://code.google.com/p/html5slides/">http://code.google.com/p/html5slides/</a></li>
</ul>
<p>Browser auf HTML5/CSS3 Fähigkeit prüfen</p>
<ul>
<li><a title="Browser auf HTML5-Fähigkeit prüfen" href="http://html5please.us/">http://html5please.us/</a></li>
<li><a title="Browser auf CSS3-Fähigkeit prüfen" href="http://css3test.com/">http://css3test.com/</a></li>
</ul>
<p>Icons-Library</p>
<ul>
<li><a title="Icons-Library" href="http://thenounproject.com/">http://thenounproject.com/</a></li>
</ul>
<p>HTML5 Canvas reference</p>
<ul>
<li><a title="HTML5 Canvas reference" href="http://canvas.quaese.de/">http://canvas.quaese.de/</a></li>
</ul>
<p>Bilder/PDF von Webseiten erstellen</p>
<ul>
<li><a title="Bilder/PDF von Webseiten erstellen" href="http://code.google.com/p/wkhtmltopdf/">http://code.google.com/p/wkhtmltopdf/</a></li>
<li><a title="Kleine Anleitung" href="http://www.phpgangsta.de/screenshots-von-webseiten-erstellen-mit-php">http://www.phpgangsta.de/screenshots-von-webseiten-erstellen-mit-php</a> &#8211; Kleine Anleitung</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://blog.kettil.de/2012/01/linkpool-2/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Fröhliche Weihnachten</title>
		<link>http://blog.kettil.de/2011/12/weihnachten/</link>
		<comments>http://blog.kettil.de/2011/12/weihnachten/#comments</comments>
		<pubDate>Sat, 24 Dec 2011 17:16:04 +0000</pubDate>
		<dc:creator>Kettil</dc:creator>
				<category><![CDATA[Sonstiges]]></category>

		<guid isPermaLink="false">http://blog.kettil.de/?p=182</guid>
		<description><![CDATA[Ich wünsche allen Lesern ein schönes und besinnliches Weihnachtsfest und ein guten Rutsch ins neue Jahr 2012. Kjell]]></description>
			<content:encoded><![CDATA[<p>Ich wünsche allen Lesern ein schönes und besinnliches Weihnachtsfest und ein guten Rutsch ins neue Jahr 2012.</p>
<p>Kjell</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.kettil.de/2011/12/weihnachten/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Canon vs. Nikon</title>
		<link>http://blog.kettil.de/2011/12/canon-vs-nikon/</link>
		<comments>http://blog.kettil.de/2011/12/canon-vs-nikon/#comments</comments>
		<pubDate>Wed, 14 Dec 2011 08:19:49 +0000</pubDate>
		<dc:creator>Kettil</dc:creator>
				<category><![CDATA[Fotografie]]></category>
		<category><![CDATA[Canon]]></category>
		<category><![CDATA[Nikon]]></category>
		<category><![CDATA[Video]]></category>

		<guid isPermaLink="false">http://blog.kettil.de/?p=176</guid>
		<description><![CDATA[Canon vs. Nikon &#8211; Der ewige Kampf in einer Counter-Strike Umgebung. (via)]]></description>
			<content:encoded><![CDATA[<p>Canon vs. Nikon &#8211; Der ewige Kampf in einer Counter-Strike Umgebung.</p>
<p><iframe src="http://www.youtube.com/embed/qTVfFmENgPU?hd=1" frameborder="0" width="640" height="360"></iframe></p>
<p>(<a title="neunzehn72.de" href="http://neunzehn72.de/canon-vs-nikon/">via</a>)</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.kettil.de/2011/12/canon-vs-nikon/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Linkpool [1]</title>
		<link>http://blog.kettil.de/2011/12/linkpool-1/</link>
		<comments>http://blog.kettil.de/2011/12/linkpool-1/#comments</comments>
		<pubDate>Mon, 12 Dec 2011 20:32:06 +0000</pubDate>
		<dc:creator>Kettil</dc:creator>
				<category><![CDATA[Linkpool]]></category>
		<category><![CDATA[Canvas]]></category>
		<category><![CDATA[CSS]]></category>
		<category><![CDATA[CSS3]]></category>
		<category><![CDATA[HowTo]]></category>
		<category><![CDATA[HTML]]></category>
		<category><![CDATA[HTML5]]></category>
		<category><![CDATA[JavaScript]]></category>

		<guid isPermaLink="false">http://blog.kettil.de/?p=158</guid>
		<description><![CDATA[Einführung in Canvas http://www.ajaxschmiede.de/canvas/einfuehrung-in-canvas HTML5 Canvas.getContext(&#8220;2d&#8221;) reference http://www.w3schools.com/html5/html5_ref_canvas.asp HTML5 Canvas Tutorials http://www.html5canvastutorials.com HTML5 Canvas Particle Animation http://timothypoon.com/blog/2011/01/19/html5-canvas-particle-animation Liste mit Beispiele was mit Canvas möglich ist http://net.tutsplus.com/articles/web-roundups/21-ridiculously-impressive-html5-canvas-experiments http://webdesignledger.com/inspiration/10-html5-demos-to-make-you-forget-about-flash CSS3 Secrets http://lea.verou.me/css3-secrets]]></description>
			<content:encoded><![CDATA[<p style="text-align: justify;">Einführung in Canvas</p>
<ul>
<li><a title="Einführung in Canvas" href="http://www.ajaxschmiede.de/canvas/einfuehrung-in-canvas/">http://www.ajaxschmiede.de/canvas/einfuehrung-in-canvas</a></li>
</ul>
<p style="text-align: justify;">HTML5 Canvas.getContext(&#8220;2d&#8221;) reference</p>
<ul>
<li><a title="HTML5 canvas.getContext(" href="http://www.w3schools.com/html5/html5_ref_canvas.asp">http://www.w3schools.com/html5/html5_ref_canvas.asp</a></li>
</ul>
<p style="text-align: justify;">HTML5 Canvas Tutorials</p>
<ul>
<li><a title="1" href="http://www.html5canvastutorials.com">http://www.html5canvastutorials.com</a></li>
</ul>
<p style="text-align: justify;">HTML5 Canvas Particle Animation</p>
<ul>
<li><a title="1" href="http://timothypoon.com/blog/2011/01/19/html5-canvas-particle-animation">http://timothypoon.com/blog/2011/01/19/html5-canvas-particle-animation</a></li>
</ul>
<p style="text-align: justify;">Liste mit Beispiele was mit Canvas möglich ist</p>
<ul>
<li><a title="1" href="http://net.tutsplus.com/articles/web-roundups/21-ridiculously-impressive-html5-canvas-experiments">http://net.tutsplus.com/articles/web-roundups/21-ridiculously-impressive-html5-canvas-experiments</a></li>
<li><a title="1" href="http://webdesignledger.com/inspiration/10-html5-demos-to-make-you-forget-about-flash">http://webdesignledger.com/inspiration/10-html5-demos-to-make-you-forget-about-flash</a></li>
</ul>
<p style="text-align: justify;">CSS3 Secrets</p>
<ul>
<li><a title="1" href="http://lea.verou.me/css3-secrets">http://lea.verou.me/css3-secrets</a></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://blog.kettil.de/2011/12/linkpool-1/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>PHPStorm 3.0 veröffentlicht</title>
		<link>http://blog.kettil.de/2011/11/phpstorm-3-0-veroffentlicht/</link>
		<comments>http://blog.kettil.de/2011/11/phpstorm-3-0-veroffentlicht/#comments</comments>
		<pubDate>Wed, 30 Nov 2011 13:41:53 +0000</pubDate>
		<dc:creator>Kettil</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[IDE]]></category>
		<category><![CDATA[JetBrains]]></category>
		<category><![CDATA[PHPStorm]]></category>
		<category><![CDATA[release]]></category>

		<guid isPermaLink="false">http://blog.kettil.de/?p=153</guid>
		<description><![CDATA[Gestern kam die Version 3.0 von JetBrains PHPStorm heraus. PHPStorm ist meiner Meinung die beste IDE für PHP. Ich habe mit Eclipse und Netbeans entwickelt und war immer mit einigen Sachen unglücklich. Mit PHPStorm kann ich effektive mein Workflow ausnutzen. &#8230; <a href="http://blog.kettil.de/2011/11/phpstorm-3-0-veroffentlicht/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p style="text-align: justify;"><a href="http://blog.kettil.de/wp-content/uploads/PhpStorm-3.0.jpg"><img class="alignright size-medium wp-image-154" title="PhpStorm 3.0" src="http://blog.kettil.de/wp-content/uploads/PhpStorm-3.0-300x199.jpg" alt="" width="300" height="199" /></a>Gestern kam die Version 3.0 von <a title="JetBrains PHPStorm" href="http://www.jetbrains.com/phpstorm/">JetBrains PHPStorm</a> heraus. PHPStorm ist meiner Meinung die beste IDE für PHP. Ich habe mit Eclipse und Netbeans entwickelt und war immer mit einigen Sachen unglücklich. Mit PHPStorm kann ich effektive mein Workflow ausnutzen.</p>
<p><a title="PHPStorm 3.0" href="http://www.jetbrains.com/phpstorm/download/ ">Hier der Link zur Download Seite</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.kettil.de/2011/11/phpstorm-3-0-veroffentlicht/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

