<?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>Leben des wolf-u.li</title>
	<atom:link href="http://wolf-u.li/feed/" rel="self" type="application/rss+xml" />
	<link>http://wolf-u.li</link>
	<description>This and That.</description>
	<lastBuildDate>Wed, 10 Mar 2010 21:25:03 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<atom:link rel="hub" href="http://pubsubhubbub.appspot.com"/><atom:link rel="hub" href="http://superfeedr.com/hubbub"/>		<item>
		<title>H&#228;ufung von Fehler &#8220;Unerreichbar&#8221; in Google Webmaster Tools aufgrund von Global Translator und Parameter replytocom</title>
		<link>http://wolf-u.li/3365/haeufung-von-fehler-unerreichbar-in-google-webmaster-tools-aufgrund-von-global-translator-und-parameter-replytocom/</link>
		<comments>http://wolf-u.li/3365/haeufung-von-fehler-unerreichbar-in-google-webmaster-tools-aufgrund-von-global-translator-und-parameter-replytocom/#comments</comments>
		<pubDate>Wed, 10 Mar 2010 21:25:03 +0000</pubDate>
		<dc:creator>Uli</dc:creator>
				<category><![CDATA[IT]]></category>
		<category><![CDATA[Blog]]></category>
		<category><![CDATA[Google]]></category>
		<category><![CDATA[Plugin]]></category>
		<category><![CDATA[Wordpress]]></category>

		<guid isPermaLink="false">http://wolf-u.li/?p=3365</guid>
		<description><![CDATA[In den letzten Tagen haben sich bei mir in den Google Webmaster-Tools sehr viele &#8220;Unerreichbar&#8221;-Fehler aufgrund des dynamischen &#8220;replytocom&#8221;-Parameters angeh&#228;uft. Dieser wird bei, von Global Translator &#252;bersetzten, Seiten an verlinkungen der Kommentare angeh&#228;ngt, was Google wohl nicht so gut verpackt.
Die L&#246;sung ist sehr einfach: Man gehe in die betroffene Seite, klicke links auf &#8220;Website-Konfiguration&#8221; und [...]]]></description>
			<content:encoded><![CDATA[<p>In den letzten Tagen haben sich bei mir in den Google Webmaster-Tools sehr viele &#8220;Unerreichbar&#8221;-Fehler aufgrund des dynamischen &#8220;replytocom&#8221;-Parameters angeh&#228;uft. Dieser wird bei, von Global Translator &#252;bersetzten, Seiten an verlinkungen der Kommentare angeh&#228;ngt, was Google wohl nicht so gut verpackt.</p>
<p>Die L&#246;sung ist sehr einfach: Man gehe in die betroffene Seite, klicke links auf &#8220;Website-Konfiguration&#8221; und anschlie&#223;end &#8220;Einstellungen&#8221;. Dort tr&#228;gt man am Ende der Seite unter &#8220;Parameterbehandlung&#8221; den Parameter &#8220;replytocom&#8221; mit der Aktion &#8220;Ignorieren&#8221; ein.<br />
<span id="more-3365"></span><br />
Sieht dann so aus:<br />
<a rel="lightbox" href="http://wolf-u.li/upload/2010/03/3365-Google-Parameter-ignorieren.png"><img src="http://wolf-u.li/upload/2010/03/3365-Google-Parameter-ignorieren-500x91.png" alt="Parametereinstellungen in Google Webmaster Tools" title="Parametereinstellungen in Google Webmaster Tools" width="500" height="91" class="aligncenter size-medium wp-image-3366" /></a></p>
<hr /><small><center>&copy; 2005-2009 by <a href='http://wolf-u.li/'>Uli Wolf</a> &#8211; This Content is distributed under the <a href='http://wolf-u.li/pwnd-faq/'>Creative Commons License</a><br /> This feed is for personal, non-commercial use only. <br /> The use of this feed on other websites without attribution to the author and notification of the author breaches copyright. If this content is not in your news reader, it makes the page you are viewing an infringement of the copyright. (Digital Fingerprint:  d2a576b5311479d89eff39b7ca886f6b)</center></small>]]></content:encoded>
			<wfw:commentRss>http://wolf-u.li/3365/haeufung-von-fehler-unerreichbar-in-google-webmaster-tools-aufgrund-von-global-translator-und-parameter-replytocom/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Erkl&#228;rung der Einstellung &#8220;Row Cycle Time&#8221; (TRC) bei RAM-Timings in CPU-Z</title>
		<link>http://wolf-u.li/3361/erklaerung-der-einstellung-row-cycle-time-trc-bei-ram-timings-in-cpu-z/</link>
		<comments>http://wolf-u.li/3361/erklaerung-der-einstellung-row-cycle-time-trc-bei-ram-timings-in-cpu-z/#comments</comments>
		<pubDate>Mon, 08 Mar 2010 21:55:21 +0000</pubDate>
		<dc:creator>Uli</dc:creator>
				<category><![CDATA[Gadgets]]></category>
		<category><![CDATA[AMD]]></category>
		<category><![CDATA[Hardware]]></category>
		<category><![CDATA[RAM]]></category>
		<category><![CDATA[Tuning]]></category>

		<guid isPermaLink="false">http://wolf-u.li/?p=3361</guid>
		<description><![CDATA[Heute habe ich zuf&#228;llig einen Blick in CPU-Z geworfen und festgestellt, dass mein RAM nicht so ganz richtig angesteuert wurde. Verbaut sind in meinem Rechenknecht zwei Kits des &#8220;OCZ DDR2 PC2-8800 Platinum 4GB Edition&#8220;, welcher sich laut Hersteller mit maximal 1100Mhz bei CL 5-5-5-18 Timings befeuern l&#228;sst. Dabei unterst&#252;tzt er bis zu 2,2V, was ihn [...]]]></description>
			<content:encoded><![CDATA[<p><a rel="lightbox[TRC]" href="http://wolf-u.li/upload/2010/03/3361-OCZ-PC8800.jpg"><img src="http://wolf-u.li/upload/2010/03/3361-OCZ-PC8800-150x150.jpg" alt="3361-OCZ-PC8800" title="3361-OCZ-PC8800" width="150" height="150" class="alignright size-thumbnail wp-image-3362" /></a>Heute habe ich zuf&#228;llig einen Blick in CPU-Z geworfen und festgestellt, dass mein RAM nicht so ganz richtig angesteuert wurde. Verbaut sind in meinem Rechenknecht zwei Kits des &#8220;<a href="http://www.ocztechnology.com/products/memory/ocz_ddr2_pc2_8800_platinum_4gb_edition_dual_channel-eol">OCZ DDR2 PC2-8800 Platinum 4GB Edition</a>&#8220;, welcher sich laut Hersteller mit maximal 1100Mhz bei CL 5-5-5-18 Timings befeuern l&#228;sst. Dabei unterst&#252;tzt er bis zu 2,2V, was ihn prinzipiell f&#252;r &#220;bertaktungsangelegenheiten interessant machen w&#252;rde. Mein Mainboard, ein <a href="http://www.gigabyte.de/Products/Motherboard/Products_Overview.aspx?ClassValue=Motherboard&#038;ProductID=4366&#038;ProductName=GA-MA790GP-UD4H">Gigabyte MA790GP-UD4H</a>, erkannte den Ram und stellte im Automatik-Modus erstmal einen Multiplikator von 4 mit CL 5-6-6-24, ein. Dies ergibt zusammen mit der HT-Referenzfrequenz von 200Mhz f&#252;r den RAM 800Mhz, was noch, angesichts der Spezifikation, etwas wenig ist. Also flugs ins Bios und auf Multi 5,33 gestellt (5,50 ist leider nicht verf&#252;gbar). Blieben noch die Timings einzustellen, was bei CPU-Z konkret die Werte f&#252;r CL, T<sub>RCD</sub>, T<sub>RP</sub>, T<sub>RAS</sub>, T<sub>RC</sub> sowie CR sind.<br />
<span id="more-3361"></span><br />
Hierzu verwendete ich heute nicht das BIOS, sondern habe mir das Tool AMD Overdrive geschnappt, dieses auf den Advanced-Mode umgeschalten und die Timings manuell eingestellt. Dies hat den Vorteil, dass ich direkt im Anschluss mittels eines Lasttests die Timings testen kann. Allerdings werden diese Timings nach einem Neustart nicht ohne aktives AMD Overdrive gesetzt, sodass man diese dann dauerhaft im BIOS festsetzen sollte.</p>
<p>In der nachfolgenden Tabelle sind die einzelnen Bestandteile des Timings aufgelistet:</p>
<table style="border:dotted 1px;text-align:center;" width="100%">
<tr>
<td>CAS</td>
<td>T<sub>RCD</sub></td>
<td>T<sub>RP</sub></td>
<td>T<sub>RAS</sub></td>
</tr>
<tr>
<td>5</td>
<td>5</td>
<td>5</td>
<td>18</td>
</tr>
</table>
<p><div id="attachment_3363" class="wp-caption alignright" style="width: 160px"><a rel="lightbox[TRC]" href="http://wolf-u.li/upload/2010/03/3361-CPU-Z-After.png"><img src="http://wolf-u.li/upload/2010/03/3361-CPU-Z-After-150x150.png" alt="CPU-Z nach Einstellung" title="CPU-Z nach Einstellung" width="150" height="150" class="size-thumbnail wp-image-3363" /></a><p class="wp-caption-text">CPU-Z nach Einstellung</p></div>Die Abk&#252;rzungen mal etwas l&#228;nger:</p>
<ul>
<li><small>CL: CAS# Latency</small></li>
<li><small>T<sub>RCD</sub>: RAS# to CAS# Latency</small></li>
<li><small>T<sub>RP</sub>: RAS# Precharge</small></li>
<li><small>T<sub>RAS</sub>: Cycle Time</small></li>
<li><small>T<sub>RC</sub>: Row Cycle Time</small></li>
<li><small>CR: Command Rate</small></li>
</ul>
<p>Weiterhin m&#246;chte AMD Overdrive von mir einen Wert f&#252;r T<sub>RC</sub> wissen. Dieser Wert bezeichnet die <em>Row Cycle Time</em>, also die Dauer, die zwischen zwei aufeinander folgenden Aktivierungen zweier beliebiger Zeilen in derselben Bank verstrichen sein muss. Er beschreibt also die minimal notwendige Zeit, um eine Speicherzeile aufzufrischen. (<a href="http://de.wikipedia.org/wiki/Dynamic_random_access_memory#tRC">Quelle</a>).</p>
<p>Laut einem Paper von <a href="http://web.archive.org/web/20080328005959/http://www.mushkin.com/doc/support/papers/latency.asp">Mushkin</a> sollte der Wert f&#252;r T<sub>RC</sub> auf <strong>TRAS + TRP</strong> gesetzt werden, was bei mir 23 (18+5) ist.</p>
<p>Obs nun wirklich schneller ist, vermag ich nicht wirklich zu beurteilen, aber man muss das gekaufte ja nicht unn&#252;tz rumliegen lassen <img src='http://wolf-u.li/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' />  Die letzten Mhz, die noch m&#246;glich sind, k&#246;nnte man durch ein Anheben der HT Referenz-Frequenz erreichen, jedoch wird dann auch gleichzeitig die CPU &#252;bertaktet, was ich nicht will.</p>
<p>Hilfreiche Seiten w&#228;hrend der Recherche:</p>
<ul>
<li><a href="http://www.tweakers.fr/timings.html#tRC">Tweakers.fr</a></li>
<li><a href="http://en.wikipedia.org/wiki/SDRAM_latency#SDRAM_access">Wikipedia &#8211; SDRAM latency</a></li>
<li><a href="http://de.wikipedia.org/wiki/Dynamic_random_access_memory#tRC">Wikipedia &#8211; Dynamic Random Access Memory</a></li>
<li><a href="http://en.wikipedia.org/wiki/Memory_timings">Wikipedia &#8211; Memory Timings</a></li>
</ul>
<hr /><small><center>&copy; 2005-2009 by <a href='http://wolf-u.li/'>Uli Wolf</a> &#8211; This Content is distributed under the <a href='http://wolf-u.li/pwnd-faq/'>Creative Commons License</a><br /> This feed is for personal, non-commercial use only. <br /> The use of this feed on other websites without attribution to the author and notification of the author breaches copyright. If this content is not in your news reader, it makes the page you are viewing an infringement of the copyright. (Digital Fingerprint:  d2a576b5311479d89eff39b7ca886f6b)</center></small>]]></content:encoded>
			<wfw:commentRss>http://wolf-u.li/3361/erklaerung-der-einstellung-row-cycle-time-trc-bei-ram-timings-in-cpu-z/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Conceptronic CH3HNAS ist verf&#252;gbar</title>
		<link>http://wolf-u.li/3356/conceptronic-ch3hnas-ist-verfuegbar/</link>
		<comments>http://wolf-u.li/3356/conceptronic-ch3hnas-ist-verfuegbar/#comments</comments>
		<pubDate>Sun, 07 Mar 2010 21:26:59 +0000</pubDate>
		<dc:creator>Uli</dc:creator>
				<category><![CDATA[Gadgets]]></category>
		<category><![CDATA[CH3HNAS]]></category>
		<category><![CDATA[Conceptronic]]></category>
		<category><![CDATA[NAS]]></category>

		<guid isPermaLink="false">http://wolf-u.li/?p=3356</guid>
		<description><![CDATA[Das Conceptronic CH3HNAS ist erschienen. Das NAS ist als Low-Budget-L&#246;sung konzipiert worden und steht damit in Konkurrenz zu Ger&#228;ten wie dem Xtreamer eTRAYz. Im Unterschied zum Conceptronic CH3MNAS fehlen der Druckserver, zeitgesteuerte Downloads und die Unterst&#252;tzung f&#252;rs fun_plug. Letzteres kann sich noch &#228;ndern, derzeit ist es aber nicht enthalten.

Hier die Gesamtliste der Features und Eigenschaften:

Abmessungen: [...]]]></description>
			<content:encoded><![CDATA[<p><div id="attachment_3359" class="wp-caption alignright" style="width: 160px"><a rel="lightbox[ch3hnas]" href="http://wolf-u.li/upload/2010/03/3356-Conceptronic-CH3HNAS-Packung.jpg"><img src="http://wolf-u.li/upload/2010/03/3356-Conceptronic-CH3HNAS-Packung-150x150.jpg" alt="Conceptronic CH3HNAS - Verpackung" title="Conceptronic CH3HNAS - Verpackung" width="150" height="150" class="size-thumbnail wp-image-3359" /></a><p class="wp-caption-text">Conceptronic CH3HNAS - Verpackung</p></div>Das <a href="http://www.conceptronic.net/site/desktopdefault.aspx?tabindex=1&#038;tabid=232&#038;cid=30&#038;gid=3030%20&#038;pid=CH3HNAS">Conceptronic CH3HNAS</a> ist erschienen. Das NAS ist als Low-Budget-L&#246;sung konzipiert worden und steht damit in Konkurrenz zu Ger&#228;ten wie dem <a href="http://www.xtreamer.net/etrayz/overview.aspx">Xtreamer eTRAYz</a>. Im Unterschied zum <a href="http://wolf-u.li/2979/vorschau-conceptronic-ch3mnas-wuerdiger-nachfolger-des-ch3snas/">Conceptronic</a> <a href="http://wolf-u.li/3213/review-und-test-des-conceptronic-ch3mnas-erste-bilder/">CH3MNAS</a> fehlen der Druckserver, zeitgesteuerte Downloads und die Unterst&#252;tzung f&#252;rs fun_plug. Letzteres kann sich noch &#228;ndern, derzeit ist es aber nicht enthalten.<br />
<span id="more-3356"></span><br />
Hier die Gesamtliste der Features und Eigenschaften:<br />
<div id="attachment_3358" class="wp-caption alignright" style="width: 160px"><a rel="lightbox[ch3hnas]" href="http://wolf-u.li/upload/2010/03/3356-Conceptronic-CH3HNAS-Front.jpg"><img src="http://wolf-u.li/upload/2010/03/3356-Conceptronic-CH3HNAS-Front-150x150.jpg" alt="Conceptronic CH3HNAS - Front" title="Conceptronic CH3HNAS - Front" width="150" height="150" class="size-thumbnail wp-image-3358" /></a><p class="wp-caption-text">Conceptronic CH3HNAS - Vorderseite</p></div>
<ul>
<li>Abmessungen: 110&#215;83x207 mm (BxHxT)</li>
<li>Gewicht: 830g (ohne Festplatte)</li>
<li>Aktiver L&#252;fter</li>
<li>Gigabit-LAN Anschluss (abw&#228;rtskompatibel mit 10/100Mbps) mit Auto-MDIX-Unterst&#252;tzung</li>
<li>Dual SATA 3.5&#8243; HDD mit maximal 2*2TB</li>
<li>Vertikale Montage der Festplatten</li>
<li>4 m&#246;gliche HDD-Konfigurationen: Standard, JBOD, RAID 0, RAID 1</li>
<li>Dateisystem: XFS</li>
<li>Memory: 64MB</li>
<li>Prozessor: PLX (Oxford) <a href="http://www.plxtech.com/products/consumer/oxe810dse">OXE810DSE</a> (367Mhz, ARM926EJ-S processor mit 32 Kbyte Cache, MMU und 128 Kbyte on-chip SRAM)</li>
</ul>
<p><a href="javascript:void(null);" onclick="s_toggleDisplay(document.getElementById('SID1910368697'), this, 'CPUINFO zeigen &#9660;', 'CPUINFO verstecken &#9650;');">CPUINFO zeigen &#9660;</a></p>
<div id='SID1910368697' style='display:none;'>
<blockquote><p><code>Processor       : ARM926EJ-S rev 5 (v5l)<br />
BogoMIPS        : 183.09<br />
Features        : swp half thumb fastmult edsp java<br />
CPU implementer : 0x4<br />
CPU architecture: 5TEJ<br />
CPU variant     : 0x0<br />
CPU part        : 0x926<br />
CPU revision    : 5<br />
Cache type      : write-back</p>
<p>Cache clean     : cp15 c7 ops<br />
Cache lockdown  : format C<br />
Cache format    : Harvard<br />
I size          : 32768<br />
I assoc         : 4<br />
I line length   : 32<br />
I sets          : 256<br />
D size          : 32768<br />
D assoc         : 4<br />
D line length   : 32<br />
D sets          : 256</p>
<p>Hardware        : Oxsemi NAS<br />
Revision        : 0000<br />
Serial          : 00000acb14ecf080</code></p></blockquote>
</div>
<p><div id="attachment_3357" class="wp-caption alignright" style="width: 160px"><a rel="lightbox[ch3hnas]" href="http://wolf-u.li/upload/2010/03/3356-Conceptronic-CH3HNAS-Back.jpg"><img src="http://wolf-u.li/upload/2010/03/3356-Conceptronic-CH3HNAS-Back-150x150.jpg" alt="Conceptronic CH3HNAS - R&#252;ckseite" title="Conceptronic CH3HNAS - Back" width="150" height="150" class="size-thumbnail wp-image-3357" /></a><p class="wp-caption-text">Conceptronic CH3HNAS - Back</p></div>Software-Ausstattung:</p>
<ul>
<li>Webinterface f&#252;r die Konfiguration</li>
<li>Unterst&#252;tzt zeitgesteuerte FTP/HTTP Downloads/Backups</li>
<li>HDD Power Management</li>
<li>Samba Server (Windows Freigaben)</li>
<li>FTP Server</li>
<li>UPnP AV Server mit DLNA-Unterst&#252;tzung</li>
<li>iTunes<sup><small>TM</small></sup> Server</li>
</ul>
<p><iframe src="http://rcm-de.amazon.de/e/cm?t=endlessinspir-21&#038;o=3&#038;p=8&#038;l=as1&#038;asins=B002Z99A46&#038;fc1=000000&#038;IS2=1&#038;lt1=_blank&#038;m=amazon&#038;lc1=0000FF&#038;bc1=000000&#038;bg1=FFFFFF&#038;f=ifr" style="width:120px;height:240px;" scrolling="no" marginwidth="0" marginheight="0" frameborder="0" align="right"></iframe> F&#252;r wen ist das Ger&#228;t geeingnet? Definitiv f&#252;r alle, die einfach nur Daten speichern m&#246;chten und keine besonderen Geschichten wie Webserver oder fun_plug Unterst&#252;tzung ben&#246;tigen.</p>
<p>Derzeit schwanken die Preise zwischen 80€ und 100€ f&#252;r das Ger&#228;t, was es ganz attraktiv macht. Leider liest man noch nix &#252;ber die &#220;bertragungsraten, die angesichts des ungew&#246;hnlichen Chipsatzes sicher interessant w&#228;ren. Die des CH3MNAS sind <a href="http://wolf-u.li/3327/performance-bzw-uebertragungsrate-des-conceptronic-ch3mnas-im-netzwerk/">hier</a> nachzulesen.</p>
<hr /><small><center>&copy; 2005-2009 by <a href='http://wolf-u.li/'>Uli Wolf</a> &#8211; This Content is distributed under the <a href='http://wolf-u.li/pwnd-faq/'>Creative Commons License</a><br /> This feed is for personal, non-commercial use only. <br /> The use of this feed on other websites without attribution to the author and notification of the author breaches copyright. If this content is not in your news reader, it makes the page you are viewing an infringement of the copyright. (Digital Fingerprint:  d2a576b5311479d89eff39b7ca886f6b)</center></small>]]></content:encoded>
			<wfw:commentRss>http://wolf-u.li/3356/conceptronic-ch3hnas-ist-verfuegbar/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Projekt zw&#246;lf2010: Wasserturm Mannheim im M&#228;rz</title>
		<link>http://wolf-u.li/3355/projekt-zwoelf2010-wasserturm-mannheim-im-maerz/</link>
		<comments>http://wolf-u.li/3355/projekt-zwoelf2010-wasserturm-mannheim-im-maerz/#comments</comments>
		<pubDate>Fri, 05 Mar 2010 19:50:18 +0000</pubDate>
		<dc:creator>Uli</dc:creator>
				<category><![CDATA[Privates]]></category>

		<guid isPermaLink="false">http://wolf-u.li/?p=3355</guid>
		<description><![CDATA[Hier das Photo vom M&#228;rz im Projekt zw&#246;lf2010:



Exif:


Brennweite:
18mm


Belichtungszeit:
1/80s


Blende:
10


ISO:
100


Geschossen wurde es mit der Sony &#945;200 und dem Tamron 18-250/3.5-6.3.
PS: @Jana: Teilnehmer #188 &#8211; Uli
&#169; 2005-2009 by Uli Wolf &#8211; This Content is distributed under the Creative Commons License This feed is for personal, non-commercial use only.  The use of this feed on other websites without [...]]]></description>
			<content:encoded><![CDATA[<p>Hier das Photo vom M&#228;rz im Projekt <a href="http://wolf-u.li/3259/projekt-zwoelf2010-wasserturm-mannheim-leitartikel/">zw&#246;lf2010</a>:<br />
<a rel="lightbox" href="http://wolf-u.li/upload/2010/01/zwoelf2010-03-M&#228;rz.jpg"><img src="http://wolf-u.li/upload/2010/01/zwoelf2010-03-M&#228;rz-500x334.jpg" alt="Wasserturm Mannheim im M&#228;rz" title="Wasserturm Mannheim im M&#228;rz" width="500" height="334" class="aligncenter size-medium wp-image-3344" /></a></p>
<table>
<tr>
<th colspan="2">Exif:</th>
</tr>
<tr>
<td>Brennweite:</td>
<td>18mm</td>
</tr>
<tr>
<td>Belichtungszeit:</td>
<td>1/80s</td>
</tr>
<tr>
<td>Blende:</td>
<td>10</td>
</tr>
<tr>
<td>ISO:</td>
<td>100</td>
</tr>
</table>
<p>Geschossen wurde es mit der <em><a href="http://wolf-u.li/tag/sony-a200/">Sony <font color="DarkOrange"><strong>&alpha;</strong></font>200</a></em> und dem <em><a href="http://wolf-u.li/tag/tamron-18-2503-5-6-3/">Tamron 18-250/3.5-6.3</a></em>.</p>
<p>PS: @<a href="http://www.janasworld.de/fotografie/fotoprojekt-zwoelf2010/fotoprojekt-zwoelf2010-101-200/">Jana</a>: Teilnehmer #188 &#8211; Uli</p>
<hr /><small><center>&copy; 2005-2009 by <a href='http://wolf-u.li/'>Uli Wolf</a> &#8211; This Content is distributed under the <a href='http://wolf-u.li/pwnd-faq/'>Creative Commons License</a><br /> This feed is for personal, non-commercial use only. <br /> The use of this feed on other websites without attribution to the author and notification of the author breaches copyright. If this content is not in your news reader, it makes the page you are viewing an infringement of the copyright. (Digital Fingerprint:  d2a576b5311479d89eff39b7ca886f6b)</center></small>]]></content:encoded>
			<wfw:commentRss>http://wolf-u.li/3355/projekt-zwoelf2010-wasserturm-mannheim-im-maerz/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>fun_plug 0.5 auf einem USB-Stick auf dem Conceptronic CH3MNAS installieren</title>
		<link>http://wolf-u.li/3329/fun_plug-0-5-auf-einem-usb-stick-auf-dem-conceptronic-ch3mnas-installieren/</link>
		<comments>http://wolf-u.li/3329/fun_plug-0-5-auf-einem-usb-stick-auf-dem-conceptronic-ch3mnas-installieren/#comments</comments>
		<pubDate>Thu, 25 Feb 2010 17:52:54 +0000</pubDate>
		<dc:creator>Uli</dc:creator>
				<category><![CDATA[Gadgets]]></category>
		<category><![CDATA[CH3MNAS]]></category>
		<category><![CDATA[Conceptronic]]></category>
		<category><![CDATA[fun_plug]]></category>
		<category><![CDATA[NAS]]></category>

		<guid isPermaLink="false">http://wolf-u.li/?p=3329</guid>
		<description><![CDATA[Diese Anleitung bezieht sich auf das fun_plug in der Version 0.5 und wurde nur auf dem Conceptronic CH3MNAS getestet. Bitte beachte den Leitartikel f&#252;r weitere Tutorials
Auf dem Conceptronic CH3MNAS l&#228;sst sich wie bereits auf dem CH3SNAS ein sogenanntes fun_plug installieren, um weitere Dienste wie beispielsweise Webserver oder Medienserver nachzur&#252;sten. Um den Spindown der Festplatten nicht [...]]]></description>
			<content:encoded><![CDATA[<div class="wolfuliannounce">Diese Anleitung bezieht sich auf das <a href="http://wolf-u.li/tag/fun_plug/">fun_plug</a> in der Version 0.5 und wurde nur auf dem Conceptronic <a href="http://wolf-u.li/tag/ch3mnas/">CH3MNAS</a> getestet. Bitte beachte den <a href="http://wolf-u.li/ch3snas/">Leitartikel</a> f&#252;r weitere Tutorials</div>
<p>Auf dem Conceptronic CH3MNAS l&#228;sst sich wie bereits auf dem CH3SNAS ein sogenanntes fun_plug installieren, um weitere Dienste wie beispielsweise Webserver oder Medienserver nachzur&#252;sten. Um den Spindown der Festplatten nicht durch das fun_plug behindern zu lassen, kann man dieses auf einem USB-Stick installieren, was Inhalt dieses Artikels ist.<br />
<span id="more-3329"></span><br />
<iframe src="http://rcm-de.amazon.de/e/cm?t=endlessinspir-21&#038;o=3&#038;p=8&#038;l=as1&#038;asins=B00279YCXI&#038;fc1=000000&#038;IS2=1&#038;lt1=_blank&#038;m=amazon&#038;lc1=0000FF&#038;bc1=000000&#038;bg1=FFFFFF&#038;f=ifr" style="width:120px;height:240px;padding-left:10px;padding-right:0px;" scrolling="no" marginwidth="0" marginheight="0" frameborder="0" align="right"></iframe>Das ffp an sich ist perfekt, um direkt auf einen USB-Stick gepackt zu werden. Ich hatte <a href="http://wolf-u.li/1214/zusaetzlicher-storage-fuer-das-conceptronic-ch3snas-d-link-dns-323-ueber-einen-usb-stick/">bereits schon einmal demonstriert</a>, wie dies f&#252;r bestimmte Programme funktioniert, jetzt ist das gesamte fun_plug dran, da dann Probleme, wie sich nicht abschaltende Festplatten und lange Antwortzeiten beim ersten Aufrufen einer Webseite (lighttpd auf der ausgeschalteten Festplatte) endlich der Vergangenheit angeh&#246;ren.</p>
<p>Zum Inhalt des Tutorials:</p>
<ol>
<li><a href="#abkuerzungen">Abk&#252;rzungsverzeichnis</a></li>
<li><a href="#intro">Vorbereitende Gedanken</a></li>
<li>Vorbereitung des USB-Sticks:
<ul>
<li><a href="#usb-problem">Problemstellung</a></li>
<li><a href="#usb-formatfunplug">Einrichtung einer "Formatierungsumgebung" auf dem NAS</a></li>
<li><a href="#usb-format">Formatieren des USB-Sticks</a></li>
</ul>
</li>
<li><a href="#ffp-install">Installation des fun_plug 0.5</a>
<ul>
<li><a href="#ffp-install-root">&#196;nderung des root-passworts</a></li>
<li><a href="#ffp-install-ssh">Aktivierung von SSH</a></li>
<li><a href="#ffp-install-start">Erkl&#228;rung des Start-Mechanismus</a></li>
</ul>
</li>
<li><a href="#packagesync">Installation von zus&#228;tzlichen Paketen</a></li>
</ol>
<p><a name="abkuerzungen"></a>Im nun folgenden Tutorial gelten diese Abk&#252;rzungen:</p>
<ul>
<li>NAS: Conceptronic CH3MNAS</li>
<li>ffp: <strong>f</strong>onz <strong>f</strong>un_<strong>p</strong>lug 0.5</li>
<li>"#:" bedeutet Konsoleneingabe (ohne die Zeichen <code>#:</code>)</li>
<li>[enter] bedeutet Das Dr&#252;cken der Return-Taste auf der Tastertur</li>
</ul>
<p><a name="intro"></a><strong>Ich bitte darum das Tutorial erst einmal KOMPLETT zu lesen, BEVOR man es durchf&#252;hrt! Viele Fragen kommen dann erst gar nicht auf und manche Probleme kl&#228;ren sich so von selbst!</strong></p>
<p>Ein kurzes Wort noch zum fun_plug 0.5 auf dem CH3MNAS. Das ffp0.5 ist eigentlich nicht f&#252;r diese Architektur konzipiert worden und kann unter Umst&#228;nden von Zeit zu Zeit ausfallen oder nicht richtig antworten. In diesen F&#228;llen ist nach einem Restart des Ger&#228;ts die Welt meist wieder in Ordnung. Das kompatible ffp0.6 ist zwar bereits in der Mache, jedoch derzeit noch nicht fertig. Ich habe bei mir das ffp0.5 nun seit einiger Zeit stabil laufen, daher kann ich zu einer Installation raten.</p>
<p>F&#252;r dieses Tutorial braucht man *oh wunder* einen <strong>USB-Stick</strong>. Dieser wird im laufen dieses Beitrag komplett formatiert, d.h. alle Daten gehen verloren! Gr&#246;&#223;enm&#228;&#223;ig sollte der Stick oberhalb von 512MB, besser bei einem 1GB liegen. Eine komplett-Installation des fun_plug ben&#246;tigt etwa 500MB inklusive Paketverzeichnis (Gr&#246;&#223;e ~100MB, wobei man das auch auf der Festplatte halten kann, da man es eh nur einmal braucht). Wichtig in diesem Tutorial ist die Menge der Festplatten im NAS. Je nach dem wird der USB-Stick anders angesprochen. Bei einer Festplatte wird der USB-Stick als "<strong>sdb</strong>", bei zwei Festplatten als "<strong>sdc</strong>" angesprochen. Ich spreche im Tutorial und in allen Dateien immer von sdc, ich bitte dies selbstst&#228;ndig auf sdb zu &#228;ndern, wenn nur eine Festplatte im Geh&#228;use steckt! Zudem braucht das NAS eine funtionierende <strong>Internetverbindung</strong>, sonst wird meine Anleitung in der momentanen Form nicht laufen! Bitte auch drauf achten, dass ein funktionierender DNS-Server zur Verf&#252;gung steht.</p>
<p><strong>Bitte jetzt den USB-Stick anstecken!</strong></p>
<p><a name="usb-problem"></a>Das grundlegende Problem ist zun&#228;chst das Dateisystem des USB-Sticks. Ich rate zu <a href="http://de.wikipedia.org/wiki/Ext2">ext2</a>, da dies bereits im NAS selbst eingesetzt wird und als relativ robust anerkannt ist. Das Problem ist nun, dass die meisten Leser vermutlich kein Programm (z.B. Partition Magic) oder auch keine Umgebung (Linux) installiert haben um den Stick auf ext2 zu formatieren.</p>
<p>Zun&#228;chst muss sichergestellt sein, dass das NAS &#252;ber eine g&#252;ltige Netzwerkkonfiguration ("Setup" -> "LAN") mit Gateway &#038; DNS-Server verf&#252;gt. Wird die IP-Adresse automatisch bezogen, ist das im Regelfall korrekt eingestellt.</p>
<p><a name="usb-formatfunplug"></a>Wir werden zun&#228;chst ein regul&#228;res ffp0.5 auf dem NAS einrichten. Wenn man keinen Zugang hat (z.B. neues NAS), dann bitte folgende drei Punkte befolgen:</p>
<ul>
<li>Download dieser <a href="http://www.inreto.de/dns323/fun-plug/0.5/fun_plug">Datei</a> und dieser <a href="http://www.inreto.de/dns323/fun-plug/0.5/fun_plug.tgz">Datei</a></li>
<li>Bitte drauf achten, dass die Datei "fun_plug" genau so benannt ist, bevor diese &#252;ber das normale File-Share ins Hauptverzeichnis auf die erste Festplatte (Zumeist als "Volume_1" &#252;ber Samba freigegeben) gespeichert wird.</li>
<li>Beim Reboot wird das normale fun_plug 0.5 initialisiert.</li>
</ul>
<p><a name="usb-format"></a>Nun werden wir den Stick frisch partitionieren. Bitte vor dem ausf&#252;hren der folgenden Schritte pr&#252;fen, ob der Stick wirklich dran steckt!<br />
<a rel='lightbox[ffp]' href='http://wolf-u.li/upload/2008/07/1318-ffpusb-1.png'><img src="http://wolf-u.li/upload/2008/07/1318-ffpusb-1-150x150.png" alt="" title="1318-ffpusb-1" width="150" height="150" class="alignleft size-thumbnail wp-image-1668" /></a>Unter Windows verwendet man dazu am einfachsten das Tool <a href="http://the.earth.li/~sgtatham/putty/latest/x86/putty.exe">PuttY</a> von <a href="http://www.chiark.greenend.org.uk/~sgtatham/putty/download.html">hier</a>. Nach dem Start muss man die Adresse des NAS unter "<em>Host Name</em>" angeben, "<em>Telnet</em>" unter Connection Type anw&#228;hlen und auf "<em>Open</em>" klicken. Nun &#246;ffnet sich die Konsole, wo man direkt eingeloggt ist. Sollte sich trotz der korrekten Eingabe der Adresse des NAS keine verbindung herstellen lassen, so pr&#252;ft man zun&#228;chst ob ein ffp.log auf Volume_1 oder Volume_2 angelegt wurde. Meistens ist dies nicht der Fall. Daher einfach die beiden Dateien fun_plug und fun_plug .tgz auf das andere Share zus&#228;tzlich ablegen.</p>
<p>Zun&#228;chst braucht man dann noch das usb-storage.ko-Modul, damit der USB-Stick erkannt werden kann:</p>
<div class="igBar"><span id="lcode-16"><a href="#" onclick="javascript:showPlainTxt('code-16'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">CODE:</span>
<div id="code-16">
<div class="code">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">mkdir -p /mnt/HD_a2/.<span style="">bootstrap</span>/</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">wget http:<span style="color:#FF9933; font-style:italic;">//wolf-u.li/download-manager.php?id=54 -O /mnt/HD_a2/.bootstrap/usb-storage.ko</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">cp /mnt/HD_a2/.<span style="">bootstrap</span>/usb-storage.<span style="">ko</span> /lib/modules/</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">insmod /lib/modules/usb-storage.<span style="">ko</span> </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p><a name="fdisk"></a>Nun ben&#246;tigt man fdisk zur Formatierung des USB-Sticks (Wer sich &#252;ber "cat" wundert: <a href="http://wolf-u.li/3346/crash-von-fdisk-unter-busybox-mit-fehler-segmentation-fault/">Klick</a>):</p>
<div class="igBar"><span id="lcode-17"><a href="#" onclick="javascript:showPlainTxt('code-17'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">CODE:</span>
<div id="code-17">
<div class="code">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">cat | fdisk /dev/sdc </div>
</li>
</ol>
</div>
</div>
</div>
<p>
<a rel='lightbox[ffp]' href='http://wolf-u.li/upload/2008/07/1318-ffpusb-2.png'><img src="http://wolf-u.li/upload/2008/07/1318-ffpusb-2-150x150.png" alt="" title="1318-ffpusb-2" width="150" height="150" class="alignleft size-thumbnail wp-image-1669" /></a>Dieses Tool zeigt nun die Zeile "<code>Command (m for help):</code>". Zun&#228;chst l&#228;sst man sich mittels "p[enter]" die momentanen Partitionen anzeigen. Die Ausgabe sieht bei meinem 512MB Test-USB-Stick so aus:</p>
<blockquote><p><code>Disk /dev/sdc: 519 MB, 519569408 bytes<br />
16 heads, 62 sectors/track, 1022 cylinders<br />
Units = cylinders of 992 * 512 = 507904 bytes</p>
<table>
<tr>
<td>Device Boot</td>
<td><strong>|</strong></td>
<td>Start</td>
<td><strong>|</strong></td>
<td>End</td>
<td><strong>|</strong></td>
<td>Blocks</td>
<td><strong>|</strong></td>
<td>Id</td>
<td><strong>|</strong></td>
<td>System</td>
</tr>
<tr>
<td>/dev/sdc1</td>
<td><strong>|</strong></td>
<td>1</td>
<td><strong>|</strong></td>
<td>1022</td>
<td><strong>|</strong></td>
<td>506881</td>
<td><strong>|</strong></td>
<td>c Win95</td>
<td><strong>|</strong></td>
<td>FAT32 (LBA)</td>
</tr>
</table>
</blockquote>
<p>Nun l&#246;schen wir diese eine Partition:</p>
<blockquote><p>d[enter]</p></blockquote>
<p>Und legen eine neue an:</p>
<blockquote><p>n[enter]<br />
p[enter]<br />
1[enter]<br />
[enter]<br />
[enter]<br />
t[enter]<br />
83[enter]</p></blockquote>
<p>Nun haben wir eine Partition erstellt, die die maximale Gr&#246;&#223;e des USB-Sticks ausf&#252;llt und als Linux-Partition markiert ist. Die &#196;nderungen sehen wir uns noch nochmal an und speichern diese anschlie&#223;end:</p>
<blockquote><p>p[enter]<br />
w[enter]</p></blockquote>
<p><a rel='lightbox[ffp]' href='http://wolf-u.li/upload/2008/07/1318-ffpusb-3.png'><img src="http://wolf-u.li/upload/2008/07/1318-ffpusb-3-150x150.png" alt="" title="1318-ffpusb-3" width="150" height="150" class="alignleft size-thumbnail wp-image-1670" /></a>Diese werden wir nun noch auf ext2 formatieren:</p>
<div class="igBar"><span id="lcode-18"><a href="#" onclick="javascript:showPlainTxt('code-18'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">CODE:</span>
<div id="code-18">
<div class="code">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">mke2fs /dev/sdc1 </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p>Damit ist der USB-Stick fertig vorbereitet. Darauf ist nun ein Dateisystem mit dem Typ ext2 in der vollen Gr&#246;&#223;e des Sticks angelegt.</p>
<p><a name="ffp-install"></a>Der n&#228;chste Schritt ist nun, das FFP_SETUP_SCRIPT herunterzuladen:</p>
<div class="igBar"><span id="lcode-19"><a href="#" onclick="javascript:showPlainTxt('code-19'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">CODE:</span>
<div id="code-19">
<div class="code">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">mkdir /mnt/HD_a2/.<span style="">bootstrap</span>/</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">wget http:<span style="color:#FF9933; font-style:italic;">//wolf-u.li/download-manager.php?id=55 -O /mnt/HD_a2/.bootstrap/setup.sh</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">chmod +x /mnt/HD_a2/.<span style="">bootstrap</span>/setup.<span style="">sh</span> </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p>Wenn man die obige minimal-umgebung gestartet hat, dann kann man diese nun vor dem Restart noch entfernen:</p>
<div class="igBar"><span id="lcode-20"><a href="#" onclick="javascript:showPlainTxt('code-20'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">CODE:</span>
<div id="code-20">
<div class="code">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">rm -R /mnt/HD_a2/ffp/ </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p>Nun muss das NAS einmal neu gestartet werden, was entweder &#252;ber das Webinterface oder die Konsole m&#246;glich ist:</p>
<div class="igBar"><span id="lcode-21"><a href="#" onclick="javascript:showPlainTxt('code-21'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">CODE:</span>
<div id="code-21">
<div class="code">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">reboot </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p><a rel="lightbox[telnet]" href='http://wolf-u.li/upload/2008/07/1426-login-as-root.png'><img src="http://wolf-u.li/upload/2008/07/1426-login-as-root-150x150.png" alt="" title="1426-login-as-root" width="150" height="150" class="alignleft size-thumbnail wp-image-1656" /></a>Nach einem Reboot ist das ffp vom USB-Stick geladen und automatisch telnet aktiviert. Zun&#228;chst sollte man sich nun mit einem geeigneten Telnet-Programm (unter Linux einfach nur "ssh", unter Windows verwende ich <a href="http://www.chiark.greenend.org.uk/~sgtatham/putty/download.html ">Putty</a>,wie oben zu sehen) auf dem NAS einloggen. Bitte f&#252;r den folgenden Schritt einfach mal das Bild links ansehen, damits klarer wird.</p>
<blockquote><p>Login as: <strong>root</strong><br />
Passwort sollte keines verlangt werden</p></blockquote>
<p><strong>Wenn (oder direkt) "<code>/mnt/HD_a2 #</code>" erscheint, ist man eingeloggt und kann fortfahren.</strong></p>
<p><a name="ffp-install-root"></a>Als eine der ersten Aktionen wird nun /etc/shadow mittels pwconv erstellt. Das Passwort wird anschlie&#223;end mittels "passwd" ge&#228;ndert:</p>
<div class="igBar"><span id="lcode-22"><a href="#" onclick="javascript:showPlainTxt('code-22'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">CODE:</span>
<div id="code-22">
<div class="code">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">pwconv</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">passwd </div>
</li>
</ol>
</div>
</div>
</div>
<p>
Wenn das neue Passwort zweimal eingegeben wurde, muss man den root-User noch aktivieren:</p>
<div class="igBar"><span id="lcode-23"><a href="#" onclick="javascript:showPlainTxt('code-23'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">CODE:</span>
<div id="code-23">
<div class="code">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">usermod -s /ffp/bin/sh root </div>
</li>
</ol>
</div>
</div>
</div>
<p>
Nun kann man den Login nun direkt testen. Hierzu gibt man im Anschluss:</p>
<div class="igBar"><span id="lcode-24"><a href="#" onclick="javascript:showPlainTxt('code-24'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">CODE:</span>
<div id="code-24">
<div class="code">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">login </div>
</li>
</ol>
</div>
</div>
</div>
<p>
ein. Wenns nicht klappt, einfach die Prozedur ab "passwd" wiederholen.</p>
<p>Wenn alles geklappt hat, dann <strong>muss</strong> das Passwort in den internen Flash-Speicher gespeichert werden.</p>
<div class="igBar"><span id="lcode-25"><a href="#" onclick="javascript:showPlainTxt('code-25'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">CODE:</span>
<div id="code-25">
<div class="code">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">store-passwd.<span style="">sh</span> </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p><a name="ffp-install-ssh"></a>Nun wird der SSH-Server aktiviert, da telnet bereits als sehr unsicher (v.a. aufgrund des unverschl&#252;sselten Verkehrs) bekannt ist (das erste Starten wird eine Weile dauern und wirft lustige Zeichen in der Kommandozeile):</p>
<div class="igBar"><span id="lcode-26"><a href="#" onclick="javascript:showPlainTxt('code-26'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">CODE:</span>
<div id="code-26">
<div class="code">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">chmod a+x /ffp/start/sshd.<span style="">sh</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">sh /ffp/start/sshd.<span style="">sh</span> start </div>
</li>
</ol>
</div>
</div>
</div>
<p>
<strong>Nun den Telnet-Client noch nicht schlie&#223;en!</strong> &#214;ffne gleichzeitig nochmals PuttY und verwende aber statt telnet nun SSH. Versuche eine Verbindung zum NAS. Diese wird (hoffentlich) erfolgreich sein.</p>
<p>Nun (und NUR wenn der Login erfolgreich war!) kann der Telnet-Server deaktiviert werden:</p>
<div class="igBar"><span id="lcode-27"><a href="#" onclick="javascript:showPlainTxt('code-27'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">CODE:</span>
<div id="code-27">
<div class="code">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">chmod -x /ffp/start/telnetd.<span style="">sh</span> </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p><a name="ffp-install-start"></a>Auf dem usbstick ist unter "<code>/mnt/HD_a2/usbstorage</code>" ein Verzeichnis namens "ffp" angelegt worden. Darin befindet sich ein Unterverzeichnis "start", in dem verschiedene Startdateien f&#252;r diverse Dienste liegen. Typischerweise weisen davon nur wenige das Attribut <em>X</em>, also <em>Executable</em>. Nur diese werden auch beim Start des fun_plug ausgef&#252;hrt. Ein paar Zeilen weiter oben habe ich "<code>chmod +x sshd.sh</code>" angeordnet. Diese Anweisung markiert eine Datei als ausf&#252;hrbar. Alle Dateien im <em>Start</em>-Ordner, die als executable markiert sind, werden vom fun_plug aufgerufen.</p>
<p><a name="packagesync"></a>Weitere Software kann man nun einfach installieren. Hierzu muss man zun&#228;chst alle Pakete von fonz auf das NAS syncronisieren. Ich habe das Verzeichnis auf dem USB-Stick angelegt. Wenn es woanders sein soll, sollte das der versierte Nutzer selbst erledigen k&#246;nnen <img src='http://wolf-u.li/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>
<div class="igBar"><span id="lcode-28"><a href="#" onclick="javascript:showPlainTxt('code-28'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">CODE:</span>
<div id="code-28">
<div class="code">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">mkdir /ffp/pkg/</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">cd /ffp/pkg/</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">rsync -av inreto.<span style="">de</span>::<span style="">dns323</span>/fun-plug/<span style="color:#800000;color:#800000;">0</span>.<span style="color:#800000;color:#800000;">5</span>/packages .</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="">cd</span> packages </div>
</li>
</ol>
</div>
</div>
</div>
<p>
Schl&#228;gt der rsync-Befehl mit der Meldung "rsync: getaddrinfo: inreto.de 873: Name or service not known" fehl, so ist der DNS-Server nicht korrekt eingetragen.</p>
<p>Mit diesen Befehlen habe ich einen Ordner namens "<em>pkg</em>" im Ordner "<em>ffp</em>" erstellt. Zus&#228;tzlich wurde nun der Ordner "<em>packages</em>" angelegt, der alle kompilierten Pakete von fonz enth&#228;lt. </p>
<p>Nun muss man zun&#228;chst einige Programme auf den neuesten Stand bringen:</p>
<div class="igBar"><span id="lcode-29"><a href="#" onclick="javascript:showPlainTxt('code-29'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">CODE:</span>
<div id="code-29">
<div class="code">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">cd /ffp/pkg/packages/</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">funpkg -u funpkg-*.<span style="">tgz</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">funpkg -u *.<span style="">tgz</span> </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p>Anschlie&#223;end installiert man alle verf&#252;gbaren Pakete:</p>
<div class="igBar"><span id="lcode-30"><a href="#" onclick="javascript:showPlainTxt('code-30'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">CODE:</span>
<div id="code-30">
<div class="code">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">cd /ffp/pkg/packages/</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">funpkg -i *.<span style="">tgz</span> </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p>Zus&#228;tzliche Pakete habe ich dann sp&#228;ter im Verzeichnis <code>/ffp/pkg/additional</code> abgelegt. Diese zus&#228;tzlichen Pakete finden sich in meinem <a href="http://wolf-u.li/2146/ulis-paket-repository-fuer-das-conceptronic-ch3snas-bzw-d-link-dns-323/">Repository</a>. Als n&#228;chstes rate ich dieses einzurichten und die <a href="http://wolf-u.li/1427/ntp-zeitabgleich-mit-dem-fun_plug-05-auf-dem-conceptronic-ch3snas-bzw-d-link-dns-323/">Zeitsynchronisation</a> einzuschalten.</p>
<hr /><small><center>&copy; 2005-2009 by <a href='http://wolf-u.li/'>Uli Wolf</a> - This Content is distributed under the <a href='http://wolf-u.li/pwnd-faq/'>Creative Commons License</a><br /> This feed is for personal, non-commercial use only. <br /> The use of this feed on other websites without attribution to the author and notification of the author breaches copyright. If this content is not in your news reader, it makes the page you are viewing an infringement of the copyright. (Digital Fingerprint:  d2a576b5311479d89eff39b7ca886f6b)</center></small>]]></content:encoded>
			<wfw:commentRss>http://wolf-u.li/3329/fun_plug-0-5-auf-einem-usb-stick-auf-dem-conceptronic-ch3mnas-installieren/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>Bildercache f&#252;r den Webserver nginx am Beispiel von Gravatar-Icons</title>
		<link>http://wolf-u.li/3348/bildercache-fuer-den-webserver-nginx-am-beispiel-von-gravatar-icons/</link>
		<comments>http://wolf-u.li/3348/bildercache-fuer-den-webserver-nginx-am-beispiel-von-gravatar-icons/#comments</comments>
		<pubDate>Mon, 22 Feb 2010 18:57:57 +0000</pubDate>
		<dc:creator>Uli</dc:creator>
				<category><![CDATA[IT]]></category>
		<category><![CDATA[Blog]]></category>
		<category><![CDATA[Nginx]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Tutorial]]></category>
		<category><![CDATA[Webserver]]></category>
		<category><![CDATA[Wordpress]]></category>

		<guid isPermaLink="false">http://wolf-u.li/?p=3348</guid>
		<description><![CDATA[Dieser Artikel ist Teil einer Reihe zum Webserver nginx.Schau dir auch die anderen Artikel an: Zum Leitartikel
Vor einigen Tagen schrieb ich bereits &#252;ber eine M&#246;glichkeit, die Gravatar-Icons lokal zwischen zu speichern. Leider wurde dabei bei jedem Aufruf eines Bildes immer einen php-call gemacht, was mir bei manchen Beitr&#228;gen das Blog in die Knie zwingen w&#252;rde [...]]]></description>
			<content:encoded><![CDATA[<div class="wolfuliannounce">Dieser Artikel ist Teil einer Reihe zum Webserver nginx.<br />Schau dir auch die anderen Artikel an: <a href="http://wolf-u.li/3137/leitartikel-zur-konfiguration-und-installation-des-webservers-nginx/">Zum Leitartikel</a></div>
<p>Vor einigen Tagen <a href="http://wolf-u.li/3347/auslieferung-von-gravatar-icons-aus-einem-lokalen-cache-download-per-curl/">schrieb</a> ich bereits &#252;ber eine M&#246;glichkeit, die Gravatar-Icons lokal zwischen zu speichern. Leider wurde dabei bei jedem Aufruf eines Bildes immer einen php-call gemacht, was mir bei manchen Beitr&#228;gen das Blog in die Knie zwingen w&#252;rde und dem eigentlich gew&#252;nschten Effekt (Beschleunigung) entgegenstehen w&#252;rde. Daher habe ich mir mal die Funktionen meines Webservers nginx angesehen und dabei festgestellt, dass dieser die folgende Pr&#252;fung erlaubt:</p>
<ul>
<li>Ist das Bild vorhanden?
<ul>
<li>Wenn ja: Direkte Auslieferung</li>
<li>Wenn nein: Aufruf einer PHP-Datei zum Download des Bildes</li>
</ul>
</li>
</ul>
<p><span id="more-3348"></span><br />
Die Umsetzung war dann einfach:</p>
<p>Das ist die Konfigurationsdatei f&#252;r den vHost in nginx:</p>
<div class="igBar"><span id="lcode-35"><a href="#" onclick="javascript:showPlainTxt('code-35'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">CODE:</span>
<div id="code-35">
<div class="code">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">server <span style="color:#006600; font-weight:bold;">&#123;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; listen&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#800000;color:#800000;">80</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; server_name&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;img.<span style="">yourdomain</span>.<span style="">tld</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; error_log&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;/path/to/your/logs/error/img.<span style="">yourdomain</span>.<span style="">tld</span>.<span style="">log</span> warn;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; root&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; /path/to/your/document/root/;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; location ~ \.<span style="">php</span>$ <span style="color:#006600; font-weight:bold;">&#123;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; fastcgi_pass&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#800000;color:#800000;">127</span>.<span style="color:#800000;color:#800000;">0</span>.<span style="color:#800000;color:#800000;">0</span>.<span style="color:#800000;color:#800000;">1</span>:<span style="color:#800000;color:#800000;">1234</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; include&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;/etc/nginx/fastcgi_params;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color:#006600; font-weight:bold;">&#125;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; location / <span style="color:#006600; font-weight:bold;">&#123;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; index&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;cdn.<span style="">php</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; # if the requested file exists, return it immediately</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; if <span style="color:#006600; font-weight:bold;">&#40;</span>-f $request_filename<span style="color:#006600; font-weight:bold;">&#41;</span> <span style="color:#006600; font-weight:bold;">&#123;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; break;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#006600; font-weight:bold;">&#125;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; # all other requests go to CDN-PHP-File</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; if <span style="color:#006600; font-weight:bold;">&#40;</span>!-e $request_filename<span style="color:#006600; font-weight:bold;">&#41;</span> <span style="color:#006600; font-weight:bold;">&#123;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; rewrite ^<span style="color:#006600; font-weight:bold;">&#40;</span>.+<span style="color:#006600; font-weight:bold;">&#41;</span>$ /cdn.<span style="">php</span> last;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#006600; font-weight:bold;">&#125;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color:#006600; font-weight:bold;">&#125;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#006600; font-weight:bold;">&#125;</span> </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p>Nun speichert man in <code>/path/to/your/document/root/</code> die Datei cdn.php mit folgendem Inhalt:</p>
<div class="igBar"><span id="lcode-36"><a href="#" onclick="javascript:showPlainTxt('code-36'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">CODE:</span>
<div id="code-36">
<div class="code">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&lt;?php</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#FF9933; font-style:italic;">// Script by Uli Wolf - http://wolf-u.li</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#FF9933; font-style:italic;">// Modify the settings below according to your needs:</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#FF9933; font-style:italic;">// Size of the gravatar-images:</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">$gimagesize = <span style="color:#800000;color:#800000;">32</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#FF9933; font-style:italic;">// If the mailadress was not found, you can get various images:</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#FF9933; font-style:italic;">// - identicon</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#FF9933; font-style:italic;">// - monsterid</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#FF9933; font-style:italic;">// - wavatar</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">$mailnotfound = <span style="color:#CC0000;">"identicon"</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">$removefromurl = array<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#CC0000;">"/g/"</span>,<span style="color:#CC0000;">"/"</span>,<span style="color:#CC0000;">".png"</span>,<span style="color:#CC0000;">".jpg"</span>,<span style="color:#CC0000;">".gif"</span><span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">$gravatar_hash = str_replace<span style="color:#006600; font-weight:bold;">&#40;</span>strtolower<span style="color:#006600; font-weight:bold;">&#40;</span>$removefromurl<span style="color:#006600; font-weight:bold;">&#41;</span>,<span style="color:#CC0000;">""</span>,$_SERVER<span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#CC0000;">"REQUEST_URI"</span><span style="color:#006600; font-weight:bold;">&#93;</span><span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">$gravatar_hash = preg_replace<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#CC0000;">"/[^a-z0-9<span style="color:#000099; font-weight:bold;">\s</span>]/"</span>, <span style="color:#CC0000;">""</span>, $gravatar_hash<span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">if<span style="color:#006600; font-weight:bold;">&#40;</span>strlen<span style="color:#006600; font-weight:bold;">&#40;</span>$gravatar_hash<span style="color:#006600; font-weight:bold;">&#41;</span>!=<span style="color:#800000;color:#800000;">32</span><span style="color:#006600; font-weight:bold;">&#41;</span> <span style="color:#006600; font-weight:bold;">&#123;</span>exit;<span style="color:#006600; font-weight:bold;">&#125;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">$grav_img = <span style="color:#CC0000;">"http://www.gravatar.com/avatar/"</span> . $gravatar_hash . <span style="color:#CC0000;">"?s="</span> . $gimagesize . <span style="color:#CC0000;">"&amp;d="</span> . $mailnotfound . <span style="color:#CC0000;">"&amp;r=G"</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">if<span style="color:#006600; font-weight:bold;">&#40;</span>extension_loaded<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#CC0000;">'curl'</span><span style="color:#006600; font-weight:bold;">&#41;</span><span style="color:#006600; font-weight:bold;">&#41;</span> <span style="color:#006600; font-weight:bold;">&#123;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; $gch = curl_init<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; $gcurl_options = array<span style="color:#006600; font-weight:bold;">&#40;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; CURLOPT_URL =&gt; $grav_img,</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; CURLOPT_HEADER =&gt; false,</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; CURLOPT_RETURNTRANSFER =&gt; true,</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; CURLOPT_TIMEOUT =&gt; <span style="color:#800000;color:#800000;">20</span>,</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; CURLOPT_BINARYTRANSFER =&gt; true,</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; CURLOPT_MAXREDIRS =&gt; <span style="color:#800000;color:#800000;">2</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; curl_setopt_array<span style="color:#006600; font-weight:bold;">&#40;</span>$gch, $gcurl_options<span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; $gdata = curl_exec<span style="color:#006600; font-weight:bold;">&#40;</span>$gch<span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; curl_close <span style="color:#006600; font-weight:bold;">&#40;</span>$gch<span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; unset<span style="color:#006600; font-weight:bold;">&#40;</span>$gch<span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#006600; font-weight:bold;">&#125;</span> else <span style="color:#006600; font-weight:bold;">&#123;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; ob_start<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; $gfilehandle_url = fopen<span style="color:#006600; font-weight:bold;">&#40;</span>$grav_img, <span style="color:#CC0000;">"rb"</span><span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; fpassthru<span style="color:#006600; font-weight:bold;">&#40;</span>$gfilehandle_url<span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; fclose<span style="color:#006600; font-weight:bold;">&#40;</span>$gfilehandle_url<span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; $gdata = ob_get_contents<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; ob_end_clean<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; unset<span style="color:#006600; font-weight:bold;">&#40;</span>$gfilehandle_url<span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#006600; font-weight:bold;">&#125;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">$gfilehandle_img = fopen<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#CC0000;">"g/"</span> . $gravatar_hash . <span style="color:#CC0000;">".png"</span>, <span style="color:#CC0000;">"wb+"</span><span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">fwrite<span style="color:#006600; font-weight:bold;">&#40;</span>$gfilehandle_img, $gdata<span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">fclose<span style="color:#006600; font-weight:bold;">&#40;</span>$gfilehandle_img<span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">unset<span style="color:#006600; font-weight:bold;">&#40;</span>$gfilehandle_img<span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">header<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#CC0000;">'content-type: image/png'</span><span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">echo $gdata;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">?&gt; </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p>Was macht diese Datei?</p>
<p>Oben kann man zun&#228;chst einstellen, wie gro&#223; die Bilder sein sollen und welches Bild angezeigt werden soll, wenn nix hinterlegt ist. Anschlie&#223;end wird eine Pr&#252;fung der URL durchgef&#252;hrt, die einige m&#246;gliche Angriffsvektoren ausfiltern soll. Dabei bleiben dann nur Strings mit 32 Zeichen in Gro&#223;- und Kleinbuchstaben &#252;brig, andernfalls wird das Script beendet. Im Anschluss wird dann das Bild geholt (per curl, wenn m&#246;glich), gespeichert und ausgegeben. Das verzeichnis /path/to/your/document/root/<strong>g/</strong> sollte hierzu vorhanden sein.</p>
<p>Warum der Unterordner /g/? Ich wollte mir damit offen halten, verschiedene Bildertypen zu cachen. Das habe ich gel&#246;st, indem ich meinen Bilderhashes ein "<code>/g/</code>" vorstelle, welches diese als Gravatar-Bilder markiert. F&#228;llt mir also irgendwann mal ein, dass ich beispielsweise gerne noch <a href="http://pavatar.com/">Pavatar</a> (wie auch immer geartet) cachen m&#246;chte, dann kann ich dies hier einbauen.</p>
<p>Meine Url sieht also am Ende so aus:</p>
<blockquote><p><code>http://img.yourdomain.tld/g/a9ec4695d424a6dcb6f896afb0ee22bc.png</code></p></blockquote>
<p>und wird bei ersten Aufruf gecached mittels php und anschlie&#223;end in den weiteren Aufrufen immer statisch durch den Webserver ausgegeben. M&#246;chte man nun regelm&#228;&#223;ig die Bilder aktualisieren, empfiehlt es sich, das <a href="http://wolf-u.li/3347/auslieferung-von-gravatar-icons-aus-einem-lokalen-cache-download-per-curl/">hier</a> bereits vorgestellte Script in regelm&#228;&#223;igen Abst&#228;nden laufen zu lassen.</p>
<p>F&#252;r den Einbau in Wordpress ist das ganze auch recht einfach. Man &#246;ffnet die comments.php und sucht darin den Aufruf:</p>
<div class="igBar"><span id="lcode-37"><a href="#" onclick="javascript:showPlainTxt('code-37'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">CODE:</span>
<div id="code-37">
<div class="code">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&lt;?php echo get_avatar<span style="color:#006600; font-weight:bold;">&#40;</span> $comment, <span style="color:#800000;color:#800000;">32</span><span style="color:#006600; font-weight:bold;">&#41;</span>; ?&gt; </div>
</li>
</ol>
</div>
</div>
</div>
<p>
Diesen ersetzt man dann durch:</p>
<div class="igBar"><span id="lcode-38"><a href="#" onclick="javascript:showPlainTxt('code-38'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">CODE:</span>
<div id="code-38">
<div class="code">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&lt;?php echo <span style="color:#CC0000;">"&lt;img src='http://img.yourdomain.tld/g/"</span> . <span style="">md5</span><span style="color:#006600; font-weight:bold;">&#40;</span>strtolower<span style="color:#006600; font-weight:bold;">&#40;</span>get_comment_author_email<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">&#41;</span><span style="color:#006600; font-weight:bold;">&#41;</span><span style="color:#006600; font-weight:bold;">&#41;</span> . <span style="color:#CC0000;">".png' height='32' width='32'&gt;"</span>; ?&gt; </div>
</li>
</ol>
</div>
</div>
</div>
<p>
Wobei die Domain und die Gr&#246;&#223;e nat&#252;rlich austauschbar sind.</p>
<p>Zu guter letzt noch ein Hinweis f&#252;r Apache-Nutzer: Das PHP-Script l&#228;sst sich nat&#252;rlich auch mit diesem Webserver nutzen.</p>
<hr /><small><center>&copy; 2005-2009 by <a href='http://wolf-u.li/'>Uli Wolf</a> - This Content is distributed under the <a href='http://wolf-u.li/pwnd-faq/'>Creative Commons License</a><br /> This feed is for personal, non-commercial use only. <br /> The use of this feed on other websites without attribution to the author and notification of the author breaches copyright. If this content is not in your news reader, it makes the page you are viewing an infringement of the copyright. (Digital Fingerprint:  d2a576b5311479d89eff39b7ca886f6b)</center></small>]]></content:encoded>
			<wfw:commentRss>http://wolf-u.li/3348/bildercache-fuer-den-webserver-nginx-am-beispiel-von-gravatar-icons/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>All ebuilds that could satisfy &#8220;dev-java/sun-jdk&#8221; have been masked: dlj-1.1 license(s)</title>
		<link>http://wolf-u.li/3352/all-ebuilds-that-could-satisfy-dev-javasun-jdk-have-been-masked-dlj-1-1-licenses/</link>
		<comments>http://wolf-u.li/3352/all-ebuilds-that-could-satisfy-dev-javasun-jdk-have-been-masked-dlj-1-1-licenses/#comments</comments>
		<pubDate>Mon, 22 Feb 2010 18:10:03 +0000</pubDate>
		<dc:creator>Uli</dc:creator>
				<category><![CDATA[IT]]></category>
		<category><![CDATA[Gentoo]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Lizenz]]></category>
		<category><![CDATA[Lösung]]></category>
		<category><![CDATA[Problem]]></category>

		<guid isPermaLink="false">http://wolf-u.li/?p=3352</guid>
		<description><![CDATA[Vor einigen Tagen ist mir beim Update der Java-Version meines Servers der folgende Fehler untergekommen:
!!! The following installed packages are masked:
- dev-java/sun-jdk-1.6.0.17 (masked by: dlj-1.1 license(s))
A copy of the 'dlj-1.1' license is located at '/usr/portage/licenses/dlj-1.1'.
- dev-java/sun-jdk-1.5.0.22 (masked by: dlj-1.1 license(s))
For more information, see the MASKED PACKAGES section in the emerge
man page or refer to the [...]]]></description>
			<content:encoded><![CDATA[<p>Vor einigen Tagen ist mir beim Update der Java-Version meines Servers der folgende Fehler untergekommen:</p>
<blockquote><p><code>!!! The following installed packages are masked:<br />
- dev-java/sun-jdk-1.6.0.17 (masked by: dlj-1.1 license(s))<br />
A copy of the 'dlj-1.1' license is located at '/usr/portage/licenses/dlj-1.1'.</p>
<p>- dev-java/sun-jdk-1.5.0.22 (masked by: dlj-1.1 license(s))<br />
For more information, see the MASKED PACKAGES section in the emerge<br />
man page or refer to the Gentoo Handbook.</p>
<p>!!! All ebuilds that could satisfy "dev-java/sun-jdk" have been masked.<br />
!!! One of the following masked packages is required to complete your request:<br />
- dev-java/sun-jdk-1.6.0.18-r1 (masked by: dlj-1.1 license(s), ~x86 keyword)<br />
A copy of the 'dlj-1.1' license is located at '/usr/portage/licenses/dlj-1.1'.</p>
<p>- dev-java/sun-jdk-1.6.0.18 (masked by: dlj-1.1 license(s), ~x86 keyword)<br />
- dev-java/sun-jdk-1.6.0.17 (masked by: dlj-1.1 license(s))<br />
- dev-java/sun-jdk-1.5.0.22 (masked by: dlj-1.1 license(s))</code></p></blockquote>
<p>Die L&#246;sung war das akzeptieren der Lizenz, wie bereits schon in der Meldung gesagt. Jedoch gibt es da verschiedene M&#246;glichkeiten:</p>
<ol>
<li>Systemweites akzeptieren aller Lizenzen:<br />F&#252;ge in der Datei <code>/etc/make.conf</code> die folgende Zeile hinzu:<br /><code>ACCEPT-LICENSE="*"<br />
</code></li>
<li>Systemweites akzeptieren einer oder mehrer spezifischer Lizenzen:<br />F&#252;ge in der Datei <code>/etc/make.conf</code> die folgende Zeile hinzu:<br /><code>ACCEPT_LICENSE="dlj-1.1</code></li>
<li>Akzeptieren einer Lizenz f&#252;r ein Paket:<br />F&#252;ge in der Datei <code>/etc/portage/package.license</code> die folgende Zeile hinzu:<br /><code>dev-java/sun-jdk dlj-1.1</code></li>
</ol>
<p>Ich habe mich f&#252;r letzteres entschieden:</p>
<blockquote><p><code>echo "dev-java/sun-jdk dlj-1.1" >> /etc/portage/package.license</code></p></blockquote>
<p>Und schon war das Problem gel&#246;st <img src='http://wolf-u.li/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<hr /><small><center>&copy; 2005-2009 by <a href='http://wolf-u.li/'>Uli Wolf</a> - This Content is distributed under the <a href='http://wolf-u.li/pwnd-faq/'>Creative Commons License</a><br /> This feed is for personal, non-commercial use only. <br /> The use of this feed on other websites without attribution to the author and notification of the author breaches copyright. If this content is not in your news reader, it makes the page you are viewing an infringement of the copyright. (Digital Fingerprint:  d2a576b5311479d89eff39b7ca886f6b)</center></small>]]></content:encoded>
			<wfw:commentRss>http://wolf-u.li/3352/all-ebuilds-that-could-satisfy-dev-javasun-jdk-have-been-masked-dlj-1-1-licenses/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>phphatesme mit neuem Design</title>
		<link>http://wolf-u.li/3350/phphatesme-mit-neuem-design/</link>
		<comments>http://wolf-u.li/3350/phphatesme-mit-neuem-design/#comments</comments>
		<pubDate>Mon, 22 Feb 2010 12:30:02 +0000</pubDate>
		<dc:creator>Uli</dc:creator>
				<category><![CDATA[Gedankenwirbel]]></category>
		<category><![CDATA[Fun]]></category>

		<guid isPermaLink="false">http://wolf-u.li/?p=3350</guid>
		<description><![CDATA[Der 500. Artikel ist auf phphatesme geschrieben worden, was diese mit einem neuen Design und einer Verlosung feiern. Einfach mal reinschauen, der Blog ist lesenswert!
&#169; 2005-2009 by Uli Wolf - This Content is distributed under the Creative Commons License This feed is for personal, non-commercial use only.  The use of this feed on other [...]]]></description>
			<content:encoded><![CDATA[<p>Der <a href="http://www.phphatesme.com/blog/allgemein/500-mal-phphatesme-wir-feiern/">500. Artikel</a> ist auf <a href="http://www.phphatesme.com/">phphatesme</a> geschrieben worden, was diese mit einem neuen Design und einer <a href="http://www.phphatesme.com/blog/allgemein/das-gewinnspiel-geht-los/">Verlosung</a> feiern. Einfach mal reinschauen, der Blog ist lesenswert!</p>
<hr /><small><center>&copy; 2005-2009 by <a href='http://wolf-u.li/'>Uli Wolf</a> - This Content is distributed under the <a href='http://wolf-u.li/pwnd-faq/'>Creative Commons License</a><br /> This feed is for personal, non-commercial use only. <br /> The use of this feed on other websites without attribution to the author and notification of the author breaches copyright. If this content is not in your news reader, it makes the page you are viewing an infringement of the copyright. (Digital Fingerprint:  d2a576b5311479d89eff39b7ca886f6b)</center></small>]]></content:encoded>
			<wfw:commentRss>http://wolf-u.li/3350/phphatesme-mit-neuem-design/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Auslieferung von Gravatar-Icons aus einem lokalen Cache &#8211; Download per curl</title>
		<link>http://wolf-u.li/3347/auslieferung-von-gravatar-icons-aus-einem-lokalen-cache-download-per-curl/</link>
		<comments>http://wolf-u.li/3347/auslieferung-von-gravatar-icons-aus-einem-lokalen-cache-download-per-curl/#comments</comments>
		<pubDate>Fri, 19 Feb 2010 10:25:17 +0000</pubDate>
		<dc:creator>Uli</dc:creator>
				<category><![CDATA[IT]]></category>
		<category><![CDATA[Blog]]></category>
		<category><![CDATA[Wordpress]]></category>

		<guid isPermaLink="false">http://wolf-u.li/?p=3347</guid>
		<description><![CDATA[Vor einigen Tagen bin ich &#252;ber Crazytoast auf einem Blog auf die Idee der Auslieferung der Gravatar-Bilder aus einem lokalen Cache gesto&#223;en. Prinzipiell fand ich das keine schlechte Idee, da auch bei mir einige Ladezeit von Gravatar verursacht wird. Auch der regelm&#228;&#223;ige Refresh erschien mir als durchaus sinnvoll. Lediglich die Art der Einbindung wollte mir [...]]]></description>
			<content:encoded><![CDATA[<p>Vor einigen Tagen bin ich &#252;ber <a href="http://www.crazytoast.de/2010/02/bloggen/gravatar-cache-fuer-wordpress-ohne-plugin.html">Crazytoast</a> auf einem <a href="http://www.plerzelwupp.de/wordpress-gravatare-cachen/">Blog</a> auf die Idee der Auslieferung der Gravatar-Bilder aus einem lokalen Cache gesto&#223;en. Prinzipiell fand ich das keine schlechte Idee, da auch bei mir einige Ladezeit von Gravatar verursacht wird. Auch der regelm&#228;&#223;ige Refresh erschien mir als durchaus sinnvoll. Lediglich die Art der Einbindung wollte mir noch nicht so recht gefallen. Auch programmiertechnisch fehlten mir einige Dinge.<br />
<span id="more-3347"></span><br />
So wurde beispielsweise als einzige M&#246;glichkeit des Herunterladen der Bilder die Funktion <em>fopen()</em> angeboten, welche jedoch bei den meisten Hostern deaktiviert (<em>allow_url_fopen=0</em>) wird, da es durchaus gen&#252;gend Beispiele f&#252;r Sicherheitsl&#252;cken welche durch die unkluge Nutzung dieser Funktion gibt. Aus <a href="http://dev.piwik.org/trac/ticket/793">meinem</a> <a href="http://wolf-u.li/3141/piwik-0-4-3-ist-erschienen/">Patch</a> f&#252;r Piwik habe ich daher einen Teil des Codes extrahiert, welcher es mir erlaubt, <em>curl</em> zu benutzen.</p>
<p>Wie bei Plerzelwupp beschrieben muss man zun&#228;chst die comments.php &#246;ffnen und die folgende Zeile suchen:</p>
<div class="igBar"><span id="lcode-42"><a href="#" onclick="javascript:showPlainTxt('code-42'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">CODE:</span>
<div id="code-42">
<div class="code">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&lt;?php echo get_avatar<span style="color:#006600; font-weight:bold;">&#40;</span> $comment, <span style="color:#800000;color:#800000;">60</span><span style="color:#006600; font-weight:bold;">&#41;</span>; ?&gt; </div>
</li>
</ol>
</div>
</div>
</div>
<p>
Das zweite Argument der Gr&#246;&#223;e k&#246;nnte bei euch auch durchaus anders aussehen!</p>
<p>Wie auch immer, man l&#246;scht jedenfalls diese Zeile und setzt daf&#252;r den folgenden Code ein:</p>
<div class="igBar"><span id="lcode-43"><a href="#" onclick="javascript:showPlainTxt('code-43'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">CODE:</span>
<div id="code-43">
<div class="code">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&lt;?php</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#FF9933; font-style:italic;">// Script originally from:</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#FF9933; font-style:italic;">// http://www.plerzelwupp.de/wordpress-gravatare-cachen/</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#FF9933; font-style:italic;">//</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#FF9933; font-style:italic;">// Modified by Uli from http://wolf-u.li:</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#FF9933; font-style:italic;">// - Translation</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#FF9933; font-style:italic;">// - Cleanup</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#FF9933; font-style:italic;">// - Added curl</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#FF9933; font-style:italic;">// Modify the settings below according to your needs:</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#FF9933; font-style:italic;">// Path to the cache-directory of the gravatar images:</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">$gimagecachedir &nbsp; &nbsp; &nbsp; &nbsp; = <span style="color:#CC0000;">"upload/g/"</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#FF9933; font-style:italic;">// Path of the directory of the gravatar-images:</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">$gimageurldomain = <span style="color:#CC0000;">"http://wolf-u.li/upload/g/"</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#FF9933; font-style:italic;">// Size of the gravatar-images:</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">$gimagesize = <span style="color:#800000;color:#800000;">64</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#FF9933; font-style:italic;">// If the mailadress was not found, you can get various images:</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#FF9933; font-style:italic;">// - identicon</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#FF9933; font-style:italic;">// - monsterid</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#FF9933; font-style:italic;">// - wavatar</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">$mailnotfound = <span style="color:#CC0000;">"identicon"</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#FF9933; font-style:italic;">// Do not modify the code below:</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">$gravatar_hash = md5<span style="color:#006600; font-weight:bold;">&#40;</span>strtolower<span style="color:#006600; font-weight:bold;">&#40;</span>get_comment_author_email<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">&#41;</span><span style="color:#006600; font-weight:bold;">&#41;</span><span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">$gcachetime = <span style="color:#800000;color:#800000;">40320</span> * <span style="color:#800000;color:#800000;">60</span>; <span style="color:#FF9933; font-style:italic;">// 40320 = 4 Weeks</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">$gimage = $gimagecachedir . <span style="color:#CC0000;">"/"</span> . $gravatar_hash . <span style="color:#CC0000;">".png"</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">if <span style="color:#006600; font-weight:bold;">&#40;</span>!file_exists<span style="color:#006600; font-weight:bold;">&#40;</span>$gimage<span style="color:#006600; font-weight:bold;">&#41;</span> || <span style="color:#006600; font-weight:bold;">&#40;</span>time<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">&#41;</span> - $gcachetime&gt; filemtime<span style="color:#006600; font-weight:bold;">&#40;</span>$gimage<span style="color:#006600; font-weight:bold;">&#41;</span><span style="color:#006600; font-weight:bold;">&#41;</span><span style="color:#006600; font-weight:bold;">&#41;</span> <span style="color:#006600; font-weight:bold;">&#123;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; ob_start<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; $grav_img = <span style="color:#CC0000;">"http://www.gravatar.com/avatar/"</span> . $gravatar_hash . <span style="color:#CC0000;">"?s="</span> . $gimagesize . <span style="color:#CC0000;">"&amp;d="</span> . $mailnotfound . <span style="color:#CC0000;">"&amp;r=G"</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; </div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; if<span style="color:#006600; font-weight:bold;">&#40;</span>extension_loaded<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#CC0000;">'curl'</span><span style="color:#006600; font-weight:bold;">&#41;</span><span style="color:#006600; font-weight:bold;">&#41;</span> <span style="color:#006600; font-weight:bold;">&#123;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; $gch = @curl_init<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; $gcurl_options = array<span style="color:#006600; font-weight:bold;">&#40;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; CURLOPT_URL =&gt; $grav_img,</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; CURLOPT_HEADER =&gt; false,</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; CURLOPT_RETURNTRANSFER =&gt; true,</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; CURLOPT_TIMEOUT =&gt; <span style="color:#800000;color:#800000;">20</span>,</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; CURLOPT_BINARYTRANSFER =&gt; is_resource<span style="color:#006600; font-weight:bold;">&#40;</span>$file<span style="color:#006600; font-weight:bold;">&#41;</span>,</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; CURLOPT_FOLLOWLOCATION =&gt; true,</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; CURLOPT_MAXREDIRS =&gt; <span style="color:#800000;color:#800000;">2</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; @curl_setopt_array<span style="color:#006600; font-weight:bold;">&#40;</span>$gch, $gcurl_options<span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; $gdata = @curl_exec<span style="color:#006600; font-weight:bold;">&#40;</span>$gch<span style="color:#006600; font-weight:bold;">&#41;</span>;&nbsp; &nbsp; </div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; @curl_close <span style="color:#006600; font-weight:bold;">&#40;</span>$gch<span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; unset<span style="color:#006600; font-weight:bold;">&#40;</span>$gch<span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color:#006600; font-weight:bold;">&#125;</span> else <span style="color:#006600; font-weight:bold;">&#123;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; ob_start<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; $gfilehandle_url = fopen<span style="color:#006600; font-weight:bold;">&#40;</span>$grav_img, <span style="color:#CC0000;">"rb"</span><span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; fpassthru<span style="color:#006600; font-weight:bold;">&#40;</span>$gfilehandle_url<span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; fclose<span style="color:#006600; font-weight:bold;">&#40;</span>$gfilehandle_url<span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; $gdata = ob_get_contents<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; ob_end_clean<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; unset<span style="color:#006600; font-weight:bold;">&#40;</span>$gfilehandle_url<span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color:#006600; font-weight:bold;">&#125;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; $gfilehandle_img = fopen<span style="color:#006600; font-weight:bold;">&#40;</span>$gimage, <span style="color:#CC0000;">"wb+"</span><span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; fwrite<span style="color:#006600; font-weight:bold;">&#40;</span>$gfilehandle_img, $gdata<span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; fclose<span style="color:#006600; font-weight:bold;">&#40;</span>$gfilehandle_img<span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; unset<span style="color:#006600; font-weight:bold;">&#40;</span>$gfilehandle_img<span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; unset<span style="color:#006600; font-weight:bold;">&#40;</span>$gdata<span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#006600; font-weight:bold;">&#125;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">echo <span style="color:#CC0000;">"&lt;img src='"</span> . $gimageurldomain . $gravatar_hash . <span style="color:#CC0000;">".png' height='"</span> . $gimagesize . <span style="color:#CC0000;">"' width='"</span> . $gimagesize . <span style="color:#CC0000;">"'&gt;"</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">?&gt; </div>
</li>
</ol>
</div>
</div>
</div>
<p>
&#220;ber die Einstellungen im Kopf des Codes kann man nun das Cacheverzeichnis festlegen. Die darauffolgende URL ist die URL, so wie sie zum Bild zeigen w&#252;rde. Darunter befindet sich die Gr&#246;&#223;e.</p>
<p>Die konkreten &#196;nderungen gegen&#252;ber der Version des Blogs:</p>
<ul>
<li>&#220;bersetzung des Codes auf Englisch (sorry, ich steh da drauf)</li>
<li>Cleanup, Entfernung &#252;berfl&#252;ssiger Codest&#252;cke</li>
<li>Einbau von Curl als pr&#228;ferierte Downloadoption</li>
<li>Entfernung der Erstellung von HTML-Dateien, da dies nicht ben&#246;tigt wird</li>
</ul>
<p>Soweit so gut. Nun habe ich noch das CronJob-Script von <a href="http://infoblog.li/wordpress-gravatar-cache-mit-automatischer-aktualisierung/">diesem Blogeintrag auf infoblog.li</a> kurz aufger&#228;umt:</p>
<div class="igBar"><span id="lcode-44"><a href="#" onclick="javascript:showPlainTxt('code-44'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">CODE:</span>
<div id="code-44">
<div class="code">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&lt;?php </div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#FF9933; font-style:italic;">// Script originally from:</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#FF9933; font-style:italic;">// http://infoblog.li/wordpress-gravatar-cache-mit-automatischer-aktualisierung/</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#FF9933; font-style:italic;">//</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#FF9933; font-style:italic;">// Modified by Uli from http://wolf-u.li:</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#FF9933; font-style:italic;">// - Translation</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#FF9933; font-style:italic;">// - Cleanup</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#FF9933; font-style:italic;">// - Added curl</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#FF9933; font-style:italic;">// Modify the settings below according to your needs:</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#FF9933; font-style:italic;">// Path to the cache-directory of the gravatar images:</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">$imagecachedir &nbsp;&nbsp;= <span style="color:#CC0000;">"blog/cdn-g/"</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#FF9933; font-style:italic;">// Size of the gravatar-images:</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">$imagesize = <span style="color:#800000;color:#800000;">64</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#FF9933; font-style:italic;">// Update files older than this time:</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">$maxcacheage = <span style="color:#800000;color:#800000;">604800</span>; <span style="color:#FF9933; font-style:italic;">// 7 * 24 * 3600 = 7 Days</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#FF9933; font-style:italic;">// If the mailadress was not found, you can get various images:</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#FF9933; font-style:italic;">// - identicon</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#FF9933; font-style:italic;">// - monsterid</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#FF9933; font-style:italic;">// - wavatar</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">$mailnotfound = <span style="color:#CC0000;">"identicon"</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#FF9933; font-style:italic;">// Do not modify the code below:</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">$handle= opendir<span style="color:#006600; font-weight:bold;">&#40;</span>$imagecachedir<span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">while <span style="color:#006600; font-weight:bold;">&#40;</span>$file = readdir <span style="color:#006600; font-weight:bold;">&#40;</span>$handle<span style="color:#006600; font-weight:bold;">&#41;</span><span style="color:#006600; font-weight:bold;">&#41;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#006600; font-weight:bold;">&#123;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color:#FF9933; font-style:italic;">// Einzelne Pfade und Dateinamen auslesen</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; $gravatar_hash&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; =&nbsp; &nbsp;substr<span style="color:#006600; font-weight:bold;">&#40;</span>$file, <span style="color:#800000;color:#800000;">0</span>, <span style="color:#800000;color:#800000;">32</span><span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; $gravatarimg&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; = &nbsp; $imagecachedir . $file ;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; if <span style="color:#006600; font-weight:bold;">&#40;</span>$gravatar_hash != <span style="color:#CC0000;">".."</span> &amp;&amp; $gravatar_hash != <span style="color:#CC0000;">"."</span><span style="color:#006600; font-weight:bold;">&#41;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color:#006600; font-weight:bold;">&#123;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#FF9933; font-style:italic;">// Update only if timestamp of the file is older than $maxcacheage</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; $cachedtime = filemtime<span style="color:#006600; font-weight:bold;">&#40;</span>$gravatarimg<span style="color:#006600; font-weight:bold;">&#41;</span> - time<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; if <span style="color:#006600; font-weight:bold;">&#40;</span>$cachedtime&gt; $maxcacheage<span style="color:#006600; font-weight:bold;">&#41;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#006600; font-weight:bold;">&#123;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $grav_img = <span style="color:#CC0000;">"http://www.gravatar.com/avatar/"</span>.$gravatar_hash.<span style="color:#CC0000;">"?s="</span> . $imagesize . <span style="color:#CC0000;">"&amp;d="</span> . $mailnotfound . <span style="color:#CC0000;">"&amp;r=G"</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; if<span style="color:#006600; font-weight:bold;">&#40;</span>extension_loaded<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#CC0000;">'curl'</span><span style="color:#006600; font-weight:bold;">&#41;</span><span style="color:#006600; font-weight:bold;">&#41;</span> <span style="color:#006600; font-weight:bold;">&#123;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; &nbsp; &nbsp;$ch = @curl_init<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $curl_options = array<span style="color:#006600; font-weight:bold;">&#40;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; CURLOPT_URL =&gt; $grav_img,</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; CURLOPT_HEADER =&gt; false,</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; CURLOPT_RETURNTRANSFER =&gt; true,</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; CURLOPT_TIMEOUT =&gt; <span style="color:#800000;color:#800000;">20</span>,</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; CURLOPT_BINARYTRANSFER =&gt; true,</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; CURLOPT_FOLLOWLOCATION =&gt; true,</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; CURLOPT_MAXREDIRS =&gt; <span style="color:#800000;color:#800000;">2</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; @curl_setopt_array<span style="color:#006600; font-weight:bold;">&#40;</span>$ch, $curl_options<span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; </div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $data = @curl_exec<span style="color:#006600; font-weight:bold;">&#40;</span>$ch<span style="color:#006600; font-weight:bold;">&#41;</span>;&nbsp; &nbsp; </div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; @curl_close <span style="color:#006600; font-weight:bold;">&#40;</span>$ch<span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; unset<span style="color:#006600; font-weight:bold;">&#40;</span>$ch<span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#006600; font-weight:bold;">&#125;</span> else <span style="color:#006600; font-weight:bold;">&#123;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; &nbsp; &nbsp;ob_start<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; &nbsp; &nbsp;$filehandle_url = fopen<span style="color:#006600; font-weight:bold;">&#40;</span>$grav_img, <span style="color:#CC0000;">"rb"</span><span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; &nbsp; &nbsp;fpassthru<span style="color:#006600; font-weight:bold;">&#40;</span>$filehandle_url<span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; &nbsp; &nbsp;fclose<span style="color:#006600; font-weight:bold;">&#40;</span>$filehandle_url<span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; &nbsp; &nbsp;$data = ob_get_contents<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; &nbsp; &nbsp;ob_end_clean<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; &nbsp; &nbsp;unset<span style="color:#006600; font-weight:bold;">&#40;</span>$filehandle_url<span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; <span style="color:#006600; font-weight:bold;">&#125;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; $filehandle_img = fopen<span style="color:#006600; font-weight:bold;">&#40;</span>$gravatarimg, <span style="color:#CC0000;">"wb+"</span><span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; fwrite<span style="color:#006600; font-weight:bold;">&#40;</span>$filehandle_img, $data<span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; fclose<span style="color:#006600; font-weight:bold;">&#40;</span>$filehandle_img<span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; unset<span style="color:#006600; font-weight:bold;">&#40;</span>$filehandle_img<span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; unset<span style="color:#006600; font-weight:bold;">&#40;</span>$data<span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#006600; font-weight:bold;">&#125;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color:#006600; font-weight:bold;">&#125;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#006600; font-weight:bold;">&#125;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">closedir<span style="color:#006600; font-weight:bold;">&#40;</span>$handle<span style="color:#006600; font-weight:bold;">&#41;</span>; </div>
</li>
</ol>
</div>
</div>
</div>
<p>
Was macht dieses Script? Es aktualisiert alle 7 Tage die Gravatars, die bereits im Cache liegen. Auch dieses Script wurde auf curl umgestellt und ein bisschen aufger&#228;umt. Ich rate dazu, das Script wenigstens alle Stunde einmal ausf&#252;hren zu lassen, um die Anzahl der gleichzeitig zu aktualisierenden Gravatare so gering wie m&#246;glich zu halten. Dies kann entweder per lokalem CronJob, oder einem CronJob-Dienst aus dem Internet wie beispielsweise <a href="http://www.cronjob.de/">cronjob.de</a> ausgef&#252;hrt werden (<a href="http://infoblog.li/script-mit-hilfe-von-cronjob-de-automatisch-ausfuehren-lassen/">HowTo f&#252;r letzteren Fall</a>).</p>
<p>Meine letzten Hinweise zur Performance: Man sollte sich im klaren sein, dass bei gr&#246;&#223;eren Kommentaranzahlen (sagen wir mal 300) auch bei jedem Kommentar gepr&#252;ft wird, ob die Datei vorhanden ist (d.h. 300 Dateisystemaufrufe). Das kann definitiv bremsen.</p>
<p>Daher habe ich mir eine andere Methode der Auslieferung &#252;berlegt, welche ich in einem weiteren Artikel beschreiben werde.</p>
<hr /><small><center>&copy; 2005-2009 by <a href='http://wolf-u.li/'>Uli Wolf</a> - This Content is distributed under the <a href='http://wolf-u.li/pwnd-faq/'>Creative Commons License</a><br /> This feed is for personal, non-commercial use only. <br /> The use of this feed on other websites without attribution to the author and notification of the author breaches copyright. If this content is not in your news reader, it makes the page you are viewing an infringement of the copyright. (Digital Fingerprint:  d2a576b5311479d89eff39b7ca886f6b)</center></small>]]></content:encoded>
			<wfw:commentRss>http://wolf-u.li/3347/auslieferung-von-gravatar-icons-aus-einem-lokalen-cache-download-per-curl/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>Crash von fdisk unter busybox mit Fehler &#8220;Segmentation fault&#8221;</title>
		<link>http://wolf-u.li/3346/crash-von-fdisk-unter-busybox-mit-fehler-segmentation-fault/</link>
		<comments>http://wolf-u.li/3346/crash-von-fdisk-unter-busybox-mit-fehler-segmentation-fault/#comments</comments>
		<pubDate>Tue, 16 Feb 2010 16:27:57 +0000</pubDate>
		<dc:creator>Uli</dc:creator>
				<category><![CDATA[IT]]></category>
		<category><![CDATA[Befehl]]></category>
		<category><![CDATA[Fehler]]></category>
		<category><![CDATA[fun_plug]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Lösung]]></category>

		<guid isPermaLink="false">http://wolf-u.li/?p=3346</guid>
		<description><![CDATA[Seit langer Zeit melden sich immer wieder Leser bei mir, dass bei ihnen bei bestimmten USB-Sticks das Programm fdisk mit der Meldung, dass es auf einen "Segmentation fault" gesto&#223;en sei, abgest&#252;rzt sei.
Anscheinend ist dies ein Bug des Input-Handlings, weshalb mir ein Leser den folgenden Weg f&#252;r den Aufruf von fdisk schickte:
cat &#124; fdisk /dev/sdc
So bescheuert [...]]]></description>
			<content:encoded><![CDATA[<p>Seit langer Zeit melden sich immer wieder Leser bei mir, dass bei ihnen bei bestimmten USB-Sticks das Programm fdisk mit der Meldung, dass es auf einen "Segmentation fault" gesto&#223;en sei, abgest&#252;rzt sei.</p>
<p>Anscheinend ist dies ein Bug des Input-Handlings, weshalb mir ein Leser den folgenden Weg f&#252;r den Aufruf von fdisk schickte:</p>
<blockquote><p><code>cat | fdisk /dev/sdc</code></p></blockquote>
<p>So bescheuert wie dieser Aufruf aussieht, er behebt den Fehler interessanterweise.</p>
<p>Danke an Martin K.!</p>
<hr /><small><center>&copy; 2005-2009 by <a href='http://wolf-u.li/'>Uli Wolf</a> - This Content is distributed under the <a href='http://wolf-u.li/pwnd-faq/'>Creative Commons License</a><br /> This feed is for personal, non-commercial use only. <br /> The use of this feed on other websites without attribution to the author and notification of the author breaches copyright. If this content is not in your news reader, it makes the page you are viewing an infringement of the copyright. (Digital Fingerprint:  d2a576b5311479d89eff39b7ca886f6b)</center></small>]]></content:encoded>
			<wfw:commentRss>http://wolf-u.li/3346/crash-von-fdisk-unter-busybox-mit-fehler-segmentation-fault/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

<!-- Dynamic page generated in 1.587 seconds. -->
<!-- Cached page generated by WP-Super-Cache on 2010-03-13 19:04:45 -->
