<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/rss2full.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.feedburner.com/~d/styles/itemcontent.css"?><rss xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:admin="http://webns.net/mvcb/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:creativeCommons="http://backend.userland.com/creativeCommonsRssModule" xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" version="2.0">
<channel>
    
    <title>c0t0d0s0.org - Toolbox</title>
    <link>http://www.c0t0d0s0.org/</link>
    <description>the sun in a lighthungry universe</description>
    <dc:language>en</dc:language>
    <generator>Serendipity 1.6 - http://www.s9y.org/</generator>
    
    

<atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" type="application/rss+xml" href="http://feeds.feedburner.com/C0t0d0s0org-Toolbox" /><feedburner:info uri="c0t0d0s0org-toolbox" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com/" /><item>
    <title>Parasitic Hadoop for backups</title>
    <link>http://feedproxy.google.com/~r/C0t0d0s0org-Toolbox/~3/mQtGQ7YwZYw/7262-Parasitic-Hadoop-for-backups.html</link>
            <category>English</category>
            <category>Solaris</category>
            <category>Toolbox</category>
    
    <comments>http://www.c0t0d0s0.org/archives/7262-Parasitic-Hadoop-for-backups.html#comments</comments>
    <wfw:comment>http://www.c0t0d0s0.org/wfwcomment.php?cid=7262</wfw:comment>

    <slash:comments>0</slash:comments>
    <wfw:commentRss>http://www.c0t0d0s0.org/rss.php?version=2.0&amp;type=comments&amp;cid=7262</wfw:commentRss>
    

    <author>nospam@example.com (Joerg Moellenkamp)</author>
    <content:encoded><![CDATA[
    A while ago, i thought about about <a href="http://www.c0t0d0s0.org/archives/6215-Parasitic-Hadoop.html">parasitic hadoop</a> in order to use unused resources on systems not loaded. An hadoop node installed on machines used for different things and configured in a way, that it just uses the resources left over by the host (the application you've bought the server for). iIn my experience, the most unloaded system part are the boot disks (to big and often not loaded). Ben Rockwood of cuddletech.com had a great idea: Using the Hadoop Distributed File System to store ZFS dumps. Read more about it in <a onclick="_gaq.push(['_trackPageview', '/extlink/cuddletech.com/blog/?p=562']);"  href="http://cuddletech.com/blog/?p=562">his blog</a>. 
    <img src="http://feeds.feedburner.com/~r/C0t0d0s0org-Toolbox/~4/mQtGQ7YwZYw" height="1" width="1"/>]]></content:encoded>

    <pubDate>Tue, 19 Apr 2011 06:11:16 +0200</pubDate>
    <guid isPermaLink="false">http://www.c0t0d0s0.org/archives/7262-guid.html</guid>
    <creativeCommons:license>http://creativecommons.org/licenses/by-sa/2.5/</creativeCommons:license>
<feedburner:origLink>http://www.c0t0d0s0.org/archives/7262-Parasitic-Hadoop-for-backups.html</feedburner:origLink></item>
<item>
    <title>Updating a Confluence Wiki with a script</title>
    <link>http://feedproxy.google.com/~r/C0t0d0s0org-Toolbox/~3/omVSHBUpyxw/5779-Updating-a-Confluence-Wiki-with-a-script.html</link>
            <category>English</category>
            <category>Toolbox</category>
    
    <comments>http://www.c0t0d0s0.org/archives/5779-Updating-a-Confluence-Wiki-with-a-script.html#comments</comments>
    <wfw:comment>http://www.c0t0d0s0.org/wfwcomment.php?cid=5779</wfw:comment>

    <slash:comments>0</slash:comments>
    <wfw:commentRss>http://www.c0t0d0s0.org/rss.php?version=2.0&amp;type=comments&amp;cid=5779</wfw:commentRss>
    

    <author>nospam@example.com (Joerg Moellenkamp)</author>
    <content:encoded><![CDATA[
    In the process of creating a wikified version of the LKSF, i had the problem of importing all those files into the Wiki. As wikis.sun.com is based on the Atlassian Confluence i couldn´t use the already available scripts for Mediawiki for example . I wasn´t really fond of the idea to do this manually, thus i´ve asked via Twitter for a solution and i´ve got a hint for the xmlrpc interface. At the end, i´ve created a script with stolen ... sorry ... copied components of many other scripts (like <a onclick="_gaq.push(['_trackPageview', '/extlink/www.mattryall.net/blog/2008/06/confluence-python']);"  href="http://www.mattryall.net/blog/2008/06/confluence-python">this one</a> or <a onclick="_gaq.push(['_trackPageview', '/extlink/confluence.atlassian.com/display/CONFEXT/XML-RPC+Page+Updater+Example']);"  href="http://confluence.atlassian.com/display/CONFEXT/XML-RPC+Page+Updater+Example">this</a> one). My script compares the current version with the new version, uploads the new version and creates new pages if nescessary.It takes three command line parameters: the name of the Wikipage, the name of the space (something like a subwiki or a administrative domain in Confluence) and the file you want to upload. Sorry for the programming style ... python isn´t really my native programming language, but the xmlrpc is solved really good in python and it was a good reason to refresh my really rusty python skills.<br />
<br />
Okay ... let´s get to the usage. For example: <blockquote><code><pre>./export.py sat.lksf_sat_crashcore.tex lksf sat/lksf_sat_crashcore.tex.wikified</pre></code></blockquote>This uploads the file <code>sat/lksf_sat_crashcore.tex.wikified</code> into the space <code>lksf</code> with the page name <code>sat.lksf_sat_crashcore.tex</code>>. This leads to the wiki page <a onclick="_gaq.push(['_trackPageview', '/extlink/wikis.sun.com/display/lksf/sat.lksf_sat_crashcore.tex']);"  href="http://wikis.sun.com/display/lksf/sat.lksf_sat_crashcore.tex">http://wikis.sun.com/display/lksf/sat.lksf_sat_crashcore.tex</a>Now to the source of the script <code>export.py</code>:<blockquote><code><pre>#!/usr/bin/python

import sys
import xmlrpclib
import hashlib

title = sys.argv[1]
space = sys.argv[2]
file  = sys.argv[3]
content = ''

print "================="
print file

chash = hashlib.sha256()

try:
 datei = open(file, 'r')
 for line in datei:
    content = content + line
    if line == "BREAKBREAKBREAK\n":
    	break
 datei.close()
except IOError:
 print  file , "not readable"
 sys.exit(1)

chash.update(content)
contenthash = chash.hexdigest();
print "new content hash:", contenthash

s = xmlrpclib.Server("http://wikis.sun.com/rpc/xmlrpc")
token = s.confluence1.login("username", "password")

newpage= "false"

try:
 	page2 = s.confluence1.getPage(token, space, title)
 	oldcontent = page2["content"]
	ochash = hashlib.sha256()
	ochash.update(oldcontent)
	oldcontenthash = ochash.hexdigest();
	print "old content hash:", oldcontenthash
	if oldcontenthash == contenthash:
		print "no update needed"
		sys.exit(0)
except xmlrpclib.Fault, err:
    print "A fault occurred"
    print "Fault code: %d" % err.faultCode
    newpage = "true"

if newpage == "true":
	page={}
	page["title"] = title
	page["content"] = content
	page["space"] = space
else:
    page=page2
    page["content"] = content

try: 
	s.confluence1.storePage(token, page)
except xmlrpclib.Fault, err:
    print "A fault occurred"
    print "Fault code: %d" % err.faultCode
    print "Fault string: %s" % err.faultString

print title, "updated"</pre></code></blockquote>Just in case you wonder because of this "BREAKBREAKBREAK" line. It´s just for debugging purposes. As i wrote yesterday, the xmlrpc is a little bit bitchy about charsets and the error message wasn´t helpful. It was easier to find the problem by bisecting the file again and again. And this was done by the "BREAKBREAKBREAK" line <img src="http://www.c0t0d0s0.org/templates/default/img/emoticons/wink.png" alt=";-)" style="display: inline; vertical-align: bottom;" class="emoticon" /> 
    <img src="http://feeds.feedburner.com/~r/C0t0d0s0org-Toolbox/~4/omVSHBUpyxw" height="1" width="1"/>]]></content:encoded>

    <pubDate>Wed, 22 Jul 2009 22:48:47 +0200</pubDate>
    <guid isPermaLink="false">http://www.c0t0d0s0.org/archives/5779-guid.html</guid>
    <creativeCommons:license>http://creativecommons.org/licenses/by-sa/2.5/</creativeCommons:license>
<feedburner:origLink>http://www.c0t0d0s0.org/archives/5779-Updating-a-Confluence-Wiki-with-a-script.html</feedburner:origLink></item>
<item>
    <title>Testing methods for I/O</title>
    <link>http://feedproxy.google.com/~r/C0t0d0s0org-Toolbox/~3/lzgs9uWUDks/3153-Testing-methods-for-IO.html</link>
            <category>English</category>
            <category>Toolbox</category>
    
    <comments>http://www.c0t0d0s0.org/archives/3153-Testing-methods-for-IO.html#comments</comments>
    <wfw:comment>http://www.c0t0d0s0.org/wfwcomment.php?cid=3153</wfw:comment>

    <slash:comments>0</slash:comments>
    <wfw:commentRss>http://www.c0t0d0s0.org/rss.php?version=2.0&amp;type=comments&amp;cid=3153</wfw:commentRss>
    

    <author>nospam@example.com (Joerg Moellenkamp)</author>
    <content:encoded><![CDATA[
    Ben Rockwood wrote an excellent article about measuring I/O bandwidth: <a onclick="_gaq.push(['_trackPageview', '/extlink/cuddletech.com/blog/pivot/entry.php?id=820']);"  href="http://cuddletech.com/blog/pivot/entry.php?id=820">IO Benchmarking: How, Why and With What</a>. 
    <img src="http://feeds.feedburner.com/~r/C0t0d0s0org-Toolbox/~4/lzgs9uWUDks" height="1" width="1"/>]]></content:encoded>

    <pubDate>Thu, 24 May 2007 13:38:40 +0200</pubDate>
    <guid isPermaLink="false">http://www.c0t0d0s0.org/archives/3153-guid.html</guid>
    <category>i/o</category>
<category>Toolbox</category>
<category>tools</category>
<creativeCommons:license>http://creativecommons.org/licenses/by-sa/2.5/</creativeCommons:license>
<feedburner:origLink>http://www.c0t0d0s0.org/archives/3153-Testing-methods-for-IO.html</feedburner:origLink></item>
<item>
    <title>Kris erklärt  die Welt - heute: fork, exec, wait und exit</title>
    <link>http://feedproxy.google.com/~r/C0t0d0s0org-Toolbox/~3/8-ueQ6WGeqA/2514-Kris-erklaert-die-Welt-heute-fork,-exec,-wait-und-exit.html</link>
            <category>German</category>
            <category>Toolbox</category>
    
    <comments>http://www.c0t0d0s0.org/archives/2514-Kris-erklaert-die-Welt-heute-fork,-exec,-wait-und-exit.html#comments</comments>
    <wfw:comment>http://www.c0t0d0s0.org/wfwcomment.php?cid=2514</wfw:comment>

    <slash:comments>0</slash:comments>
    <wfw:commentRss>http://www.c0t0d0s0.org/rss.php?version=2.0&amp;type=comments&amp;cid=2514</wfw:commentRss>
    

    <author>nospam@example.com (Joerg Moellenkamp)</author>
    <content:encoded><![CDATA[
    Kris hat einen ein sehr guten Artikel über die Abläufe beim Starten und Beenden von Prozessen in einem unixoiden Operating Environment geschrieben: <a onclick="_gaq.push(['_trackPageview', '/extlink/blog.koehntopp.de/archives/1525-fork,-exec,-wait-und-exit.html']);"  href="http://blog.koehntopp.de/archives/1525-fork,-exec,-wait-und-exit.html">fork, exec, wait und exit</a>. Eindeutige Leseempfehlung. 
    <img src="http://feeds.feedburner.com/~r/C0t0d0s0org-Toolbox/~4/8-ueQ6WGeqA" height="1" width="1"/>]]></content:encoded>

    <pubDate>Sun, 07 Jan 2007 07:44:30 +0100</pubDate>
    <guid isPermaLink="false">http://www.c0t0d0s0.org/archives/2514-guid.html</guid>
    <category>knowhow</category>
<category>linux</category>
<category>Toolbox</category>
<category>unix</category>
<creativeCommons:license>http://creativecommons.org/licenses/by-sa/2.5/</creativeCommons:license>
<feedburner:origLink>http://www.c0t0d0s0.org/archives/2514-Kris-erklaert-die-Welt-heute-fork,-exec,-wait-und-exit.html</feedburner:origLink></item>
<item>
    <title>Safari</title>
    <link>http://feedproxy.google.com/~r/C0t0d0s0org-Toolbox/~3/JIB0BhfG8ic/1616-Safari.html</link>
            <category>German</category>
            <category>Toolbox</category>
    
    <comments>http://www.c0t0d0s0.org/archives/1616-Safari.html#comments</comments>
    <wfw:comment>http://www.c0t0d0s0.org/wfwcomment.php?cid=1616</wfw:comment>

    <slash:comments>0</slash:comments>
    <wfw:commentRss>http://www.c0t0d0s0.org/rss.php?version=2.0&amp;type=comments&amp;cid=1616</wfw:commentRss>
    

    <author>nospam@example.com (Joerg Moellenkamp)</author>
    <content:encoded><![CDATA[
    Ich weiss, es gibt <a onclick="_gaq.push(['_trackPageview', '/extlink/my.safaribooksonline.com/home']);"  href="http://my.safaribooksonline.com/home">Safari Books</a> schon länger. Ich habe es trotzdem erst jetzt für mich entdeckt. Schon praktisch, wenn man sich Fachbücher nur ausleiht so lange man sie defacto braucht. Ich habe etwa ein Billy-Regal voll mit Fachbüchern, die ich nur seltenst anpacke und sowieso nie da habe, wo ich sie brauche.  
    <img src="http://feeds.feedburner.com/~r/C0t0d0s0org-Toolbox/~4/JIB0BhfG8ic" height="1" width="1"/>]]></content:encoded>

    <pubDate>Sat, 10 Jun 2006 12:36:52 +0200</pubDate>
    <guid isPermaLink="false">http://www.c0t0d0s0.org/archives/1616-guid.html</guid>
    <category>bücher</category>
<category>Toolbox</category>
<category>work</category>
<creativeCommons:license>http://creativecommons.org/licenses/by-sa/2.5/</creativeCommons:license>
<feedburner:origLink>http://www.c0t0d0s0.org/archives/1616-Safari.html</feedburner:origLink></item>
<item>
    <title>SunRay ueber WAN</title>
    <link>http://feedproxy.google.com/~r/C0t0d0s0org-Toolbox/~3/S0r0_AS14Sg/1511-SunRay-ueber-WAN.html</link>
            <category>German</category>
            <category>Toolbox</category>
    
    <comments>http://www.c0t0d0s0.org/archives/1511-SunRay-ueber-WAN.html#comments</comments>
    <wfw:comment>http://www.c0t0d0s0.org/wfwcomment.php?cid=1511</wfw:comment>

    <slash:comments>0</slash:comments>
    <wfw:commentRss>http://www.c0t0d0s0.org/rss.php?version=2.0&amp;type=comments&amp;cid=1511</wfw:commentRss>
    

    <author>nospam@example.com (Joerg Moellenkamp)</author>
    <content:encoded><![CDATA[
    Man nehme zwei <a onclick="_gaq.push(['_trackPageview', '/extlink/www.linksys.com/servlet/Satellite?c=L_Product_C2&amp;amp;childpagename=US%2FLayout&amp;amp;cid=1133202177241&amp;amp;pagename=Linksys%2FCommon%2FVisitorWrapper']);"  href="http://www.linksys.com/servlet/Satellite?c=L_Product_C2&amp;childpagename=US%2FLayout&amp;cid=1133202177241&amp;pagename=Linksys%2FCommon%2FVisitorWrapper">Linksys WRT54GL</a>, die <a onclick="_gaq.push(['_trackPageview', '/extlink/wrt-wiki.bsr-clan.de/index.php?title=What_is_%22DD-WRT%22%3F#v23_File_Versions']);"  href="http://wrt-wiki.bsr-clan.de/index.php?title=What_is_%22DD-WRT%22%3F#v23_File_Versions">DD-WRT Firmware</a> mit VPN-Unterstützung sowie ein paar kleinere Startup-Scripte und schon kann man SunRay-Sessions auch ueber WAN benutzen. Ich werde darueber in den nächsten Tagen eine Anleitung im Wiki schreiben. 
    <img src="http://feeds.feedburner.com/~r/C0t0d0s0org-Toolbox/~4/S0r0_AS14Sg" height="1" width="1"/>]]></content:encoded>

    <pubDate>Thu, 18 May 2006 16:10:24 +0200</pubDate>
    <guid isPermaLink="false">http://www.c0t0d0s0.org/archives/1511-guid.html</guid>
    <category>Toolbox</category>
<creativeCommons:license>http://creativecommons.org/licenses/by-sa/2.5/</creativeCommons:license>
<feedburner:origLink>http://www.c0t0d0s0.org/archives/1511-SunRay-ueber-WAN.html</feedburner:origLink></item>
<item>
    <title>Toolbox 2: How to convert schemafiles from OpenLdap to SunOne Directory Server</title>
    <link>http://feedproxy.google.com/~r/C0t0d0s0org-Toolbox/~3/Kg3nM8vd8KM/1145-Toolbox-2-How-to-convert-schemafiles-from-OpenLdap-to-SunOne-Directory-Server.html</link>
            <category>English</category>
            <category>Toolbox</category>
    
    <comments>http://www.c0t0d0s0.org/archives/1145-Toolbox-2-How-to-convert-schemafiles-from-OpenLdap-to-SunOne-Directory-Server.html#comments</comments>
    <wfw:comment>http://www.c0t0d0s0.org/wfwcomment.php?cid=1145</wfw:comment>

    <slash:comments>0</slash:comments>
    <wfw:commentRss>http://www.c0t0d0s0.org/rss.php?version=2.0&amp;type=comments&amp;cid=1145</wfw:commentRss>
    

    <author>nospam@example.com (Joerg Moellenkamp)</author>
    <content:encoded><![CDATA[
    Okay, you´ve downloaded the Sun One Directory server, want to use an opensource application with schema extensions for OpenLdap... but ... the schema files of openldap are non-standard, so you are not able to add them to the Sun One Directory Server. You have to rewrite them. Or convert them with a little script. <br /><a href="http://www.c0t0d0s0.org/archives/1145-Toolbox-2-How-to-convert-schemafiles-from-OpenLdap-to-SunOne-Directory-Server.html#extended">Continue reading "Toolbox 2: How to convert schemafiles from OpenLdap to SunOne Directory Server"</a>
    <img src="http://feeds.feedburner.com/~r/C0t0d0s0org-Toolbox/~4/Kg3nM8vd8KM" height="1" width="1"/>]]></content:encoded>

    <pubDate>Thu, 22 Dec 2005 00:09:35 +0100</pubDate>
    <guid isPermaLink="false">http://www.c0t0d0s0.org/archives/1145-guid.html</guid>
    <category>convert</category>
<category>openldap</category>
<category>s1ds</category>
<category>schema</category>
<category>sun</category>
<category>sun one directory server</category>
<category>Toolbox</category>
<creativeCommons:license>http://creativecommons.org/licenses/by-sa/2.5/</creativeCommons:license>
<feedburner:origLink>http://www.c0t0d0s0.org/archives/1145-Toolbox-2-How-to-convert-schemafiles-from-OpenLdap-to-SunOne-Directory-Server.html</feedburner:origLink></item>
<item>
    <title>Toolbox 1: Was treibt ein Script auf meinem LDAP-Server ?</title>
    <link>http://feedproxy.google.com/~r/C0t0d0s0org-Toolbox/~3/fYbxV8dxauA/954-Toolbox-1-Was-treibt-ein-Script-auf-meinem-LDAP-Server.html</link>
            <category>German</category>
            <category>Toolbox</category>
    
    <comments>http://www.c0t0d0s0.org/archives/954-Toolbox-1-Was-treibt-ein-Script-auf-meinem-LDAP-Server.html#comments</comments>
    <wfw:comment>http://www.c0t0d0s0.org/wfwcomment.php?cid=954</wfw:comment>

    <slash:comments>2</slash:comments>
    <wfw:commentRss>http://www.c0t0d0s0.org/rss.php?version=2.0&amp;type=comments&amp;cid=954</wfw:commentRss>
    

    <author>nospam@example.com (Joerg Moellenkamp)</author>
    <content:encoded><![CDATA[
    Der Admin des LDAP-Servers ist beim Mittag oder hat gerade keine Lust die Audit-Logs herauszugeben. Oder es stehen Requests von hunderten von Servern auf dem Server ein und die Analyse  geraet zum Nadel im Nadelhaufen suchen. <br />
<pre>
/opt/csw/bin/tethereal -V port 389 | /usr/xpg4/bin/egrep "(Filter|Base)"
</pre> 
    <img src="http://feeds.feedburner.com/~r/C0t0d0s0org-Toolbox/~4/fYbxV8dxauA" height="1" width="1"/>]]></content:encoded>

    <pubDate>Thu, 06 Oct 2005 11:55:07 +0200</pubDate>
    <guid isPermaLink="false">http://www.c0t0d0s0.org/archives/954-guid.html</guid>
    <category>Toolbox</category>
<creativeCommons:license>http://creativecommons.org/licenses/by-sa/2.5/</creativeCommons:license>
<feedburner:origLink>http://www.c0t0d0s0.org/archives/954-Toolbox-1-Was-treibt-ein-Script-auf-meinem-LDAP-Server.html</feedburner:origLink></item>

</channel>
</rss>

