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 September
2014</title>
5 <description>Entries from September
2014</description>
6 <link>http://people.skolelinux.org/pere/blog/
</link>
10 <title>Hva henger under skibrua over E16 på Sollihøgda?
</title>
11 <link>http://people.skolelinux.org/pere/blog/Hva_henger_under_skibrua_over_E16_p__Sollih_gda_.html
</link>
12 <guid isPermaLink=
"true">http://people.skolelinux.org/pere/blog/Hva_henger_under_skibrua_over_E16_p__Sollih_gda_.html
</guid>
13 <pubDate>Sun,
21 Sep
2014 09:
50:
00 +
0200</pubDate>
14 <description><p
>Rundt omkring i Oslo og Østlandsområdet henger det bokser over
15 veiene som jeg har lurt på hva gjør. De har ut fra plassering og
16 vinkling sett ut som bokser som sniffer ut et eller annet fra
17 forbipasserende trafikk, men det har vært uklart for meg hva det er de
18 leser av. Her om dagen tok jeg bilde av en slik boks som henger under
19 <a href=
"http://www.openstreetmap.no/?zoom=
19&mlat=
59.96396&mlon=
10.34443&layers=B00000
">ei
20 skibru på Sollihøgda
</a
>:
</p
>
22 <p align=
"center
"><img width=
"60%
" src=
"http://people.skolelinux.org/pere/blog/images/
2014-
09-
13-kapsch-sollihogda-crop.jpeg
"></p
>
24 <p
>Boksen er tydelig merket «Kapsch
>>>», logoen til
25 <a href=
"http://www.kapsch.net/
">det sveitsiske selskapet Kapsch
</a
> som
26 blant annet lager sensorsystemer for veitrafikk. Men de lager mye
27 forskjellig, og jeg kjente ikke igjen boksen på utseendet etter en
28 kjapp titt på produktlista til selskapet.
</p
>
30 <p
>I og med at boksen henger over veien E16, en riksvei vedlikeholdt
31 av Statens Vegvesen, så antok jeg at det burde være mulig å bruke
32 REST-API-et som gir tilgang til vegvesenets database over veier,
33 skilter og annet veirelatert til å finne ut hva i alle dager dette
34 kunne være. De har både
35 <a href=
"https://www.vegvesen.no/nvdb/api/dokumentasjon/datakatalog
">en
36 datakatalog
</a
> og
37 <a href=
"https://www.vegvesen.no/nvdb/api/dokumentasjon/sok
">et
38 søk
</a
>, der en kan søke etter ulike typer oppføringer innen for et
39 gitt geografisk område. Jeg laget et enkelt shell-script for å hente
40 ut antall av en gitt type innenfor området skibrua dekker, og listet
41 opp navnet på typene som ble funnet. Orket ikke slå opp hvordan
42 URL-koding av aktuelle strenger kunne gjøres mer generisk, og brukte
43 en stygg sed-linje i stedet.
</p
>
45 <blockquote
><pre
>
49 -e
's/ / /g
' -e
's/{/%
7B/g
' \
50 -e
's/}/%
7D/g
' -e
's/\[/%
5B/g
' \
51 -e
's/\]/%
5D/g
' -e
's/ /%
20/g
' \
52 -e
's/,/%
2C/g
' -e
's/\
"/%
22/g
' \
53 -e
's/:/%
3A/g
'
58 curl -s -H
'Accept: application/vnd.vegvesen.nvdb-v1+xml
' \
59 "https://www.vegvesen.no/nvdb/api$url
" | xmllint --format -
62 for id in $(seq
1 874) ; do
65 bbox: \
"10.34425,
59.96386,
10.34458,
59.96409\
",
66 srid: \
"WGS84\
"
73 query=/sok?kriterie=$(echo $search | urlmap)
74 if lookup
"$query
" |
75 grep -q
'&lt;totaltAntallReturnert
>0&lt;
'
80 lookup
"/datakatalog/objekttyper/$id
" |grep
'^
&lt;navn
>'
85 </pre
></blockquote
>
87 Aktuelt ID-område
1-
874 var riktig i datakatalogen da jeg laget
88 scriptet. Det vil endre seg over tid. Skriptet listet så opp
89 aktuelle typer i og rundt skibrua:
91 <blockquote
><pre
>
93 &lt;navn
>Rekkverk
&lt;/navn
>
95 &lt;navn
>Rekkverksende
&lt;/navn
>
97 &lt;navn
>Trafikklomme
&lt;/navn
>
99 &lt;navn
>Trafikkøy
&lt;/navn
>
101 &lt;navn
>Bru
&lt;/navn
>
103 &lt;navn
>Stikkrenne/Kulvert
&lt;/navn
>
105 &lt;navn
>Grøft, åpen
&lt;/navn
>
107 &lt;navn
>Belysningsstrekning
&lt;/navn
>
109 &lt;navn
>Skiltpunkt
&lt;/navn
>
111 &lt;navn
>Skiltplate
&lt;/navn
>
113 &lt;navn
>Referansestolpe
&lt;/navn
>
115 &lt;navn
>Vegoppmerking, langsgående
&lt;/navn
>
117 &lt;navn
>Fartsgrense
&lt;/navn
>
119 &lt;navn
>Vinterdriftsstrategi
&lt;/navn
>
121 &lt;navn
>Trafikkdeler
&lt;/navn
>
123 &lt;navn
>Vegdekke
&lt;/navn
>
125 &lt;navn
>Breddemåling
&lt;/navn
>
127 &lt;navn
>Kantklippareal
&lt;/navn
>
129 &lt;navn
>Snø-/isrydding
&lt;/navn
>
131 &lt;navn
>Skred
&lt;/navn
>
133 &lt;navn
>Dokumentasjon
&lt;/navn
>
135 &lt;navn
>Undergang
&lt;/navn
>
137 &lt;navn
>Tverrprofil
&lt;/navn
>
139 &lt;navn
>Vegreferanse
&lt;/navn
>
141 &lt;navn
>Region
&lt;/navn
>
143 &lt;navn
>Fylke
&lt;/navn
>
145 &lt;navn
>Kommune
&lt;/navn
>
147 &lt;navn
>Gate
&lt;/navn
>
149 &lt;navn
>Transportlenke
&lt;/navn
>
151 &lt;navn
>Trafikkmengde
&lt;/navn
>
153 &lt;navn
>Trafikkulykke
&lt;/navn
>
155 &lt;navn
>Ulykkesinvolvert enhet
&lt;/navn
>
157 &lt;navn
>Ulykkesinvolvert person
&lt;/navn
>
159 &lt;navn
>Politidistrikt
&lt;/navn
>
161 &lt;navn
>Vegbredde
&lt;/navn
>
163 &lt;navn
>Høydebegrensning
&lt;/navn
>
165 &lt;navn
>Nedbøyningsmåling
&lt;/navn
>
167 &lt;navn
>Støy-luft, Strekningsdata
&lt;/navn
>
169 &lt;navn
>Oppgravingsdata
&lt;/navn
>
171 &lt;navn
>Oppgravingslag
&lt;/navn
>
173 &lt;navn
>PMS-parsell
&lt;/navn
>
175 &lt;navn
>Vegnormalstrekning
&lt;/navn
>
177 &lt;navn
>Værrelatert strekning
&lt;/navn
>
179 &lt;navn
>Feltstrekning
&lt;/navn
>
181 &lt;navn
>Adressepunkt
&lt;/navn
>
183 &lt;navn
>Friksjonsmåleserie
&lt;/navn
>
185 &lt;navn
>Vegdekke, flatelapping
&lt;/navn
>
187 &lt;navn
>Kurvatur, horisontalelement
&lt;/navn
>
189 &lt;navn
>Kurvatur, vertikalelement
&lt;/navn
>
191 &lt;navn
>Kurvatur, vertikalpunkt
&lt;/navn
>
193 &lt;navn
>Statistikk, trafikkmengde
&lt;/navn
>
195 &lt;navn
>Statistikk, vegbredde
&lt;/navn
>
197 &lt;navn
>Nedbøyningsmåleserie
&lt;/navn
>
199 &lt;navn
>ATK, influensstrekning
&lt;/navn
>
201 &lt;navn
>Systemobjekt
&lt;/navn
>
203 &lt;navn
>Vinterdriftsklasse
&lt;/navn
>
205 &lt;navn
>Funksjonell vegklasse
&lt;/navn
>
207 &lt;navn
>Kurvatur, stigning
&lt;/navn
>
209 &lt;navn
>Vegbredde, beregnet
&lt;/navn
>
211 &lt;navn
>Reisetidsregistreringspunkt
&lt;/navn
>
213 &lt;navn
>Bruksklasse
&lt;/navn
>
214 </pre
></blockquote
>
216 <p
>Av disse ser ID
775 og
862 mest relevant ut. ID
775 antar jeg
217 refererer til fotoboksen som står like ved brua, mens
218 «Reisetidsregistreringspunkt» kanskje kan være boksen som henger der.
219 Hvordan finner jeg så ut hva dette kan være for noe. En titt på
220 <a href=
"http://labs.vegdata.no/nvdb-datakatalog/
862-Reisetidsregistreringspunkt/
">datakatalogsiden
221 for ID
862/Reisetidsregistreringspunkt
</a
> viser at det er finnes
53
222 slike målere i Norge, og hvor de er plassert, men gir ellers få
223 detaljer. Det er plassert
40 på østlandet og
13 i Trondheimsregionen.
224 Men siden nevner «AutoPASS», og hvis en slår opp oppføringen på
225 Sollihøgda nevner den «Ciber AS» som ID for eksternt system. (Kan det
227 <a href=
"http://www.proff.no/selskap/ciber-norge-as/oslo/internettdesign-og-programmering/Z0I3KMF4/
">Ciber
228 Norge AS
</a
>, et selskap eid av Ciber Europe Bv?) Et nettsøk på
229 «Ciber AS autopass» fører meg til en artikkel fra NRK Trøndelag i
231 «
<a href=
"http://www.nrk.no/trondelag/sjekk-dette-hvis-du-vil-unnga-ko-
1.11327947">Sjekk
232 dette hvis du vil unngå kø
</a
>». Artikkelen henviser til vegvesenets
234 <a href=
"http://www.reisetider.no/reisetid/forside.html
">reisetider.no
</a
>
236 <a href=
"http://www.reisetider.no/reisetid/omrade.html?omrade=
5">kartside
237 for Østlandet
</a
> som viser at det måles mellom Sandvika og Sollihøgda.
238 Det kan dermed se ut til at jeg har funnet ut hva boksene gjør.
</p
>
240 <p
>Hvis det stemmer, så er dette bokser som leser av AutoPASS-ID-en
241 til alle passerende biler med AutoPASS-brikke, og dermed gjør det mulig
242 for de som kontrollerer boksene å holde rede på hvor en gitt bil er
243 når den passerte et slikt målepunkt. NRK-artikkelen forteller at
244 denne informasjonen i dag kun brukes til å koble to
245 AutoPASS-brikkepasseringer passeringer sammen for å beregne
246 reisetiden, og at bruken er godkjent av Datatilsynet. Det er desverre
247 ikke mulig for en sjåfør som passerer under en slik boks å kontrollere
248 at AutoPASS-ID-en kun brukes til dette i dag og i fremtiden.
</p
>
250 <p
>I tillegg til denne type AutoPASS-sniffere vet jeg at det også
251 finnes mange automatiske stasjoner som tar betalt pr. passering (aka
252 bomstasjoner), og der lagres informasjon om tid, sted og bilnummer i
253 10 år. Finnes det andre slike sniffere plassert ut på veiene?
</p
>
255 <p
>Personlig har jeg valgt å ikke bruke AutoPASS-brikke, for å gjøre
256 det vanskeligere og mer kostbart for de som vil invadere privatsfæren
257 og holde rede på hvor bilen min beveger seg til enhver tid. Jeg håper
258 flere vil gjøre det samme, selv om det gir litt høyere private
259 utgifter (dyrere bompassering). Vern om privatsfæren koster i disse
262 <p
>Takk til Jan Kristian Jensen i Statens Vegvesen for tips om
263 dokumentasjon på vegvesenets REST-API.
</p
>
268 <title>Speeding up the Debian installer using eatmydata and dpkg-divert
</title>
269 <link>http://people.skolelinux.org/pere/blog/Speeding_up_the_Debian_installer_using_eatmydata_and_dpkg_divert.html
</link>
270 <guid isPermaLink=
"true">http://people.skolelinux.org/pere/blog/Speeding_up_the_Debian_installer_using_eatmydata_and_dpkg_divert.html
</guid>
271 <pubDate>Tue,
16 Sep
2014 14:
00:
00 +
0200</pubDate>
272 <description><p
>The
<a href=
"https://www.debian.org/
">Debian
</a
> installer could be
273 a lot quicker. When we install more than
2000 packages in
274 <a href=
"http://www.skolelinux.org/
">Skolelinux / Debian Edu
</a
> using
275 tasksel in the installer, unpacking the binary packages take forever.
276 A part of the slow I/O issue was discussed in
277 <a href=
"https://bugs.debian.org/
613428">bug #
613428</a
> about too
278 much file system sync-ing done by dpkg, which is the package
279 responsible for unpacking the binary packages. Other parts (like code
280 executed by postinst scripts) might also sync to disk during
281 installation. All this sync-ing to disk do not really make sense to
282 me. If the machine crash half-way through, I start over, I do not try
283 to salvage the half installed system. So the failure sync-ing is
284 supposed to protect against, hardware or system crash, is not really
285 relevant while the installer is running.
</p
>
287 <p
>A few days ago, I thought of a way to get rid of all the file
288 system sync()-ing in a fairly non-intrusive way, without the need to
289 change the code in several packages. The idea is not new, but I have
290 not heard anyone propose the approach using dpkg-divert before. It
291 depend on the small and clever package
292 <a href=
"https://packages.qa.debian.org/eatmydata
">eatmydata
</a
>, which
293 uses LD_PRELOAD to replace the system functions for syncing data to
294 disk with functions doing nothing, thus allowing programs to live
295 dangerous while speeding up disk I/O significantly. Instead of
296 modifying the implementation of dpkg, apt and tasksel (which are the
297 packages responsible for selecting, fetching and installing packages),
298 it occurred to me that we could just divert the programs away, replace
299 them with a simple shell wrapper calling
300 "eatmydata
&nbsp;$program
&nbsp;$@
", to get the same effect.
301 Two days ago I decided to test the idea, and wrapped up a simple
302 implementation for the Debian Edu udeb.
</p
>
304 <p
>The effect was stunning. In my first test it reduced the running
305 time of the pkgsel step (installing tasks) from
64 to less than
44
306 minutes (
20 minutes shaved off the installation) on an old Dell
307 Latitude D505 machine. I am not quite sure what the optimised time
308 would have been, as I messed up the testing a bit, causing the debconf
309 priority to get low enough for two questions to pop up during
310 installation. As soon as I saw the questions I moved the installation
311 along, but do not know how long the question were holding up the
312 installation. I did some more measurements using Debian Edu Jessie,
313 and got these results. The time measured is the time stamp in
314 /var/log/syslog between the
"pkgsel: starting tasksel
" and the
315 "pkgsel: finishing up
" lines, if you want to do the same measurement
316 yourself. In Debian Edu, the tasksel dialog do not show up, and the
317 timing thus do not depend on how quickly the user handle the tasksel
320 <p
><table
>
323 <th
>Machine/setup
</th
>
324 <th
>Original tasksel
</th
>
325 <th
>Optimised tasksel
</th
>
326 <th
>Reduction
</th
>
330 <td
>Latitude D505 Main+LTSP LXDE
</td
>
331 <td
>64 min (
07:
46-
08:
50)
</td
>
332 <td
><44 min (
11:
27-
12:
11)
</td
>
333 <td
>>20 min
18%
</td
>
337 <td
>Latitude D505 Roaming LXDE
</td
>
338 <td
>57 min (
08:
48-
09:
45)
</td
>
339 <td
>34 min (
07:
43-
08:
17)
</td
>
340 <td
>23 min
40%
</td
>
344 <td
>Latitude D505 Minimal
</td
>
345 <td
>22 min (
10:
37-
10:
59)
</td
>
346 <td
>11 min (
11:
16-
11:
27)
</td
>
347 <td
>11 min
50%
</td
>
351 <td
>Thinkpad X200 Minimal
</td
>
352 <td
>6 min (
08:
19-
08:
25)
</td
>
353 <td
>4 min (
08:
04-
08:
08)
</td
>
354 <td
>2 min
33%
</td
>
358 <td
>Thinkpad X200 Roaming KDE
</td
>
359 <td
>19 min (
09:
21-
09:
40)
</td
>
360 <td
>15 min (
10:
25-
10:
40)
</td
>
361 <td
>4 min
21%
</td
>
364 </table
></p
>
366 <p
>The test is done using a netinst ISO on a USB stick, so some of the
367 time is spent downloading packages. The connection to the Internet
368 was
100Mbit/s during testing, so downloading should not be a
369 significant factor in the measurement. Download typically took a few
370 seconds to a few minutes, depending on the amount of packages being
373 <p
>The speedup is implemented by using two hooks in
374 <a href=
"https://www.debian.org/devel/debian-installer/
">Debian
375 Installer
</a
>, the pre-pkgsel.d hook to set up the diverts, and the
376 finish-install.d hook to remove the divert at the end of the
377 installation. I picked the pre-pkgsel.d hook instead of the
378 post-base-installer.d hook because I test using an ISO without the
379 eatmydata package included, and the post-base-installer.d hook in
380 Debian Edu can only operate on packages included in the ISO. The
381 negative effect of this is that I am unable to activate this
382 optimization for the kernel installation step in d-i. If the code is
383 moved to the post-base-installer.d hook, the speedup would be larger
384 for the entire installation.
</p
>
386 <p
>I
've implemented this in the
387 <a href=
"https://packages.qa.debian.org/debian-edu-install
">debian-edu-install
</a
>
388 git repository, and plan to provide the optimization as part of the
389 Debian Edu installation. If you want to test this yourself, you can
390 create two files in the installer (or in an udeb). One shell script
391 need do go into /usr/lib/pre-pkgsel.d/, with content like this:
</p
>
393 <p
><blockquote
><pre
>
396 . /usr/share/debconf/confmodule
398 logger -t my-pkgsel
"info: $*
"
401 logger -t my-pkgsel
"error: $*
"
404 apt-install eatmydata || true
405 if [ -x /target/usr/bin/eatmydata ] ; then
406 for bin in dpkg apt-get aptitude tasksel ; do
408 # Test that the file exist and have not been diverted already.
409 if [ -f /target$file ] ; then
410 info
"diverting $file using eatmydata
"
411 printf
"#!/bin/sh\neatmydata $bin.distrib \
"\$@\
"\n
" \
412 > /target$file.edu
413 chmod
755 /target$file.edu
414 in-target dpkg-divert --package debian-edu-config \
415 --rename --quiet --add $file
416 ln -sf ./$bin.edu /target$file
418 error
"unable to divert $file, as it is missing.
"
422 error
"unable to find /usr/bin/eatmydata after installing the eatmydata pacage
"
427 </pre
></blockquote
></p
>
429 <p
>To clean up, another shell script should go into
430 /usr/lib/finish-install.d/ with code like this:
432 <p
><blockquote
><pre
>
434 . /usr/share/debconf/confmodule
436 logger -t my-finish-install
"error: $@
"
438 remove_install_override() {
439 for bin in dpkg apt-get aptitude tasksel ; do
441 if [ -x /target$file.edu ] ; then
443 in-target dpkg-divert --package debian-edu-config \
444 --rename --quiet --remove $file
447 error
"Missing divert for $file.
"
450 sync # Flush file buffers before continuing
453 remove_install_override
454 </pre
></blockquote
></p
>
456 <p
>In Debian Edu, I placed both code fragments in a separate script
457 edu-eatmydata-install and call it from the pre-pkgsel.d and
458 finish-install.d scripts.
</p
>
460 <p
>By now you might ask if this change should get into the normal
461 Debian installer too? I suspect it should, but am not sure the
462 current debian-installer coordinators find it useful enough. It also
463 depend on the side effects of the change. I
'm not aware of any, but I
464 guess we will see if the change is safe after some more testing.
465 Perhaps there is some package in Debian depending on sync() and
466 fsync() having effect? Perhaps it should go into its own udeb, to
467 allow those of us wanting to enable it to do so without affecting
473 <title>Good bye subkeys.pgp.net, welcome pool.sks-keyservers.net
</title>
474 <link>http://people.skolelinux.org/pere/blog/Good_bye_subkeys_pgp_net__welcome_pool_sks_keyservers_net.html
</link>
475 <guid isPermaLink=
"true">http://people.skolelinux.org/pere/blog/Good_bye_subkeys_pgp_net__welcome_pool_sks_keyservers_net.html
</guid>
476 <pubDate>Wed,
10 Sep
2014 13:
10:
00 +
0200</pubDate>
477 <description><p
>Yesterday, I had the pleasure of attending a talk with the
478 <a href=
"http://www.nuug.no/
">Norwegian Unix User Group
</a
> about
479 <a href=
"http://www.nuug.no/aktiviteter/
20140909-sks-keyservers/
">the
480 OpenPGP keyserver pool sks-keyservers.net
</a
>, and was very happy to
481 learn that there is a large set of publicly available key servers to
482 use when looking for peoples public key. So far I have used
483 subkeys.pgp.net, and some times wwwkeys.nl.pgp.net when the former
484 were misbehaving, but those days are ended. The servers I have used
485 up until yesterday have been slow and some times unavailable. I hope
486 those problems are gone now.
</p
>
488 <p
>Behind the round robin DNS entry of the
489 <a href=
"https://sks-keyservers.net/
">sks-keyservers.net
</a
> service
490 there is a pool of more than
100 keyservers which are checked every
491 day to ensure they are well connected and up to date. It must be
492 better than what I have used so far. :)
</p
>
494 <p
>Yesterdays speaker told me that the service is the default
495 keyserver provided by the default configuration in GnuPG, but this do
496 not seem to be used in Debian. Perhaps it should?
</p
>
498 <p
>Anyway, I
've updated my ~/.gnupg/options file to now include this
501 <p
><blockquote
><pre
>
502 keyserver pool.sks-keyservers.net
503 </pre
></blockquote
></p
>
505 <p
>With GnuPG version
2 one can also locate the keyserver using SRV
506 entries in DNS. Just for fun, I did just that at work, so now every
507 user of GnuPG at the University of Oslo should find a OpenGPG
508 keyserver automatically should their need it:
</p
>
510 <p
><blockquote
><pre
>
511 % host -t srv _pgpkey-http._tcp.uio.no
512 _pgpkey-http._tcp.uio.no has SRV record
0 100 11371 pool.sks-keyservers.net.
514 </pre
></blockquote
></p
>
517 <a href=
"http://ietfreport.isoc.org/idref/draft-shaw-openpgp-hkp/
">the
518 HKP lookup protocol
</a
> supported finding signature paths, I would be
519 very happy. It can look up a given key or search for a user ID, but I
520 normally do not want that, but to find a trust path from my key to
521 another key. Given a user ID or key ID, I would like to find (and
522 download) the keys representing a signature path from my key to the
523 key in question, to be able to get a trust path between the two keys.
524 This is as far as I can tell not possible today. Perhaps something
525 for a future version of the protocol?
</p
>