<?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; hacking</title>
	<atom:link href="http://blog.jwchat.org/category/hacking/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>today: radio talk on openmicroblogging (in german)</title>
		<link>http://blog.jwchat.org/2008/10/08/today-radio-talk-on-openmicroblogging-in-german/</link>
		<comments>http://blog.jwchat.org/2008/10/08/today-radio-talk-on-openmicroblogging-in-german/#comments</comments>
		<pubDate>Wed, 08 Oct 2008 07:20:50 +0000</pubDate>
		<dc:creator>Steve</dc:creator>
		
		<category><![CDATA[Jabber]]></category>

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

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

		<category><![CDATA[open-birdcage]]></category>

		<guid isPermaLink="false">http://blog.jwchat.org/2008/10/08/today-radio-talk-on-openmicroblogging-in-german/</guid>
		<description><![CDATA[Today I&#8217;ll be giving an interview to radio fsk, hamburg. The topic is about twitter and openmicroblogging. They&#8217;ll have Cem Basman from WhisperN News and Media (brokerz) at face and I&#8217;ll join later on to talk about the role of XMPP in the field of openmicroblogging. The live broadcast calls itself Nerdalert and will start [...]]]></description>
			<content:encoded><![CDATA[<p>Today I&#8217;ll be giving an interview to <a href="http://www.fsk-hh.org/">radio fsk, hamburg</a>. The topic is about twitter and openmicroblogging. They&#8217;ll have <a href="http://sprechblase.wordpress.com/">Cem Basman</a> from WhisperN News and Media (<a href="http://brokerz.com">brokerz</a>) at face and I&#8217;ll join later on to talk about the role of XMPP in the field of openmicroblogging. The live broadcast calls itself <a href="http://nerdalert.de/cgi-bin/main.pl?NerdAlert">Nerdalert</a> and will start at 17:00h CEST. And of course there is also a <a href="http://www.fsk-hh.org/livestream">livestream</a> available.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.jwchat.org/2008/10/08/today-radio-talk-on-openmicroblogging-in-german/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>
