1 <?xml version=
"1.0" encoding=
"utf-8"?>
2 <rss version='
2.0' xmlns:lj='http://www.livejournal.org/rss/lj/
1.0/' xmlns:
atom=
"http://www.w3.org/2005/Atom">
4 <title>Petter Reinholdtsen
</title>
5 <description></description>
6 <link>http://people.skolelinux.org/pere/blog/
</link>
7 <atom:link href=
"http://people.skolelinux.org/pere/blog/index.rss" rel=
"self" type=
"application/rss+xml" />
10 <title>UsingQR -
"Electronic
" paper invoices using JSON and QR codes
</title>
11 <link>http://people.skolelinux.org/pere/blog/UsingQR____Electronic__paper_invoices_using_JSON_and_QR_codes.html
</link>
12 <guid isPermaLink=
"true">http://people.skolelinux.org/pere/blog/UsingQR____Electronic__paper_invoices_using_JSON_and_QR_codes.html
</guid>
13 <pubDate>Sat,
19 Mar
2016 09:
40:
00 +
0100</pubDate>
14 <description><p
>Back in
2013 I proposed
15 <a href=
"http://people.skolelinux.org/pere/blog/_Electronic__paper_invoices___using_vCard_in_a_QR_code.html
">a
16 way to make paper and PDF invoices easier to process electronically by
17 adding a QR code with the key information about the invoice
</a
>. I
18 suggested using vCard field definition, to get some standard format
19 for name and address, but any format would work. I did not do
20 anything about the proposal, but hoped someone one day would make
21 something like it. It would make it possible to efficiently send
22 machine readable invoices directly between seller and buyer.
</p
>
24 <p
>This was the background when I came across a proposal and
25 specification from the web based accounting and invoicing supplier
26 <a href=
"http://www.visma.com/
">Visma
</a
> in Sweden called
27 <a href=
"http://usingqr.com/
">UsingQR
</a
>. Their PDF invoices contain
28 a QR code with the key information of the invoice in JSON format.
29 This is the typical content of a QR code following the UsingQR
30 specification (based on a real world example, some numbers replaced to
31 get a more bogus entry). I
've reformatted the JSON to make it easier
32 to read. Normally this is all on one long line:
</p
>
34 <p
><img src=
"http://people.skolelinux.org/pere/blog/images/
2016-
03-
19-qr-invoice.png
" align=
"right
"><pre
>
36 "vh
":
500.00,
41 "nme
":
"Din Leverandør
",
42 "cc
":
"NO
",
43 "cid
":
"997912345 MVA
",
44 "iref
":
"12300001",
45 "idt
":
"20151022",
46 "ddt
":
"20151105",
47 "due
":
2500.0000,
48 "cur
":
"NOK
",
49 "pt
":
"BBAN
",
50 "acc
":
"17202612345",
51 "bc
":
"BIENNOK1
",
52 "adr
":
"0313 OSLO
"
54 </pre
></p
>
56 </p
>The interpretation of the fields can be found in the
57 <a href=
"http://usingqr.com/wp-content/uploads/
2014/
06/UsingQR_specification1.pdf
">format
58 specification
</a
> (revision
2 from june
2014). The format seem to
59 have most of the information needed to handle accounting and payment
60 of invoices, at least the fields I have needed so far here in
63 <p
>Unfortunately, the site and document do not mention anything about
64 the patent, trademark and copyright status of the format and the
65 specification. Because of this, I asked the people behind it back in
66 November to clarify. Ann-Christine Savlid (ann-christine.savlid (at)
67 visma.com) replied that Visma had not applied for patent or trademark
68 protection for this format, and that there were no copyright based
69 usage limitations for the format. I urged her to make sure this was
70 explicitly written on the web pages and in the specification, but
71 unfortunately this has not happened yet. So I guess if there is
72 submarine patents, hidden trademarks or a will to sue for copyright
73 infringements, those starting to use the UsingQR format might be at
74 risk, but if this happen there is some legal defense in the fact that
75 the people behind the format claimed it was safe to do so. At least
76 with patents, there is always
77 <a href=
"http://www.paperspecs.com/paper-news/beware-the-qr-code-patent-trap/
">a
78 chance of getting sued...
</a
></p
>
80 <p
>I also asked if they planned to maintain the format in an
81 independent standard organization to give others more confidence that
82 they would participate in the standardization process on equal terms
83 with Visma, but they had no immediate plans for this. Their plan was
84 to work with banks to try to get more users of the format, and
85 evaluate the way forward if the format proved to be popular. I hope
86 they conclude that using an open standard organisation like
87 <a href=
"http://www.ietf.org/
">IETF
</a
> is the correct place to
88 maintain such specification.
</p
>
90 <p
><strong
>Update
2016-
03-
20</strong
>: Via Twitter I became aware of
91 <a href=
"https://news.ycombinator.com/item?id=
11319492">some comments
92 about this blog post
</a
> that had several useful links and references to
93 similar systems. In the Czech republic, the Czech Banking Association
94 standard #
26, with short name SPAYD, uses QR codes with payment
95 information. More information is available from the Wikipedia page on
96 <a href=
"https://en.wikipedia.org/wiki/Short_Payment_Descriptor
">Short
97 Payment Descriptor
</a
>. And in Germany, there is a system named
98 <a href=
"http://www.bezahlcode.de/
">BezahlCode
</a
>,
99 (
<a href=
"http://www.bezahlcode.de/wp-content/uploads/BezahlCode_TechDok.pdf
">specification
100 v1.8
2013-
12-
05 available as PDF
</a
>), which uses QR codes with
101 URL-like formatting using
"bank:
" as the URI schema/protocol to
102 provide the payment information. There is also the
103 <a href=
"http://www.ferd-net.de/front_content.php?idcat=
231">ZUGFeRD
</a
>
104 file format that perhaps could be transfered using QR codes, but I am
105 not sure if it is done already. Last, in Bolivia there are reports
106 that tax information since november
2014 need to be printed in QR
107 format on invoices. I have not been able to track down a
108 specification for this format, because of my limited language skill
114 <title>Making battery measurements a little easier in Debian
</title>
115 <link>http://people.skolelinux.org/pere/blog/Making_battery_measurements_a_little_easier_in_Debian.html
</link>
116 <guid isPermaLink=
"true">http://people.skolelinux.org/pere/blog/Making_battery_measurements_a_little_easier_in_Debian.html
</guid>
117 <pubDate>Tue,
15 Mar
2016 15:
00:
00 +
0100</pubDate>
118 <description><p
>Back in September, I blogged about
119 <a href=
"http://people.skolelinux.org/pere/blog/The_life_and_death_of_a_laptop_battery.html
">the
120 system I wrote to collect statistics about my laptop battery
</a
>, and
121 how it showed the decay and death of this battery (now replaced). I
122 created a simple deb package to handle the collection and graphing,
123 but did not want to upload it to Debian as there were already
124 <a href=
"https://tracker.debian.org/pkg/battery-stats
">a battery-stats
125 package in Debian
</a
> that should do the same thing, and I did not see
126 a point of uploading a competing package when battery-stats could be
127 fixed instead. I reported a few bugs about its non-function, and
128 hoped someone would step in and fix it. But no-one did.
</p
>
130 <p
>I got tired of waiting a few days ago, and took matters in my own
131 hands. The end result is that I am now the new upstream developer of
132 battery stats (
<a href=
"https://github.com/petterreinholdtsen/battery-stats
">available from github
</a
>) and part of the team maintaining
133 battery-stats in Debian, and the package in Debian unstable is finally
134 able to collect battery status using the
<tt
>/sys/class/power_supply/
</tt
>
135 information provided by the Linux kernel. If you install the
136 battery-stats package from unstable now, you will be able to get a
137 graph of the current battery fill level, to get some idea about the
138 status of the battery. The source package build and work just fine in
139 Debian testing and stable (and probably oldstable too, but I have not
140 tested). The default graph you get for that system look like this:
</p
>
142 <p align=
"center
"><img src=
"http://people.skolelinux.org/pere/blog/images/
2016-
03-
15-battery-stats-graph-example.png
" width=
"70%
" align=
"center
"></p
>
144 <p
>My plans for the future is to merge my old scripts into the
145 battery-stats package, as my old scripts collected a lot more details
146 about the battery. The scripts are merged into the upstream
147 battery-stats git repository already, but I am not convinced they work
148 yet, as I changed a lot of paths along the way. Will have to test a
149 bit more before I make a new release.
</p
>
151 <p
>I will also consider changing the file format slightly, as I
152 suspect the way I combine several values into one field might make it
153 impossible to know the type of the value when using it for processing
154 and graphing.
</p
>
156 <p
>If you would like I would like to keep an close eye on your laptop
157 battery, check out the battery-stats package in
158 <a href=
"https://tracker.debian.org/pkg/battery-stats
">Debian
</a
> and
160 <a href=
"https://github.com/petterreinholdtsen/battery-stats
">github
</a
>.
161 I would love some help to improve the system further.
</p
>
166 <title>Creating, updating and checking debian/copyright semi-automatically
</title>
167 <link>http://people.skolelinux.org/pere/blog/Creating__updating_and_checking_debian_copyright_semi_automatically.html
</link>
168 <guid isPermaLink=
"true">http://people.skolelinux.org/pere/blog/Creating__updating_and_checking_debian_copyright_semi_automatically.html
</guid>
169 <pubDate>Fri,
19 Feb
2016 15:
00:
00 +
0100</pubDate>
170 <description><p
>Making packages for Debian requires quite a lot of attention to
171 details. And one of the details is the content of the
172 debian/copyright file, which should list all relevant licenses used by
173 the code in the package in question, preferably in
174 <a href=
"https://www.debian.org/doc/packaging-manuals/copyright-format/
1.0/
">machine
175 readable DEP5 format
</a
>.
</p
>
177 <p
>For large packages with lots of contributors it is hard to write
178 and update this file manually, and if you get some detail wrong, the
179 package is normally rejected by the ftpmasters. So getting it right
180 the first time around get the package into Debian faster, and save
181 both you and the ftpmasters some work.. Today, while trying to figure
182 out what was wrong with
183 <a href=
"https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=
686447">the
184 zfsonlinux copyright file
</a
>, I decided to spend some time on
185 figuring out the options for doing this job automatically, or at least
186 semi-automatically.
</p
>
188 <p
>Lucikly, there are at least two tools available for generating the
189 file based on the code in the source package,
190 <tt
><a href=
"https://tracker.debian.org/pkg/debmake
">debmake
</a
></tt
>
191 and
<tt
><a href=
"https://tracker.debian.org/pkg/cme
">cme
</a
></tt
>. I
'm
192 not sure which one of them came first, but both seem to be able to
193 create a sensible draft file. As far as I can tell, none of them can
194 be trusted to get the result just right, so the content need to be
195 polished a bit before the file is OK to upload. I found the debmake
197 <a href=
"http://goofying-with-debian.blogspot.com/
2014/
07/debmake-checking-source-against-dep-
5.html
">a
198 blog posts from
2014</a
>.
200 <p
>To generate using debmake, use the -cc option:
203 debmake -cc
> debian/copyright
204 </pre
></p
>
206 <p
>Note there are some problems with python and non-ASCII names, so
207 this might not be the best option.
</p
>
209 <p
>The cme option is based on a config parsing library, and I found
211 <a href=
"https://ddumont.wordpress.com/
2015/
04/
05/improving-creation-of-debian-copyright-file/
">a
212 blog post from
2015</a
>. To generate using cme, use the
'update
213 dpkg-copyright
' option:
216 cme update dpkg-copyright
217 </pre
></p
>
219 <p
>This will create or update debian/copyright. The cme tool seem to
220 handle UTF-
8 names better than debmake.
</p
>
222 <p
>When the copyright file is created, I would also like some help to
223 check if the file is correct. For this I found two good options,
224 <tt
>debmake -k
</tt
> and
<tt
>license-reconcile
</tt
>. The former seem
225 to focus on license types and file matching, and is able to detect
226 ineffective blocks in the copyright file. The latter reports missing
227 copyright holders and years, but was confused by inconsistent license
228 names (like CDDL vs. CDDL-
1.0). I suspect it is good to use both and
229 fix all issues reported by them before uploading. But I do not know
230 if the tools and the ftpmasters agree on what is important to fix in a
231 copyright file, so the package might still be rejected.
</p
>
233 <p
>The devscripts tool
<tt
>licensecheck
</tt
> deserve mentioning. It
234 will read through the source and try to find all copyright statements.
235 It is not comparing the result to the content of debian/copyright, but
236 can be useful when verifying the content of the copyright file.
</p
>
238 <p
>Are you aware of better tools in Debian to create and update
239 debian/copyright file. Please let me know, or blog about it on
240 planet.debian.org.
</p
>
242 <p
>As usual, if you use Bitcoin and want to show your support of my
243 activities, please send Bitcoin donations to my address
244 <b
><a href=
"bitcoin:
15oWEoG9dUPovwmUL9KWAnYRtNJEkP1u1b
">15oWEoG9dUPovwmUL9KWAnYRtNJEkP1u1b
</a
></b
>.
</p
>
246 <p
><strong
>Update
2016-
02-
20</strong
>: I got a tip from Mike Gabriel
247 on how to use licensecheck and cdbs to create a draft copyright file
250 licensecheck --copyright -r `find * -type f` | \
251 /usr/lib/cdbs/licensecheck2dep5
> debian/copyright.auto
252 </pre
></p
>
254 <p
>He mentioned that he normally check the generated file into the
255 version control system to make it easier to discover license and
256 copyright changes in the upstream source. I will try to do the same
257 with my packages in the future.
</p
>
259 <p
><strong
>Update
2016-
02-
21</strong
>: The cme author recommended
260 against using -quiet for new users, so I removed it from the proposed
261 command line.
</p
>
266 <title>Using appstream in Debian to locate packages with firmware and mime type support
</title>
267 <link>http://people.skolelinux.org/pere/blog/Using_appstream_in_Debian_to_locate_packages_with_firmware_and_mime_type_support.html
</link>
268 <guid isPermaLink=
"true">http://people.skolelinux.org/pere/blog/Using_appstream_in_Debian_to_locate_packages_with_firmware_and_mime_type_support.html
</guid>
269 <pubDate>Thu,
4 Feb
2016 16:
40:
00 +
0100</pubDate>
270 <description><p
>The
<a href=
"https://wiki.debian.org/DEP-
11">appstream system
</a
>
271 is taking shape in Debian, and one provided feature is a very
272 convenient way to tell you which package to install to make a given
273 firmware file available when the kernel is looking for it. This can
274 be done using apt-file too, but that is for someone else to blog
277 <p
>Here is a small recipe to find the package with a given firmware
278 file, in this example I am looking for ctfw-
3.2.3.0.bin, randomly
279 picked from the set of firmware announced using appstream in Debian
280 unstable. In general you would be looking for the firmware requested
281 by the kernel during kernel module loading. To find the package
282 providing the example file, do like this:
</p
>
284 <blockquote
><pre
>
285 % apt install appstream
289 % appstreamcli what-provides firmware:runtime ctfw-
3.2.3.0.bin | \
290 awk
'/Package:/ {print $
2}
'
293 </pre
></blockquote
>
295 <p
>See
<a href=
"https://wiki.debian.org/AppStream/Guidelines
">the
296 appstream wiki
</a
> page to learn how to embed the package metadata in
297 a way appstream can use.
</p
>
299 <p
>This same approach can be used to find any package supporting a
300 given MIME type. This is very useful when you get a file you do not
301 know how to handle. First find the mime type using
<tt
>file
302 --mime-type
</tt
>, and next look up the package providing support for
303 it. Lets say you got an SVG file. Its MIME type is image/svg+xml,
304 and you can find all packages handling this type like this:
</p
>
306 <blockquote
><pre
>
307 % apt install appstream
311 % appstreamcli what-provides mimetype image/svg+xml | \
312 awk
'/Package:/ {print $
2}
'
334 </pre
></blockquote
>
336 <p
>I believe the MIME types are fetched from the desktop file for
337 packages providing appstream metadata.
</p
>
342 <title>Creepy, visualise geotagged social media information - nice free software
</title>
343 <link>http://people.skolelinux.org/pere/blog/Creepy__visualise_geotagged_social_media_information___nice_free_software.html
</link>
344 <guid isPermaLink=
"true">http://people.skolelinux.org/pere/blog/Creepy__visualise_geotagged_social_media_information___nice_free_software.html
</guid>
345 <pubDate>Sun,
24 Jan
2016 10:
50:
00 +
0100</pubDate>
346 <description><p
>Most people seem not to realise that every time they walk around
347 with the computerised radio beacon known as a mobile phone their
348 position is tracked by the phone company and often stored for a long
349 time (like every time a SMS is received or sent). And if their
350 computerised radio beacon is capable of running programs (often called
351 mobile apps) downloaded from the Internet, these programs are often
352 also capable of tracking their location (if the app requested access
353 during installation). And when these programs send out information to
354 central collection points, the location is often included, unless
355 extra care is taken to not send the location. The provided
356 information is used by several entities, for good and bad (what is
357 good and bad, depend on your point of view). What is certain, is that
358 the private sphere and the right to free movement is challenged and
359 perhaps even eradicated for those announcing their location this way,
360 when they share their whereabouts with private and public
363 <p align=
"center
"><img width=
"70%
" src=
"http://people.skolelinux.org/pere/blog/images/
2016-
01-
24-nice-creepy-desktop-window.png
"></p
>
365 <p
>The phone company logs provide a register of locations to check out
366 when one want to figure out what the tracked person was doing. It is
367 unavailable for most of us, but provided to selected government
368 officials, company staff, those illegally buying information from
369 unfaithful servants and crackers stealing the information. But the
370 public information can be collected and analysed, and a free software
371 tool to do so is called
372 <a href=
"http://www.geocreepy.com/
">Creepy or Cree.py
</a
>. I
373 discovered it when I read
374 <a href=
"http://www.aftenposten.no/kultur/Slik-kan-du-bli-overvaket-pa-Twitter-og-Instagram-uten-a-ane-det-
7787884.html
">an
375 article about Creepy
</a
> in the Norwegian newspaper Aftenposten i
376 November
2014, and decided to check if it was available in Debian.
377 The python program was in Debian, but
378 <a href=
"https://tracker.debian.org/pkg/creepy
">the version in
379 Debian
</a
> was completely broken and practically unmaintained. I
380 uploaded a new version which did not work quite right, but did not
381 have time to fix it then. This Christmas I decided to finally try to
382 get Creepy operational in Debian. Now a fixed version is available in
383 Debian unstable and testing, and almost all Debian specific patches
385 <a href=
"https://github.com/jkakavas/creepy
">upstream
</a
>.
</p
>
387 <p
>The Creepy program visualises geolocation information fetched from
388 Twitter, Instagram, Flickr and Google+, and allow one to get a
389 complete picture of every social media message posted recently in a
390 given area, or track the movement of a given individual across all
391 these services. Earlier it was possible to use the search API of at
392 least some of these services without identifying oneself, but these
393 days it is impossible. This mean that to use Creepy, you need to
394 configure it to log in as yourself on these services, and provide
395 information to them about your search interests. This should be taken
396 into account when using Creepy, as it will also share information
397 about yourself with the services.
</p
>
399 <p
>The picture above show the twitter messages sent from (or at least
400 geotagged with a position from) the city centre of Oslo, the capital
401 of Norway. One useful way to use Creepy is to first look at
402 information tagged with an area of interest, and next look at all the
403 information provided by one or more individuals who was in the area.
404 I tested it by checking out which celebrity provide their location in
405 twitter messages by checkout out who sent twitter messages near a
406 Norwegian TV station, and next could track their position over time,
407 making it possible to locate their home and work place, among other
408 things. A similar technique have been
409 <a href=
"http://www.buzzfeed.com/maxseddon/does-this-soldiers-instagram-account-prove-russia-is-covertl
">used
410 to locate Russian soldiers in Ukraine
</a
>, and it is both a powerful
411 tool to discover lying governments, and a useful tool to help people
412 understand the value of the private information they provide to the
415 <p
>The package is not trivial to backport to Debian Stable/Jessie, as
416 it depend on several python modules currently missing in Jessie (at
417 least python-instagram, python-flickrapi and
418 python-requests-toolbelt).
</p
>
420 <p
>(I have uploaded
421 <a href=
"https://screenshots.debian.net/package/creepy
">the image to
422 screenshots.debian.net
</a
> and licensed it under the same terms as the
423 Creepy program in Debian.)
</p
>
428 <title>Always download Debian packages using Tor - the simple recipe
</title>
429 <link>http://people.skolelinux.org/pere/blog/Always_download_Debian_packages_using_Tor___the_simple_recipe.html
</link>
430 <guid isPermaLink=
"true">http://people.skolelinux.org/pere/blog/Always_download_Debian_packages_using_Tor___the_simple_recipe.html
</guid>
431 <pubDate>Fri,
15 Jan
2016 00:
30:
00 +
0100</pubDate>
432 <description><p
>During his DebConf15 keynote, Jacob Appelbaum
433 <a href=
"https://summit.debconf.org/debconf15/meeting/
331/what-is-to-be-done/
">observed
434 that those listening on the Internet lines would have good reason to
435 believe a computer have a given security hole
</a
> if it download a
436 security fix from a Debian mirror. This is a good reason to always
437 use encrypted connections to the Debian mirror, to make sure those
438 listening do not know which IP address to attack. In August, Richard
439 Hartmann observed that encryption was not enough, when it was possible
440 to interfere download size to security patches or the fact that
441 download took place shortly after a security fix was released, and
442 <a href=
"http://richardhartmann.de/blog/posts/
2015/
08/
24-Tor-enabled_Debian_mirror/
">proposed
443 to always use Tor to download packages from the Debian mirror
</a
>. He
444 was not the first to propose this, as the
445 <tt
><a href=
"https://tracker.debian.org/pkg/apt-transport-tor
">apt-transport-tor
</a
></tt
>
446 package by Tim Retout already existed to make it easy to convince apt
447 to use
<a href=
"https://www.torproject.org/
">Tor
</a
>, but I was not
448 aware of that package when I read the blog post from Richard.
</p
>
450 <p
>Richard discussed the idea with Peter Palfrader, one of the Debian
451 sysadmins, and he set up a Tor hidden service on one of the central
452 Debian mirrors using the address vwakviie2ienjx6t.onion, thus making
453 it possible to download packages directly between two tor nodes,
454 making sure the network traffic always were encrypted.
</p
>
456 <p
>Here is a short recipe for enabling this on your machine, by
457 installing
<tt
>apt-transport-tor
</tt
> and replacing http and https
458 urls with tor+http and tor+https, and using the hidden service instead
459 of the official Debian mirror site. I recommend installing
460 <tt
>etckeeper
</tt
> before you start to have a history of the changes
461 done in /etc/.
</p
>
463 <blockquote
><pre
>
464 apt install apt-transport-tor
465 sed -i
's% http://ftp.debian.org/% tor+http://vwakviie2ienjx6t.onion/%
' /etc/apt/sources.list
466 sed -i
's% http% tor+http%
' /etc/apt/sources.list
467 </pre
></blockquote
>
469 <p
>If you have more sources listed in /etc/apt/sources.list.d/, run
470 the sed commands for these too. The sed command is assuming your are
471 using the ftp.debian.org Debian mirror. Adjust the command (or just
472 edit the file manually) to match your mirror.
</p
>
474 <p
>This work in Debian Jessie and later. Note that tools like
475 <tt
>apt-file
</tt
> only recently started using the apt transport
476 system, and do not work with these tor+http URLs. For
477 <tt
>apt-file
</tt
> you need the version currently in experimental,
478 which need a recent apt version currently only in unstable. So if you
479 need a working
<tt
>apt-file
</tt
>, this is not for you.
</p
>
481 <p
>Another advantage from this change is that your machine will start
482 using Tor regularly and at fairly random intervals (every time you
483 update the package lists or upgrade or install a new package), thus
484 masking other Tor traffic done from the same machine. Using Tor will
485 become normal for the machine in question.
</p
>
487 <p
>On
<a href=
"https://wiki.debian.org/FreedomBox
">Freedombox
</a
>, APT
488 is set up by default to use
<tt
>apt-transport-tor
</tt
> when Tor is
489 enabled. It would be great if it was the default on any Debian
495 <title>Nedlasting fra NRK, som Matroska med undertekster
</title>
496 <link>http://people.skolelinux.org/pere/blog/Nedlasting_fra_NRK__som_Matroska_med_undertekster.html
</link>
497 <guid isPermaLink=
"true">http://people.skolelinux.org/pere/blog/Nedlasting_fra_NRK__som_Matroska_med_undertekster.html
</guid>
498 <pubDate>Sat,
2 Jan
2016 13:
50:
00 +
0100</pubDate>
499 <description><p
>Det kommer stadig nye løsninger for å ta lagre unna innslag fra NRK
500 for å se på det senere. For en stund tilbake kom jeg over et script
501 nrkopptak laget av Ingvar Hagelund. Han fjernet riktignok sitt script
502 etter forespørsel fra Erik Bolstad i NRK, men noen tok heldigvis og
503 gjorde det
<a href=
"https://github.com/liangqi/nrkopptak
">tilgjengelig
504 via github
</a
>.
</p
>
506 <p
>Scriptet kan lagre som MPEG4 eller Matroska, og bake inn
507 undertekster i fila på et vis som blant annet VLC forstår. For å
508 bruke scriptet, kopier ned git-arkivet og kjør
</p
>
511 nrkopptak/bin/nrk-opptak k
<ahref=
"https://tv.nrk.no/serie/bmi-turne/MUHH45000115/sesong-
1/episode-
1">https://tv.nrk.no/serie/bmi-turne/MUHH45000115/sesong-
1/episode-
1</a
>
512 </pre
></p
>
514 <p
>URL-eksemplet er dagens toppsak på tv.nrk.no. Argument
'k
' ber
515 scriptet laste ned og lagre som Matroska. Det finnes en rekke andre
516 muligheter for valg av kvalitet og format.
</p
>
518 <p
>Jeg foretrekker dette scriptet fremfor youtube-dl, som
519 <a href=
"http://people.skolelinux.org/pere/blog/Hvordan_enkelt_laste_ned_filmer_fra_NRK_med_den__nye__l_sningen.html
">
520 nevnt i
2014 støtter NRK
</a
> og en rekke andre videokilder, på grunn
521 av at nrkopptak samler undertekster og video i en enkelt fil, hvilket
522 gjør håndtering enklere på disk.
</p
>
527 <title>OpenALPR, find car license plates in video streams - nice free software
</title>
528 <link>http://people.skolelinux.org/pere/blog/OpenALPR__find_car_license_plates_in_video_streams___nice_free_software.html
</link>
529 <guid isPermaLink=
"true">http://people.skolelinux.org/pere/blog/OpenALPR__find_car_license_plates_in_video_streams___nice_free_software.html
</guid>
530 <pubDate>Wed,
23 Dec
2015 01:
00:
00 +
0100</pubDate>
531 <description><p
>When I was a kid, we used to collect
"car numbers
", as we used to
532 call the car license plate numbers in those days. I would write the
533 numbers down in my little book and compare notes with the other kids
534 to see how many region codes we had seen and if we had seen some
535 exotic or special region codes and numbers. It was a fun game to pass
536 time, as we kids have plenty of it.
</p
>
538 <p
>A few days I came across
539 <a href=
"https://github.com/openalpr/openalpr
">the OpenALPR
540 project
</a
>, a free software project to automatically discover and
541 report license plates in images and video streams, and provide the
542 "car numbers
" in a machine readable format. I
've been looking for
543 such system for a while now, because I believe it is a bad idea that the
544 <a href=
"https://en.wikipedia.org/wiki/Automatic_number_plate_recognition
">automatic
545 number plate recognition
</a
> tool only is available in the hands of
546 the powerful, and want it to be available also for the powerless to
547 even the score when it comes to surveillance and sousveillance. I
548 discovered the developer
549 <a href=
"https://bugs.debian.org/
747509">wanted to get the tool into
550 Debian
</a
>, and as I too wanted it to be in Debian, I volunteered to
551 help him get it into shape to get the package uploaded into the Debian
554 <p
>Today we finally managed to get the package into shape and uploaded
555 it into Debian, where it currently
556 <a href=
"https://ftp-master.debian.org//new/openalpr_2.2
.1-
1.html
">waits
557 in the NEW queue
</a
> for review by the Debian ftpmasters.
</p
>
559 <p
>I guess you are wondering why on earth such tool would be useful
560 for the common folks, ie those not running a large government
561 surveillance system? Well, I plan to put it in a computer on my bike
562 and in my car, tracking the cars nearby and allowing me to be notified
563 when number plates on my watch list are discovered. Another use case
564 was suggested by a friend of mine, who wanted to set it up at his home
565 to open the car port automatically when it discovered the plate on his
566 car. When I mentioned it perhaps was a bit foolhardy to allow anyone
567 capable of placing his license plate number of a piece of cardboard to
568 open his car port, men replied that it was always unlocked anyway. I
569 guess for such use case it make sense. I am sure there are other use
570 cases too, for those with imagination and a vision.
</p
>
572 <p
>If you want to build your own version of the Debian package, check
573 out the upstream git source and symlink ./distros/debian to ./debian/
574 before running
"debuild
" to build the source. Or wait a bit until the
575 package show up in unstable.
</p
>
580 <title>Using appstream with isenkram to install hardware related packages in Debian
</title>
581 <link>http://people.skolelinux.org/pere/blog/Using_appstream_with_isenkram_to_install_hardware_related_packages_in_Debian.html
</link>
582 <guid isPermaLink=
"true">http://people.skolelinux.org/pere/blog/Using_appstream_with_isenkram_to_install_hardware_related_packages_in_Debian.html
</guid>
583 <pubDate>Sun,
20 Dec
2015 12:
20:
00 +
0100</pubDate>
584 <description><p
>Around three years ago, I created
585 <a href=
"http://packages.qa.debian.org/isenkram
">the isenkram
586 system
</a
> to get a more practical solution in Debian for handing
587 hardware related packages. A GUI system in the isenkram package will
588 present a pop-up dialog when some hardware dongle supported by
589 relevant packages in Debian is inserted into the machine. The same
590 lookup mechanism to detect packages is available as command line
591 tools in the isenkram-cli package. In addition to mapping hardware,
592 it will also map kernel firmware files to packages and make it easy to
593 install needed firmware packages automatically. The key for this
594 system to work is a good way to map hardware to packages, in other
595 words, allow packages to announce what hardware they will work
598 <p
>I started by providing data files in the isenkram source, and
599 adding code to download the latest version of these data files at run
600 time, to ensure every user had the most up to date mapping available.
601 I also added support for storing the mapping in the Packages file in
602 the apt repositories, but did not push this approach because while I
603 was trying to figure out how to best store hardware/package mappings,
604 <a href=
"http://www.freedesktop.org/software/appstream/docs/
">the
605 appstream system
</a
> was announced. I got in touch and suggested to
606 add the hardware mapping into that data set to be able to use
607 appstream as a data source, and this was accepted at least for the
608 Debian version of appstream.
</p
>
610 <p
>A few days ago using appstream in Debian for this became possible,
611 and today I uploaded a new version
0.20 of isenkram adding support for
612 appstream as a data source for mapping hardware to packages. The only
613 package so far using appstream to announce its hardware support is my
614 pymissile package. I got help from Matthias Klumpp with figuring out
615 how do add the required
616 <a href=
"https://appstream.debian.org/html/sid/main/metainfo/pymissile.html
">metadata
617 in pymissile
</a
>. I added a file debian/pymissile.metainfo.xml with
618 this content:
</p
>
620 <blockquote
><pre
>
621 &lt;?xml version=
"1.0" encoding=
"UTF-
8"?
&gt;
622 &lt;component
&gt;
623 &lt;id
&gt;pymissile
&lt;/id
&gt;
624 &lt;metadata_license
&gt;MIT
&lt;/metadata_license
&gt;
625 &lt;name
&gt;pymissile
&lt;/name
&gt;
626 &lt;summary
&gt;Control original Striker USB Missile Launcher
&lt;/summary
&gt;
627 &lt;description
&gt;
629 Pymissile provides a curses interface to control an original
630 Marks and Spencer / Striker USB Missile Launcher, as well as a
631 motion control script to allow a webcamera to control the
634 &lt;/description
&gt;
635 &lt;provides
&gt;
636 &lt;modalias
&gt;usb:v1130p0202d*
&lt;/modalias
&gt;
637 &lt;/provides
&gt;
638 &lt;/component
&gt;
639 </pre
></blockquote
>
641 <p
>The key for isenkram is the component/provides/modalias value,
642 which is a glob style match rule for hardware specific strings
643 (modalias strings) provided by the Linux kernel. In this case, it
644 will map to all USB devices with vendor code
1130 and product code
647 <p
>Note, it is important that the license of all the metadata files
648 are compatible to have permissions to aggregate them into archive wide
649 appstream files. Matthias suggested to use MIT or BSD licenses for
650 these files. A challenge is figuring out a good id for the data, as
651 it is supposed to be globally unique and shared across distributions
652 (in other words, best to coordinate with upstream what to use). But
653 it can be changed later or, so we went with the package name as
654 upstream for this project is dormant.
</p
>
656 <p
>To get the metadata file installed in the correct location for the
657 mirror update scripts to pick it up and include its content the
658 appstream data source, the file must be installed in the binary
659 package under /usr/share/appdata/. I did this by adding the following
660 line to debian/pymissile.install:
</p
>
662 <blockquote
><pre
>
663 debian/pymissile.metainfo.xml usr/share/appdata
664 </pre
></blockquote
>
666 <p
>With that in place, the command line tool isenkram-lookup will list
667 all packages useful on the current computer automatically, and the GUI
668 pop-up handler will propose to install the package not already
669 installed if a hardware dongle is inserted into the machine in
672 <p
>Details of the modalias field in appstream is available from the
673 <a href=
"https://wiki.debian.org/DEP-
11">DEP-
11</a
> proposal.
</p
>
675 <p
>To locate the modalias values of all hardware present in a machine,
676 try running this command on the command line:
</p
>
678 <blockquote
><pre
>
679 cat $(find /sys/devices/|grep modalias)
680 </pre
></blockquote
>
682 <p
>To learn more about the isenkram system, please check out
683 <a href=
"http://people.skolelinux.org/pere/blog/tags/isenkram/
">my
684 blog posts tagged isenkram
</a
>.
</p
>
689 <title>Bokhandeldistribusjon av boken Fri kultur av Lawrence Lessig
</title>
690 <link>http://people.skolelinux.org/pere/blog/Bokhandeldistribusjon_av_boken_Fri_kultur_av_Lawrence_Lessig.html
</link>
691 <guid isPermaLink=
"true">http://people.skolelinux.org/pere/blog/Bokhandeldistribusjon_av_boken_Fri_kultur_av_Lawrence_Lessig.html
</guid>
692 <pubDate>Mon,
14 Dec
2015 12:
10:
00 +
0100</pubDate>
693 <description><p
><strong
>Besøk
694 <a href=
"https://www.lulu.com/shop/lawrence-lessig/fri-kultur/paperback/product-
22441576.html
">lulu.com
</a
>
696 <a href=
"https://www.amazon.com/Fri-kultur-Norwegian-Lawrence-Lessig/dp/
8269018236/
">Amazon
</a
>
697 for å kjøpe boken på papir, eller last ned ebook som
698 <a href=
"https://github.com/petterreinholdtsen/free-culture-lessig/raw/master/archive/freeculture.nb.pdf
">PDF
</a
>,
699 <a href=
"https://github.com/petterreinholdtsen/free-culture-lessig/raw/master/archive/freeculture.nb.epub
">ePub
</a
>
701 <a href=
"https://github.com/petterreinholdtsen/free-culture-lessig/raw/master/archive/freeculture.nb.mobi
">MOBI
</a
>
703 <a href=
"https://github.com/petterreinholdtsen/free-culture-lessig/
">github
</a
>.
</strong
></p
>
705 <p
>Jeg ble gledelig overrasket i dag da jeg oppdaget at boken jeg har
707 <a href=
"https://www.amazon.com/Fri-kultur-Norwegian-Lawrence-Lessig/dp/
8269018236/
">hadde
708 dukket opp i Amazon
</a
>. Jeg hadde trodd det skulle ta lenger tid, da
709 jeg fikk beskjed om at det skulle ta seks til åtte uker.
710 Amazonoppføringen er et resultat av at jeg for noen uker siden
711 diskuterte prissetting og håndtering av profitt med forfatteren. Det
712 måtte avklares da bruksvilkårene til boken har krav om
713 ikke-kommersiell bruk. Vi ble enige om at overskuddet fra salg av
714 boken skal sendes til
715 <a href=
"https://creativecommons.org/
">Creative Commons-stiftelsen
</a
>.
716 Med det på plass kunne jeg be
717 <a href=
"https://www.lulu.com/shop/lawrence-lessig/fri-kultur/paperback/product-
22441576.html
">lulu.com
</a
>
718 om å gi boken «utvidet» distribusjon. Årsaken til at
719 bokhandeldistribusjon var litt utfordrende er at bokhandlere krever
720 mulighet for profitt på bøkene de selger (selvfølgelig), og dermed
721 måtte de få lov til å selge til høyere pris enn lulu.com. I tillegg
722 er det krav om samme pris på lulu.com og i bokhandlene, dermed blir
723 prisen økt også hos lulu.com. Hva skulle jeg gjøre med den profitten
724 uten å bryte med klausulen om ikkekommersiell? Løsningen var å gi
725 bort profitten til CC-stiftelsen. Prisen på boken ble nesten
726 tredoblet, til $
19.99 (ca.
160,-) pluss frakt, men synligheten øker
727 betraktelig når den kan finnes i katalogene til store nettbokhandlere.
728 Det betyr at hvis du allerede har kjøpt boken har du fått den veldig
729 billig, og kjøper du den nå, får du den fortsatt billig samt donerer i
730 tillegg noen tiere til fremme av Creative Commons.
</p
>
732 <p
>Mens jeg var i gang med å titte etter informasjon om boken
733 oppdaget jeg at den også var dukket opp på
734 <a href=
"https://books.google.no/books?id=uKUGCwAAQBAJ
">Google
735 Books
</a
>, der en kan lese den på web. PDF-utgaven har ennå ikke
736 dukket opp hos
<a href=
"https://www.nb.no/
">Nasjonalbiblioteket
</a
>,
737 men det regner jeg med kommer på plass i løpet av noen uker. Boken er
738 heller ikke dukket opp hos
739 <a href=
"https://www.barnesandnoble.com/
">Barnes
& Noble
</a
> ennå, men
740 jeg antar det bare er et tidsspørsmål før dette er på plass.
</p
>
742 <p
>Boken er dessverre ikke tilgjengelig fra norske bokhandlere, og
743 kommer neppe til å bli det med det første. Årsaken er at for å få det
744 til måtte jeg personlig håndtere bestilling av bøker, hvilket jeg ikke
745 er interessert i å bruke tid på. Jeg kunne betalt ca
2000,- til
746 <a href=
"http://www.bokbasen.no/
">den norske bokbasen
</a
>, en felles
747 database over bøker tilgjengelig for norske bokhandlere, for å få en
748 oppføring der, men da måtte jeg tatt imot bestillinger på epost og
749 sendt ut bøker selv. Det ville krevd at jeg var klar til å
750 sende ut bøker på kort varsel, dvs. holdt meg med ekstra bøker,
751 konvolutter og frimerker. Bokbasen har visst ikke opplegg for å be
752 bokhandlene bestille direkte via web, så jeg droppet oppføring der.
753 Jeg har spurt Haugen bok og Tronsmo direkte på epost om de er
754 interessert i å ta inn boken i sin bestillingskatalog, men ikke fått
755 svar, så jeg antar de ikke er interessert. Derimot har jeg fått en
756 hyggelig henvendelse fra Biblioteksentralen som fortalte at de har
757 lagt den inn i sin database slik at deres bibliotekskunder enkelt kan
758 bestille den via dem.
</p
>
760 <p
>Boken er i følge
761 <a href=
"http://bibsys-almaprimo.hosted.exlibrisgroup.com/primo_library/libweb/action/display.do?tabs=detailsTab
&ct=display
&fn=search
&doc=BIBSYS_ILS71518423420002201
&indx=
1&recIds=BIBSYS_ILS71518423420002201
&recIdxs=
0&elementId=
0&renderMode=poppedOut
&displayMode=full
&frbrVersion=
&dscnt=
0&tab=library_catalogue
&dstmp=
1448543801124&vl(freeText0)=fri%
20kultur
&vid=UBO
&mode=Basic
">Bibsys/Oria
</a
>
763 <a href=
"https://www.deich.folkebibl.no/cgi-bin/websok?tnr=
1819617">Deichmanske
</a
>
764 tilgjengelig fra flere biblioteker allerede, og alle eksemplarer er
765 visst allerede utlånt med ventetid. Det synes jeg er veldig gledelig
766 å se. Jeg håper mange kommer til å lese boken. Jeg tror den er
767 spesielt egnet for foreldre og bekjente av oss nerder for å forklare
768 hva slags problemer vi ser med dagens opphavsrettsregime.
</p
>