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>Non-blocking bittorrent plugin for vlc
</title>
11 <link>http://people.skolelinux.org/pere/blog/Non_blocking_bittorrent_plugin_for_vlc.html
</link>
12 <guid isPermaLink=
"true">http://people.skolelinux.org/pere/blog/Non_blocking_bittorrent_plugin_for_vlc.html
</guid>
13 <pubDate>Wed,
12 Dec
2018 07:
20:
00 +
0100</pubDate>
14 <description><p
>A few hours ago, a new and improved version (
2.4) of
15 <a href=
"https://tracker.debian.org/pkg/vlc-plugin-bittorrent
">the VLC
16 bittorrent plugin
</a
> was uploaded to Debian. This new version
17 include a complete rewrite of the bittorrent related code, which seem
18 to make the plugin non-blocking. This mean you can actually exit VLC
19 even when the plugin seem to be unable to get the bittorrent streaming
20 started. The new version also include support for filtering playlist
21 by file extension using command line options, if you want to avoid
22 processing audio, video or images. The package is currently in Debian
23 unstable, but should be available in Debian testing in two days. To
24 test it, simply install it like this:
</p
>
27 apt install vlc-plugin-bittorrent
28 </pre
></p
>
30 <p
>After it is installed, you can try to use it to play a file
31 downloaded live via bittorrent like this:
34 vlc https://archive.org/download/Glass_201703/Glass_201703_archive.torrent
35 </pre
></p
>
37 <p
>As usual, if you use Bitcoin and want to show your support of my
38 activities, please send Bitcoin donations to my address
39 <b
><a href=
"bitcoin:
15oWEoG9dUPovwmUL9KWAnYRtNJEkP1u1b
">15oWEoG9dUPovwmUL9KWAnYRtNJEkP1u1b
</a
></b
>.
</p
>
44 <title>Retten til kontant betaling er en rettighet som må brukes for å beholdes
</title>
45 <link>http://people.skolelinux.org/pere/blog/Retten_til_kontant_betaling_er_en_rettighet_som_m__brukes_for___beholdes.html
</link>
46 <guid isPermaLink=
"true">http://people.skolelinux.org/pere/blog/Retten_til_kontant_betaling_er_en_rettighet_som_m__brukes_for___beholdes.html
</guid>
47 <pubDate>Tue,
11 Dec
2018 10:
00:
00 +
0100</pubDate>
48 <description><p
><a href=
"https://www.fn.no/Om-FN/Avtaler/Menneskerettigheter/FNs-verdenserklaering-om-menneskerettigheter
">FNs
49 menneskerettighetserklæring
</a
> artikkel
13 første punkt lyder som
52 <p
><blockquote
>
53 Enhver har rett til å bevege seg fritt og til fritt å velge
54 oppholdssted innenfor en stats grenser.
55 </blockquote
></p
>
57 <p
>Det er altså en menneskerett å kunne bevege seg fritt i landet.
58 For å bevege seg fritt i landet, så må en kunne bevege seg uten å bli
59 sporet. Det vil i dagens samfunn innebære å bevege seg uten å legge
60 igjen digitale spor og uten å være radiomerket. Hvis en vet at ens
61 bevegelser, hvor en befinner seg når, og hvem som befinner seg i
62 nærheten, blir samlet inn og gjort tilgjengelig for fremmede, det være
63 seg myndighetene eller private organisasjoner, så kan en ikke lenger
64 bevege seg fritt. Dette gjør at det er en forutsetning for å ha glede
65 av retten til å bevege seg fritt i landet at en motstår fristelsen til
66 å legge igjen digitale spor når en betaler for seg. Rettigheter som
67 ikke blir brukt, blir fjernet. Den eneste måten i dag å unngå å legge
68 igjen digitale spor når en betaler for seg, er å betale med kontanter,
69 samt takke nei til å legge igjen navn og adresse (slik f.eks. Elkjøp
70 ber om
&mdash; jeg sier de kan legge inn «anonym anonym» når
71 datasystemet deres trenger et navn). Personlig anbefaler jeg å
72 konsekvent bruke kontant betaling når man beveger seg rundt, for å
73 bidra til forsvaret av menneskerettighetene i Norge. Kanskje noe også
74 for deg? Merk at det ikke er tilstrekkelig for å unngå sporing å
75 betale med kontanter, men det er et lite steg i riktig retning.
</p
>
77 <p
>Det er flere andre argumenter i tillegg til
78 menneskerettighetsargumentet for å bruke kontanter. I går hadde
79 Dagbladet en utmerket kommentar av sin journalist John Olav Egeland om
81 <a href=
"https://www.dagbladet.no/kultur/kontantlost-diktatur/
70543434">kontantløst
82 diktatur
</a
> som venter oss hvis mange nok slutter å insistere på å
83 betale med kontanter. Jeg anbefaler deg å lese den.
</p
>
85 <p
>Som vanlig, hvis du bruker Bitcoin og ønsker å vise din støtte til
86 det jeg driver med, setter jeg pris på om du sender Bitcoin-donasjoner
88 <b
><a href=
"bitcoin:
15oWEoG9dUPovwmUL9KWAnYRtNJEkP1u1b
">15oWEoG9dUPovwmUL9KWAnYRtNJEkP1u1b
</a
></b
>.
89 Merk, betaling med bitcoin er ikke anonymt. :)
</p
>
94 <title>Why is your site not using Content Security Policy / CSP?
</title>
95 <link>http://people.skolelinux.org/pere/blog/Why_is_your_site_not_using_Content_Security_Policy___CSP_.html
</link>
96 <guid isPermaLink=
"true">http://people.skolelinux.org/pere/blog/Why_is_your_site_not_using_Content_Security_Policy___CSP_.html
</guid>
97 <pubDate>Sun,
9 Dec
2018 15:
00:
00 +
0100</pubDate>
98 <description><p
>Yesterday, I had the pleasure of watching on Frikanalen the OWASP
99 talk by Scott Helme titled
100 "<a href=
"https://frikanalen.no/video/
626080/
">What We’ve Learned From
101 Billions of Security Reports
</a
>". I had not heard of the
102 <a href=
"https://en.wikipedia.org/wiki/Content_Security_Policy
">Content
103 Security Policy standard
</a
> nor its ability to
"call home
" when a
104 browser detect a policy breach (I do not follow web page design
105 development much these days), and found the talk very illuminating.
</p
>
107 <p
>The mechanism allow a web site owner to use HTTP headers to tell
108 visitors web browser which sources (internal and external) are allowed to
109 be used on the web site. Thus it become possible to enforce a
"only
110 local content
" policy despite web designers urge to fetch programs
111 from random sites on the Internet, like the one
112 <a href=
"https://securityaffairs.co/wordpress/
68966/hacking/browsealoud-plugin-hack.html
">enabling
113 the attack
</a
> reported by Scott Helme earlier this year.
</p
>
115 <p
>Using CSP seem like an obvious thing for a site admin to implement
116 to take some control over the information leak that occur when
117 external sources are used to render web pages, it is a mystery more
118 sites are not using CSP? It is being
119 <a href=
"https://www.w3.org/TR/CSP/
">standardized under W3C
</a
> these
120 days, and is supposed by most web browsers
</p
>
122 <p
>I managed to find
<a href=
"https://github.com/mozilla/django-csp
">a
123 Django middleware for implementing CSP
</a
> and was happy to discover
124 it was already in Debian. I plan to use it to add CSP support to the
125 Frikanalen web site soon.
</p
>
127 <p
>As usual, if you use Bitcoin and want to show your support of my
128 activities, please send Bitcoin donations to my address
129 <b
><a href=
"bitcoin:
15oWEoG9dUPovwmUL9KWAnYRtNJEkP1u1b
">15oWEoG9dUPovwmUL9KWAnYRtNJEkP1u1b
</a
></b
>.
</p
>
134 <title>New and improved Frikanalen Kodi addon version
0.0.3</title>
135 <link>http://people.skolelinux.org/pere/blog/New_and_improved_Frikanalen_Kodi_addon_version_0_0_3.html
</link>
136 <guid isPermaLink=
"true">http://people.skolelinux.org/pere/blog/New_and_improved_Frikanalen_Kodi_addon_version_0_0_3.html
</guid>
137 <pubDate>Thu,
8 Nov
2018 10:
30:
00 +
0100</pubDate>
138 <description><p
>If you read my blog regularly, you probably know I am involved in
139 running and developing the
<a href=
"https://frikanalen.no/
">Norwegian
140 TV channel Frikanalen
</a
>. It is an open channel, allowing everyone
141 in Norway to publish videos on a TV channel with national coverage.
142 You can think of it as Youtube for national television.
143 In addition to distribution on RiksTV and Uninett, Frikanalen is also
144 available as a Kodi addon. The last few days I have updated the code
145 to add more features. A
146 <a href=
"https://kodi.tv/addon/plugins-video-add-ons/frikanalen-nett-tv
">new
147 and improved version
0.0.3 Frikanalen addon
</a
> was just made
148 available via the Kodi repositories. This new version include a
149 option to browse videos by category, as well as free text search
150 in the video archive. It will now also show the video duration in the
151 video lists, which were missing earlier. A new and experimental
152 link to the HD video stream currently being worked on is provided, for
153 those that want to see what the
<a href=
"https://casparcg.com/
">CasparCG
</a
>
154 output look like. The alternative is the SD video stream, generated
155 using MLT. CasparCG is controlled by our
156 <a href=
"https://github.com/Frikanalen/mltplayout/
">mltplayout
157 server
</a
> which instead of talking to mlt is giving PLAY instructions
158 to the CasparCG server when it is time to start a new program.
</p
>
160 <p
>By now, you are probably wondering what kind of content is being
161 played on the channel. These days, it is filled with technical
162 presentations like those from
<a href=
"https://www.nuug.no/
">NUUG
</a
>,
163 <a href=
"https://www.debconf.org/
">Debconf
</a
>, Makercon, and TED,
164 but there are also some periods with
165 <a href=
"https://www.empo.no/
">EMPT TV
</a
> and
166 <a href=
"https://www.p7.no/
">P7
</a
>.
168 <p
>As usual, if you use Bitcoin and want to show your support of my
169 activities, please send Bitcoin donations to my address
170 <b
><a href=
"bitcoin:
15oWEoG9dUPovwmUL9KWAnYRtNJEkP1u1b
">15oWEoG9dUPovwmUL9KWAnYRtNJEkP1u1b
</a
></b
>.
</p
>
175 <title>Time for an official MIME type for patches?
</title>
176 <link>http://people.skolelinux.org/pere/blog/Time_for_an_official_MIME_type_for_patches_.html
</link>
177 <guid isPermaLink=
"true">http://people.skolelinux.org/pere/blog/Time_for_an_official_MIME_type_for_patches_.html
</guid>
178 <pubDate>Thu,
1 Nov
2018 08:
15:
00 +
0100</pubDate>
179 <description><p
>As part of my involvement in
180 <a href=
"https://gitlab.com/OsloMet-ABI/nikita-noark5-core
">the Nikita
181 archive API project
</a
>, I
've been importing a fairly large lump of
182 emails into a test instance of the archive to see how well this would
183 go. I picked a subset of
<a href=
"https://notmuchmail.org/
">my
184 notmuch email database
</a
>, all public emails sent to me via
185 @lists.debian.org, giving me a set of around
216 000 emails to import.
186 In the process, I had a look at the various attachments included in
187 these emails, to figure out what to do with attachments, and noticed
188 that one of the most common attachment formats do not have
189 <a href=
"https://www.iana.org/assignments/media-types/media-types.xhtml
">an
190 official MIME type
</a
> registered with IANA/IETF. The output from
191 diff, ie the input for patch, is on the top
10 list of formats
192 included in these emails. At the moment people seem to use either
193 text/x-patch or text/x-diff, but neither is officially registered. It
194 would be better if one official MIME type were registered and used
195 everywhere.
</p
>
197 <p
>To try to get one official MIME type for these files, I
've brought
199 <a href=
"https://www.ietf.org/mailman/listinfo/media-types
">the
200 media-types mailing list
</a
>. If you are interested in discussion
201 which MIME type to use as the official for patch files, or involved in
202 making software using a MIME type for patches, perhaps you would like
203 to join the discussion?
</p
>
205 <p
>As usual, if you use Bitcoin and want to show your support of my
206 activities, please send Bitcoin donations to my address
207 <b
><a href=
"bitcoin:
15oWEoG9dUPovwmUL9KWAnYRtNJEkP1u1b
">15oWEoG9dUPovwmUL9KWAnYRtNJEkP1u1b
</a
></b
>.
</p
>
212 <title>Measuring the speaker frequency response using the AUDMES free software GUI - nice free software
</title>
213 <link>http://people.skolelinux.org/pere/blog/Measuring_the_speaker_frequency_response_using_the_AUDMES_free_software_GUI___nice_free_software.html
</link>
214 <guid isPermaLink=
"true">http://people.skolelinux.org/pere/blog/Measuring_the_speaker_frequency_response_using_the_AUDMES_free_software_GUI___nice_free_software.html
</guid>
215 <pubDate>Mon,
22 Oct
2018 08:
40:
00 +
0200</pubDate>
216 <description><p
><img src=
"http://people.skolelinux.org/pere/blog/images/
2018-
10-
22-audmes-measure-speakers.png
" align=
"right
" width=
"40%
"/
></p
>
218 <p
>My current home stereo is a patchwork of various pieces I got on
219 flee markeds over the years. It is amazing what kind of equipment
220 show up there. I
've been wondering for a while if it was possible to
221 measure how well this equipment is working together, and decided to
222 see how far I could get using free software. After trawling the web I
223 came across an article from DIY Audio and Video on
224 <a href=
"https://www.diyaudioandvideo.com/Tutorial/SpeakerResponseTesting/
">Speaker
225 Testing and Analysis
</a
> describing how to test speakers, and it listing
226 several software options, among them
227 <a href=
"https://sourceforge.net/projects/audmes/
">AUDio MEasurement
228 System (AUDMES)
</a
>. It is the only free software system I could find
229 focusing on measuring speakers and audio frequency response. In the
230 process I also found an interesting article from NOVO on
231 <a href=
"http://novo.press/understanding-speaker-specifications-and-frequency-response/
">Understanding
232 Speaker Specifications and Frequency Response
</a
> and an article from
234 <a href=
"https://www.ecoustics.com/articles/understanding-speaker-frequency-response/
">Understanding
235 Speaker Frequency Response
</a
>, with a lot of information on what to
236 look for and how to interpret the graphs. Armed with this knowledge,
237 I set out to measure the state of my speakers.
</p
>
239 <p
>The first hurdle was that AUDMES hadn
't seen a commit for
10 years
240 and did not build with current compilers and libraries. I got in
241 touch with its author, who no longer was spending time on the program
242 but gave me write access to the subversion repository on Sourceforge.
243 The end result is that now the code build on Linux and is capable of
244 saving and loading the collected frequency response data in CSV
245 format. The application is quite nice and flexible, and I was able to
246 select the input and output audio interfaces independently. This made
247 it possible to use a USB mixer as the input source, while sending
248 output via my laptop headphone connection. I lacked the hardware and
249 cabling to figure out a different way to get independent cabling to
250 speakers and microphone.
</p
>
252 <p
>Using this setup I could see how a large range of high frequencies
253 apparently were not making it out of my speakers. The picture show
254 the frequency response measurement of one of the speakers. Note the
255 frequency lines seem to be slightly misaligned, compared to the CSV
256 output from the program. I can not hear several of these are high
257 frequencies, according to measurement from
258 <a href=
"http://freehearingtestsoftware.com
">Free Hearing Test
259 Software
</a
>, an freeware system to measure your hearing (still
260 looking for a free software alternative), so I do not know if they are
261 coming out out the speakers. I thus do not quite know how to figure
262 out if the missing frequencies is a problem with the microphone, the
263 amplifier or the speakers, but I managed to rule out the audio card in my
264 PC by measuring my Bose noise canceling headset using its own
265 microphone. This setup was able to see the high frequency tones, so
266 the problem with my stereo had to be in the amplifier or speakers.
</p
>
268 <p
>Anyway, to try to role out one factor I ended up picking up a new
269 set of speakers at a flee marked, and these work a lot better than the
270 old speakers, so I guess the microphone and amplifier is OK. If you
271 need to measure your own speakers, check out AUDMES. If more people
272 get involved, perhaps the project could become good enough to
273 <a href=
"https://bugs.debian.org/
910876">include in Debian
</a
>? And if
274 you know of some other free software to measure speakers and amplifier
275 performance, please let me know. I am aware of the freeware option
276 <a href=
"https://www.roomeqwizard.com/
">REW
</a
>, but I want something
277 that can be developed also when the vendor looses interest.
</p
>
279 <p
>As usual, if you use Bitcoin and want to show your support of my
280 activities, please send Bitcoin donations to my address
281 <b
><a href=
"bitcoin:
15oWEoG9dUPovwmUL9KWAnYRtNJEkP1u1b
">15oWEoG9dUPovwmUL9KWAnYRtNJEkP1u1b
</a
></b
>.
</p
>
286 <title>Web browser integration of VLC with Bittorrent support
</title>
287 <link>http://people.skolelinux.org/pere/blog/Web_browser_integration_of_VLC_with_Bittorrent_support.html
</link>
288 <guid isPermaLink=
"true">http://people.skolelinux.org/pere/blog/Web_browser_integration_of_VLC_with_Bittorrent_support.html
</guid>
289 <pubDate>Sun,
21 Oct
2018 09:
50:
00 +
0200</pubDate>
290 <description><p
>Bittorrent is as far as I know, currently the most efficient way to
291 distribute content on the Internet. It is used all by all sorts of
292 content providers, from national TV stations like
293 <a href=
"https://www.nrk.no/
">NRK
</a
>, Linux distributors like
294 <a href=
"https://www.debian.org/
">Debian
</a
> and
295 <a href=
"https://www.ubuntu.com/
">Ubuntu
</a
>, and of course the
296 <a href=
"https://archive.org/
">Internet archive
</A
>.
298 <p
>Almost a month ago
299 <a href=
"https://tracker.debian.org/pkg/vlc-plugin-bittorrent
">a new
300 package adding Bittorrent support to VLC
</a
> became available in
301 Debian testing and unstable. To test it, simply install it like
305 apt install vlc-plugin-bittorrent
306 </pre
></p
>
308 <p
>Since the plugin was made available for the first time in Debian,
309 several improvements have been made to it. In version
2.2-
4, now
310 available in both testing and unstable, a desktop file is provided to
311 teach browsers to start VLC when the user click on torrent files or
312 magnet links. The last part is thanks to me finally understanding
313 what the strange x-scheme-handler style MIME types in desktop files
314 are used for. By adding x-scheme-handler/magnet to the MimeType entry
315 in the desktop file, at least the browsers Firefox and Chromium will
316 suggest to start VLC when selecting a magnet URI on a web page. The
317 end result is that now, with the plugin installed in Buster and Sid,
319 <a href=
"https://archive.org/details/CopyingIsNotTheft1080p
">Internet
320 Archive page with movies
</a
> using a web browser and click on the
321 torrent link to start streaming the movie.
</p
>
323 <p
>Note, there is still some misfeatures in the plugin. One is the
324 fact that it will hang and
325 <a href=
"https://github.com/johang/vlc-bittorrent/issues/
13">block VLC
326 from exiting until the torrent streaming starts
</a
>. Another is the
328 <a href=
"https://github.com/johang/vlc-bittorrent/issues/
9">will pick
329 and play a random file in a multi file torrent
</a
>. This is not
330 always the video file you want. Combined with the first it can be a
331 bit hard to get the video streaming going. But when it work, it seem
332 to do a good job.
</p
>
334 <p
>For the Debian packaging, I would love to find a good way to test
335 if the plugin work with VLC using autopkgtest. I tried, but do not
336 know enough of the inner workings of VLC to get it working. For now
337 the autopkgtest script is only checking if the .so file was
338 successfully loaded by VLC. If you have any suggestions, please
339 submit a patch to the Debian bug tracking system.
</p
>
341 <p
>As usual, if you use Bitcoin and want to show your support of my
342 activities, please send Bitcoin donations to my address
343 <b
><a href=
"bitcoin:
15oWEoG9dUPovwmUL9KWAnYRtNJEkP1u1b
">15oWEoG9dUPovwmUL9KWAnYRtNJEkP1u1b
</a
></b
>.
</p
>
348 <title>Release
0.2 of free software archive system Nikita announced
</title>
349 <link>http://people.skolelinux.org/pere/blog/Release_0_2_of_free_software_archive_system_Nikita_announced.html
</link>
350 <guid isPermaLink=
"true">http://people.skolelinux.org/pere/blog/Release_0_2_of_free_software_archive_system_Nikita_announced.html
</guid>
351 <pubDate>Thu,
18 Oct
2018 14:
40:
00 +
0200</pubDate>
352 <description><p
>This morning, the new release of the
353 <a href=
"https://gitlab.com/OsloMet-ABI/nikita-noark5-core/
">Nikita
354 Noark
5 core project
</a
> was
355 <a href=
"https://lists.nuug.no/pipermail/nikita-noark/
2018-October/
000406.html
">announced
356 on the project mailing list
</a
>. The free software solution is an
357 implementation of the Norwegian archive standard Noark
5 used by
358 government offices in Norway. These were the changes in version
0.2
359 since version
0.1.1 (from NEWS.md):
362 <li
>Fix typos in REL names
</li
>
363 <li
>Tidy up error message reporting
</li
>
364 <li
>Fix issue where we used Integer.valueOf(), not Integer.getInteger()
</li
>
365 <li
>Change some String handling to StringBuffer
</li
>
366 <li
>Fix error reporting
</li
>
367 <li
>Code tidy-up
</li
>
368 <li
>Fix issue using static non-synchronized SimpleDateFormat to avoid
369 race conditions
</li
>
370 <li
>Fix problem where deserialisers were treating integers as strings
</li
>
371 <li
>Update methods to make them null-safe
</li
>
372 <li
>Fix many issues reported by coverity
</li
>
373 <li
>Improve equals(), compareTo() and hash() in domain model
</li
>
374 <li
>Improvements to the domain model for metadata classes
</li
>
375 <li
>Fix CORS issues when downloading document
</li
>
376 <li
>Implementation of case-handling with registryEntry and document upload
</li
>
377 <li
>Better support in Javascript for OPTIONS
</li
>
378 <li
>Adding concept description of mail integration
</li
>
379 <li
>Improve setting of default values for GET on ny-journalpost
</li
>
380 <li
>Better handling of required values during deserialisation
</li
>
381 <li
>Changed tilknyttetDato (M620) from date to dateTime
</li
>
382 <li
>Corrected some opprettetDato (M600) (de)serialisation errors.
</li
>
383 <li
>Improve parse error reporting.
</li
>
384 <li
>Started on OData search and filtering.
</li
>
385 <li
>Added Contributor Covenant Code of Conduct to project.
</li
>
386 <li
>Moved repository and project from Github to Gitlab.
</li
>
387 <li
>Restructured repository, moved code into src/ and web/.
</li
>
388 <li
>Updated code to use Spring Boot version
2.
</li
>
389 <li
>Added support for OAuth2 authentication.
</li
>
390 <li
>Fixed several bugs discovered by Coverity.
</li
>
391 <li
>Corrected handling of date/datetime fields.
</li
>
392 <li
>Improved error reporting when rejecting during deserializatoin.
</li
>
393 <li
>Adjusted default values provided for ny-arkivdel, ny-mappe,
394 ny-saksmappe, ny-journalpost and ny-dokumentbeskrivelse.
</li
>
395 <li
>Several fixes for korrespondansepart*.
</li
>
396 <li
>Updated web GUI:
398 <li
>Now handle both file upload and download.
</li
>
399 <li
>Uses new OAuth2 authentication for login.
</li
>
400 <li
>Forms now fetches default values from API using GET.
</li
>
401 <li
>Added RFC
822 (email), TIFF and JPEG to list of possible file formats.
</li
>
402 </ul
></li
>
405 <p
>The changes and improvements are extensive. Running diffstat on
406 the changes between git tab
0.1.1 and
0.2 show
1098 files changed,
407 108666 insertions(+),
54066 deletions(-).
</p
>
409 <p
>If free and open standardized archiving API sound interesting to
410 you, please contact us on IRC
411 (
<a href=
"irc://irc.freenode.net/%
23nikita
">#nikita on
412 irc.freenode.net
</a
>) or email
413 (
<a href=
"https://lists.nuug.no/mailman/listinfo/nikita-noark
">nikita-noark
414 mailing list
</a
>).
</p
>
416 <p
>As usual, if you use Bitcoin and want to show your support of my
417 activities, please send Bitcoin donations to my address
418 <b
><a href=
"bitcoin:
15oWEoG9dUPovwmUL9KWAnYRtNJEkP1u1b
">15oWEoG9dUPovwmUL9KWAnYRtNJEkP1u1b
</a
></b
>.
</p
>
423 <title>Fetching trusted timestamps using the rfc3161ng python module
</title>
424 <link>http://people.skolelinux.org/pere/blog/Fetching_trusted_timestamps_using_the_rfc3161ng_python_module.html
</link>
425 <guid isPermaLink=
"true">http://people.skolelinux.org/pere/blog/Fetching_trusted_timestamps_using_the_rfc3161ng_python_module.html
</guid>
426 <pubDate>Mon,
8 Oct
2018 12:
30:
00 +
0200</pubDate>
427 <description><p
>I have earlier covered the basics of trusted timestamping using the
428 'openssl ts
' client. See blog post for
429 <a href=
"http://people.skolelinux.org/pere/blog/Public_Trusted_Timestamping_services_for_everyone.html
">2014</a
>,
430 <a href=
"http://people.skolelinux.org/pere/blog/syslog_trusted_timestamp___chain_of_trusted_timestamps_for_your_syslog.html
">2016</a
>
432 <a href=
"http://people.skolelinux.org/pere/blog/Idea_for_storing_trusted_timestamps_in_a_Noark_5_archive.html
">2017</a
>
433 for those stories. But some times I want to integrate the timestamping
434 in other code, and recently I needed to integrate it into Python.
435 After searching a bit, I found
436 <a href=
"https://dev.entrouvert.org/projects/python-rfc3161
">the
437 rfc3161 library
</a
> which seemed like a good fit, but I soon
438 discovered it only worked for python version
2, and I needed something
439 that work with python version
3. Luckily I next came across
440 <a href=
"https://github.com/trbs/rfc3161ng/
">the rfc3161ng library
</a
>,
441 a fork of the original rfc3161 library. Not only is it working with
442 python
3, it have fixed a few of the bugs in the original library, and
443 it has an active maintainer. I decided to wrap it up and make it
444 <a href=
"https://tracker.debian.org/pkg/python-rfc3161ng
">available in
445 Debian
</a
>, and a few days ago it entered Debian unstable and testing.
</p
>
447 <p
>Using the library is fairly straight forward. The only slightly
448 problematic step is to fetch the required certificates to verify the
449 timestamp. For some services it is straight forward, while for others
450 I have not yet figured out how to do it. Here is a small standalone
451 code example based on of the integration tests in the library code:
</p
>
458 Python
3 script demonstrating how to use the rfc3161ng module to
459 get trusted timestamps.
461 The license of this code is the same as the license of the rfc3161ng
467 import pyasn1.codec.der
471 import urllib.request
478 def fetch(url, f=None):
479 response = urllib.request.urlopen(url)
480 data = response.read()
486 with tempfile.NamedTemporaryFile() as cert_f,\
487 tempfile.NamedTemporaryFile() as ca_f,\
488 tempfile.NamedTemporaryFile() as msg_f,\
489 tempfile.NamedTemporaryFile() as tsr_f:
491 # First fetch certificates used by service
492 certificate_data = fetch(
'https://freetsa.org/files/tsa.crt
', cert_f)
493 ca_data_data = fetch(
'https://freetsa.org/files/cacert.pem
', ca_f)
495 # Then timestamp the message
497 rfc3161ng.RemoteTimestamper(
'http://freetsa.org/tsr
',
498 certificate=certificate_data)
499 data = b
"Python forever!\n
"
500 tsr = timestamper(data=data, return_tsr=True)
502 # Finally, convert message and response to something
'openssl ts
' can verify
504 store(tsr_f, pyasn1.codec.der.encoder.encode(tsr))
505 args = [
"openssl
",
"ts
",
"-verify
",
506 "-data
", msg_f.name,
507 "-in
", tsr_f.name,
508 "-CAfile
", ca_f.name,
509 "-untrusted
", cert_f.name]
510 subprocess.check_call(args)
512 if
'__main__
' == __name__:
516 <p
>The code fetches the required certificates, store them as temporary
517 files, timestamp a simple message, store the message and timestamp to
518 disk and ask
'openssl ts
' to verify the timestamp. A timestamp is
519 around
1.5 kiB in size, and should be fairly easy to store for future
522 <p
>As usual, if you use Bitcoin and want to show your support of my
523 activities, please send Bitcoin donations to my address
524 <b
><a href=
"bitcoin:
15oWEoG9dUPovwmUL9KWAnYRtNJEkP1u1b
">15oWEoG9dUPovwmUL9KWAnYRtNJEkP1u1b
</a
></b
>.
</p
>
529 <title>Automatic Google Drive sync using grive in Debian
</title>
530 <link>http://people.skolelinux.org/pere/blog/Automatic_Google_Drive_sync_using_grive_in_Debian.html
</link>
531 <guid isPermaLink=
"true">http://people.skolelinux.org/pere/blog/Automatic_Google_Drive_sync_using_grive_in_Debian.html
</guid>
532 <pubDate>Thu,
4 Oct
2018 15:
20:
00 +
0200</pubDate>
533 <description><p
>A few days, I rescued a Windows victim over to Debian. To try to
534 rescue the remains, I helped set up automatic sync with Google Drive.
535 I did not find any sensible Debian package handling this
536 automatically, so I rebuild the grive2 source from
537 <a href=
"http://www.webupd8.org/
">the Ubuntu UPD8 PPA
</a
> to do the
538 task and added a autostart desktop entry and a small shell script to
539 run in the background while the user is logged in to do the sync.
540 Here is a sketch of the setup for future reference.
</p
>
542 <p
>I first created
<tt
>~/googledrive
</tt
>, entered the directory and
543 ran
'<tt
>grive -a
</tt
>' to authenticate the machine/user. Next, I
544 created a autostart hook in
<tt
>~/.config/autostart/grive.desktop
</tt
>
545 to start the sync when the user log in:
</p
>
547 <p
><blockquote
><pre
>
549 Name=Google drive autosync
551 Exec=/home/user/bin/grive-sync
552 </pre
></blockquote
></p
>
554 <p
>Finally, I wrote the
<tt
>~/bin/grive-sync
</tt
> script to sync
555 ~/googledrive/ with the files in Google Drive.
</p
>
557 <p
><blockquote
><pre
>
562 if [
"$syncpid
" ] ; then
566 trap cleanup EXIT INT QUIT
567 /usr/lib/grive/grive-sync.sh listen googledrive
2>&1 | sed
"s%^%$
0:%
" &
570 if ! xhost
>/dev/null
2>&1 ; then
571 echo
"no DISPLAY, exiting as the user probably logged out
"
574 if [ ! -e /run/user/
1000/grive-sync.sh_googledrive ] ; then
575 /usr/lib/grive/grive-sync.sh sync googledrive
578 done
2>&1 | sed
"s%^%$
0:%
"
579 </pre
></blockquote
></p
>
581 <p
>Feel free to use the setup if you want. It can be assumed to be
582 GNU GPL v2 licensed (or any later version, at your leisure), but I
583 doubt this code is possible to claim copyright on.
</p
>
585 <p
>As usual, if you use Bitcoin and want to show your support of my
586 activities, please send Bitcoin donations to my address
587 <b
><a href=
"bitcoin:
15oWEoG9dUPovwmUL9KWAnYRtNJEkP1u1b
">15oWEoG9dUPovwmUL9KWAnYRtNJEkP1u1b
</a
></b
>.
</p
>