<?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"
	>

<channel>
	<title>a little bit of zeank &#187; coding</title>
	<atom:link href="http://blog.jwchat.org/category/coding/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.jwchat.org</link>
	<description>coding and stuff</description>
	<pubDate>Fri, 18 Dec 2009 08:59:45 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.5.1</generator>
	<language>en</language>
			<item>
		<title>Nagios Plugin to monitor BOSH services</title>
		<link>http://blog.jwchat.org/2009/06/17/nagios-plugin-to-monitor-bosh-services/</link>
		<comments>http://blog.jwchat.org/2009/06/17/nagios-plugin-to-monitor-bosh-services/#comments</comments>
		<pubDate>Wed, 17 Jun 2009 15:29:18 +0000</pubDate>
		<dc:creator>Steve</dc:creator>
		
		<category><![CDATA[Jabber]]></category>

		<category><![CDATA[coding]]></category>

		<category><![CDATA[hacking]]></category>

		<category><![CDATA[scriplets]]></category>

		<category><![CDATA[sysadmin]]></category>

		<guid isPermaLink="false">http://blog.jwchat.org/?p=123</guid>
		<description><![CDATA[Enjoy!

#!/usr/bin/perl -w
#
# check_bosh plugin for nagios
#
# usage:
#    check_bosh -U url -H host
#
# Check if bosh service running at specified address
#
# initial version: 3 May 2000 by Truongchinh Nguyen and Karl DeBisschop
#
# current status: $Revision: 1196 $
#
# Copyright Notice: GPL
# $Id: check_bosh.pl 1196 2009-06-17 15:20:46Z s.strigler $
#
use strict;
use lib "/usr/lib/nagios/plugins";
use utils qw($TIMEOUT %ERRORS [...]]]></description>
			<content:encoded><![CDATA[<p>Enjoy!</p>
<p><code><br />
#!/usr/bin/perl -w<br />
#<br />
# check_bosh plugin for nagios<br />
#<br />
# usage:<br />
#    check_bosh -U url -H host<br />
#<br />
# Check if bosh service running at specified address<br />
#<br />
# initial version: 3 May 2000 by Truongchinh Nguyen and Karl DeBisschop<br />
#<br />
# current status: $Revision: 1196 $<br />
#<br />
# Copyright Notice: GPL<br />
# $Id: check_bosh.pl 1196 2009-06-17 15:20:46Z s.strigler $<br />
#</p>
<p>use strict;<br />
use lib "/usr/lib/nagios/plugins";<br />
use utils qw($TIMEOUT %ERRORS &#038;print_revision &#038;support);<br />
use vars qw($PROGNAME);<br />
my ($verbose,$host,$response,$state);<br />
my ($opt_V,$opt_H,$opt_h,$opt_U);<br />
$opt_V = $opt_h, $opt_h = $opt_U = '';<br />
$state = 'UNKNOWN';</p>
<p>$PROGNAME = "check_bosh";<br />
sub print_help ();<br />
sub print_usage ();</p>
<p>$ENV{'BASH_ENV'}='';<br />
$ENV{'ENV'}='';<br />
$ENV{'PATH'}='';<br />
$ENV{'LC_ALL'}='C';</p>
<p>use Getopt::Long;<br />
Getopt::Long::Configure('bundling');<br />
GetOptions(<br />
	"V"   => \$opt_V,   "version"    => \$opt_V,<br />
	"h"   => \$opt_h,   "help"       => \$opt_h,<br />
 	"U=s" => \$opt_U,   "url=s"      => \$opt_U,<br />
    "H=s" => \$opt_H,   "host=s"     => \$opt_H,<br />
 	"v+"  => \$verbose, "verbose+"   => \$verbose<br />
);</p>
<p># -h means display verbose help screen<br />
if ($opt_h) { print_help(); exit $ERRORS{'OK'}; }</p>
<p># -V means display version number<br />
if ($opt_V) {<br />
	print_revision($PROGNAME,'$Revision: 1196 $ ');<br />
	exit $ERRORS{'OK'};<br />
}</p>
<p># -U means URL<br />
unless ($opt_U) { print_usage(); exit $ERRORS{'UNKNOWN'}; }</p>
<p># -H means host name<br />
unless ($opt_H) { print_usage(); exit $ERRORS{'UNKNOWN'}; }</p>
<p>if (! utils::is_hostname($opt_H)){<br />
	print "$opt_H is not a valid host name\n";<br />
	print_usage();<br />
	exit $ERRORS{"UNKNOWN"};<br />
}</p>
<p># Just in case of problems, let's not hang Nagios<br />
$SIG{'ALRM'} = sub {<br />
        print ("ERROR: No response from RPC server (alarm)\n");<br />
        exit $ERRORS{"UNKNOWN"};<br />
};<br />
alarm($TIMEOUT);</p>
<p>$state = &#038;check_bosh($opt_U, $opt_H);</p>
<p>if ($state eq 'OK') {<br />
	print "$state: BOSH service at $opt_U up and running\n";<br />
}elsif ($state eq 'WARNING') {<br />
    print "$state: BOSH service not working correctly. Bad hostname given?\n";<br />
}else{<br />
    print "$state: BOSH service at $opt_U is not running\n";<br />
}<br />
exit $ERRORS{$state};</p>
<p>sub check_bosh() {<br />
    my $url = shift;<br />
    my $host = shift;</p>
<p>    use LWP::UserAgent;<br />
    my $ua = LWP::UserAgent->new;</p>
<p>    my $req = HTTP::Request->new(POST => $url);<br />
    $req->content_type('text/xml; charset=utf-8');<br />
    my $payload =  "<body content='text/xml; charset=utf-8' hold='1' xmlns='http://jabber.org/protocol/httpbind' to='$host' wait='300' rid='205152' ver='1.6' xmlns:xmpp='urn:xmpp:xbosh' xmpp:version='1.0'/>&#8220;;<br />
    print &#8220;SEND: &#8220;, $payload, &#8220;\n&#8221; if($verbose);</p>
<p>    $req->content($payload);</p>
<p>    my $res = $ua->request($req);</p>
<p>    if ($res->is_success) {<br />
        print &#8220;RECV: &#8220;, $res->content, &#8220;\n&#8221; if ($verbose);</p>
<p>        if ($res->content =~ /type=&#8217;terminate&#8217;/) {<br />
            return &#8216;WARNING&#8217;;<br />
        } elsif ($res->content =~ /sid=&#8217;([^']+)&#8217;/) {<br />
            $req = HTTP::Request->new(POST => $url);<br />
            $req->content_type(&#8217;text/xml; charset=utf-8&#8242;);</p>
<p>            $payload = &#8220;<body content='text/xml; charset=utf-8' xmlns='http://jabber.org/protocol/httpbind' sid='$1' rid='205153' type='terminate'/>&#8220;;<br />
            print &#8220;SEND: &#8220;, $payload, &#8220;\n&#8221; if($verbose);<br />
            $req->content($payload);</p>
<p>            $res = $ua->request($req);</p>
<p>            if ($res->is_success) {<br />
                print &#8220;RECV: &#8220;, $res->content, &#8220;\n&#8221; if ($verbose);<br />
            }<br />
            else {<br />
                print $res->status_line, &#8220;\n&#8221; if ($verbose);<br />
                return &#8216;CRITICAL&#8217;;<br />
            }<br />
        }<br />
    }<br />
    else {<br />
        print $res->status_line, &#8220;\n&#8221; if ($verbose);<br />
        return &#8216;CRITICAL&#8217;;<br />
    }</p>
<p>    return &#8216;OK&#8217;;<br />
}</p>
<p>sub print_help() {<br />
	print_revision($PROGNAME,&#8217;$Revision: 1196 $ &#8216;);<br />
	print &#8220;Copyright (c) 2009 Stefan Strigler\n&#8221;;<br />
    print &#8220;adopted from check_rpc by Karl DeBisschop/Truongchinh Nguyen/Subhendu Ghosh\n&#8221;;<br />
	print &#8220;\n&#8221;;<br />
	print &#8220;Check if bosh service is up and running\n&#8221;;<br />
	print &#8220;\n&#8221;;<br />
	print_usage();<br />
	print &#8220;\n&#8221;;<br />
	print &#8221;  <url>           URL of bosh service\n&#8221;;<br />
    print &#8221;  <host>          XMPP host name\n&#8221;;<br />
	print &#8221;  [-v]            Verbose \n&#8221;;<br />
	print &#8221;  [-v -v]         Verbose - will print supported programs and numbers \n&#8221;;<br />
	print &#8220;\n&#8221;;<br />
	support();<br />
}</p>
<p>sub print_usage () {<br />
	print &#8220;Usage: \n&#8221;;<br />
	print &#8221; $PROGNAME -U url -H host [-v]\n&#8221;;<br />
	print &#8221; $PROGNAME [-h | --help]\n&#8221;;<br />
	print &#8221; $PROGNAME [-V | --version]\n&#8221;;<br />
}<br />
</host></url></code></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.jwchat.org/2009/06/17/nagios-plugin-to-monitor-bosh-services/feed/</wfw:commentRss>
		</item>
		<item>
		<title>dojo vs. isArray</title>
		<link>http://blog.jwchat.org/2009/01/16/dojo-vs-isarray/</link>
		<comments>http://blog.jwchat.org/2009/01/16/dojo-vs-isarray/#comments</comments>
		<pubDate>Fri, 16 Jan 2009 08:46:18 +0000</pubDate>
		<dc:creator>Steve</dc:creator>
		
		<category><![CDATA[coding]]></category>

		<category><![CDATA[javascript]]></category>

		<guid isPermaLink="false">http://blog.jwchat.org/?p=120</guid>
		<description><![CDATA[Some days ago a spent many hours to fix a somewhat broken toJson output from dojo. I&#8217;ve been copying around an array between different frames and ended up having an object instead of an array as it should be. Seems Ajaxian has a solution to this array bug now. So please dojo could you please [...]]]></description>
			<content:encoded><![CDATA[<p>Some days ago a spent many hours to fix a somewhat broken toJson output from dojo. I&#8217;ve been copying around an array between different frames and ended up having an object instead of an array as it should be. Seems Ajaxian has <a href="http://ajaxian.com/archives/isarray-why-is-it-so-bloody-hard-to-get-right">a solution to this array bug</a> now. So please <a href="http://dojotoolkit.org">dojo</a> could you please fix your <a href="http://api.dojotoolkit.org/jsdoc/dojo/1.2/dojo.isArray">dojo.isArray</a>?</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.jwchat.org/2009/01/16/dojo-vs-isarray/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Open-Birdcage Project</title>
		<link>http://blog.jwchat.org/2008/09/11/open-birdcage-project/</link>
		<comments>http://blog.jwchat.org/2008/09/11/open-birdcage-project/#comments</comments>
		<pubDate>Thu, 11 Sep 2008 09:05:34 +0000</pubDate>
		<dc:creator>Steve</dc:creator>
		
		<category><![CDATA[Jabber]]></category>

		<category><![CDATA[coding]]></category>

		<category><![CDATA[microblogging]]></category>

		<guid isPermaLink="false">http://blog.jwchat.org/2008/09/11/open-birdcage-project/</guid>
		<description><![CDATA[As my last post on XMPP and microblogging has gathered lots of attention I thought it might be a good idea to establish a place for collecting all of the informations on the topic and coordinate further steps. Thus I&#8217;ve setup a trac environment at http://open-birdcage.com. I&#8217;ve already started linking articles and insightful discussions related [...]]]></description>
			<content:encoded><![CDATA[<p>As my <a href="http://blog.jwchat.org/2008/09/09/xmpp-and-microblogging-lets-do-it/">last post on XMPP and microblogging</a> has gathered lots of attention I thought it might be a good idea to establish a place for collecting all of the informations on the topic and coordinate further steps. Thus I&#8217;ve setup a <a href="http://open-birdcage.com">trac environment at http://open-birdcage.com</a>. I&#8217;ve already started linking articles and insightful discussions related to the topic. So please if you know of more places on the web with valueable informations everything from microblogging up to distributed, highly scalable services edit the wiki pages!</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.jwchat.org/2008/09/11/open-birdcage-project/feed/</wfw:commentRss>
		</item>
		<item>
		<title>blog moved - wordpress downgrade considered harmful</title>
		<link>http://blog.jwchat.org/2008/09/03/blog-moved-wordpress-downgrade-considered-harmful/</link>
		<comments>http://blog.jwchat.org/2008/09/03/blog-moved-wordpress-downgrade-considered-harmful/#comments</comments>
		<pubDate>Wed, 03 Sep 2008 12:11:41 +0000</pubDate>
		<dc:creator>Steve</dc:creator>
		
		<category><![CDATA[coding]]></category>

		<category><![CDATA[meta]]></category>

		<category><![CDATA[sysadmin]]></category>

		<guid isPermaLink="false">http://blog.jwchat.org/2008/09/03/blog-moved-wordpress-downgrade-considered-harmful/</guid>
		<description><![CDATA[Today I moved my blog away from IN-Berlin e.V. to my own server as I got frustrated by all those wordpress upgrades necessary lately. So maybe you might want to update your bookmarks. The new location is http://blog.jwchat.org.
On my private server I&#8217;m hosting debian&#8217;s default wordpress package which should get security updates automatically, thus I&#8217;m [...]]]></description>
			<content:encoded><![CDATA[<p>Today I moved my blog away from <a href="http://www.in-berlin.de">IN-Berlin e.V.</a> to my own server as I got frustrated by all those wordpress upgrades necessary lately. So maybe you might want to update your bookmarks. The new location is http://blog.jwchat.org.</p>
<p>On my private server I&#8217;m hosting debian&#8217;s default wordpress package which should get security updates automatically, thus I&#8217;m fine.<br />
Unfortunately I had been using Wordpress as of version 2.3.3 while this one is still at 2.0.x and that makes importing my old data a pain in the ass. I&#8217;ve written a small perl script which maybe could be of help for you too if you should need a downgrade of wordpress too (I guess it should work with wordpress 2.5.x, 2.6.x also):<br />
<a href="/download/wp_downgrade_2.3.x_to_2.0.x.pl.txt">wp_downgrade_2.3.x_to_2.0.x.pl</a></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.jwchat.org/2008/09/03/blog-moved-wordpress-downgrade-considered-harmful/feed/</wfw:commentRss>
		</item>
		<item>
		<title>jsjac++</title>
		<link>http://blog.jwchat.org/2008/01/03/jsjac/</link>
		<comments>http://blog.jwchat.org/2008/01/03/jsjac/#comments</comments>
		<pubDate>Thu, 03 Jan 2008 15:04:25 +0000</pubDate>
		<dc:creator>Steve</dc:creator>
		
		<category><![CDATA[JSJaC]]></category>

		<category><![CDATA[Jabber]]></category>

		<category><![CDATA[coding]]></category>

		<guid isPermaLink="false">http://zeank.in-berlin.de/2008/01/03/jsjac/</guid>
		<description><![CDATA[Happy to announce a new version of JSJaC, the one and only lib for implementing jabber clients (if it&#8217;s about the web ;)). Most notably version 1.2.2 hopefully makes you happy with its new packer (borrowed from mootools) that shrinks down filesize from 71K to 44K. Other changes include bugfixes as well as some issues [...]]]></description>
			<content:encoded><![CDATA[<p>Happy to announce a new version of <a href="http://zeank.in-berlin.de/jsjac/">JSJaC</a>, the one and only lib for implementing jabber clients (if it&#8217;s about the web ;)). Most notably version 1.2.2 hopefully makes you happy with its new packer (borrowed from mootools) that shrinks down filesize from 71K to 44K. Other changes include bugfixes as well as some issues with licenses and copyright statements being fixed now.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.jwchat.org/2008/01/03/jsjac/feed/</wfw:commentRss>
		</item>
		<item>
		<title>JSDebugger now with copyright and license</title>
		<link>http://blog.jwchat.org/2008/01/02/jsdebugger-now-with-copyright-and-license/</link>
		<comments>http://blog.jwchat.org/2008/01/02/jsdebugger-now-with-copyright-and-license/#comments</comments>
		<pubDate>Wed, 02 Jan 2008 15:10:37 +0000</pubDate>
		<dc:creator>Steve</dc:creator>
		
		<category><![CDATA[coding]]></category>

		<category><![CDATA[scriplets]]></category>

		<category><![CDATA[webdev]]></category>

		<guid isPermaLink="false">http://zeank.in-berlin.de/2008/01/02/jsdebugger-now-with-copyright-and-license/</guid>
		<description><![CDATA[Just a short note that I released a new version of JSDebugger containing the usual legalese (Copyright and GPL).
]]></description>
			<content:encoded><![CDATA[<p>Just a short note that I released a new version of <a href="http://zeank.in-berlin.de/javascript-debug-logger/">JSDebugger</a> containing the usual legalese (Copyright and GPL).</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.jwchat.org/2008/01/02/jsdebugger-now-with-copyright-and-license/feed/</wfw:commentRss>
		</item>
		<item>
		<title>obfuscated erlang</title>
		<link>http://blog.jwchat.org/2007/10/12/obfuscated-erlang/</link>
		<comments>http://blog.jwchat.org/2007/10/12/obfuscated-erlang/#comments</comments>
		<pubDate>Fri, 12 Oct 2007 12:12:45 +0000</pubDate>
		<dc:creator>Steve</dc:creator>
		
		<category><![CDATA[coding]]></category>

		<category><![CDATA[erlang]]></category>

		<guid isPermaLink="false">http://zeank.in-berlin.de/2007/10/12/obfuscated-erlang/</guid>
		<description><![CDATA[Want to have fun playing with erlang? Then join the Obfuscated Erlang Competition!
]]></description>
			<content:encoded><![CDATA[<p>Want to have fun playing with erlang? Then join the <a href="http://www.erlang-consulting.com/obfuscatederlang.html">Obfuscated Erlang Competition</a>!</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.jwchat.org/2007/10/12/obfuscated-erlang/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Google Tech Talk on Building JavaScript Libraries</title>
		<link>http://blog.jwchat.org/2007/08/27/google-tech-talk-on-building-javascript-libraries/</link>
		<comments>http://blog.jwchat.org/2007/08/27/google-tech-talk-on-building-javascript-libraries/#comments</comments>
		<pubDate>Mon, 27 Aug 2007 07:30:09 +0000</pubDate>
		<dc:creator>Steve</dc:creator>
		
		<category><![CDATA[JSJaC]]></category>

		<category><![CDATA[coding]]></category>

		<category><![CDATA[hacking]]></category>

		<guid isPermaLink="false">http://zeank.in-berlin.de/2007/08/27/google-tech-talk-on-building-javascript-libraries/</guid>
		<description><![CDATA[ 
]]></description>
			<content:encoded><![CDATA[<p><embed style="width:400px; height:326px;" id="VideoPlayback" type="application/x-shockwave-flash" src="http://video.google.com/googleplayer.swf?docId=-474821803269194441&#038;hl=de" flashvars=""> </embed></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.jwchat.org/2007/08/27/google-tech-talk-on-building-javascript-libraries/feed/</wfw:commentRss>
		</item>
	</channel>
</rss>
