1 <?xml version=
"1.0" encoding=
"ISO-8859-1"?>
2 <rss version='
2.0' xmlns:lj='http://www.livejournal.org/rss/lj/
1.0/'
>
4 <title>Petter Reinholdtsen - Entries from December
2012</title>
5 <description>Entries from December
2012</description>
6 <link>http://people.skolelinux.org/pere/blog/
</link>
10 <title>61 kommuner lenker nå til FiksGataMi fra sine nettsider
</title>
11 <link>http://people.skolelinux.org/pere/blog/
61_kommuner_lenker_n__til_FiksGataMi_fra_sine_nettsider.html
</link>
12 <guid isPermaLink=
"true">http://people.skolelinux.org/pere/blog/
61_kommuner_lenker_n__til_FiksGataMi_fra_sine_nettsider.html
</guid>
13 <pubDate>Tue,
11 Dec
2012 23:
55:
00 +
0100</pubDate>
14 <description><p
>For noen dager siden omfavnet nok en kommune NUUGs
15 <a href=
"http://www.fiksgatami.no/
">FiksGataMi
</a
>. Med
61 kommuner
16 som lenker til FiksGataMi fra sine hjemmesider er «markedsandelen»
14%
17 (av
429 kommuner). Siden
18 <a href=
"http://people.skolelinux.org/pere/blog/
59_kommuner_omfavner_n__FiksGataMi.html
">siste
19 oppdatering i november
</a
> har kommunene Re og Vågsøy kommet til og
20 slår følge med kommunene Askim, Askøy, Audnedal, Aure, Balestrand,
21 Bærum, Eide, Farsund, Flekkefjord, Folldal, Gran, Grue, Hadsel,
22 Halden, Halsa, Hamar, Hobøl, Holtålen, Hægebostad, Høyanger,
23 Kongsberg, Kristiansund, Kvinesdal, Kviteseid, Levanger, Lindesnes,
24 Luster, Lyngdal, Løten, Mandal, Marnardal, Moss, Namsos, Nissedal,
25 Nordreisa, Randaberg, Rindal, Sel, Sirdal, Skiptvet, Sortland,
26 Spydeberg, Stange, Stjørdal, Stord, Søgne, Sør-Odal, Tolga, Trysil,
27 Tynset, Tysvær, Ullensvang Herad, Utsira, Vennesla, Verdal, Vågan,
28 Vågå, Våler og Åseral. Oppdatert liste er tilgjengelig fra
29 <a href=
"http://wiki.nuug.no/grupper/fiksgatami/positivemottakere
">NUUGs
30 wiki
</a
>. Kartet er dog ikke oppdatert med de siste kommunene.
</p
>
32 <p
>Kanskje du bør høre med din kommune om de vil bli mer aktive
33 brukere av FiksGataMi? Se
34 <a href=
"http://people.skolelinux.org/pere/blog/
40_kommuner_lenker_n__til_FiksGataMi_fra_sine_nettsider___gj_r_din_.html
">en
35 tidligere bloggpost
</a
> med tips om hvordan det kan gjøres.
</p
>
37 <p
>I snitt rapporteres det nå via FiksGataMi ca.
60 meldinger fra
38 innbyggerne i uka om feil på offentlig infrastruktur.
</p
>
43 <title>Scripting the Cerebrum/bofhd user administration system using XML-RPC
</title>
44 <link>http://people.skolelinux.org/pere/blog/Scripting_the_Cerebrum_bofhd_user_administration_system_using_XML_RPC.html
</link>
45 <guid isPermaLink=
"true">http://people.skolelinux.org/pere/blog/Scripting_the_Cerebrum_bofhd_user_administration_system_using_XML_RPC.html
</guid>
46 <pubDate>Thu,
6 Dec
2012 10:
30:
00 +
0100</pubDate>
47 <description><p
>Where I work at the
<a href=
"http://www.uio.no/
">University of
48 Oslo
</a
>, we use the
49 <a href=
"http://sourceforge.net/projects/cerebrum/
">Cerebrum user
50 administration system
</a
> to maintain users, groups, DNS, DHCP, etc.
51 I
've known since the system was written that the server is providing
52 an
<a href=
"http://en.wikipedia.org/wiki/XML-RPC
">XML-RPC
</a
> API, but
53 I have never spent time to try to figure out how to use it, as we
54 always use the bofh command line client at work. Until today. I want
55 to script the updating of DNS and DHCP to make it easier to set up
56 virtual machines. Here are a few notes on how to use it with
59 <p
>I started by looking at the source of the Java
60 <a href=
"http://cerebrum.svn.sourceforge.net/viewvc/cerebrum/trunk/cerebrum/clients/jbofh/
">bofh
61 client
</a
>, to figure out how it connected to the API server. I also
62 googled for python examples on how to use XML-RPC, and found
63 <a href=
"http://tldp.org/HOWTO/XML-RPC-HOWTO/xmlrpc-howto-python.html
">a
64 simple example in
</a
> the XML-RPC howto.
</p
>
66 <p
>This simple example code show how to connect, get the list of
67 commands (as a JSON dump), and how to get the information about the
68 user currently logged in:
</p
>
70 <blockquote
><pre
>
74 server_url =
'https://cerebrum-uio.uio.no:
8000';
75 username = getpass.getuser()
76 password = getpass.getpass()
77 server = xmlrpclib.Server(server_url);
78 #print server.get_commands(sessionid)
79 sessionid = server.login(username, password)
80 print server.run_command(sessionid,
"user_info
", username)
81 result = server.logout(sessionid)
83 </pre
></blockquote
>
85 <p
>Armed with this knowledge I can now move forward and script the DNS
86 and DHCP updates I wanted to do.
</p
>