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>Full battery stats collector is now available in Debian
</title>
11 <link>http://people.skolelinux.org/pere/blog/Full_battery_stats_collector_is_now_available_in_Debian.html
</link>
12 <guid isPermaLink=
"true">http://people.skolelinux.org/pere/blog/Full_battery_stats_collector_is_now_available_in_Debian.html
</guid>
13 <pubDate>Wed,
23 Mar
2016 22:
10:
00 +
0100</pubDate>
14 <description><p
>Since this morning, the battery-stats package in Debian include an
15 extended collector that will collect the complete battery history for
16 later processing and graphing. The original collector store the
17 battery level as percentage of last full level, while the new
18 collector also record battery vendor, model, serial number, design
19 full level, last full level and current battery level. This make it
20 possible to predict the lifetime of the battery as well as visualise
21 the energy flow when the battery is charging or discharging.
</p
>
23 <p
>The new tools are available in
<tt
>/usr/share/battery-stats/
</tt
>
24 in the version
0.5.1 package in unstable. Get the new battery level graph
25 and lifetime prediction by running:
28 /usr/share/battery-stats/battery-stats-graph /var/log/battery-stats.csv
29 </pre
></p
>
31 <p
>Or select the
'Battery Level Graph
' from your application menu.
</p
>
33 <p
>The flow in/out of the battery can be seen by running (no menu
37 /usr/share/battery-stats/battery-stats-graph-flow
38 </pre
></p
>
40 <p
>I
'm not quite happy with the way the data is visualised, at least
41 when there are few data points. The graphs look a bit better with a
42 few years of data.
</p
>
44 <p
>A while back one important feature I use in the battery stats
45 collector broke in Debian. The scripts in
46 <tt
>/usr/lib/pm-utils/power.d/
</tt
> were no longer executed. I
47 suspect it happened when Jessie started using systemd, but I do not
48 know. The issue is reported as bug #
818649 against pm-utils. I
49 managed to work around it by adding an udev rule to call the collector
50 script every time the power connector is connected and disconnected.
51 With this fix in place it was finally time to make a new release of
52 the package, and get it into Debian.
</p
>
54 <p
>If you are interested in how your laptop battery is doing, please
56 <a href=
"https://tracker.debian.org/pkg/battery-stats
">battery-stats
</a
>
57 in Debian unstable, or rebuild it on Jessie to get it working on
58 Debian stable. :) The upstream source is available from
59 <a href=
"https://github.com/petterreinholdtsen/battery-stats
">github
</a
>.
60 As always, patches are very welcome.
</p
>
65 <title>UsingQR -
"Electronic
" paper invoices using JSON and QR codes
</title>
66 <link>http://people.skolelinux.org/pere/blog/UsingQR____Electronic__paper_invoices_using_JSON_and_QR_codes.html
</link>
67 <guid isPermaLink=
"true">http://people.skolelinux.org/pere/blog/UsingQR____Electronic__paper_invoices_using_JSON_and_QR_codes.html
</guid>
68 <pubDate>Sat,
19 Mar
2016 09:
40:
00 +
0100</pubDate>
69 <description><p
>Back in
2013 I proposed
70 <a href=
"http://people.skolelinux.org/pere/blog/_Electronic__paper_invoices___using_vCard_in_a_QR_code.html
">a
71 way to make paper and PDF invoices easier to process electronically by
72 adding a QR code with the key information about the invoice
</a
>. I
73 suggested using vCard field definition, to get some standard format
74 for name and address, but any format would work. I did not do
75 anything about the proposal, but hoped someone one day would make
76 something like it. It would make it possible to efficiently send
77 machine readable invoices directly between seller and buyer.
</p
>
79 <p
>This was the background when I came across a proposal and
80 specification from the web based accounting and invoicing supplier
81 <a href=
"http://www.visma.com/
">Visma
</a
> in Sweden called
82 <a href=
"http://usingqr.com/
">UsingQR
</a
>. Their PDF invoices contain
83 a QR code with the key information of the invoice in JSON format.
84 This is the typical content of a QR code following the UsingQR
85 specification (based on a real world example, some numbers replaced to
86 get a more bogus entry). I
've reformatted the JSON to make it easier
87 to read. Normally this is all on one long line:
</p
>
89 <p
><img src=
"http://people.skolelinux.org/pere/blog/images/
2016-
03-
19-qr-invoice.png
" align=
"right
"><pre
>
91 "vh
":
500.00,
96 "nme
":
"Din Leverandør
",
97 "cc
":
"NO
",
98 "cid
":
"997912345 MVA
",
99 "iref
":
"12300001",
100 "idt
":
"20151022",
101 "ddt
":
"20151105",
102 "due
":
2500.0000,
103 "cur
":
"NOK
",
104 "pt
":
"BBAN
",
105 "acc
":
"17202612345",
106 "bc
":
"BIENNOK1
",
107 "adr
":
"0313 OSLO
"
109 </pre
></p
>
111 </p
>The interpretation of the fields can be found in the
112 <a href=
"http://usingqr.com/wp-content/uploads/
2014/
06/UsingQR_specification1.pdf
">format
113 specification
</a
> (revision
2 from june
2014). The format seem to
114 have most of the information needed to handle accounting and payment
115 of invoices, at least the fields I have needed so far here in
118 <p
>Unfortunately, the site and document do not mention anything about
119 the patent, trademark and copyright status of the format and the
120 specification. Because of this, I asked the people behind it back in
121 November to clarify. Ann-Christine Savlid (ann-christine.savlid (at)
122 visma.com) replied that Visma had not applied for patent or trademark
123 protection for this format, and that there were no copyright based
124 usage limitations for the format. I urged her to make sure this was
125 explicitly written on the web pages and in the specification, but
126 unfortunately this has not happened yet. So I guess if there is
127 submarine patents, hidden trademarks or a will to sue for copyright
128 infringements, those starting to use the UsingQR format might be at
129 risk, but if this happen there is some legal defense in the fact that
130 the people behind the format claimed it was safe to do so. At least
131 with patents, there is always
132 <a href=
"http://www.paperspecs.com/paper-news/beware-the-qr-code-patent-trap/
">a
133 chance of getting sued...
</a
></p
>
135 <p
>I also asked if they planned to maintain the format in an
136 independent standard organization to give others more confidence that
137 they would participate in the standardization process on equal terms
138 with Visma, but they had no immediate plans for this. Their plan was
139 to work with banks to try to get more users of the format, and
140 evaluate the way forward if the format proved to be popular. I hope
141 they conclude that using an open standard organisation like
142 <a href=
"http://www.ietf.org/
">IETF
</a
> is the correct place to
143 maintain such specification.
</p
>
145 <p
><strong
>Update
2016-
03-
20</strong
>: Via Twitter I became aware of
146 <a href=
"https://news.ycombinator.com/item?id=
11319492">some comments
147 about this blog post
</a
> that had several useful links and references to
148 similar systems. In the Czech republic, the Czech Banking Association
149 standard #
26, with short name SPAYD, uses QR codes with payment
150 information. More information is available from the Wikipedia page on
151 <a href=
"https://en.wikipedia.org/wiki/Short_Payment_Descriptor
">Short
152 Payment Descriptor
</a
>. And in Germany, there is a system named
153 <a href=
"http://www.bezahlcode.de/
">BezahlCode
</a
>,
154 (
<a href=
"http://www.bezahlcode.de/wp-content/uploads/BezahlCode_TechDok.pdf
">specification
155 v1.8
2013-
12-
05 available as PDF
</a
>), which uses QR codes with
156 URL-like formatting using
"bank:
" as the URI schema/protocol to
157 provide the payment information. There is also the
158 <a href=
"http://www.ferd-net.de/front_content.php?idcat=
231">ZUGFeRD
</a
>
159 file format that perhaps could be transfered using QR codes, but I am
160 not sure if it is done already. Last, in Bolivia there are reports
161 that tax information since november
2014 need to be printed in QR
162 format on invoices. I have not been able to track down a
163 specification for this format, because of my limited language skill
169 <title>Making battery measurements a little easier in Debian
</title>
170 <link>http://people.skolelinux.org/pere/blog/Making_battery_measurements_a_little_easier_in_Debian.html
</link>
171 <guid isPermaLink=
"true">http://people.skolelinux.org/pere/blog/Making_battery_measurements_a_little_easier_in_Debian.html
</guid>
172 <pubDate>Tue,
15 Mar
2016 15:
00:
00 +
0100</pubDate>
173 <description><p
>Back in September, I blogged about
174 <a href=
"http://people.skolelinux.org/pere/blog/The_life_and_death_of_a_laptop_battery.html
">the
175 system I wrote to collect statistics about my laptop battery
</a
>, and
176 how it showed the decay and death of this battery (now replaced). I
177 created a simple deb package to handle the collection and graphing,
178 but did not want to upload it to Debian as there were already
179 <a href=
"https://tracker.debian.org/pkg/battery-stats
">a battery-stats
180 package in Debian
</a
> that should do the same thing, and I did not see
181 a point of uploading a competing package when battery-stats could be
182 fixed instead. I reported a few bugs about its non-function, and
183 hoped someone would step in and fix it. But no-one did.
</p
>
185 <p
>I got tired of waiting a few days ago, and took matters in my own
186 hands. The end result is that I am now the new upstream developer of
187 battery stats (
<a href=
"https://github.com/petterreinholdtsen/battery-stats
">available from github
</a
>) and part of the team maintaining
188 battery-stats in Debian, and the package in Debian unstable is finally
189 able to collect battery status using the
<tt
>/sys/class/power_supply/
</tt
>
190 information provided by the Linux kernel. If you install the
191 battery-stats package from unstable now, you will be able to get a
192 graph of the current battery fill level, to get some idea about the
193 status of the battery. The source package build and work just fine in
194 Debian testing and stable (and probably oldstable too, but I have not
195 tested). The default graph you get for that system look like this:
</p
>
197 <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
>
199 <p
>My plans for the future is to merge my old scripts into the
200 battery-stats package, as my old scripts collected a lot more details
201 about the battery. The scripts are merged into the upstream
202 battery-stats git repository already, but I am not convinced they work
203 yet, as I changed a lot of paths along the way. Will have to test a
204 bit more before I make a new release.
</p
>
206 <p
>I will also consider changing the file format slightly, as I
207 suspect the way I combine several values into one field might make it
208 impossible to know the type of the value when using it for processing
209 and graphing.
</p
>
211 <p
>If you would like I would like to keep an close eye on your laptop
212 battery, check out the battery-stats package in
213 <a href=
"https://tracker.debian.org/pkg/battery-stats
">Debian
</a
> and
215 <a href=
"https://github.com/petterreinholdtsen/battery-stats
">github
</a
>.
216 I would love some help to improve the system further.
</p
>
221 <title>Creating, updating and checking debian/copyright semi-automatically
</title>
222 <link>http://people.skolelinux.org/pere/blog/Creating__updating_and_checking_debian_copyright_semi_automatically.html
</link>
223 <guid isPermaLink=
"true">http://people.skolelinux.org/pere/blog/Creating__updating_and_checking_debian_copyright_semi_automatically.html
</guid>
224 <pubDate>Fri,
19 Feb
2016 15:
00:
00 +
0100</pubDate>
225 <description><p
>Making packages for Debian requires quite a lot of attention to
226 details. And one of the details is the content of the
227 debian/copyright file, which should list all relevant licenses used by
228 the code in the package in question, preferably in
229 <a href=
"https://www.debian.org/doc/packaging-manuals/copyright-format/
1.0/
">machine
230 readable DEP5 format
</a
>.
</p
>
232 <p
>For large packages with lots of contributors it is hard to write
233 and update this file manually, and if you get some detail wrong, the
234 package is normally rejected by the ftpmasters. So getting it right
235 the first time around get the package into Debian faster, and save
236 both you and the ftpmasters some work.. Today, while trying to figure
237 out what was wrong with
238 <a href=
"https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=
686447">the
239 zfsonlinux copyright file
</a
>, I decided to spend some time on
240 figuring out the options for doing this job automatically, or at least
241 semi-automatically.
</p
>
243 <p
>Lucikly, there are at least two tools available for generating the
244 file based on the code in the source package,
245 <tt
><a href=
"https://tracker.debian.org/pkg/debmake
">debmake
</a
></tt
>
246 and
<tt
><a href=
"https://tracker.debian.org/pkg/cme
">cme
</a
></tt
>. I
'm
247 not sure which one of them came first, but both seem to be able to
248 create a sensible draft file. As far as I can tell, none of them can
249 be trusted to get the result just right, so the content need to be
250 polished a bit before the file is OK to upload. I found the debmake
252 <a href=
"http://goofying-with-debian.blogspot.com/
2014/
07/debmake-checking-source-against-dep-
5.html
">a
253 blog posts from
2014</a
>.
255 <p
>To generate using debmake, use the -cc option:
258 debmake -cc
> debian/copyright
259 </pre
></p
>
261 <p
>Note there are some problems with python and non-ASCII names, so
262 this might not be the best option.
</p
>
264 <p
>The cme option is based on a config parsing library, and I found
266 <a href=
"https://ddumont.wordpress.com/
2015/
04/
05/improving-creation-of-debian-copyright-file/
">a
267 blog post from
2015</a
>. To generate using cme, use the
'update
268 dpkg-copyright
' option:
271 cme update dpkg-copyright
272 </pre
></p
>
274 <p
>This will create or update debian/copyright. The cme tool seem to
275 handle UTF-
8 names better than debmake.
</p
>
277 <p
>When the copyright file is created, I would also like some help to
278 check if the file is correct. For this I found two good options,
279 <tt
>debmake -k
</tt
> and
<tt
>license-reconcile
</tt
>. The former seem
280 to focus on license types and file matching, and is able to detect
281 ineffective blocks in the copyright file. The latter reports missing
282 copyright holders and years, but was confused by inconsistent license
283 names (like CDDL vs. CDDL-
1.0). I suspect it is good to use both and
284 fix all issues reported by them before uploading. But I do not know
285 if the tools and the ftpmasters agree on what is important to fix in a
286 copyright file, so the package might still be rejected.
</p
>
288 <p
>The devscripts tool
<tt
>licensecheck
</tt
> deserve mentioning. It
289 will read through the source and try to find all copyright statements.
290 It is not comparing the result to the content of debian/copyright, but
291 can be useful when verifying the content of the copyright file.
</p
>
293 <p
>Are you aware of better tools in Debian to create and update
294 debian/copyright file. Please let me know, or blog about it on
295 planet.debian.org.
</p
>
297 <p
>As usual, if you use Bitcoin and want to show your support of my
298 activities, please send Bitcoin donations to my address
299 <b
><a href=
"bitcoin:
15oWEoG9dUPovwmUL9KWAnYRtNJEkP1u1b
">15oWEoG9dUPovwmUL9KWAnYRtNJEkP1u1b
</a
></b
>.
</p
>
301 <p
><strong
>Update
2016-
02-
20</strong
>: I got a tip from Mike Gabriel
302 on how to use licensecheck and cdbs to create a draft copyright file
305 licensecheck --copyright -r `find * -type f` | \
306 /usr/lib/cdbs/licensecheck2dep5
> debian/copyright.auto
307 </pre
></p
>
309 <p
>He mentioned that he normally check the generated file into the
310 version control system to make it easier to discover license and
311 copyright changes in the upstream source. I will try to do the same
312 with my packages in the future.
</p
>
314 <p
><strong
>Update
2016-
02-
21</strong
>: The cme author recommended
315 against using -quiet for new users, so I removed it from the proposed
316 command line.
</p
>
321 <title>Using appstream in Debian to locate packages with firmware and mime type support
</title>
322 <link>http://people.skolelinux.org/pere/blog/Using_appstream_in_Debian_to_locate_packages_with_firmware_and_mime_type_support.html
</link>
323 <guid isPermaLink=
"true">http://people.skolelinux.org/pere/blog/Using_appstream_in_Debian_to_locate_packages_with_firmware_and_mime_type_support.html
</guid>
324 <pubDate>Thu,
4 Feb
2016 16:
40:
00 +
0100</pubDate>
325 <description><p
>The
<a href=
"https://wiki.debian.org/DEP-
11">appstream system
</a
>
326 is taking shape in Debian, and one provided feature is a very
327 convenient way to tell you which package to install to make a given
328 firmware file available when the kernel is looking for it. This can
329 be done using apt-file too, but that is for someone else to blog
332 <p
>Here is a small recipe to find the package with a given firmware
333 file, in this example I am looking for ctfw-
3.2.3.0.bin, randomly
334 picked from the set of firmware announced using appstream in Debian
335 unstable. In general you would be looking for the firmware requested
336 by the kernel during kernel module loading. To find the package
337 providing the example file, do like this:
</p
>
339 <blockquote
><pre
>
340 % apt install appstream
344 % appstreamcli what-provides firmware:runtime ctfw-
3.2.3.0.bin | \
345 awk
'/Package:/ {print $
2}
'
348 </pre
></blockquote
>
350 <p
>See
<a href=
"https://wiki.debian.org/AppStream/Guidelines
">the
351 appstream wiki
</a
> page to learn how to embed the package metadata in
352 a way appstream can use.
</p
>
354 <p
>This same approach can be used to find any package supporting a
355 given MIME type. This is very useful when you get a file you do not
356 know how to handle. First find the mime type using
<tt
>file
357 --mime-type
</tt
>, and next look up the package providing support for
358 it. Lets say you got an SVG file. Its MIME type is image/svg+xml,
359 and you can find all packages handling this type like this:
</p
>
361 <blockquote
><pre
>
362 % apt install appstream
366 % appstreamcli what-provides mimetype image/svg+xml | \
367 awk
'/Package:/ {print $
2}
'
389 </pre
></blockquote
>
391 <p
>I believe the MIME types are fetched from the desktop file for
392 packages providing appstream metadata.
</p
>
397 <title>Creepy, visualise geotagged social media information - nice free software
</title>
398 <link>http://people.skolelinux.org/pere/blog/Creepy__visualise_geotagged_social_media_information___nice_free_software.html
</link>
399 <guid isPermaLink=
"true">http://people.skolelinux.org/pere/blog/Creepy__visualise_geotagged_social_media_information___nice_free_software.html
</guid>
400 <pubDate>Sun,
24 Jan
2016 10:
50:
00 +
0100</pubDate>
401 <description><p
>Most people seem not to realise that every time they walk around
402 with the computerised radio beacon known as a mobile phone their
403 position is tracked by the phone company and often stored for a long
404 time (like every time a SMS is received or sent). And if their
405 computerised radio beacon is capable of running programs (often called
406 mobile apps) downloaded from the Internet, these programs are often
407 also capable of tracking their location (if the app requested access
408 during installation). And when these programs send out information to
409 central collection points, the location is often included, unless
410 extra care is taken to not send the location. The provided
411 information is used by several entities, for good and bad (what is
412 good and bad, depend on your point of view). What is certain, is that
413 the private sphere and the right to free movement is challenged and
414 perhaps even eradicated for those announcing their location this way,
415 when they share their whereabouts with private and public
418 <p align=
"center
"><img width=
"70%
" src=
"http://people.skolelinux.org/pere/blog/images/
2016-
01-
24-nice-creepy-desktop-window.png
"></p
>
420 <p
>The phone company logs provide a register of locations to check out
421 when one want to figure out what the tracked person was doing. It is
422 unavailable for most of us, but provided to selected government
423 officials, company staff, those illegally buying information from
424 unfaithful servants and crackers stealing the information. But the
425 public information can be collected and analysed, and a free software
426 tool to do so is called
427 <a href=
"http://www.geocreepy.com/
">Creepy or Cree.py
</a
>. I
428 discovered it when I read
429 <a href=
"http://www.aftenposten.no/kultur/Slik-kan-du-bli-overvaket-pa-Twitter-og-Instagram-uten-a-ane-det-
7787884.html
">an
430 article about Creepy
</a
> in the Norwegian newspaper Aftenposten i
431 November
2014, and decided to check if it was available in Debian.
432 The python program was in Debian, but
433 <a href=
"https://tracker.debian.org/pkg/creepy
">the version in
434 Debian
</a
> was completely broken and practically unmaintained. I
435 uploaded a new version which did not work quite right, but did not
436 have time to fix it then. This Christmas I decided to finally try to
437 get Creepy operational in Debian. Now a fixed version is available in
438 Debian unstable and testing, and almost all Debian specific patches
440 <a href=
"https://github.com/jkakavas/creepy
">upstream
</a
>.
</p
>
442 <p
>The Creepy program visualises geolocation information fetched from
443 Twitter, Instagram, Flickr and Google+, and allow one to get a
444 complete picture of every social media message posted recently in a
445 given area, or track the movement of a given individual across all
446 these services. Earlier it was possible to use the search API of at
447 least some of these services without identifying oneself, but these
448 days it is impossible. This mean that to use Creepy, you need to
449 configure it to log in as yourself on these services, and provide
450 information to them about your search interests. This should be taken
451 into account when using Creepy, as it will also share information
452 about yourself with the services.
</p
>
454 <p
>The picture above show the twitter messages sent from (or at least
455 geotagged with a position from) the city centre of Oslo, the capital
456 of Norway. One useful way to use Creepy is to first look at
457 information tagged with an area of interest, and next look at all the
458 information provided by one or more individuals who was in the area.
459 I tested it by checking out which celebrity provide their location in
460 twitter messages by checkout out who sent twitter messages near a
461 Norwegian TV station, and next could track their position over time,
462 making it possible to locate their home and work place, among other
463 things. A similar technique have been
464 <a href=
"http://www.buzzfeed.com/maxseddon/does-this-soldiers-instagram-account-prove-russia-is-covertl
">used
465 to locate Russian soldiers in Ukraine
</a
>, and it is both a powerful
466 tool to discover lying governments, and a useful tool to help people
467 understand the value of the private information they provide to the
470 <p
>The package is not trivial to backport to Debian Stable/Jessie, as
471 it depend on several python modules currently missing in Jessie (at
472 least python-instagram, python-flickrapi and
473 python-requests-toolbelt).
</p
>
475 <p
>(I have uploaded
476 <a href=
"https://screenshots.debian.net/package/creepy
">the image to
477 screenshots.debian.net
</a
> and licensed it under the same terms as the
478 Creepy program in Debian.)
</p
>
483 <title>Always download Debian packages using Tor - the simple recipe
</title>
484 <link>http://people.skolelinux.org/pere/blog/Always_download_Debian_packages_using_Tor___the_simple_recipe.html
</link>
485 <guid isPermaLink=
"true">http://people.skolelinux.org/pere/blog/Always_download_Debian_packages_using_Tor___the_simple_recipe.html
</guid>
486 <pubDate>Fri,
15 Jan
2016 00:
30:
00 +
0100</pubDate>
487 <description><p
>During his DebConf15 keynote, Jacob Appelbaum
488 <a href=
"https://summit.debconf.org/debconf15/meeting/
331/what-is-to-be-done/
">observed
489 that those listening on the Internet lines would have good reason to
490 believe a computer have a given security hole
</a
> if it download a
491 security fix from a Debian mirror. This is a good reason to always
492 use encrypted connections to the Debian mirror, to make sure those
493 listening do not know which IP address to attack. In August, Richard
494 Hartmann observed that encryption was not enough, when it was possible
495 to interfere download size to security patches or the fact that
496 download took place shortly after a security fix was released, and
497 <a href=
"http://richardhartmann.de/blog/posts/
2015/
08/
24-Tor-enabled_Debian_mirror/
">proposed
498 to always use Tor to download packages from the Debian mirror
</a
>. He
499 was not the first to propose this, as the
500 <tt
><a href=
"https://tracker.debian.org/pkg/apt-transport-tor
">apt-transport-tor
</a
></tt
>
501 package by Tim Retout already existed to make it easy to convince apt
502 to use
<a href=
"https://www.torproject.org/
">Tor
</a
>, but I was not
503 aware of that package when I read the blog post from Richard.
</p
>
505 <p
>Richard discussed the idea with Peter Palfrader, one of the Debian
506 sysadmins, and he set up a Tor hidden service on one of the central
507 Debian mirrors using the address vwakviie2ienjx6t.onion, thus making
508 it possible to download packages directly between two tor nodes,
509 making sure the network traffic always were encrypted.
</p
>
511 <p
>Here is a short recipe for enabling this on your machine, by
512 installing
<tt
>apt-transport-tor
</tt
> and replacing http and https
513 urls with tor+http and tor+https, and using the hidden service instead
514 of the official Debian mirror site. I recommend installing
515 <tt
>etckeeper
</tt
> before you start to have a history of the changes
516 done in /etc/.
</p
>
518 <blockquote
><pre
>
519 apt install apt-transport-tor
520 sed -i
's% http://ftp.debian.org/% tor+http://vwakviie2ienjx6t.onion/%
' /etc/apt/sources.list
521 sed -i
's% http% tor+http%
' /etc/apt/sources.list
522 </pre
></blockquote
>
524 <p
>If you have more sources listed in /etc/apt/sources.list.d/, run
525 the sed commands for these too. The sed command is assuming your are
526 using the ftp.debian.org Debian mirror. Adjust the command (or just
527 edit the file manually) to match your mirror.
</p
>
529 <p
>This work in Debian Jessie and later. Note that tools like
530 <tt
>apt-file
</tt
> only recently started using the apt transport
531 system, and do not work with these tor+http URLs. For
532 <tt
>apt-file
</tt
> you need the version currently in experimental,
533 which need a recent apt version currently only in unstable. So if you
534 need a working
<tt
>apt-file
</tt
>, this is not for you.
</p
>
536 <p
>Another advantage from this change is that your machine will start
537 using Tor regularly and at fairly random intervals (every time you
538 update the package lists or upgrade or install a new package), thus
539 masking other Tor traffic done from the same machine. Using Tor will
540 become normal for the machine in question.
</p
>
542 <p
>On
<a href=
"https://wiki.debian.org/FreedomBox
">Freedombox
</a
>, APT
543 is set up by default to use
<tt
>apt-transport-tor
</tt
> when Tor is
544 enabled. It would be great if it was the default on any Debian
550 <title>Nedlasting fra NRK, som Matroska med undertekster
</title>
551 <link>http://people.skolelinux.org/pere/blog/Nedlasting_fra_NRK__som_Matroska_med_undertekster.html
</link>
552 <guid isPermaLink=
"true">http://people.skolelinux.org/pere/blog/Nedlasting_fra_NRK__som_Matroska_med_undertekster.html
</guid>
553 <pubDate>Sat,
2 Jan
2016 13:
50:
00 +
0100</pubDate>
554 <description><p
>Det kommer stadig nye løsninger for å ta lagre unna innslag fra NRK
555 for å se på det senere. For en stund tilbake kom jeg over et script
556 nrkopptak laget av Ingvar Hagelund. Han fjernet riktignok sitt script
557 etter forespørsel fra Erik Bolstad i NRK, men noen tok heldigvis og
558 gjorde det
<a href=
"https://github.com/liangqi/nrkopptak
">tilgjengelig
559 via github
</a
>.
</p
>
561 <p
>Scriptet kan lagre som MPEG4 eller Matroska, og bake inn
562 undertekster i fila på et vis som blant annet VLC forstår. For å
563 bruke scriptet, kopier ned git-arkivet og kjør
</p
>
566 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
>
567 </pre
></p
>
569 <p
>URL-eksemplet er dagens toppsak på tv.nrk.no. Argument
'k
' ber
570 scriptet laste ned og lagre som Matroska. Det finnes en rekke andre
571 muligheter for valg av kvalitet og format.
</p
>
573 <p
>Jeg foretrekker dette scriptet fremfor youtube-dl, som
574 <a href=
"http://people.skolelinux.org/pere/blog/Hvordan_enkelt_laste_ned_filmer_fra_NRK_med_den__nye__l_sningen.html
">
575 nevnt i
2014 støtter NRK
</a
> og en rekke andre videokilder, på grunn
576 av at nrkopptak samler undertekster og video i en enkelt fil, hvilket
577 gjør håndtering enklere på disk.
</p
>
582 <title>OpenALPR, find car license plates in video streams - nice free software
</title>
583 <link>http://people.skolelinux.org/pere/blog/OpenALPR__find_car_license_plates_in_video_streams___nice_free_software.html
</link>
584 <guid isPermaLink=
"true">http://people.skolelinux.org/pere/blog/OpenALPR__find_car_license_plates_in_video_streams___nice_free_software.html
</guid>
585 <pubDate>Wed,
23 Dec
2015 01:
00:
00 +
0100</pubDate>
586 <description><p
>When I was a kid, we used to collect
"car numbers
", as we used to
587 call the car license plate numbers in those days. I would write the
588 numbers down in my little book and compare notes with the other kids
589 to see how many region codes we had seen and if we had seen some
590 exotic or special region codes and numbers. It was a fun game to pass
591 time, as we kids have plenty of it.
</p
>
593 <p
>A few days I came across
594 <a href=
"https://github.com/openalpr/openalpr
">the OpenALPR
595 project
</a
>, a free software project to automatically discover and
596 report license plates in images and video streams, and provide the
597 "car numbers
" in a machine readable format. I
've been looking for
598 such system for a while now, because I believe it is a bad idea that the
599 <a href=
"https://en.wikipedia.org/wiki/Automatic_number_plate_recognition
">automatic
600 number plate recognition
</a
> tool only is available in the hands of
601 the powerful, and want it to be available also for the powerless to
602 even the score when it comes to surveillance and sousveillance. I
603 discovered the developer
604 <a href=
"https://bugs.debian.org/
747509">wanted to get the tool into
605 Debian
</a
>, and as I too wanted it to be in Debian, I volunteered to
606 help him get it into shape to get the package uploaded into the Debian
609 <p
>Today we finally managed to get the package into shape and uploaded
610 it into Debian, where it currently
611 <a href=
"https://ftp-master.debian.org//new/openalpr_2.2
.1-
1.html
">waits
612 in the NEW queue
</a
> for review by the Debian ftpmasters.
</p
>
614 <p
>I guess you are wondering why on earth such tool would be useful
615 for the common folks, ie those not running a large government
616 surveillance system? Well, I plan to put it in a computer on my bike
617 and in my car, tracking the cars nearby and allowing me to be notified
618 when number plates on my watch list are discovered. Another use case
619 was suggested by a friend of mine, who wanted to set it up at his home
620 to open the car port automatically when it discovered the plate on his
621 car. When I mentioned it perhaps was a bit foolhardy to allow anyone
622 capable of placing his license plate number of a piece of cardboard to
623 open his car port, men replied that it was always unlocked anyway. I
624 guess for such use case it make sense. I am sure there are other use
625 cases too, for those with imagination and a vision.
</p
>
627 <p
>If you want to build your own version of the Debian package, check
628 out the upstream git source and symlink ./distros/debian to ./debian/
629 before running
"debuild
" to build the source. Or wait a bit until the
630 package show up in unstable.
</p
>
635 <title>Using appstream with isenkram to install hardware related packages in Debian
</title>
636 <link>http://people.skolelinux.org/pere/blog/Using_appstream_with_isenkram_to_install_hardware_related_packages_in_Debian.html
</link>
637 <guid isPermaLink=
"true">http://people.skolelinux.org/pere/blog/Using_appstream_with_isenkram_to_install_hardware_related_packages_in_Debian.html
</guid>
638 <pubDate>Sun,
20 Dec
2015 12:
20:
00 +
0100</pubDate>
639 <description><p
>Around three years ago, I created
640 <a href=
"http://packages.qa.debian.org/isenkram
">the isenkram
641 system
</a
> to get a more practical solution in Debian for handing
642 hardware related packages. A GUI system in the isenkram package will
643 present a pop-up dialog when some hardware dongle supported by
644 relevant packages in Debian is inserted into the machine. The same
645 lookup mechanism to detect packages is available as command line
646 tools in the isenkram-cli package. In addition to mapping hardware,
647 it will also map kernel firmware files to packages and make it easy to
648 install needed firmware packages automatically. The key for this
649 system to work is a good way to map hardware to packages, in other
650 words, allow packages to announce what hardware they will work
653 <p
>I started by providing data files in the isenkram source, and
654 adding code to download the latest version of these data files at run
655 time, to ensure every user had the most up to date mapping available.
656 I also added support for storing the mapping in the Packages file in
657 the apt repositories, but did not push this approach because while I
658 was trying to figure out how to best store hardware/package mappings,
659 <a href=
"http://www.freedesktop.org/software/appstream/docs/
">the
660 appstream system
</a
> was announced. I got in touch and suggested to
661 add the hardware mapping into that data set to be able to use
662 appstream as a data source, and this was accepted at least for the
663 Debian version of appstream.
</p
>
665 <p
>A few days ago using appstream in Debian for this became possible,
666 and today I uploaded a new version
0.20 of isenkram adding support for
667 appstream as a data source for mapping hardware to packages. The only
668 package so far using appstream to announce its hardware support is my
669 pymissile package. I got help from Matthias Klumpp with figuring out
670 how do add the required
671 <a href=
"https://appstream.debian.org/html/sid/main/metainfo/pymissile.html
">metadata
672 in pymissile
</a
>. I added a file debian/pymissile.metainfo.xml with
673 this content:
</p
>
675 <blockquote
><pre
>
676 &lt;?xml version=
"1.0" encoding=
"UTF-
8"?
&gt;
677 &lt;component
&gt;
678 &lt;id
&gt;pymissile
&lt;/id
&gt;
679 &lt;metadata_license
&gt;MIT
&lt;/metadata_license
&gt;
680 &lt;name
&gt;pymissile
&lt;/name
&gt;
681 &lt;summary
&gt;Control original Striker USB Missile Launcher
&lt;/summary
&gt;
682 &lt;description
&gt;
684 Pymissile provides a curses interface to control an original
685 Marks and Spencer / Striker USB Missile Launcher, as well as a
686 motion control script to allow a webcamera to control the
689 &lt;/description
&gt;
690 &lt;provides
&gt;
691 &lt;modalias
&gt;usb:v1130p0202d*
&lt;/modalias
&gt;
692 &lt;/provides
&gt;
693 &lt;/component
&gt;
694 </pre
></blockquote
>
696 <p
>The key for isenkram is the component/provides/modalias value,
697 which is a glob style match rule for hardware specific strings
698 (modalias strings) provided by the Linux kernel. In this case, it
699 will map to all USB devices with vendor code
1130 and product code
702 <p
>Note, it is important that the license of all the metadata files
703 are compatible to have permissions to aggregate them into archive wide
704 appstream files. Matthias suggested to use MIT or BSD licenses for
705 these files. A challenge is figuring out a good id for the data, as
706 it is supposed to be globally unique and shared across distributions
707 (in other words, best to coordinate with upstream what to use). But
708 it can be changed later or, so we went with the package name as
709 upstream for this project is dormant.
</p
>
711 <p
>To get the metadata file installed in the correct location for the
712 mirror update scripts to pick it up and include its content the
713 appstream data source, the file must be installed in the binary
714 package under /usr/share/appdata/. I did this by adding the following
715 line to debian/pymissile.install:
</p
>
717 <blockquote
><pre
>
718 debian/pymissile.metainfo.xml usr/share/appdata
719 </pre
></blockquote
>
721 <p
>With that in place, the command line tool isenkram-lookup will list
722 all packages useful on the current computer automatically, and the GUI
723 pop-up handler will propose to install the package not already
724 installed if a hardware dongle is inserted into the machine in
727 <p
>Details of the modalias field in appstream is available from the
728 <a href=
"https://wiki.debian.org/DEP-
11">DEP-
11</a
> proposal.
</p
>
730 <p
>To locate the modalias values of all hardware present in a machine,
731 try running this command on the command line:
</p
>
733 <blockquote
><pre
>
734 cat $(find /sys/devices/|grep modalias)
735 </pre
></blockquote
>
737 <p
>To learn more about the isenkram system, please check out
738 <a href=
"http://people.skolelinux.org/pere/blog/tags/isenkram/
">my
739 blog posts tagged isenkram
</a
>.
</p
>