<?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>Thomas Gericke &#187; programming</title>
	<atom:link href="http://www.thomasgericke.de/v4/interactive/blog/tag/programming/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.thomasgericke.de/v4/interactive/blog</link>
	<description>Facts. Thoughts. Stories. A Blog.</description>
	<lastBuildDate>Wed, 08 Feb 2012 11:43:25 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>unfake.it About To Block bit.ly And Others</title>
		<link>http://www.thomasgericke.de/v4/interactive/blog/2010/08/unfake-it-about-to-block-bit-ly-and-others/</link>
		<comments>http://www.thomasgericke.de/v4/interactive/blog/2010/08/unfake-it-about-to-block-bit-ly-and-others/#comments</comments>
		<pubDate>Wed, 25 Aug 2010 07:00:05 +0000</pubDate>
		<dc:creator>Thomas</dc:creator>
				<category><![CDATA[tech]]></category>
		<category><![CDATA[API]]></category>
		<category><![CDATA[internet]]></category>
		<category><![CDATA[programming]]></category>
		<category><![CDATA[unfake]]></category>
		<category><![CDATA[url shortening]]></category>

		<guid isPermaLink="false">http://www.thomasgericke.de/v4/interactive/blog/?p=8172</guid>
		<description><![CDATA[Due to excessive spam abuse, unfake.it will soon begin  [...]]]></description>
			<content:encoded><![CDATA[<p>Due to excessive spam abuse, <code>unfake.it</code> will soon begin to block URLs from various other URL shortening services such as <a href="http://www.thomasgericke.de/v4/interactive/blog/go.php?http://bit.ly/" target="_blank" title="(122 hits)">http://bit.ly/</a>. All incoming URLs (no matter if they&#8217;re injected via web or API) from blacklisted domains won&#8217;t be shortened any longer as of the effective date.</p>
<p style="text-align: center;"><strong>Effective date is: 2010-08-26 6pm UTC</strong></p>
<p>Reasons ain&#8217;t to harm other shortening services, but to reduce spam. It&#8217;s a common practice of spammers to shorten and shorten and shorten their URLs through more and more shortening services. <code>unfake.it</code> won&#8217;t support such habits any longer.</p>
<p>If you intend to shorten formerly shortened URLs again and have the feeling that it&#8217;s okay, get in touch with me. We&#8217;ll find a way! Maybe by using an API key.</p>
<p>I feel sorry for all those 42.000+ short URLs, but there ain&#8217;t no other way to prevent further spamming. Already shortened URLs will remain valid, so they might still be accessed in the future.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.thomasgericke.de/v4/interactive/blog/2010/08/unfake-it-about-to-block-bit-ly-and-others/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>unfake.it ist Platz 1 von über 19 Millionen! Sponsoren interessiert?</title>
		<link>http://www.thomasgericke.de/v4/interactive/blog/2010/08/unfake-it-ist-platz-1-von-uber-19-millionen-sponsoren-interessiert/</link>
		<comments>http://www.thomasgericke.de/v4/interactive/blog/2010/08/unfake-it-ist-platz-1-von-uber-19-millionen-sponsoren-interessiert/#comments</comments>
		<pubDate>Thu, 12 Aug 2010 22:37:55 +0000</pubDate>
		<dc:creator>Thomas</dc:creator>
				<category><![CDATA[daily life]]></category>
		<category><![CDATA[tech]]></category>
		<category><![CDATA[API]]></category>
		<category><![CDATA[Google]]></category>
		<category><![CDATA[html]]></category>
		<category><![CDATA[internet]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[programming]]></category>
		<category><![CDATA[sponsoring]]></category>
		<category><![CDATA[unfake]]></category>
		<category><![CDATA[unfake plugin]]></category>
		<category><![CDATA[url shortening]]></category>

		<guid isPermaLink="false">http://www.thomasgericke.de/v4/interactive/blog/?p=7262</guid>
		<description><![CDATA[Ich wundere mich seit Tagen über extrem angestiegenen  [...]]]></description>
			<content:encoded><![CDATA[<p>Ich wundere mich seit Tagen über extrem angestiegenen Traffic für meinen URL Shortener <a href="http://www.thomasgericke.de/v4/interactive/blog/go.php?http://unfake.it/" target="_blank" title="(709 hits)">unfake.it</a>. Des Rätsels Lösung ist wohl sehr einfach: eine <a href="http://www.thomasgericke.de/v4/interactive/blog/go.php?http://www.google.de/search?q=url+faker" target="_blank" title="(109 hits)">Google-Suche nach &#8220;url faker&#8221;</a> liefert 19.400.000 Ergebnisse. Und unfake.it ist auf Platz 1 inkl. Mini-Sitelinks, Platz 2 ist mein <a href="http://www.thomasgericke.de/v4/interactive/blog/go.php?http://www.thomasgericke.de/v4/interactive/blog/2009/01/url-shortener-unfaker/" target="_blank" title="(140 hits)">Blog-Artikel über unfake.it</a> vom 25. Januar 2009. Das ist ziemlich neu, da bin ich mir relativ sicher.</p>
<p>Da wundert mich nichts mehr. Leider, leider gerät das System aber so langsam aber Sicher an die Lastgrenzen und ich muss mir überlegen, ob ich nicht doch eine meiner Regeln breche, denn ich hatte ursprünglich beschlossen und kommuniziert, dass unfake.it <a href="http://www.thomasgericke.de/v4/interactive/blog/go.php?http://unfake.it/help.php#commercials" target="_blank" title="(296 hits)">niemals Werbung vor oder nach dem Klicken einer Kurz-URL anzeigen wird</a>.</p>
<p><strong>Was meint ihr?</strong> Sollte ich Werbung schalten und so ggf. neue, schnellere Hardware finanzieren? Oder findet sich ggf. irgendwo ein freundlicher <strong>Sponsor</strong>? Bin gerne bereit, darüber zu verhandeln <img src='http://www.thomasgericke.de/v4/interactive/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://www.thomasgericke.de/v4/interactive/blog/2010/08/unfake-it-ist-platz-1-von-uber-19-millionen-sponsoren-interessiert/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Shorten your URLs using unfake.it with TweetDeck</title>
		<link>http://www.thomasgericke.de/v4/interactive/blog/2010/08/shorten-your-urls-using-unfake-it-with-tweetdeck/</link>
		<comments>http://www.thomasgericke.de/v4/interactive/blog/2010/08/shorten-your-urls-using-unfake-it-with-tweetdeck/#comments</comments>
		<pubDate>Wed, 11 Aug 2010 06:00:32 +0000</pubDate>
		<dc:creator>Thomas</dc:creator>
				<category><![CDATA[tech]]></category>
		<category><![CDATA[howto]]></category>
		<category><![CDATA[internet]]></category>
		<category><![CDATA[programming]]></category>
		<category><![CDATA[tweetdeck]]></category>
		<category><![CDATA[twitter]]></category>
		<category><![CDATA[unfake]]></category>
		<category><![CDATA[url shortening]]></category>

		<guid isPermaLink="false">http://www.thomasgericke.de/v4/interactive/blog/?p=7132</guid>
		<description><![CDATA[You may shorten URLs using unfake.it URL Shortener righ [...]]]></description>
			<content:encoded><![CDATA[<p>You may shorten URLs using <a href="http://www.thomasgericke.de/v4/interactive/blog/go.php?http://unfake.it/" target="_blank" title="(709 hits)">unfake.it</a> URL Shortener right inside your TweetDeck application. This is how to do so:</p>
<ol>
<li>Open TweetDeck&#8217;s <em><strong>preferences</strong></em></li>
<li>Choose <em><strong>Services</strong></em></li>
<li>Switch URL shortening service (usually bit.ly) to <em><strong>Other</strong></em></li>
<li>Type <code><strong>http://unfake.it/?a=api&amp;url=%@</strong></code> in the field beside that pulldown menu</li>
<li>Hit <em><strong>Save Settings</strong></em></li>
<li>Enjoy!</li>
</ol>
<p>Long URLs, typed into TweetDeck&#8217;s &#8220;<em>What&#8217;s happening?</em>&#8221; box, will now be shortened immediately using <a href="http://www.thomasgericke.de/v4/interactive/blog/go.php?http://unfake.it/" target="_blank" title="(709 hits)">unfake.it</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.thomasgericke.de/v4/interactive/blog/2010/08/shorten-your-urls-using-unfake-it-with-tweetdeck/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>HOWTO: SpamAssassins sa-learn von IMAP Mailboxen lernen lassen</title>
		<link>http://www.thomasgericke.de/v4/interactive/blog/2010/07/howto-spamassassins-sa-learn-von-imap-mailboxen-lernen-lassen/</link>
		<comments>http://www.thomasgericke.de/v4/interactive/blog/2010/07/howto-spamassassins-sa-learn-von-imap-mailboxen-lernen-lassen/#comments</comments>
		<pubDate>Wed, 07 Jul 2010 07:15:59 +0000</pubDate>
		<dc:creator>Thomas</dc:creator>
				<category><![CDATA[personal]]></category>
		<category><![CDATA[tech]]></category>
		<category><![CDATA[e-mail]]></category>
		<category><![CDATA[howto]]></category>
		<category><![CDATA[imap]]></category>
		<category><![CDATA[internet]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[perl]]></category>
		<category><![CDATA[programming]]></category>
		<category><![CDATA[sa-learn]]></category>
		<category><![CDATA[spam]]></category>
		<category><![CDATA[spamassassin]]></category>

		<guid isPermaLink="false">http://www.thomasgericke.de/v4/interactive/blog/?p=5732</guid>
		<description><![CDATA[Seit wohl mehr als zwei Jahren wundere ich mich hin und [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.thomasgericke.de/v4/interactive/blog/go.php?http://spamassassin.apache.org/" title="(52 hits)"><img class="alignleft size-full wp-image-5752" title="arrowlogo" src="http://www.thomasgericke.de/v4/interactive/blog/wp-content/uploads/2010/07/arrowlogo.png" alt="" width="334" height="148" /></a>Seit wohl mehr als zwei Jahren wundere ich mich hin und wieder, weshalb mein <a href="http://www.thomasgericke.de/v4/interactive/blog/go.php?http://spamassassin.apache.org/" target="_blank" title="(52 hits)">SpamAssassin</a> bei der Beurteilung, ob es sich bei einer eintreffenden E-Mail um Spam oder nicht handelt, nicht langsam mal ein wenig cleverer wird. Nutze ich doch schliesslich <code>sa-learn</code> und verfüttere ihm gesammelte Spam-E-Mails, damit deren Signaturen erkannt und zukünftig nicht mehr durchgelassen werden. Irgendwie wurde es aber nie besser. Gefühlt kam immer mehr Spam durch. Aber das Thema war auch nicht so wichtig, dass ich es mit Nachdruck verfolgt hätte. Bis vor ein paar Tagen.</p>
<p>Ich habe auf meinem Server eine Konfiguration mit Exim4, SpamAssassin (<code>sa-exim</code>) und Cyrus als IMAP-Server. Der Server ist MX für einige Domains und überprüft eingehende E-Mails bereits während und nach den SMTP-Headern nach verschiedenen Methoden auf Spam. Sicher als Spam eingestufte E-Mails werden nicht angenommen, E-Mails, bei denen es nicht so klar ist (mittlerer Spam-Score), landen in einem Quarantäne-Ordner und werden hin und wieder begutachtet.</p>
<p>Kürzlich bin ich hinter das Rätsel gekommen, weshalb das Erlernen neuer Spam-Signaturen nicht funktioniert hat: <span id="more-5732"></span>Spam-E-Mails in diesem Quarantäne-Ordner werden von mir von Zeit zu Zeit in einen Spam-Ordner verschoben oder gelöscht. Nun bringt SpamAssassin ja die nette Funktion mit sich, dass man ihn <a href="http://www.thomasgericke.de/v4/interactive/blog/go.php?http://de.wikipedia.org/wiki/Spam" target="_blank" title="(40 hits)">Spam</a> oder <a href="http://www.thomasgericke.de/v4/interactive/blog/go.php?http://en.wikipedia.org/wiki/Anti-spam_techniques#Checking_words:_false_positives" target="_blank" title="(51 hits)">Ham</a> <em>&#8220;lernen&#8221;</em> lassen kann. Da ich auf meinem Server allerdings IMAP verwende, die mitgelieferte Version von <code>sa-learn</code> nur Folder im mbox-Format lesen kann, wurde also zwei Jahre lang ein Ordner indiziert, welcher zwar (warum auch immer, vermutlich Altlast aus der Zeit vor IMAP) vorhanden war, allerdings keineswegs mit den Spam-Mails gefüttert wurde. Gna, so simpel&#8230;</p>
<p>Also habe ich neulich nach einer (einfachen) Methode gesucht, um dem SpamAssassin direkt meinen IMAP-Spam-Folder lesen und auswerten zu lassen. Und siehe da, <a href="http://www.thomasgericke.de/v4/interactive/blog/go.php?http://www.sonologic.nl/pub/Projects/ImapSaLearn/imap-sa-learn.pl.txt" target="_blank" title="(179 hits)">auf dieser Seite</a> wurde ich mit folgendem Script fündig:</p>
<p>
<pre class="brush: php">#!/usr/bin/perl&lt;br /&gt;
#&lt;br /&gt;
# imap-sa-learn.pl, wrapper around sa-learn for imap mail boxes&lt;br /&gt;
# Copyright (C) 2004  David M. Zendzian&lt;br /&gt;
# Copyright (C) 2006  Koen Martens&lt;br /&gt;
#&lt;br /&gt;
# This library is free software; you can redistribute it and/or&lt;br /&gt;
# modify it under the terms of the GNU Lesser General Public&lt;br /&gt;
# License as published by the Free Software Foundation; either&lt;br /&gt;
# version 2.1 of the License, or (at your option) any later version.&lt;br /&gt;
#&lt;br /&gt;
# This library is distributed in the hope that it will be useful,&lt;br /&gt;
# but WITHOUT ANY WARRANTY; without even the implied warranty of&lt;br /&gt;
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU&lt;br /&gt;
# Lesser General Public License for more details.&lt;br /&gt;
#&lt;br /&gt;
# You should have received a copy of the GNU Lesser General Public&lt;br /&gt;
# License along with this library; if not, write to the Free Software&lt;br /&gt;
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA&lt;br /&gt;
#&lt;br /&gt;
# Feed mail from an imap mail folder to sa-learn. Options:&lt;br /&gt;
#&lt;br /&gt;
#&lt;br /&gt;
# Derived from: http://www.dmzs.com/tools/files/spam.phtml&lt;br /&gt;
# Derived by  : Koen Martens,&lt;br /&gt;
# Derived on  : October, 13th (Friday), 2006&lt;br /&gt;
# License     : LGPL&lt;br /&gt;
#&lt;br /&gt;
# Things to try if it doesn&#039;t work&lt;br /&gt;
# 1) Use -v for verbose output&lt;br /&gt;
# 2) Check your local.cf for spamassassin bayes_path settings.&lt;br /&gt;
#&lt;br /&gt;
# Also be sure to check that your spamassassin is truely using the&lt;br /&gt;
# bayes files (-D manual startup of spamd to debug there)&lt;br /&gt;
#&lt;br /&gt;
# Modified by ZMI 20090519 ( michael.monnerie@is.it-management.at )&lt;br /&gt;
#&lt;/p&gt;
&lt;p&gt;use Mail::IMAPClient;&lt;br /&gt;
use Getopt::Long;&lt;/p&gt;
&lt;p&gt;sub usage {&lt;br /&gt;
$rv = &amp;quot;--host name         Host name\n&amp;quot;;&lt;br /&gt;
$rv = &amp;quot;-p 1234             Port number\n&amp;quot;;&lt;br /&gt;
$rv = &amp;quot;--port=1234         Port number\n&amp;quot;;&lt;br /&gt;
$rv.= &amp;quot;--spam              Classify messages as spam\n&amp;quot;;&lt;br /&gt;
$rv.= &amp;quot;--ham               Classify messages as ham\n&amp;quot;;&lt;br /&gt;
$rv.= &amp;quot;-m name             Set mailbox name\n&amp;quot;;&lt;br /&gt;
$rv.= &amp;quot;-mbox name          Set mailbox name\n&amp;quot;;&lt;br /&gt;
$rv.= &amp;quot;-u username         Username to login with\n&amp;quot;;&lt;br /&gt;
$rv.= &amp;quot;--user username     Username to login with\n&amp;quot;;&lt;br /&gt;
$rv.= &amp;quot;-p password         Password to login with\n&amp;quot;;&lt;br /&gt;
$rv.= &amp;quot;--pass password     Password to login with\n&amp;quot;;&lt;br /&gt;
$rv.= &amp;quot;--password password Password to login with\n&amp;quot;;&lt;br /&gt;
$rv.= &amp;quot;--debug 1           more verbose output, good for scripts\n&amp;quot;;&lt;br /&gt;
$rv.= &amp;quot;--debug 2           fully verbose output\n&amp;quot;;&lt;br /&gt;
$rv.= &amp;quot;-d                  Delete messages after processing\n&amp;quot;;&lt;br /&gt;
$rv.= &amp;quot;--delete            Delete messages after processing\n&amp;quot;;&lt;br /&gt;
$rv.= &amp;quot;-h                  Show this help text\n&amp;quot;;&lt;br /&gt;
$rv.= &amp;quot;--help              Show this help text\n&amp;quot;;&lt;br /&gt;
return $rv;&lt;br /&gt;
}&lt;/p&gt;
&lt;p&gt;my $host=&#039;localhost&#039;;&lt;br /&gt;
my $port=143;&lt;br /&gt;
my $spam=0;&lt;br /&gt;
my $ham=0;&lt;br /&gt;
my $mbox=&#039;learnspam&#039;;&lt;br /&gt;
my $user=&#039;foo&#039;;&lt;br /&gt;
my $pass=&#039;bar&#039;;&lt;br /&gt;
# ZMI 20090519: variables for easy reconfiguration:&lt;br /&gt;
my $salearnbin=&amp;quot;/usr/bin/sa-learn&amp;quot;;&lt;br /&gt;
my $tmpfile=&amp;quot;/tmp/imapsalearn$$&amp;quot;;&lt;/p&gt;
&lt;p&gt;my $delete=0;&lt;br /&gt;
# debug 1: terse reporting&lt;br /&gt;
# debug 2: full reporting&lt;br /&gt;
my $debug=0;&lt;br /&gt;
my $help=0;&lt;/p&gt;
&lt;p&gt;if(not GetOptions( &#039;host=s&#039; =&amp;amp;amp;gt; \$host,&lt;br /&gt;
&#039;p|port=i&#039; =&amp;amp;amp;gt; \$port,&lt;br /&gt;
&#039;spam&#039; =&amp;amp;amp;gt; \$spam,&lt;br /&gt;
&#039;ham&#039; =&amp;amp;amp;gt; \$ham,&lt;br /&gt;
&#039;m|mbox=s&#039; =&amp;amp;amp;gt; \$mbox,&lt;br /&gt;
&#039;u|user=s&#039; =&amp;amp;amp;gt; \$user,&lt;br /&gt;
&#039;p|pass|password=s&#039; =&amp;amp;amp;gt; \$pass,&lt;br /&gt;
&#039;debug=i&#039; =&amp;amp;amp;gt; \$debug,&lt;br /&gt;
&#039;d|delete&#039; =&amp;amp;amp;gt; \$delete,&lt;br /&gt;
&#039;h|help&#039; =&amp;amp;amp;gt; \$help)) {&lt;br /&gt;
die(usage());&lt;br /&gt;
}&lt;/p&gt;
&lt;p&gt;if( ($spam &amp;amp;amp;amp;&amp;amp;amp;amp; $ham) || not($spam || $ham) || $help) {&lt;br /&gt;
die(usage());&lt;br /&gt;
}&lt;/p&gt;
&lt;p&gt;my $spamhamopt=$spam?&amp;quot;--spam&amp;quot;:&amp;quot;--ham&amp;quot;;&lt;/p&gt;
&lt;p&gt;my $salearn;&lt;/p&gt;
&lt;p&gt;print &amp;quot;connecting...\n&amp;quot;;&lt;br /&gt;
my $imapdebug=0;&lt;br /&gt;
if ($debug &amp;amp;amp;gt;= 2) { $imapdebug=1; }&lt;br /&gt;
my $imap = Mail::IMAPClient-&amp;amp;amp;gt;new( Server=&amp;amp;amp;gt; &amp;quot;$host:$port&amp;quot;,&lt;br /&gt;
User =&amp;amp;amp;gt; $user,&lt;br /&gt;
Password =&amp;amp;amp;gt; $pass,&lt;br /&gt;
Debug =&amp;amp;amp;gt; $imapdebug);&lt;/p&gt;
&lt;p&gt;if (!defined($imap)) { die &amp;quot;IMAP Login Failed&amp;quot;; }&lt;br /&gt;
print &amp;quot;connected...\n&amp;quot;;&lt;/p&gt;
&lt;p&gt;# print out the total counts for each mailbox&lt;br /&gt;
print &amp;quot;getting spam count...\n&amp;quot;;&lt;br /&gt;
my $spamcount = $imap-&amp;amp;amp;gt;message_count($mbox);&lt;br /&gt;
print $spamcount, ($spam?&amp;quot; spam&amp;quot;:&amp;quot; ham&amp;quot;),&amp;quot; to process\n&amp;quot;;&lt;/p&gt;
&lt;p&gt;# Process the spam mailbox&lt;br /&gt;
print &amp;quot;get all messages...\n&amp;quot;;&lt;br /&gt;
$imap-&amp;amp;amp;gt;select($mbox);&lt;br /&gt;
my @msgs = $imap-&amp;amp;amp;gt;search(&amp;quot;ALL&amp;quot;);&lt;br /&gt;
$|=1;&lt;br /&gt;
print &amp;quot;processing...\n&amp;quot;;&lt;br /&gt;
for (my $i=0;$i &amp;amp;amp;lt;= $#msgs; $i++) {   print &amp;quot;$i&amp;quot;;   # I put it into a file for processing, doing it into a perl var &amp;amp;amp;amp; piping through sa-learn just didn&#039;t seem to work   $imap-&amp;amp;amp;gt;message_to_file(&amp;quot;$tmpfile&amp;quot;,$msgs[$i]);&lt;/p&gt;
&lt;p&gt;# execute sa-learn w/data&lt;br /&gt;
if ($debug &amp;amp;amp;gt;= 2) {&lt;br /&gt;
$salearn = `$salearnbin -D --no-sync $spamhamopt $tmpfile`;&lt;br /&gt;
print &amp;quot;-------\nlearn: &amp;quot;,$salearn,&amp;quot;-------\n&amp;quot;;&lt;br /&gt;
}&lt;br /&gt;
else {&lt;br /&gt;
$salearn = `$salearnbin --no-sync $spamhamopt $tmpfile`;&lt;br /&gt;
if ($debug == 1) { print &amp;quot;: &amp;quot;,$salearn; }&lt;br /&gt;
else { print &amp;quot;\r&amp;quot;; }&lt;br /&gt;
}&lt;/p&gt;
&lt;p&gt;# delete processed message&lt;br /&gt;
if($delete) {&lt;br /&gt;
$imap-&amp;amp;amp;gt;delete_message($msgs[$i]);&lt;br /&gt;
}&lt;br /&gt;
unlink(&amp;quot;$tmpfile&amp;quot;);&lt;br /&gt;
}&lt;br /&gt;
print &amp;quot;\nDone processing..\n&amp;quot;;&lt;br /&gt;
if($delete) {&lt;br /&gt;
$imap-&amp;amp;amp;gt;expunge();&lt;br /&gt;
}&lt;br /&gt;
$imap-&amp;amp;amp;gt;close();&lt;/p&gt;
&lt;p&gt;$imap-&amp;amp;amp;gt;logout();&lt;/p&gt;
&lt;p&gt;# integrate learned stuff&lt;br /&gt;
my $sarebuild = `$salearnbin --sync`;&lt;br /&gt;
if ($debug &amp;amp;amp;gt;= 2) { print &amp;quot;\n-------\nRebuild: &amp;quot;,$sarebuild,&amp;quot;-------\n&amp;quot;; }&lt;br /&gt;
else { if ($debug == 1) { print &amp;quot;\nRebuild: &amp;quot;,$sarebuild; } }</pre>
</p>
<p>Habe es als Script hinterlegt, die Perl-Module nachgezogen, die Config angepasst und es funktioniert sofort. Prima, so soll&#8217;s sein. Ich empfehle, das Script ohne Parameter aufzurufen, sondern die gewünschten Werte im Code zu hinterlegen. Da ggf. ein Passwort eingetragen werden muss, muss natürlich auf die Berechtigungen geachtet werden. Ich habe es ausschliesslich für root les- und ausführbar gemacht.</p>
<p>Aufwand:</p>
<ul>
<li>5 Minuten nach der Ursache suchen</li>
<li>5 Minuten wundern und Kopfschütteln</li>
<li>2 Minuten nach einer <code>sa-learn</code> Lösung für IMAP suchen</li>
<li>1 Minute Script einbauen</li>
<li>1 Minute Config anpassen</li>
<li>ein Leben lang freuen</li>
</ul>
<p>So einfach kann&#8217;s manchmal sein, wenn man endlich mal die Muße hat, nach der Ursache zu suchen.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.thomasgericke.de/v4/interactive/blog/2010/07/howto-spamassassins-sa-learn-von-imap-mailboxen-lernen-lassen/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>unfake.it: performance increase and temporary twitter failure</title>
		<link>http://www.thomasgericke.de/v4/interactive/blog/2009/12/unfakeit-performance-increase-and-temporary-twitter-failure/</link>
		<comments>http://www.thomasgericke.de/v4/interactive/blog/2009/12/unfakeit-performance-increase-and-temporary-twitter-failure/#comments</comments>
		<pubDate>Mon, 21 Dec 2009 15:02:25 +0000</pubDate>
		<dc:creator>Thomas</dc:creator>
				<category><![CDATA[tech]]></category>
		<category><![CDATA[API]]></category>
		<category><![CDATA[internet]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[programming]]></category>
		<category><![CDATA[twitter]]></category>
		<category><![CDATA[unfake]]></category>
		<category><![CDATA[url shortening]]></category>
		<category><![CDATA[wordpress]]></category>

		<guid isPermaLink="false">http://www.thomasgericke.de/v4/interactive/blog/?p=4541</guid>
		<description><![CDATA[Hi there,

during the past few days, unfake.it's perf [...]]]></description>
			<content:encoded><![CDATA[<p>Hi there,</p>
<p>during the past few days, <a title="unfake.it (709 hits)" href="http://www.thomasgericke.de/v4/interactive/blog/go.php?http://unfake.it/" target="_blank">unfake.it</a>&#8216;s performance increased dramatically. Several scripts and jobs have been <strong>moved onto new servers</strong>, the database structure and various <code>SQL</code> statements have been enhanced and even <code>SQL SELECT</code> statements have been optimized to more and more use readonly slave servers. Most URLs are being faked in much less than <strong>a tenth of a second</strong>. The <a title="magical previews (296 hits)" href="http://www.thomasgericke.de/v4/interactive/blog/go.php?http://unfake.it/help.php#preview" target="_blank">magical preview</a>s of faked URLs are generated <strong>almost instantly</strong>, since performance increased dramatically.</p>
<p>Unfortunately, faked URLs weren&#8217;t posted to <a title="Twitter (111 hits)" href="http://www.thomasgericke.de/v4/interactive/blog/go.php?http://twitter.com/" target="_blank">Twitter</a> when using the <a title="WordPress Plugin (605 hits)" href="http://www.thomasgericke.de/v4/interactive/blog/go.php?http://wordpress.org/extend/plugins/url-shortener-for-twitter-tools/" target="_blank">WordPress Plugin</a> during the past 4 hours due to a <strong>tiny misconfiguration</strong>. This issue could be solved.</p>
<p><a title="unfake.it (709 hits)" href="http://www.thomasgericke.de/v4/interactive/blog/go.php?http://unfake.it/" target="_blank">unfake.it</a> has become <strong>a more and more commonly used URL shortener</strong> during the past months. Almost <strong>1.000 URLs</strong> are faked in a 24 hour period, even though this magic edge has not yet been crossed. See the <a title="stats (394 hits)" href="http://www.thomasgericke.de/v4/interactive/blog/go.php?http://unfake.it/stats.php" target="_blank">stats</a> for more information &#8217;bout that.</p>
<p>Bye, Thomas</p>
]]></content:encoded>
			<wfw:commentRss>http://www.thomasgericke.de/v4/interactive/blog/2009/12/unfakeit-performance-increase-and-temporary-twitter-failure/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>HOWTO: publishing content on newsfeeds using a facebook application</title>
		<link>http://www.thomasgericke.de/v4/interactive/blog/2009/08/howto-publishing-content-on-newsfeeds-using-a-facebook-application/</link>
		<comments>http://www.thomasgericke.de/v4/interactive/blog/2009/08/howto-publishing-content-on-newsfeeds-using-a-facebook-application/#comments</comments>
		<pubDate>Sun, 16 Aug 2009 19:08:56 +0000</pubDate>
		<dc:creator>Thomas</dc:creator>
				<category><![CDATA[tech]]></category>
		<category><![CDATA[facebook]]></category>
		<category><![CDATA[FBJS]]></category>
		<category><![CDATA[FBML]]></category>
		<category><![CDATA[howto]]></category>
		<category><![CDATA[internet]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[programming]]></category>

		<guid isPermaLink="false">http://www.thomasgericke.de/v4/interactive/blog/?p=4271</guid>
		<description><![CDATA[Hi there!
Quite a while ago, I started writing my firs [...]]]></description>
			<content:encoded><![CDATA[<p>Hi there!</p>
<p>Quite a while ago, I started writing my first and own <a title="unfake.it's facebook application (216 hits)" href="http://www.thomasgericke.de/v4/interactive/blog/go.php?http://apps.facebook.com/unfake_it/" target="_blank">facebook application</a>. I got stuck while trying to publish content to my own profile page and also to my friends&#8217; newsfeeds. I stumbled upon several problems. Either there was no content displayed, it was formatted in a wrong way, it was not published on my friends&#8217; newsfeeds or it even was published on behalf of my friends&#8217; username. It was quite strange to me and I could not find an easy documentation on how to do it the right way.</p>
<p>I played around with <a title="Stream.publish (257 hits)" href="http://www.thomasgericke.de/v4/interactive/blog/go.php?http://wiki.developers.facebook.com/index.php/Stream.publish" target="_blank">Stream.publish</a>, <a title="Feed.publishUserAction (207 hits)" href="http://www.thomasgericke.de/v4/interactive/blog/go.php?http://wiki.developers.facebook.com/index.php/Feed.publishUserAction" target="_blank">Feed.publishUserAction</a> or <a title="Notifications.send (221 hits)" href="http://www.thomasgericke.de/v4/interactive/blog/go.php?http://wiki.developers.facebook.com/index.php/Notifications.send" target="_blank">Notifications.send</a> &#8211; none of those functions did what I wanted them to do. This may be so, because I did not fully understand their purposes.</p>
<p><strong>So, this is my way to do it.</strong> I am using the <a title="FBJS (208 hits)" href="http://www.thomasgericke.de/v4/interactive/blog/go.php?http://wiki.developers.facebook.com/index.php/FBJS" target="_blank">FBJS</a> (FaceBook JavaScript) popup call <a title="Facebook.showFeedDialog (291 hits)" href="http://www.thomasgericke.de/v4/interactive/blog/go.php?http://wiki.developers.facebook.com/index.php/Facebook.showFeedDialog" target="_blank">Facebook.showFeedDialog</a>. This is truely (as far as I&#8217;m concerned) the best and easiest way.</p>
<p>First of all, I assume you are familiar with how to build an facebook application from scratch. If not, please read the <a title="developer's documentation (428 hits)" href="http://www.thomasgericke.de/v4/interactive/blog/go.php?http://developers.facebook.com/get_started.php" target="_blank">developer&#8217;s documentation</a>.</p>
<p><strong><span style="text-decoration: underline;">Step 1: build and register your Feed Template Bundle</span></strong></p>
<ol>
<li>go to the <a title="Feed Template Console (533 hits)" href="http://www.thomasgericke.de/v4/interactive/blog/go.php?http://developers.facebook.com/tools.php?feed" target="_blank">Feed Template Console</a></li>
<li>choose your application and hit &#8220;Next&#8221;</li>
<li>create a template for your &#8220;One Line Story&#8221; and hit &#8220;Next&#8221;</li>
<li>create a template for your &#8220;Short Story&#8221; and hit &#8220;Next&#8221;</li>
<li>create Action Links and hit &#8220;Next&#8221;</li>
<li>hit &#8220;Register Template Bundle&#8221;</li>
<li>copy and save the Template Bundle ID given in the popup (you will have to paste it into your application&#8217;s code later)</li>
</ol>
<p>When doing this, you may enter any text or even HyperText in the fields for the <strong>One Line</strong> or <strong>Short Story</strong>. You also may enter predefined tags such as <code>{*actor*}</code> or your own defined tags such as <code>{*foobar*}</code>. In the <strong>Sample Template Data</strong>, you may enter the tag definitions and display a preview. What you enter there and at this very moment has <em><strong>no effect on the content displayed within your application later</strong></em>! That&#8217;s just for previewing purposes. The real content will be defined later in your application&#8217;s script. Remember that! Some Examples for your Sample Template Data at this point may be:</p>
<p>
<pre class="brush: php">{&amp;quot;foobar&amp;quot;: &amp;quot;This is a foobar text&amp;quot;}</pre>
</p>
<p>Or a bit more complex:</p>
<p>
<pre class="brush: php">{&amp;quot;foolink&amp;quot;: &amp;quot;&amp;lt;a href=&amp;quot;http://www.google.com/&amp;quot;&amp;gt;Google&amp;lt;/a&amp;gt;&amp;quot;,&lt;/p&gt;
&lt;p&gt;&amp;quot;images&amp;quot;:[{&amp;quot;src&amp;quot;:&amp;quot;http://domain.com/image1.jpg&amp;quot;, &amp;quot;href&amp;quot;:&amp;quot;&amp;lt;a href=&amp;quot;http://www.facebook.com/&amp;quot;&amp;gt;http://www.facebook.com&amp;lt;/a&amp;gt;&amp;quot;},&lt;/p&gt;
&lt;p&gt;{&amp;quot;src&amp;quot;: &amp;quot;http://anotherdomain.com/image2.jpg&amp;quot;, &amp;quot;href&amp;quot;:&amp;quot;&amp;lt;a href=&amp;quot;http://www.facebook.com/&amp;quot;&amp;gt;http://www.facebook.com&amp;lt;/a&amp;gt;&amp;quot;}]}</pre>
</p>
<p>You see, e.g . the <code>{*images*}</code> tag is defined as some sort of array consisting of multiple SRC and HREF values. Attention: the special tag <code>{*images*}</code> is displayed automatically on Short Stories, you don&#8217;t need to call them!</p>
<p><strong><span style="text-decoration: underline;">2. write your application&#8217;s content</span></strong></p>
<p>
<pre class="brush: php">&lt;?PHP&lt;/p&gt;
&lt;p&gt;require_once &#039;facebook-platform/php/facebook.php&#039;;&lt;/p&gt;
&lt;p&gt;$appid = &#039;xxxxxxxxx&#039;; // your app ID&lt;/p&gt;
&lt;p&gt;$appapikey = &#039;XXXXXXXXXXXXXXXX; // your app key&lt;/p&gt;
&lt;p&gt;$appsecret = &#039;XXXXXXXXXXXXXXXX&#039;; // your app secret&lt;/p&gt;
&lt;p&gt;$template_bundle_id = &#039;xxxxxxxxxxxxxxxx&#039;; // the ID you got in Step 1&lt;/p&gt;
&lt;p&gt;$facebook = new Facebook($appapikey, $appsecret);&lt;/p&gt;
&lt;p&gt;$user_id = $facebook-&gt;require_login();&lt;/p&gt;
&lt;p&gt;echo &quot;&lt;p&gt;Hello, &lt;fb:name uid=\&quot;$user_id\&quot; useyou=\&quot;false\&quot; /&gt;!&lt;/p&gt;&quot;;&lt;/p&gt;
&lt;p&gt;?&gt;&lt;/p&gt;
&lt;p&gt;&lt;script type=&quot;text/javascript&quot;&gt;&lt;!--&lt;/p&gt;
&lt;p&gt;    var template_bundle_id =&quot;&quot;;&lt;/p&gt;
&lt;p&gt;    var url=&quot;http://www.google.com/&quot;;&lt;/p&gt;
&lt;p&gt;    var user_message_prompt = &quot;Share this URL with your friends?&quot;;&lt;/p&gt;
&lt;p&gt;    var user_message = {value: &quot;wants to share a greate website.&quot;};&lt;/p&gt;
&lt;p&gt;    var image =&quot;http://www.google.com/intl/en_ALL/images/logo.gif&quot;;&lt;/p&gt;
&lt;p&gt;    var template_data = {&quot;url&quot;: url,&lt;/p&gt;
&lt;p&gt;                                  &quot;images&quot;: [{&#039;href&#039;: url, &#039;src&#039; : image}]};&lt;/p&gt;
&lt;p&gt;    Facebook.showFeedDialog(template_bundle_id, template_data, &#039;&#039;, &#039;&#039;, &#039;&#039;, user_message_prompt, user_message);&lt;/p&gt;
&lt;p&gt;// --&gt;&lt;/script&gt;&lt;/p&gt;
&lt;p&gt;</pre>
</p>
<p><strong>This is it.</strong></p>
<p>Every time you call your application&#8217;s page, you&#8217;ll get a facebook popup asking you to display the content on your profile and even in your friends&#8217; newsfeeds. Of course, it does not make any sense to share some data every time you call your application&#8217;s canvas page, so you may want to add some more code to your application.</p>
<p>The text to be shared is the text you entered when registering the Template Bundle in Step 1. If you get an error, please make sure the defined variables (such as &#8220;url&#8221; or &#8220;images&#8221;) are valid and do exist. In other words: <strong>whatever you call in your Template Bundle, it has to be defined in your script</strong>.</p>
<p>Of course, you may generate the content dynamically from a database or any other source.</p>
<p>I hope this HOWTO helped.</p>
<p>Bye, T.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.thomasgericke.de/v4/interactive/blog/2009/08/howto-publishing-content-on-newsfeeds-using-a-facebook-application/feed/</wfw:commentRss>
		<slash:comments>37</slash:comments>
		</item>
		<item>
		<title>unfake.it now with facebook integration</title>
		<link>http://www.thomasgericke.de/v4/interactive/blog/2009/08/unfakeit-now-with-facebook-integration/</link>
		<comments>http://www.thomasgericke.de/v4/interactive/blog/2009/08/unfakeit-now-with-facebook-integration/#comments</comments>
		<pubDate>Sun, 16 Aug 2009 01:48:44 +0000</pubDate>
		<dc:creator>Thomas</dc:creator>
				<category><![CDATA[tech]]></category>
		<category><![CDATA[facebook]]></category>
		<category><![CDATA[FBML]]></category>
		<category><![CDATA[internet]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[programming]]></category>
		<category><![CDATA[twitter]]></category>
		<category><![CDATA[unfake]]></category>
		<category><![CDATA[unfake plugin]]></category>
		<category><![CDATA[url shortening]]></category>
		<category><![CDATA[wordpress]]></category>

		<guid isPermaLink="false">http://www.thomasgericke.de/v4/interactive/blog/?p=4211</guid>
		<description><![CDATA[Hi there,

after several months, unfake.it has become [...]]]></description>
			<content:encoded><![CDATA[<p>Hi there,</p>
<p>after several months, unfake.it has become even more important in the Web2.0 community. A few weeks ago, I was talking to some guys and co-workers about programming and such things. I then told about unfake.it and a co-worker of mine said, he somehow stubled upon <a href="http://www.thomasgericke.de/v4/interactive/blog/go.php?http://unfake.it/" title="(709 hits)">http://unfake.it/</a> and uses it irregular. That was quite funny to me.</p>
<p>I&#8217;ve had very few time the past months and since I got stuck on the half way because of some WordPress problems and also some problems with facebook&#8217;s API and FBML, there was no more development. But now I&#8217;m proud to announce that today, I released a completely new version including new features:</p>
<p><strong>WordPress plugin version 1.2</strong></p>
<p>The new <a title="WordPress plugin (605 hits)" href="http://www.thomasgericke.de/v4/interactive/blog/go.php?http://wordpress.org/extend/plugins/url-shortener-for-twitter-tools/" target="_blank">plugin</a> comes with its own settings page and adds two own tables to your WordPress installation. The main purpose is to let you configure, whether or not you wish to be taken to facebook and add the shortened URL for your new blog post (including a thumbnailed screenshot) to your facebook profile page and even in your friends newsfeeds.</p>
<p><strong>Facebook application</strong></p>
<p>unfake.it now has <a title="facebook application (216 hits)" href="http://www.thomasgericke.de/v4/interactive/blog/go.php?http://apps.facebook.com/unfake_it/" target="_blank">its own facebook application</a> which lets you add shortened URLs, lists them as screenshots in a profile box, displays about new URLs on your profile wall and even tells your friends about it in their newsfeeds. Want an example? See:</p>
<p><a href="http://www.thomasgericke.de/v4/interactive/blog/go.php?http://www.thomasgericke.de/v4/interactive/blog/wp-content/uploads/2009/08/uf_v12.png" title="(149 hits)"><img class="aligncenter size-full wp-image-4221" title="uf_v12" src="http://www.thomasgericke.de/v4/interactive/blog/wp-content/uploads/2009/08/uf_v12.png" alt="uf_v12" width="510" height="132" /></a></p>
<p>Since a few hundred URLs are shortened every single day, I also had to do some enhancements to the database structure and especially to the thumbnailing process. Just think about it: at the moment, we have more than 20,000 shortened URLs, each of them was once and initially thumbnailed, stored and is re-fetched every few days, if still hits occur. That&#8217;s a lot of traffic and a lot of CPU power. Just take a look how MySQL handlers and Apache traffic increased the last months:</p>
<p><a href="http://www.thomasgericke.de/v4/interactive/blog/go.php?http://www.thomasgericke.de/v4/interactive/blog/wp-content/uploads/2009/08/uf_mysql_200908.png" title="(159 hits)"><img class="aligncenter size-full wp-image-4231" title="uf_mysql_200908" src="http://www.thomasgericke.de/v4/interactive/blog/wp-content/uploads/2009/08/uf_mysql_200908.png" alt="uf_mysql_200908" width="421" height="148" /></a></p>
<p><a href="http://www.thomasgericke.de/v4/interactive/blog/go.php?http://www.thomasgericke.de/v4/interactive/blog/wp-content/uploads/2009/08/uf_apache_200908.png" title="(160 hits)"><img class="aligncenter size-full wp-image-4241" title="uf_apache_200908" src="http://www.thomasgericke.de/v4/interactive/blog/wp-content/uploads/2009/08/uf_apache_200908.png" alt="uf_apache_200908" width="420" height="147" /></a></p>
<p>You may see most recent stats at <a href="http://www.thomasgericke.de/v4/interactive/blog/go.php?http://unfake.it/stats.php" title="(394 hits)">http://unfake.it/stats.php</a>.</p>
<p>Please let me know, if you have any problems with the new version of the WordPress plugin and especially what you think about the facebook application.</p>
<p>Bye, T.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.thomasgericke.de/v4/interactive/blog/2009/08/unfakeit-now-with-facebook-integration/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Highly sophisticated wakeup call using nagios</title>
		<link>http://www.thomasgericke.de/v4/interactive/blog/2009/07/highly-sophisticated-wakeup-call-using-nagios/</link>
		<comments>http://www.thomasgericke.de/v4/interactive/blog/2009/07/highly-sophisticated-wakeup-call-using-nagios/#comments</comments>
		<pubDate>Thu, 30 Jul 2009 08:30:49 +0000</pubDate>
		<dc:creator>Thomas</dc:creator>
				<category><![CDATA[daily life]]></category>
		<category><![CDATA[tech]]></category>
		<category><![CDATA[cellphone]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[nagios]]></category>
		<category><![CDATA[programming]]></category>
		<category><![CDATA[unix]]></category>

		<guid isPermaLink="false">http://www.thomasgericke.de/v4/interactive/blog/?p=3051</guid>
		<description><![CDATA[Hi there!

Do you know this problem?! You have to get [...]]]></description>
			<content:encoded><![CDATA[<p>Hi there!</p>
<p><a href="http://www.thomasgericke.de/v4/interactive/blog/go.php?http://www.thomasgericke.de/v4/interactive/blog/wp-content/uploads/2009/07/wecker.png" title="(180 hits)"><img class="size-full wp-image-3071 alignleft" title="wecker" src="http://www.thomasgericke.de/v4/interactive/blog/wp-content/uploads/2009/07/wecker.png" alt="wecker" width="150" height="300" /></a>Do you know this problem?! You have to get up at some certain time in the morning, so you set up your alarm clock to give you a friendly &#8220;rrrrrrring-rrrrring&#8221;. But you simply don&#8217;t wake up! Your alarm clock rings and rings and rings for like hours but you simply don&#8217;t hear it. Sometimes, you use the snooze button, but you cannot even remember you did it.</p>
<p>Well, that&#8217;s like how I feel sometimes in the morning. Bad thing, if you have some kind of meeting or appointment. Several times in the past, I sent automated e-mails to my co-workers to give me a wakeup call on my cellphone, this surprisingly always works. But it&#8217;s annoying. For me and my co-workers.</p>
<p><strong><span style="text-decoration: underline;">Here comes the solution:</span></strong></p>
<p><strong>use nagios to give you a highly sophisticated wakeup call.</strong></p>
<p>Imagine, you have a <strong>linux box</strong> which is under surveillance of a <strong>nagios remote monitoring system</strong>. And imagine furthermore, this nagios system is <strong>configured to send out voice calls</strong> in cases of critical states. All you need is a new plugin (most commonly via NRPE) which tells nagios to initiate your wakeup call.</p>
<p><span style="text-decoration: underline;">This is how I do it:</span></p>
<p>1. Add the following line to your NRPE config file on your linux box (e. g. <code>/etc/nagios/nrpe.cfg</code>):</p>
<pre class="brush: bash">command[wakeupcall]=/usr/lib/nagios/plugins/wakeupcall</pre>
<p>2. Create the plugin and place it on your linux box at <code>/usr/lib/nagios/plugins/wakeupcall</code></p>
<pre class="brush: bash">#!/bin/bash
#
# nagios nrpe plugin to initiate a wakeup call
# 2009, Thomas Gericke, thomas (at) thomasgericke (dot) de
#

FILE=&quot;/etc/wakeupcall/wakeupcall&quot;

if [ -e $FILE ]; then
        echo &quot;Wakeupcall needed. Gonna hit ya!&quot;
        exit 2
else
        echo &quot;No wakeupcall needed. Sleep well.&quot;
        exit 0
fi</pre>
<p>3. Restart your NRPE service on your linux box (e. g. <code>/etc/init.d/nagios-nrpe-server restart</code>)</p>
<p>4. Set up the service check in your nagios configuration on your nagios server</p>
<p>I assume, you already have the host configured on your nagios system and you already are familiar with nagios&#8217; notifications. Here&#8217;s the service check you need:</p>
<pre class="brush: bash">define service {
        use                     generic-service
        max_check_attempts      1
        notification_options    c
        service_description     Wakeup Call
        host_name               YOUR.HOST.NAME
        check_command           check_nrpe!wakeupcall
        contact_groups          YOUR_CONTACT_GROUP
}</pre>
<p>I hope you&#8217;re familiar with nagios&#8217; service check templates and such stuff.</p>
<p>5. Reload your nagios on your nagios server (e. g. <code>/etc/init.d/nagios reload</code>)</p>
<p>6. Create the wakeupcall config directory on your linux box (<code>mkdir /etc/wakeupcall/</code>)</p>
<p>7. Set up a file for an at-job on your linux box (e. g. <code>~/add.wakeupcall</code>)</p>
<pre class="brush: bash">touch /etc/wakeupcall/wakeupcall</pre>
<p>8. Set up an at-job on your linux box once you need to be woken up</p>
<pre class="brush: bash">at -f ~/add.wakeupcall 06:40</pre>
<p>Your linux box will create <code>/etc/wakeupcall/wakeupcall</code> <strong>at 6.40AM</strong> (the very next time this moment occurs), nagios will realize it and will initiate the notification. If you have configured your nagios server to send out voice calls to your cellphone, you will receive a <strong>wakeup call</strong>.</p>
<p>Have fun, comments are appreciated! <img src='http://www.thomasgericke.de/v4/interactive/blog/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://www.thomasgericke.de/v4/interactive/blog/2009/07/highly-sophisticated-wakeup-call-using-nagios/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>after 100 days of unfake.it</title>
		<link>http://www.thomasgericke.de/v4/interactive/blog/2009/05/after-100-days-of-unfakeit/</link>
		<comments>http://www.thomasgericke.de/v4/interactive/blog/2009/05/after-100-days-of-unfakeit/#comments</comments>
		<pubDate>Thu, 07 May 2009 21:25:35 +0000</pubDate>
		<dc:creator>Thomas</dc:creator>
				<category><![CDATA[tech]]></category>
		<category><![CDATA[blog]]></category>
		<category><![CDATA[facebook]]></category>
		<category><![CDATA[Google]]></category>
		<category><![CDATA[html]]></category>
		<category><![CDATA[internet]]></category>
		<category><![CDATA[programming]]></category>
		<category><![CDATA[twitter]]></category>
		<category><![CDATA[unfake]]></category>
		<category><![CDATA[unfake plugin]]></category>
		<category><![CDATA[url shortening]]></category>
		<category><![CDATA[wordpress]]></category>

		<guid isPermaLink="false">http://www.thomasgericke.de/v4/interactive/blog/?p=2431</guid>
		<description><![CDATA[Hi there!

I have to thank you! All of you, using unf [...]]]></description>
			<content:encoded><![CDATA[<p>Hi there!</p>
<p>I have to thank you! All of you, using <a title="http://unfake.it/ (709 hits)" href="http://www.thomasgericke.de/v4/interactive/blog/go.php?http://unfake.it/" target="_blank">unfake.it</a> as URL shortening service!</p>
<p>It&#8217;s been <strong>100 days</strong>, since I faked the first URL with <a title="http://unfake.it/ (709 hits)" href="http://www.thomasgericke.de/v4/interactive/blog/go.php?http://unfake.it/" target="_blank">unfake.it</a> &#8211; my very own URL shortening service. I started this project, &#8217;cause I always forgot the names of all the other URL shortening providers, so I very quickly wrote my own application, which now is used every day by lots of users.</p>
<p style="text-align: center;"><a href="http://www.thomasgericke.de/v4/interactive/blog/go.php?http://www.thomasgericke.de/v4/interactive/blog/wp-content/uploads/2009/05/uf_100days_url.png" title="(111 hits)"><img class="size-full wp-image-2441 aligncenter" title="new shortened URLs by day" src="http://www.thomasgericke.de/v4/interactive/blog/wp-content/uploads/2009/05/uf_100days_url.png" alt="new shortened URLs by day" width="576" height="360" /></a></p>
<p>What began for my personal use only, has now become a huge and important project. A few days after the initial launch &#8211; and even without heavy announcement, the first people started using <a title="http://unfake.it/ (709 hits)" href="http://www.thomasgericke.de/v4/interactive/blog/go.php?http://unfake.it/" target="_blank">unfake.it</a> to shorten URLs. Using the <a title="http://unfake.it/help.php#bookmarklet (296 hits)" href="http://www.thomasgericke.de/v4/interactive/blog/go.php?http://unfake.it/help.php#bookmarklet" target="_blank">bookmarklet</a>, some friends and co-workers started using <a title="http://unfake.it/ (709 hits)" href="http://www.thomasgericke.de/v4/interactive/blog/go.php?http://unfake.it/" target="_blank">unfake.it</a> and spreading the URL all over the world.</p>
<p>Then, I implemented an <a title="http://unfake.it/help.php#api (296 hits)" href="http://www.thomasgericke.de/v4/interactive/blog/go.php?http://unfake.it/help.php#api" target="_blank">API</a> and wrote a <a title="http://wordpress.org/extend/plugins/url-shortener-for-twitter-tools/ (605 hits)" href="http://www.thomasgericke.de/v4/interactive/blog/go.php?http://wordpress.org/extend/plugins/url-shortener-for-twitter-tools/" target="_blank">standalone WordPress plugin</a> to shorten URLs for new blog postings before sending them to <a title="http://twitter.com/thomasgericke (534 hits)" href="http://www.thomasgericke.de/v4/interactive/blog/go.php?http://twitter.com/thomasgericke" target="_blank">Twitter</a>. Since March, this plugin is downloaded and installed on new WordPress blogs almost every day a couple of times, which really makes me proud. Today, several co-workers as well as absolutely unknown users all over the globe are using my plugin. And there&#8217;s an huge number of hits per day:</p>
<p style="text-align: center;"><a href="http://www.thomasgericke.de/v4/interactive/blog/go.php?http://www.thomasgericke.de/v4/interactive/blog/wp-content/uploads/2009/05/uf_100days_hits.png" title="(112 hits)"><img class="size-full wp-image-2491 aligncenter" title="number of hits by day" src="http://www.thomasgericke.de/v4/interactive/blog/wp-content/uploads/2009/05/uf_100days_hits.png" alt="number of hits by day" width="518" height="243" /></a></p>
<p>Then, I implemented the magic <a title="http://unfake.it/help.php#preview (296 hits)" href="http://www.thomasgericke.de/v4/interactive/blog/go.php?http://unfake.it/help.php#preview" target="_blank">preview function</a> with thumbnailed images of the destination websites. Then I wrote a facebook application to add faked URLs and their thumbnails to your facebook profile. Those are just toy-like features, but I relly like them &#8211; as well as lots of users.</p>
<p>Some facts of what has happened so far (or is happening):</p>
<ul>
<li>more than <strong>3.000 URLs</strong> have been faked up to now</li>
<li>there are more than <strong>42.000 hits</strong> to those URLs up to now</li>
<li>the last 3 days, more than <strong>100 new URLs</strong> have been added <strong>per day</strong></li>
<li>URLs for more than <strong>130 unique websites</strong> have been faked up to now</li>
<li>the WordPress plugin has been <strong>downloaded</strong> and most likely installed more than <strong>80 times</strong></li>
<li><a title="http://search.twitter.com/search?q=+unfake.it+filter%3Alinks&amp;rpp=50 (166 hits)" href="http://www.thomasgericke.de/v4/interactive/blog/go.php?http://search.twitter.com/search?q=+unfake.it+filter%3Alinks&amp;rpp=50" target="_blank">Twitter knows more than <strong>850 faked URLs</strong></a> of the last 7 days</li>
<li><a title="http://www.google.com/search?q=site:unfake.it (178 hits)" href="http://www.thomasgericke.de/v4/interactive/blog/go.php?http://www.google.com/search?q=site:unfake.it" target="_blank">Google knows more than <strong>20 pages</strong></a><strong> of faked URLs</strong></li>
<li>unfake.it is <strong>growing every day</strong></li>
</ul>
<p>I&#8217;m really looking forward to <a title="http://unfake.it/ (709 hits)" href="http://www.thomasgericke.de/v4/interactive/blog/go.php?http://unfake.it/" target="_blank">unfake.it</a>&#8216;s future. Sure, there is an increasing number of shortening services, but I guess, some of &#8216;em will disappear again.</p>
<p>Bye, T.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.thomasgericke.de/v4/interactive/blog/2009/05/after-100-days-of-unfakeit/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Updating profile boxes with a facebook app</title>
		<link>http://www.thomasgericke.de/v4/interactive/blog/2009/03/updating-profile-boxes-with-a-facebook-app/</link>
		<comments>http://www.thomasgericke.de/v4/interactive/blog/2009/03/updating-profile-boxes-with-a-facebook-app/#comments</comments>
		<pubDate>Thu, 12 Mar 2009 21:52:33 +0000</pubDate>
		<dc:creator>Thomas</dc:creator>
				<category><![CDATA[tech]]></category>
		<category><![CDATA[API]]></category>
		<category><![CDATA[facebook]]></category>
		<category><![CDATA[FBML]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[programming]]></category>

		<guid isPermaLink="false">http://www.thomasgericke.de/v4/interactive/blog/?p=1601</guid>
		<description><![CDATA[Hi there!

A few days ago, I started to write my firs [...]]]></description>
			<content:encoded><![CDATA[<p>Hi there!</p>
<p>A few days ago, I started to write <strong>my first own facebook application</strong>. It all went quite okay until one certain point: I wanted my application to update the profile box of the user, which uses the app at that single moment. And that wasn&#8217;t as easy, as I thought.</p>
<p>The problem was: after the profile box has been updated, <strong>all profile boxes of all users had the same content</strong> &#8211; the content of the user who last updated his profile box.</p>
<p>I will come to the solution later. First of all, a quick explanation of what I needed to do:</p>
<ol>
<li>I <strong>read the documentation</strong> of facebook&#8217;s application guide to understand the <a title="API (202 hits)" href="http://www.thomasgericke.de/v4/interactive/blog/go.php?http://wiki.developers.facebook.com/index.php/API" target="_blank">API</a> and the <a title="FBML (232 hits)" href="http://www.thomasgericke.de/v4/interactive/blog/go.php?http://wiki.developers.facebook.com/index.php/FBML" target="_blank">FBML language</a></li>
<li>I <strong>set up my own application</strong> using the <a title="step-by-step guide (428 hits)" href="http://www.thomasgericke.de/v4/interactive/blog/go.php?http://developers.facebook.com/get_started.php" target="_blank">step-by-step guide</a></li>
<li>I <strong>set up my new application on my own host</strong> including facebook&#8217;s PHP libraries</li>
</ol>
<p><strong>Here&#8217;s the code step-by-step </strong>(just put all sniplets together)<strong>:</strong></p>
<p><strong><code>Code sniplet #1</code></strong></p>
<pre class="brush: php">require_once &#039;facebook-platform/php/facebook.php&#039;;

$appid = &#039;xxxxxxxxxxxx&#039;;
$appapikey = &#039;xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx&#039;;
$appsecret = &#039;xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx&#039;;

$facebook = new Facebook($appapikey, $appsecret);
$user_id = $facebook-&gt;require_login();</pre>
<p><strong>Above:</strong> first of all, we need to include facebook&#8217;s <strong>PHP libraries</strong>, define several <strong>variables</strong> for our application, <strong>initialize our facebook object</strong> and <strong>retrieve the UID</strong> of the user who currently uses the application.</p>
<p><strong><code>Code sniplet #2</code></strong></p>
<pre class="brush: php">$fb_box = &quot;&lt;H4 class=&#039;box_header clearfix&#039;&gt;&lt;span&gt;&quot;;
$fb_box .= &quot;Hello World!&quot;;
$fb_box .= &quot;&lt;/span&gt;&lt;/H4&gt;&quot;;
$fb_box .= &quot;&lt;div&gt;I am &quot;;
$fb_box .= &quot;&lt;fb:name uid=\&quot;$user_id\&quot; useyou=\&quot;false\&quot; /&gt;.&quot;;
$fb_box .= &quot;Nice you&#039;re on my page.&lt;/div&gt;&quot;;
$fb_box .= &quot;Some more content in HTML or FBML...&quot;;</pre>
<p><strong>Above:</strong> we then define the <strong>content</strong> which we want to be displayed <strong>within the profile box</strong>. In this examble, it will be the name of the user, greeting the visitor.</p>
<p><strong><code>Code sniplet #3</code></strong></p>
<pre class="brush: php">$fb_box_handle = &#039;pb_&#039; . $appid . &#039;_&#039; . $user_id;</pre>
<p><strong>Above:</strong> this is <strong>important</strong>! At this point, I got stuck for a while. The reason was, facebook <strong>caches</strong> profile boxes content until the application&#8217;s canvas page is requested for the next time. <strong>The handle is very important</strong> for that caching mechanism, since it has to be <strong>a unique identifier</strong> for each application and each user. For that reason, I simply use the prefix &#8216;<strong>pb_</strong>&#8216; followed by the <strong>applications ID</strong> (defined above) and the <strong>UID</strong> of the current user (also defined above)!</p>
<p><strong><code>Code sniplet #4</code></strong></p>
<pre class="brush: php">$facebook-&gt;api_client-&gt;call_method(&#039;facebook.profile.setFBML&#039;,
array(
&#039;api_key&#039; =&gt; $appapikey,
&#039;v&#039; =&gt; &#039;1.0&#039;,
&#039;uid&#039; =&gt; $user_id,
&#039;profile&#039; =&gt; &#039;&lt;fb:narrow&gt;&lt;fb:ref handle=&quot;&#039; . $fb_box_handle . &#039;&quot; /&gt;&lt;/fb:narrow&gt;&#039;,
&#039;profile_main&#039; =&gt; &#039;&lt;fb:ref handle=&quot;&#039; . $fb_box_handle . &#039;&quot; /&gt;&#039;,
)
);</pre>
<p><strong>Above:</strong> the rest is quite simple. We make an <strong>API call</strong> to facebook and send our <strong>application key</strong>, the <strong>protocol version</strong>, the <strong>UID</strong> of the facebook user whose profile box ought to be updated and, of course, the <strong>content</strong> for that box. The content will be sent as the <strong>reference handle</strong> we defined earlier.</p>
<p>If you want to update multiple profile boxes with one single API call, I guess, this could work if you send an array containing the UIDs. If not, you can still get all those UIDs, walk through the array and perform multiple API calls. I read somewhere, some users had problem updating large numbers of profiles&#8230; Just give it a try.</p>
<p>Comments (if it worked for you or even if it didn&#8217;t) are appreciated <img src='http://www.thomasgericke.de/v4/interactive/blog/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> </p>
<p><code>UPDATE because of comment #2:</code></p>
<p>The example above is about updating content in a users profile, <strong>not</strong> about setting up a profile box on a profile. You should read the manual carefully.</p>
<p>A user has to approve a certain application to create a profile box. Therefore, you need to <strong>render a button</strong>, which sets up the box.  You can easily do this by:</p>
<pre class="brush: php">$appapikey = &#039;xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx&#039;;
$appsecret = &#039;xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx&#039;;
$facebook = new Facebook($appapikey, $appsecret);
$user_id = $facebook-&gt;require_login();
$facebook-&gt;api_client-&gt;profile_setFBML($appapikey, $user_id, &#039;profile&#039;, NULL, &#039;mobile_profile&#039;, &#039;profile_main&#039;);
echo &quot;&lt;fb:add-section-button section=&#039;profile&#039; /&gt;&quot;;</pre>
<p>The last line renders the button, you want to have on your canvas page.</p>
<p>Good luck!  Thomas</p>
]]></content:encoded>
			<wfw:commentRss>http://www.thomasgericke.de/v4/interactive/blog/2009/03/updating-profile-boxes-with-a-facebook-app/feed/</wfw:commentRss>
		<slash:comments>14</slash:comments>
		</item>
	</channel>
</rss>

