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 October
2018</title>
5 <description>Entries from October
2018</description>
6 <link>http://people.skolelinux.org/pere/blog/
</link>
10 <title>Web browser integration of VLC with Bittorrent support
</title>
11 <link>http://people.skolelinux.org/pere/blog/Web_browser_integration_of_VLC_with_Bittorrent_support.html
</link>
12 <guid isPermaLink=
"true">http://people.skolelinux.org/pere/blog/Web_browser_integration_of_VLC_with_Bittorrent_support.html
</guid>
13 <pubDate>Sun,
21 Oct
2018 09:
50:
00 +
0200</pubDate>
14 <description><p
>Bittorrent is as far as I know, currently the most efficient way to
15 distribute content on the Internet. It is used all by all sorts of
16 content providers, from national TV stations like
17 <a href=
"https://www.nrk.no/
">NRK
</a
>, Linux distributors like
18 <a href=
"https://www.debian.org/
">Debian
</a
> and
19 <a href=
"https://www.ubuntu.com/
">Ubuntu
</a
>, and of course the
20 <a href=
"https://archive.org/
">Internet archive
</A
>.
22 <p
>Almost a month ago
23 <a href=
"https://tracker.debian.org/pkg/vlc-plugin-bittorrent
">a new
24 package adding Bittorrent support to VLC
</a
> became available in
25 Debian testing and unstable. To test it, simply install it like
29 apt install vlc-plugin-bittorrent
30 </pre
></p
>
32 <p
>Since the plugin was made available for the first time in Debian,
33 several improvements have been made to it. In version
2.2-
4, now
34 available in both testing and unstable, a desktop file is provided to
35 teach browsers to start VLC when the user click on torrent files or
36 magnet links. The last part is thanks to me finally understanding
37 what the strange x-scheme-handler style MIME types in desktop files
38 are used for. By adding x-scheme-handler/magnet to the MimeType entry
39 in the desktop file, at least the browsers Firefox and Chromium will
40 suggest to start VLC when selecting a magnet URI on a web page. The
41 end result is that now, with the plugin installed in Buster and Sid,
43 <a href=
"https://archive.org/details/CopyingIsNotTheft1080p
">Internet
44 Archive page with movies
</a
> using a web browser and click on the
45 torrent link to start streaming the movie.
</p
>
47 <p
>Note, there is still some misfeatures in the plugin. One is the
48 fact that it will hang and
49 <a href=
"https://github.com/johang/vlc-bittorrent/issues/
13">block VLC
50 from exiting until the torrent streaming starts
</a
>. Another is the
52 <a href=
"https://github.com/johang/vlc-bittorrent/issues/
9">will pick
53 and play a random file in a multi file torrent
</a
>. This is not
54 always the video file you want. Combined with the first it can be a
55 bit hard to get the video streaming going. But when it work, it seem
56 to do a good job.
</p
>
58 <p
>For the Debian packaging, I would love to find a good way to test
59 if the plugin work with VLC using autopkgtest. I tried, but do not
60 know enough of the inner workings of VLC to get it working. For now
61 the autopkgtest script is only checking if the .so file was
62 successfully loaded by VLC. If you have any suggestions, please
63 submit a patch to the Debian bug tracking system.
</p
>
65 <p
>As usual, if you use Bitcoin and want to show your support of my
66 activities, please send Bitcoin donations to my address
67 <b
><a href=
"bitcoin:
15oWEoG9dUPovwmUL9KWAnYRtNJEkP1u1b
">15oWEoG9dUPovwmUL9KWAnYRtNJEkP1u1b
</a
></b
>.
</p
>
72 <title>Release
0.2 of free software archive system Nikita announced
</title>
73 <link>http://people.skolelinux.org/pere/blog/Release_0_2_of_free_software_archive_system_Nikita_announced.html
</link>
74 <guid isPermaLink=
"true">http://people.skolelinux.org/pere/blog/Release_0_2_of_free_software_archive_system_Nikita_announced.html
</guid>
75 <pubDate>Thu,
18 Oct
2018 14:
40:
00 +
0200</pubDate>
76 <description><p
>This morning, the new release of the
77 <a href=
"https://gitlab.com/OsloMet-ABI/nikita-noark5-core/
">Nikita
78 Noark
5 core project
</a
> was
79 <a href=
"https://lists.nuug.no/pipermail/nikita-noark/
2018-October/
000406.html
">announced
80 on the project mailing list
</a
>. The free software solution is an
81 implementation of the Norwegian archive standard Noark
5 used by
82 government offices in Norway. These were the changes in version
0.2
83 since version
0.1.1 (from NEWS.md):
86 <li
>Fix typos in REL names
</li
>
87 <li
>Tidy up error message reporting
</li
>
88 <li
>Fix issue where we used Integer.valueOf(), not Integer.getInteger()
</li
>
89 <li
>Change some String handling to StringBuffer
</li
>
90 <li
>Fix error reporting
</li
>
91 <li
>Code tidy-up
</li
>
92 <li
>Fix issue using static non-synchronized SimpleDateFormat to avoid
93 race conditions
</li
>
94 <li
>Fix problem where deserialisers were treating integers as strings
</li
>
95 <li
>Update methods to make them null-safe
</li
>
96 <li
>Fix many issues reported by coverity
</li
>
97 <li
>Improve equals(), compareTo() and hash() in domain model
</li
>
98 <li
>Improvements to the domain model for metadata classes
</li
>
99 <li
>Fix CORS issues when downloading document
</li
>
100 <li
>Implementation of case-handling with registryEntry and document upload
</li
>
101 <li
>Better support in Javascript for OPTIONS
</li
>
102 <li
>Adding concept description of mail integration
</li
>
103 <li
>Improve setting of default values for GET on ny-journalpost
</li
>
104 <li
>Better handling of required values during deserialisation
</li
>
105 <li
>Changed tilknyttetDato (M620) from date to dateTime
</li
>
106 <li
>Corrected some opprettetDato (M600) (de)serialisation errors.
</li
>
107 <li
>Improve parse error reporting.
</li
>
108 <li
>Started on OData search and filtering.
</li
>
109 <li
>Added Contributor Covenant Code of Conduct to project.
</li
>
110 <li
>Moved repository and project from Github to Gitlab.
</li
>
111 <li
>Restructured repository, moved code into src/ and web/.
</li
>
112 <li
>Updated code to use Spring Boot version
2.
</li
>
113 <li
>Added support for OAuth2 authentication.
</li
>
114 <li
>Fixed several bugs discovered by Coverity.
</li
>
115 <li
>Corrected handling of date/datetime fields.
</li
>
116 <li
>Improved error reporting when rejecting during deserializatoin.
</li
>
117 <li
>Adjusted default values provided for ny-arkivdel, ny-mappe,
118 ny-saksmappe, ny-journalpost and ny-dokumentbeskrivelse.
</li
>
119 <li
>Several fixes for korrespondansepart*.
</li
>
120 <li
>Updated web GUI:
122 <li
>Now handle both file upload and download.
</li
>
123 <li
>Uses new OAuth2 authentication for login.
</li
>
124 <li
>Forms now fetches default values from API using GET.
</li
>
125 <li
>Added RFC
822 (email), TIFF and JPEG to list of possible file formats.
</li
>
126 </ul
></li
>
129 <p
>The changes and improvements are extensive. Running diffstat on
130 the changes between git tab
0.1.1 and
0.2 show
1098 files changed,
131 108666 insertions(+),
54066 deletions(-).
</p
>
133 <p
>If free and open standardized archiving API sound interesting to
134 you, please contact us on IRC
135 (
<a href=
"irc://irc.freenode.net/%
23nikita
">#nikita on
136 irc.freenode.net
</a
>) or email
137 (
<a href=
"https://lists.nuug.no/mailman/listinfo/nikita-noark
">nikita-noark
138 mailing list
</a
>).
</p
>
140 <p
>As usual, if you use Bitcoin and want to show your support of my
141 activities, please send Bitcoin donations to my address
142 <b
><a href=
"bitcoin:
15oWEoG9dUPovwmUL9KWAnYRtNJEkP1u1b
">15oWEoG9dUPovwmUL9KWAnYRtNJEkP1u1b
</a
></b
>.
</p
>
147 <title>Fetching trusted timestamps using the rfc3161ng python module
</title>
148 <link>http://people.skolelinux.org/pere/blog/Fetching_trusted_timestamps_using_the_rfc3161ng_python_module.html
</link>
149 <guid isPermaLink=
"true">http://people.skolelinux.org/pere/blog/Fetching_trusted_timestamps_using_the_rfc3161ng_python_module.html
</guid>
150 <pubDate>Mon,
8 Oct
2018 12:
30:
00 +
0200</pubDate>
151 <description><p
>I have earlier covered the basics of trusted timestamping using the
152 'openssl ts
' client. See blog post for
153 <a href=
"http://people.skolelinux.org/pere/blog/Public_Trusted_Timestamping_services_for_everyone.html
">2014</a
>,
154 <a href=
"http://people.skolelinux.org/pere/blog/syslog_trusted_timestamp___chain_of_trusted_timestamps_for_your_syslog.html
">2016</a
>
156 <a href=
"http://people.skolelinux.org/pere/blog/Idea_for_storing_trusted_timestamps_in_a_Noark_5_archive.html
">2017</a
>
157 for those stories. But some times I want to integrate the timestamping
158 in other code, and recently I needed to integrate it into Python.
159 After searching a bit, I found
160 <a href=
"https://dev.entrouvert.org/projects/python-rfc3161
">the
161 rfc3161 library
</a
> which seemed like a good fit, but I soon
162 discovered it only worked for python version
2, and I needed something
163 that work with python version
3. Luckily I next came across
164 <a href=
"https://github.com/trbs/rfc3161ng/
">the rfc3161ng library
</a
>,
165 a fork of the original rfc3161 library. Not only is it working with
166 python
3, it have fixed a few of the bugs in the original library, and
167 it has an active maintainer. I decided to wrap it up and make it
168 <a href=
"https://tracker.debian.org/pkg/python-rfc3161ng
">available in
169 Debian
</a
>, and a few days ago it entered Debian unstable and testing.
</p
>
171 <p
>Using the library is fairly straight forward. The only slightly
172 problematic step is to fetch the required certificates to verify the
173 timestamp. For some services it is straight forward, while for others
174 I have not yet figured out how to do it. Here is a small standalone
175 code example based on of the integration tests in the library code:
</p
>
182 Python
3 script demonstrating how to use the rfc3161ng module to
183 get trusted timestamps.
185 The license of this code is the same as the license of the rfc3161ng
191 import pyasn1.codec.der
195 import urllib.request
202 def fetch(url, f=None):
203 response = urllib.request.urlopen(url)
204 data = response.read()
210 with tempfile.NamedTemporaryFile() as cert_f,\
211 tempfile.NamedTemporaryFile() as ca_f,\
212 tempfile.NamedTemporaryFile() as msg_f,\
213 tempfile.NamedTemporaryFile() as tsr_f:
215 # First fetch certificates used by service
216 certificate_data = fetch(
'https://freetsa.org/files/tsa.crt
', cert_f)
217 ca_data_data = fetch(
'https://freetsa.org/files/cacert.pem
', ca_f)
219 # Then timestamp the message
221 rfc3161ng.RemoteTimestamper(
'http://freetsa.org/tsr
',
222 certificate=certificate_data)
223 data = b
"Python forever!\n
"
224 tsr = timestamper(data=data, return_tsr=True)
226 # Finally, convert message and response to something
'openssl ts
' can verify
228 store(tsr_f, pyasn1.codec.der.encoder.encode(tsr))
229 args = [
"openssl
",
"ts
",
"-verify
",
230 "-data
", msg_f.name,
231 "-in
", tsr_f.name,
232 "-CAfile
", ca_f.name,
233 "-untrusted
", cert_f.name]
234 subprocess.check_call(args)
236 if
'__main__
' == __name__:
240 <p
>The code fetches the required certificates, store them as temporary
241 files, timestamp a simple message, store the message and timestamp to
242 disk and ask
'openssl ts
' to verify the timestamp. A timestamp is
243 around
1.5 kiB in size, and should be fairly easy to store for future
246 <p
>As usual, if you use Bitcoin and want to show your support of my
247 activities, please send Bitcoin donations to my address
248 <b
><a href=
"bitcoin:
15oWEoG9dUPovwmUL9KWAnYRtNJEkP1u1b
">15oWEoG9dUPovwmUL9KWAnYRtNJEkP1u1b
</a
></b
>.
</p
>
253 <title>Automatic Google Drive sync using grive in Debian
</title>
254 <link>http://people.skolelinux.org/pere/blog/Automatic_Google_Drive_sync_using_grive_in_Debian.html
</link>
255 <guid isPermaLink=
"true">http://people.skolelinux.org/pere/blog/Automatic_Google_Drive_sync_using_grive_in_Debian.html
</guid>
256 <pubDate>Thu,
4 Oct
2018 15:
20:
00 +
0200</pubDate>
257 <description><p
>A few days, I rescued a Windows victim over to Debian. To try to
258 rescue the remains, I helped set up automatic sync with Google Drive.
259 I did not find any sensible Debian package handling this
260 automatically, so I rebuild the grive2 source from
261 <a href=
"http://www.webupd8.org/
">the Ubuntu UPD8 PPA
</a
> to do the
262 task and added a autostart desktop entry and a small shell script to
263 run in the background while the user is logged in to do the sync.
264 Here is a sketch of the setup for future reference.
</p
>
266 <p
>I first created
<tt
>~/googledrive
</tt
>, entered the directory and
267 ran
'<tt
>grive -a
</tt
>' to authenticate the machine/user. Next, I
268 created a autostart hook in
<tt
>~/.config/autostart/grive.desktop
</tt
>
269 to start the sync when the user log in:
</p
>
271 <p
><blockquote
><pre
>
273 Name=Google drive autosync
275 Exec=/home/user/bin/grive-sync
276 </pre
></blockquote
></p
>
278 <p
>Finally, I wrote the
<tt
>~/bin/grive-sync
</tt
> script to sync
279 ~/googledrive/ with the files in Google Drive.
</p
>
281 <p
><blockquote
><pre
>
286 if [
"$syncpid
" ] ; then
290 trap cleanup EXIT INT QUIT
291 /usr/lib/grive/grive-sync.sh listen googledrive
2>&1 | sed
"s%^%$
0:%
" &
294 if ! xhost
>/dev/null
2>&1 ; then
295 echo
"no DISPLAY, exiting as the user probably logged out
"
298 if [ ! -e /run/user/
1000/grive-sync.sh_googledrive ] ; then
299 /usr/lib/grive/grive-sync.sh sync googledrive
302 done
2>&1 | sed
"s%^%$
0:%
"
303 </pre
></blockquote
></p
>
305 <p
>Feel free to use the setup if you want. It can be assumed to be
306 GNU GPL v2 licensed (or any later version, at your leisure), but I
307 doubt this code is possible to claim copyright on.
</p
>
309 <p
>As usual, if you use Bitcoin and want to show your support of my
310 activities, please send Bitcoin donations to my address
311 <b
><a href=
"bitcoin:
15oWEoG9dUPovwmUL9KWAnYRtNJEkP1u1b
">15oWEoG9dUPovwmUL9KWAnYRtNJEkP1u1b
</a
></b
>.
</p
>