- <div class="title"><a href="http://people.skolelinux.org/pere/blog/Debian_Edu_interview__Wolfgang_Schweer.html">Debian Edu interview: Wolfgang Schweer</a></div>
- <div class="date"> 1st April 2012</div>
- <div class="body"><p>Germany is a core area for the
-<a href="http://www.skolelinux.org/">Debian Edu and Skolelinux</a>
-user community, and this time I managed to get hold of Wolfgang
-Schweer, a valuable contributor to the project from Germany.
-
-<p><strong>Who are you, and how do you spend your days?</strong></p>
-
-<p>I've studied Mathematics at the university 'Ruhr-Universität' in
-Bochum, Germany. Since 1981 I'm working as a teacher at the school
-"<a href="http://www.westfalenkolleg-dortmund.de/">Westfalen-Kolleg
-Dortmund</a>", a second chance school. Here, young adults is given
-the opportunity to get further education in order to do the school
-examination 'Abitur', which will allow to study at a university. This
-second chance is of value for those who want a better job perspective
-or failed to get a higher school examination being teens.</p>
-
-<p>Besides teaching I was involved in developing online courses for a
-blended learning project called 'abitur-online.nrw' and in some other
-information technology related projects. For about ten years I've been
-teacher and coordinator for the 'abitur-online' project at my
-school. Being now in my early sixties, I've decided to leave school at
-the end of April this year.</p>
-
-<p><strong>How did you get in contact with the Skolelinux/Debian Edu
-project?</strong></p>
-
-<p>The first information about Skolelinux must have come to my
-attention years ago and somehow related to LTSP (Linux Terminal Server
-Project). At school, we had set up a network at the beginning of 1997
-using Suse Linux on the desktop, replacing a Novell network. Since
-2002, we used old machines from the city council of Dortmund as thin
-clients (LTSP, later Ubuntu/Lessdisks) cause new hardware was out of
-reach. At home I'm using Debian since years and - subscribed to the
-Debian news letter - heard from time to time about Skolelinux. About
-two years ago I proposed to replace the (somehow undocumented and only
-known to me) system at school by a well known Debian based system:
-Skolelinux.</p>
-
-<p>Students and teachers appreciated the new system because of a
-better look and feel and an enhanced access to local media on thin
-clients. The possibility to alter and/or reset passwords using a GUI
-was welcomed, too. Being able to do administrative tasks using a GUI
-and to easily set up workstations using PXE was of very high value for
-the admin teachers.</p>
-
-<p><strong>What do you see as the advantages of Skolelinux/Debian
-Edu?</strong></p>
-
-<p>It's open source, easy to set up, stable and flexible due to it's
-Debian base. It integrates LTSP out-of-the-box. And it is documented!
-So it was a perfect choice.</p>
-
-<p>Being open source, there are no license problems and so it's
-possible to point teachers and students to programs like
-OpenOffice.org, ViewYourMind (mind mapping) and The Gimp. It's of
-high value to be able to adapt parts of the system to special needs of
-a school and to choose where to get support for this.</p>
-
-<p><strong>What do you see as the disadvantages of Skolelinux/Debian
-Edu?</strong></p>
-
-<p>Nothing yet.</p>
-
-<p><strong>Which free software do you use daily?</strong></p>
-
-<p>At home (Debian Sid with Gnome Desktop): Iceweasel, LibreOffice,
-Mutt, Gedit, Document Viewer, Midnight Commander, flpsed (PDF
-Annotator). At school (Skolelinux Lenny): Iceweasel, Gedit,
-LibreOffice.</p>
-
-<p><strong>Which strategy do you believe is the right one to use to
-get schools to use free software?</strong></p>
-
-<p>Some time ago I thought it was enough to tell people about it. But
-that doesn't seem to work quite well. Now I concentrate on those more
-interested and hope to get multiplicators that way.</p>
+ <div class="title"><a href="http://people.skolelinux.org/pere/blog/Scripting_the_Cerebrum_bofhd_user_administration_system_using_XML_RPC.html">Scripting the Cerebrum/bofhd user administration system using XML-RPC</a></div>
+ <div class="date"> 6th December 2012</div>
+ <div class="body"><p>Where I work at the <a href="http://www.uio.no/">University of
+Oslo</a>, we use the
+<a href="http://sourceforge.net/projects/cerebrum/">Cerebrum user
+administration system</a> to maintain users, groups, DNS, DHCP, etc.
+I've known since the system was written that the server is providing
+an <a href="http://en.wikipedia.org/wiki/XML-RPC">XML-RPC</a> API, but
+I have never spent time to try to figure out how to use it, as we
+always use the bofh command line client at work. Until today. I want
+to script the updating of DNS and DHCP to make it easier to set up
+virtual machines. Here are a few notes on how to use it with
+Python.</p>
+
+<p>I started by looking at the source of the Java
+<a href="http://cerebrum.svn.sourceforge.net/viewvc/cerebrum/trunk/cerebrum/clients/jbofh/">bofh
+client</a>, to figure out how it connected to the API server. I also
+googled for python examples on how to use XML-RPC, and found
+<a href="http://tldp.org/HOWTO/XML-RPC-HOWTO/xmlrpc-howto-python.html">a
+simple example in</a> the XML-RPC howto.</p>
+
+<p>This simple example code show how to connect, get the list of
+commands (as a JSON dump), and how to get the information about the
+user currently logged in:</p>
+
+<blockquote><pre>
+#!/usr/bin/env python
+import getpass
+import xmlrpclib
+server_url = 'https://cerebrum-uio.uio.no:8000';
+username = getpass.getuser()
+password = getpass.getpass()
+server = xmlrpclib.Server(server_url);
+#print server.get_commands(sessionid)
+sessionid = server.login(username, password)
+print server.run_command(sessionid, "user_info", username)
+result = server.logout(sessionid)
+print result
+</pre></blockquote>
+
+<p>Armed with this knowledge I can now move forward and script the DNS
+and DHCP updates I wanted to do.</p>