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>Ledger - double-entry accounting using text based storage format
</title>
11 <link>http://people.skolelinux.org/pere/blog/Ledger___double_entry_accounting_using_text_based_storage_format.html
</link>
12 <guid isPermaLink=
"true">http://people.skolelinux.org/pere/blog/Ledger___double_entry_accounting_using_text_based_storage_format.html
</guid>
13 <pubDate>Tue,
18 Dec
2012 23:
30:
00 +
0100</pubDate>
14 <description><p
>A few days ago I came across
15 <a href=
"http://joeyh.name/blog/entry/hledger/
">a blog post from Joey
16 Hess
</a
> describing
<a href=
"http://ledger-cli.org/
">ledger
</a
> and
17 hledger, a text based system for double-entry accounting. I found it
18 interesting, as I am involved with several organizations where
19 accounting is an issue, and I have not really become too friendly with
20 the different web based systems we use. I find it hard to find what I
21 look for in the menus and even harder try to get sensible data out of
22 the systems. Ledger seem different. The accounting data is kept in
23 text files that can be stored in a version control system, and there
25 are at least
<a href=
"https://github.com/ledger/ledger/wiki/Ports
">five
26 different implementations
</a
> able to read the format. An example
27 entry look like this, and is simple enough that it will be trivial to
28 generate entries based on CVS files fetched from the bank:
</p
>
30 <blockquote
><pre
>
34 </pre
></blockquote
>
36 <p
>The concept seemed interesting enough for me to check it out and
37 look for others using it. I found blog posts from
38 <a href=
"http://blog.spang.cc/posts/hledger_rocks_my_world/
">Christine
40 <a href=
"http://bugsplat.info/
2010-
05-
23-keeping-finances-with-ledger.html
">Pete
42 <a href=
"http://blog.andrewcantino.com/blog/
2010/
11/
06/command-line-accounting-with-ledger-and-reckon/
">Andrew
44 <a href=
"http://blog.iphoting.com/blog/
2012/
11/
29/command-line-double-entry-accounting/
">Ronald
45 Ip
</a
> describing how they use it, as well as a post from
46 <a href=
"https://groups.google.com/forum/?fromgroups=#!topic/ledger-cli/r0oWjwbQ9Bo
">Bradley
47 M. Kuhn
</a
> at the Software Freedom Conservancy. All seemed like good
48 recommendations fitting my need.
</p
>
50 <p
>The
<a href=
"http://packages.qa.debian.org/l/ledger.html
">ledger
</a
>
51 package is available in Debian Squeeze, while the
52 <a href=
"http://packages.qa.debian.org/h/haskell-hledger.html
">hledger
</a
>
53 package only is available in Debian Sid. As I use Squeeze, ledger
54 seemed the best choice to get started.
</p
>
56 <p
>To get some real data to test on, I wrote a
57 <a href=
"http://www.nuug.no/tools/lodo2ledger
">web scraper
</a
> for
58 <a href=
"http://www.lodo.no/
">LODO
</a
>, the accounting system used by
59 the
<a href=
"http://www.nuug.no/
">NUUG
</a
> association, and started to
60 play with the data set. I
'm not really deeply into accounting, but I
61 am able to get a simple balance and accounting status for example
62 using the
"<tt
>ledger balance
</tt
>" command. But I will have to
63 gather more experience before I know if the ledger way is a good fit
64 for the organisations I am involved in.
</p
>
69 <title>61 kommuner lenker nå til FiksGataMi fra sine nettsider
</title>
70 <link>http://people.skolelinux.org/pere/blog/
61_kommuner_lenker_n__til_FiksGataMi_fra_sine_nettsider.html
</link>
71 <guid isPermaLink=
"true">http://people.skolelinux.org/pere/blog/
61_kommuner_lenker_n__til_FiksGataMi_fra_sine_nettsider.html
</guid>
72 <pubDate>Tue,
11 Dec
2012 23:
55:
00 +
0100</pubDate>
73 <description><p
>For noen dager siden omfavnet nok en kommune NUUGs
74 <a href=
"http://www.fiksgatami.no/
">FiksGataMi
</a
>. Med
61 kommuner
75 som lenker til FiksGataMi fra sine hjemmesider er «markedsandelen»
14%
76 (av
429 kommuner). Siden
77 <a href=
"http://people.skolelinux.org/pere/blog/
59_kommuner_omfavner_n__FiksGataMi.html
">siste
78 oppdatering i november
</a
> har kommunene Re og Vågsøy kommet til og
79 slår følge med kommunene Askim, Askøy, Audnedal, Aure, Balestrand,
80 Bærum, Eide, Farsund, Flekkefjord, Folldal, Gran, Grue, Hadsel,
81 Halden, Halsa, Hamar, Hobøl, Holtålen, Hægebostad, Høyanger,
82 Kongsberg, Kristiansund, Kvinesdal, Kviteseid, Levanger, Lindesnes,
83 Luster, Lyngdal, Løten, Mandal, Marnardal, Moss, Namsos, Nissedal,
84 Nordreisa, Randaberg, Rindal, Sel, Sirdal, Skiptvet, Sortland,
85 Spydeberg, Stange, Stjørdal, Stord, Søgne, Sør-Odal, Tolga, Trysil,
86 Tynset, Tysvær, Ullensvang Herad, Utsira, Vennesla, Verdal, Vågan,
87 Vågå, Våler og Åseral. Oppdatert liste er tilgjengelig fra
88 <a href=
"http://wiki.nuug.no/grupper/fiksgatami/positivemottakere
">NUUGs
89 wiki
</a
>. Kartet er dog ikke oppdatert med de siste kommunene.
</p
>
91 <p
>Kanskje du bør høre med din kommune om de vil bli mer aktive
92 brukere av FiksGataMi? Se
93 <a href=
"http://people.skolelinux.org/pere/blog/
40_kommuner_lenker_n__til_FiksGataMi_fra_sine_nettsider___gj_r_din_.html
">en
94 tidligere bloggpost
</a
> med tips om hvordan det kan gjøres.
</p
>
96 <p
>I snitt rapporteres det nå via FiksGataMi ca.
60 meldinger fra
97 innbyggerne i uka om feil på offentlig infrastruktur.
</p
>
102 <title>Scripting the Cerebrum/bofhd user administration system using XML-RPC
</title>
103 <link>http://people.skolelinux.org/pere/blog/Scripting_the_Cerebrum_bofhd_user_administration_system_using_XML_RPC.html
</link>
104 <guid isPermaLink=
"true">http://people.skolelinux.org/pere/blog/Scripting_the_Cerebrum_bofhd_user_administration_system_using_XML_RPC.html
</guid>
105 <pubDate>Thu,
6 Dec
2012 10:
30:
00 +
0100</pubDate>
106 <description><p
>Where I work at the
<a href=
"http://www.uio.no/
">University of
107 Oslo
</a
>, we use the
108 <a href=
"http://sourceforge.net/projects/cerebrum/
">Cerebrum user
109 administration system
</a
> to maintain users, groups, DNS, DHCP, etc.
110 I
've known since the system was written that the server is providing
111 an
<a href=
"http://en.wikipedia.org/wiki/XML-RPC
">XML-RPC
</a
> API, but
112 I have never spent time to try to figure out how to use it, as we
113 always use the bofh command line client at work. Until today. I want
114 to script the updating of DNS and DHCP to make it easier to set up
115 virtual machines. Here are a few notes on how to use it with
118 <p
>I started by looking at the source of the Java
119 <a href=
"http://cerebrum.svn.sourceforge.net/viewvc/cerebrum/trunk/cerebrum/clients/jbofh/
">bofh
120 client
</a
>, to figure out how it connected to the API server. I also
121 googled for python examples on how to use XML-RPC, and found
122 <a href=
"http://tldp.org/HOWTO/XML-RPC-HOWTO/xmlrpc-howto-python.html
">a
123 simple example in
</a
> the XML-RPC howto.
</p
>
125 <p
>This simple example code show how to connect, get the list of
126 commands (as a JSON dump), and how to get the information about the
127 user currently logged in:
</p
>
129 <blockquote
><pre
>
130 #!/usr/bin/env python
133 server_url =
'https://cerebrum-uio.uio.no:
8000';
134 username = getpass.getuser()
135 password = getpass.getpass()
136 server = xmlrpclib.Server(server_url);
137 #print server.get_commands(sessionid)
138 sessionid = server.login(username, password)
139 print server.run_command(sessionid,
"user_info
", username)
140 result = server.logout(sessionid)
142 </pre
></blockquote
>
144 <p
>Armed with this knowledge I can now move forward and script the DNS
145 and DHCP updates I wanted to do.
</p
>