]> pere.pagekite.me Git - homepage.git/blob - blog/archive/2012/12/12.rss
Typo.
[homepage.git] / blog / archive / 2012 / 12 / 12.rss
1 <?xml version="1.0" encoding="ISO-8859-1"?>
2 <rss version='2.0' xmlns:lj='http://www.livejournal.org/rss/lj/1.0/'>
3 <channel>
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>
7
8
9 <item>
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>&lt;p&gt;A few days ago I came across
15 &lt;a href=&quot;http://joeyh.name/blog/entry/hledger/&quot;&gt;a blog post from Joey
16 Hess&lt;/a&gt; describing &lt;a href=&quot;http://ledger-cli.org/&quot;&gt;ledger&lt;/a&gt; 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
24
25 are at least &lt;a href=&quot;https://github.com/ledger/ledger/wiki/Ports&quot;&gt;five
26 different implementations&lt;/a&gt; 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:&lt;/p&gt;
29
30 &lt;blockquote&gt;&lt;pre&gt;
31 2004-05-27 Book Store
32 Expenses:Books $20.00
33 Liabilities:Visa
34 &lt;/pre&gt;&lt;/blockquote&gt;
35
36 &lt;p&gt;The concept seemed interesting enough for me to check it out and
37 look for others using it. I found blog posts from
38 &lt;a href=&quot;http://blog.spang.cc/posts/hledger_rocks_my_world/&quot;&gt;Christine
39 Spang&lt;/a&gt;,
40 &lt;a href=&quot;http://bugsplat.info/2010-05-23-keeping-finances-with-ledger.html&quot;&gt;Pete
41 Keen&lt;/a&gt;,
42 &lt;a href=&quot;http://blog.andrewcantino.com/blog/2010/11/06/command-line-accounting-with-ledger-and-reckon/&quot;&gt;Andrew
43 Cantino&lt;/a&gt; and
44 &lt;a href=&quot;http://blog.iphoting.com/blog/2012/11/29/command-line-double-entry-accounting/&quot;&gt;Ronald
45 Ip&lt;/a&gt; describing how they use it, as well as a post from
46 &lt;a href=&quot;https://groups.google.com/forum/?fromgroups=#!topic/ledger-cli/r0oWjwbQ9Bo&quot;&gt;Bradley
47 M. Kuhn&lt;/a&gt; at the Software Freedom Conservancy. All seemed like good
48 recommendations fitting my need.&lt;/p&gt;
49
50 &lt;p&gt;The &lt;a href=&quot;http://packages.qa.debian.org/l/ledger.html&quot;&gt;ledger&lt;/a&gt;
51 package is available in Debian Squeeze, while the
52 &lt;a href=&quot;http://packages.qa.debian.org/h/haskell-hledger.html&quot;&gt;hledger&lt;/a&gt;
53 package only is available in Debian Sid. As I use Squeeze, ledger
54 seemed the best choice to get started.&lt;/p&gt;
55
56 &lt;p&gt;To get some real data to test on, I wrote a
57 &lt;a href=&quot;http://www.nuug.no/tools/lodo2ledger&quot;&gt;web scraper&lt;/a&gt; for
58 &lt;a href=&quot;http://www.lodo.no/&quot;&gt;LODO&lt;/a&gt;, the accounting system used by
59 the &lt;a href=&quot;http://www.nuug.no/&quot;&gt;NUUG&lt;/a&gt; association, and started to
60 play with the data set. I&#39;m not really deeply into accounting, but I
61 am able to get a simple balance and accounting status for example
62 using the &quot;&lt;tt&gt;ledger balance&lt;/tt&gt;&quot; 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.&lt;/p&gt;
65 </description>
66 </item>
67
68 <item>
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>&lt;p&gt;For noen dager siden omfavnet nok en kommune NUUGs
74 &lt;a href=&quot;http://www.fiksgatami.no/&quot;&gt;FiksGataMi&lt;/a&gt;. Med 61 kommuner
75 som lenker til FiksGataMi fra sine hjemmesider er «markedsandelen» 14%
76 (av 429 kommuner). Siden
77 &lt;a href=&quot;http://people.skolelinux.org/pere/blog/59_kommuner_omfavner_n__FiksGataMi.html&quot;&gt;siste
78 oppdatering i november&lt;/a&gt; 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 &lt;a href=&quot;http://wiki.nuug.no/grupper/fiksgatami/positivemottakere&quot;&gt;NUUGs
89 wiki&lt;/a&gt;. Kartet er dog ikke oppdatert med de siste kommunene.&lt;/p&gt;
90
91 &lt;p&gt;Kanskje du bør høre med din kommune om de vil bli mer aktive
92 brukere av FiksGataMi? Se
93 &lt;a href=&quot;http://people.skolelinux.org/pere/blog/40_kommuner_lenker_n__til_FiksGataMi_fra_sine_nettsider___gj_r_din_.html&quot;&gt;en
94 tidligere bloggpost&lt;/a&gt; med tips om hvordan det kan gjøres.&lt;/p&gt;
95
96 &lt;p&gt;I snitt rapporteres det nå via FiksGataMi ca. 60 meldinger fra
97 innbyggerne i uka om feil på offentlig infrastruktur.&lt;/p&gt;
98 </description>
99 </item>
100
101 <item>
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>&lt;p&gt;Where I work at the &lt;a href=&quot;http://www.uio.no/&quot;&gt;University of
107 Oslo&lt;/a&gt;, we use the
108 &lt;a href=&quot;http://sourceforge.net/projects/cerebrum/&quot;&gt;Cerebrum user
109 administration system&lt;/a&gt; to maintain users, groups, DNS, DHCP, etc.
110 I&#39;ve known since the system was written that the server is providing
111 an &lt;a href=&quot;http://en.wikipedia.org/wiki/XML-RPC&quot;&gt;XML-RPC&lt;/a&gt; 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
116 Python.&lt;/p&gt;
117
118 &lt;p&gt;I started by looking at the source of the Java
119 &lt;a href=&quot;http://cerebrum.svn.sourceforge.net/viewvc/cerebrum/trunk/cerebrum/clients/jbofh/&quot;&gt;bofh
120 client&lt;/a&gt;, 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 &lt;a href=&quot;http://tldp.org/HOWTO/XML-RPC-HOWTO/xmlrpc-howto-python.html&quot;&gt;a
123 simple example in&lt;/a&gt; the XML-RPC howto.&lt;/p&gt;
124
125 &lt;p&gt;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:&lt;/p&gt;
128
129 &lt;blockquote&gt;&lt;pre&gt;
130 #!/usr/bin/env python
131 import getpass
132 import xmlrpclib
133 server_url = &#39;https://cerebrum-uio.uio.no:8000&#39;;
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, &quot;user_info&quot;, username)
140 result = server.logout(sessionid)
141 print result
142 &lt;/pre&gt;&lt;/blockquote&gt;
143
144 &lt;p&gt;Armed with this knowledge I can now move forward and script the DNS
145 and DHCP updates I wanted to do.&lt;/p&gt;
146 </description>
147 </item>
148
149 </channel>
150 </rss>