]> pere.pagekite.me Git - homepage.git/blob - blog/index.rss
Generated.
[homepage.git] / blog / index.rss
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">
3 <channel>
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" />
8
9 <item>
10 <title>Privacy respecting health monitor / fitness tracker?</title>
11 <link>http://people.skolelinux.org/pere/blog/Privacy_respecting_health_monitor___fitness_tracker_.html</link>
12 <guid isPermaLink="true">http://people.skolelinux.org/pere/blog/Privacy_respecting_health_monitor___fitness_tracker_.html</guid>
13 <pubDate>Tue, 7 Aug 2018 16:00:00 +0200</pubDate>
14 <description>&lt;p&gt;Dear lazyweb,&lt;/p&gt;
15
16 &lt;p&gt;I wonder, is there a fitness tracker / health monitor available for
17 sale today that respect the users privacy? With this I mean a
18 watch/bracelet capable of measuring pulse rate and other
19 fitness/health related values (and by all means, also the correct time
20 and location if possible), which is &lt;strong&gt;only&lt;/strong&gt; provided for
21 me to extract/read from the unit with computer without a radio beacon
22 and Internet connection. In other words, it do not depend on a cell
23 phone app, and do make the measurements available via other peoples
24 computer (aka &quot;the cloud&quot;). The collected data should be available
25 using only free software. I&#39;m not interested in depending on some
26 non-free software that will leave me high and dry some time in the
27 future. I&#39;ve been unable to find any such unit. I would like to buy
28 it. The ones I have seen for sale here in Norway are proud to report
29 that they share my health data with strangers (aka &quot;cloud enabled&quot;).
30 Is there an alternative? I&#39;m not interested in giving money to people
31 requiring me to accept &quot;privacy terms&quot; to allow myself to measure my
32 own health.&lt;/p&gt;
33
34 &lt;p&gt;As usual, if you use Bitcoin and want to show your support of my
35 activities, please send Bitcoin donations to my address
36 &lt;b&gt;&lt;a href=&quot;bitcoin:15oWEoG9dUPovwmUL9KWAnYRtNJEkP1u1b&quot;&gt;15oWEoG9dUPovwmUL9KWAnYRtNJEkP1u1b&lt;/a&gt;&lt;/b&gt;.&lt;/p&gt;
37 </description>
38 </item>
39
40 <item>
41 <title>Sharing images with friends and family using RSS and EXIF/XMP metadata</title>
42 <link>http://people.skolelinux.org/pere/blog/Sharing_images_with_friends_and_family_using_RSS_and_EXIF_XMP_metadata.html</link>
43 <guid isPermaLink="true">http://people.skolelinux.org/pere/blog/Sharing_images_with_friends_and_family_using_RSS_and_EXIF_XMP_metadata.html</guid>
44 <pubDate>Tue, 31 Jul 2018 23:30:00 +0200</pubDate>
45 <description>&lt;p&gt;For a while now, I have looked for a sensible way to share images
46 with my family using a self hosted solution, as it is unacceptable to
47 place images from my personal life under the control of strangers
48 working for data hoarders like Google or Dropbox. The last few days I
49 have drafted an approach that might work out, and I would like to
50 share it with you. I would like to publish images on a server under
51 my control, and point some Internet connected display units using some
52 free and open standard to the images I published. As my primary
53 language is not limited to ASCII, I need to store metadata using
54 UTF-8. Many years ago, I hoped to find a digital photo frame capable
55 of reading a RSS feed with image references (aka using the
56 &amp;lt;enclosure&amp;gt; RSS tag), but was unable to find a current supplier
57 of such frames. In the end I gave up that approach.&lt;/p&gt;
58
59 &lt;p&gt;Some months ago, I discovered that
60 &lt;a href=&quot;https://www.jwz.org/xscreensaver/&quot;&gt;XScreensaver&lt;/a&gt; is able to
61 read images from a RSS feed, and used it to set up a screen saver on
62 my home info screen, showing images from the Daily images feed from
63 NASA. This proved to work well. More recently I discovered that
64 &lt;a href=&quot;https://kodi.tv&quot;&gt;Kodi&lt;/a&gt; (both using
65 &lt;a href=&quot;https://www.openelec.tv/&quot;&gt;OpenELEC&lt;/a&gt; and
66 &lt;a href=&quot;https://libreelec.tv&quot;&gt;LibreELEC&lt;/a&gt;) provide the
67 &lt;a href=&quot;https://github.com/grinsted/script.screensaver.feedreader&quot;&gt;Feedreader&lt;/a&gt;
68 screen saver capable of reading a RSS feed with images and news. For
69 fun, I used it this summer to test Kodi on my parents TV by hooking up
70 a Raspberry PI unit with LibreELEC, and wanted to provide them with a
71 screen saver showing selected pictures from my selection.&lt;/p&gt;
72
73 &lt;p&gt;Armed with motivation and a test photo frame, I set out to generate
74 a RSS feed for the Kodi instance. I adjusted my &lt;a
75 href=&quot;https://freedombox.org/&quot;&gt;Freedombox&lt;/a&gt; instance, created
76 /var/www/html/privatepictures/, wrote a small Perl script to extract
77 title and description metadata from the photo files and generate the
78 RSS file. I ended up using Perl instead of python, as the
79 libimage-exiftool-perl Debian package seemed to handle the EXIF/XMP
80 tags I ended up using, while python3-exif did not. The relevant EXIF
81 tags only support ASCII, so I had to find better alternatives. XMP
82 seem to have the support I need.&lt;/p&gt;
83
84 &lt;p&gt;I am a bit unsure which EXIF/XMP tags to use, as I would like to
85 use tags that can be easily added/updated using normal free software
86 photo managing software. I ended up using the tags set using this
87 exiftool command, as these tags can also be set using digiKam:&lt;/p&gt;
88
89 &lt;blockquote&gt;&lt;pre&gt;
90 exiftool -headline=&#39;The RSS image title&#39; \
91 -description=&#39;The RSS image description.&#39; \
92 -subject+=for-family photo.jpeg
93 &lt;/pre&gt;&lt;/blockquote&gt;
94
95 &lt;p&gt;I initially tried the &quot;-title&quot; and &quot;keyword&quot; tags, but they were
96 invisible in digiKam, so I changed to &quot;-headline&quot; and &quot;-subject&quot;. I
97 use the keyword/subject &#39;for-family&#39; to flag that the photo should be
98 shared with my family. Images with this keyword set are located and
99 copied into my Freedombox for the RSS generating script to find.&lt;/p&gt;
100
101 &lt;p&gt;Are there better ways to do this? Get in touch if you have better
102 suggestions.&lt;/p&gt;
103
104 &lt;p&gt;As usual, if you use Bitcoin and want to show your support of my
105 activities, please send Bitcoin donations to my address
106 &lt;b&gt;&lt;a href=&quot;bitcoin:15oWEoG9dUPovwmUL9KWAnYRtNJEkP1u1b&quot;&gt;15oWEoG9dUPovwmUL9KWAnYRtNJEkP1u1b&lt;/a&gt;&lt;/b&gt;.&lt;/p&gt;
107 </description>
108 </item>
109
110 <item>
111 <title>Simple streaming the Linux desktop to Kodi using GStreamer and RTP</title>
112 <link>http://people.skolelinux.org/pere/blog/Simple_streaming_the_Linux_desktop_to_Kodi_using_GStreamer_and_RTP.html</link>
113 <guid isPermaLink="true">http://people.skolelinux.org/pere/blog/Simple_streaming_the_Linux_desktop_to_Kodi_using_GStreamer_and_RTP.html</guid>
114 <pubDate>Thu, 12 Jul 2018 17:55:00 +0200</pubDate>
115 <description>&lt;p&gt;Last night, I wrote
116 &lt;a href=&quot;http://people.skolelinux.org/pere/blog/Streaming_the_Linux_desktop_to_Kodi_using_VLC_and_RTSP.html&quot;&gt;a
117 recipe to stream a Linux desktop using VLC to a instance of Kodi&lt;/a&gt;.
118 During the day I received valuable feedback, and thanks to the
119 suggestions I have been able to rewrite the recipe into a much simpler
120 approach requiring no setup at all. It is a single script that take
121 care of it all.&lt;/p&gt;
122
123 &lt;p&gt;This new script uses GStreamer instead of VLC to capture the
124 desktop and stream it to Kodi. This fixed the video quality issue I
125 saw initially. It further removes the need to add a m3u file on the
126 Kodi machine, as it instead connects to
127 &lt;a href=&quot;https://kodi.wiki/view/JSON-RPC_API/v8&quot;&gt;the JSON-RPC API in
128 Kodi&lt;/a&gt; and simply ask Kodi to play from the stream created using
129 GStreamer. Streaming the desktop to Kodi now become trivial. Copy
130 the script below, run it with the DNS name or IP address of the kodi
131 server to stream to as the only argument, and watch your screen show
132 up on the Kodi screen. Note, it depend on multicast on the local
133 network, so if you need to stream outside the local network, the
134 script must be modified. Also note, I have no idea if audio work, as
135 I only care about the picture part.&lt;/p&gt;
136
137 &lt;blockquote&gt;&lt;pre&gt;
138 #!/bin/sh
139 #
140 # Stream the Linux desktop view to Kodi. See
141 # http://people.skolelinux.org/pere/blog/Streaming_the_Linux_desktop_to_Kodi_using_VLC_and_RTSP.html
142 # for backgorund information.
143
144 # Make sure the stream is stopped in Kodi and the gstreamer process is
145 # killed if something go wrong (for example if curl is unable to find the
146 # kodi server). Do the same when interrupting this script.
147 kodicmd() {
148 host=&quot;$1&quot;
149 cmd=&quot;$2&quot;
150 params=&quot;$3&quot;
151 curl --silent --header &#39;Content-Type: application/json&#39; \
152 --data-binary &quot;{ \&quot;id\&quot;: 1, \&quot;jsonrpc\&quot;: \&quot;2.0\&quot;, \&quot;method\&quot;: \&quot;$cmd\&quot;, \&quot;params\&quot;: $params }&quot; \
153 &quot;http://$host/jsonrpc&quot;
154 }
155 cleanup() {
156 if [ -n &quot;$kodihost&quot; ] ; then
157 # Stop the playing when we end
158 playerid=$(kodicmd &quot;$kodihost&quot; Player.GetActivePlayers &quot;{}&quot; |
159 jq .result[].playerid)
160 kodicmd &quot;$kodihost&quot; Player.Stop &quot;{ \&quot;playerid\&quot; : $playerid }&quot; &gt; /dev/null
161 fi
162 if [ &quot;$gstpid&quot; ] &amp;&amp; kill -0 &quot;$gstpid&quot; &gt;/dev/null 2&gt;&amp;1; then
163 kill &quot;$gstpid&quot;
164 fi
165 }
166 trap cleanup EXIT INT
167
168 if [ -n &quot;$1&quot; ]; then
169 kodihost=$1
170 shift
171 else
172 kodihost=kodi.local
173 fi
174
175 mcast=239.255.0.1
176 mcastport=1234
177 mcastttl=1
178
179 pasrc=$(pactl list | grep -A2 &#39;Source #&#39; | grep &#39;Name: .*\.monitor$&#39; | \
180 cut -d&quot; &quot; -f2|head -1)
181 gst-launch-1.0 ximagesrc use-damage=0 ! video/x-raw,framerate=30/1 ! \
182 videoconvert ! queue2 ! \
183 x264enc bitrate=8000 speed-preset=superfast tune=zerolatency qp-min=30 \
184 key-int-max=15 bframes=2 ! video/x-h264,profile=high ! queue2 ! \
185 mpegtsmux alignment=7 name=mux ! rndbuffersize max=1316 min=1316 ! \
186 udpsink host=$mcast port=$mcastport ttl-mc=$mcastttl auto-multicast=1 sync=0 \
187 pulsesrc device=$pasrc ! audioconvert ! queue2 ! avenc_aac ! queue2 ! mux. \
188 &gt; /dev/null 2&gt;&amp;1 &amp;
189 gstpid=$!
190
191 # Give stream a second to get going
192 sleep 1
193
194 # Ask kodi to start streaming using its JSON-RPC API
195 kodicmd &quot;$kodihost&quot; Player.Open \
196 &quot;{\&quot;item\&quot;: { \&quot;file\&quot;: \&quot;udp://@$mcast:$mcastport\&quot; } }&quot; &gt; /dev/null
197
198 # wait for gst to end
199 wait &quot;$gstpid&quot;
200 &lt;/pre&gt;&lt;/blockquote&gt;
201
202 &lt;p&gt;I hope you find the approach useful. I know I do.&lt;/p&gt;
203
204 &lt;p&gt;As usual, if you use Bitcoin and want to show your support of my
205 activities, please send Bitcoin donations to my address
206 &lt;b&gt;&lt;a href=&quot;bitcoin:15oWEoG9dUPovwmUL9KWAnYRtNJEkP1u1b&quot;&gt;15oWEoG9dUPovwmUL9KWAnYRtNJEkP1u1b&lt;/a&gt;&lt;/b&gt;.&lt;/p&gt;
207 </description>
208 </item>
209
210 <item>
211 <title>Streaming the Linux desktop to Kodi using VLC and RTSP</title>
212 <link>http://people.skolelinux.org/pere/blog/Streaming_the_Linux_desktop_to_Kodi_using_VLC_and_RTSP.html</link>
213 <guid isPermaLink="true">http://people.skolelinux.org/pere/blog/Streaming_the_Linux_desktop_to_Kodi_using_VLC_and_RTSP.html</guid>
214 <pubDate>Thu, 12 Jul 2018 02:00:00 +0200</pubDate>
215 <description>&lt;p&gt;PS: See
216 &lt;ahref=&quot;http://people.skolelinux.org/pere/blog/Simple_streaming_the_Linux_desktop_to_Kodi_using_GStreamer_and_RTP.html&quot;&gt;the
217 followup post&lt;/a&gt; for a even better approach.&lt;/p&gt;
218
219 &lt;p&gt;A while back, I was asked by a friend how to stream the desktop to
220 my projector connected to Kodi. I sadly had to admit that I had no
221 idea, as it was a task I never had tried. Since then, I have been
222 looking for a way to do so, preferable without much extra software to
223 install on either side. Today I found a way that seem to kind of
224 work. Not great, but it is a start.&lt;/p&gt;
225
226 &lt;p&gt;I had a look at several approaches, for example
227 &lt;a href=&quot;https://github.com/mfoetsch/dlna_live_streaming&quot;&gt;using uPnP
228 DLNA as described in 2011&lt;/a&gt;, but it required a uPnP server, fuse and
229 local storage enough to store the stream locally. This is not going
230 to work well for me, lacking enough free space, and it would
231 impossible for my friend to get working.&lt;/p&gt;
232
233 &lt;p&gt;Next, it occurred to me that perhaps I could use VLC to create a
234 video stream that Kodi could play. Preferably using
235 broadcast/multicast, to avoid having to change any setup on the Kodi
236 side when starting such stream. Unfortunately, the only recipe I
237 could find using multicast used the rtp protocol, and this protocol
238 seem to not be supported by Kodi.&lt;/p&gt;
239
240 &lt;p&gt;On the other hand, the rtsp protocol is working! Unfortunately I
241 have to specify the IP address of the streaming machine in both the
242 sending command and the file on the Kodi server. But it is showing my
243 desktop, and thus allow us to have a shared look on the big screen at
244 the programs I work on.&lt;/p&gt;
245
246 &lt;p&gt;I did not spend much time investigating codeces. I combined the
247 rtp and rtsp recipes from
248 &lt;a href=&quot;https://wiki.videolan.org/Documentation:Streaming_HowTo/Command_Line_Examples/&quot;&gt;the
249 VLC Streaming HowTo/Command Line Examples&lt;/a&gt;, and was able to get
250 this working on the desktop/streaming end.&lt;/p&gt;
251
252 &lt;blockquote&gt;&lt;pre&gt;
253 vlc screen:// --sout \
254 &#39;#transcode{vcodec=mp4v,acodec=mpga,vb=800,ab=128}:rtp{dst=projector.local,port=1234,sdp=rtsp://192.168.11.4:8080/test.sdp}&#39;
255 &lt;/pre&gt;&lt;/blockquote&gt;
256
257 &lt;p&gt;I ssh-ed into my Kodi box and created a file like this with the
258 same IP address:&lt;/p&gt;
259
260 &lt;blockquote&gt;&lt;pre&gt;
261 echo rtsp://192.168.11.4:8080/test.sdp \
262 &gt; /storage/videos/screenstream.m3u
263 &lt;/pre&gt;&lt;/blockquote&gt;
264
265 &lt;p&gt;Note the 192.168.11.4 IP address is my desktops IP address. As far
266 as I can tell the IP must be hardcoded for this to work. In other
267 words, if someone elses machine is going to do the steaming, you have
268 to update screenstream.m3u on the Kodi machine and adjust the vlc
269 recipe. To get started, locate the file in Kodi and select the m3u
270 file while the VLC stream is running. The desktop then show up in my
271 big screen. :)&lt;/p&gt;
272
273 &lt;p&gt;When using the same technique to stream a video file with audio,
274 the audio quality is really bad. No idea if the problem is package
275 loss or bad parameters for the transcode. I do not know VLC nor Kodi
276 enough to tell.&lt;/p&gt;
277
278 &lt;p&gt;&lt;strong&gt;Update 2018-07-12&lt;/strong&gt;: Johannes Schauer send me a few
279 succestions and reminded me about an important step. The &quot;screen:&quot;
280 input source is only available once the vlc-plugin-access-extra
281 package is installed on Debian. Without it, you will see this error
282 message: &quot;VLC is unable to open the MRL &#39;screen://&#39;. Check the log
283 for details.&quot; He further found that it is possible to drop some parts
284 of the VLC command line to reduce the amount of hardcoded information.
285 It is also useful to consider using cvlc to avoid having the VLC
286 window in the desktop view. In sum, this give us this command line on
287 the source end
288
289 &lt;blockquote&gt;&lt;pre&gt;
290 cvlc screen:// --sout \
291 &#39;#transcode{vcodec=mp4v,acodec=mpga,vb=800,ab=128}:rtp{sdp=rtsp://:8080/}&#39;
292 &lt;/pre&gt;&lt;/blockquote&gt;
293
294 &lt;p&gt;and this on the Kodi end&lt;p&gt;
295
296 &lt;blockquote&gt;&lt;pre&gt;
297 echo rtsp://192.168.11.4:8080/ \
298 &gt; /storage/videos/screenstream.m3u
299 &lt;/pre&gt;&lt;/blockquote&gt;
300
301 &lt;p&gt;Still bad image quality, though. But I did discover that streaming
302 a DVD using dvdsimple:///dev/dvd as the source had excellent video and
303 audio quality, so I guess the issue is in the input or transcoding
304 parts, not the rtsp part. I&#39;ve tried to change the vb and ab
305 parameters to use more bandwidth, but it did not make a
306 difference.&lt;/p&gt;
307
308 &lt;p&gt;I further received a suggestion from Einar Haraldseid to try using
309 gstreamer instead of VLC, and this proved to work great! He also
310 provided me with the trick to get Kodi to use a multicast stream as
311 its source. By using this monstrous oneliner, I can stream my desktop
312 with good video quality in reasonable framerate to the 239.255.0.1
313 multicast address on port 1234:
314
315 &lt;blockquote&gt;&lt;pre&gt;
316 gst-launch-1.0 ximagesrc use-damage=0 ! video/x-raw,framerate=30/1 ! \
317 videoconvert ! queue2 ! \
318 x264enc bitrate=8000 speed-preset=superfast tune=zerolatency qp-min=30 \
319 key-int-max=15 bframes=2 ! video/x-h264,profile=high ! queue2 ! \
320 mpegtsmux alignment=7 name=mux ! rndbuffersize max=1316 min=1316 ! \
321 udpsink host=239.255.0.1 port=1234 ttl-mc=1 auto-multicast=1 sync=0 \
322 pulsesrc device=$(pactl list | grep -A2 &#39;Source #&#39; | \
323 grep &#39;Name: .*\.monitor$&#39; | cut -d&quot; &quot; -f2|head -1) ! \
324 audioconvert ! queue2 ! avenc_aac ! queue2 ! mux.
325 &lt;/pre&gt;&lt;/blockquote&gt;
326
327 &lt;p&gt;and this on the Kodi end&lt;p&gt;
328
329 &lt;blockquote&gt;&lt;pre&gt;
330 echo udp://@239.255.0.1:1234 \
331 &gt; /storage/videos/screenstream.m3u
332 &lt;/pre&gt;&lt;/blockquote&gt;
333
334 &lt;p&gt;Note the trick to pick a valid pulseaudio source. It might not
335 pick the one you need. This approach will of course lead to trouble
336 if more than one source uses the same multicast port and address.
337 Note the ttl-mc=1 setting, which limit the multicast packages to the
338 local network. If the value is increased, your screen will be
339 broadcasted further, one network &quot;hop&quot; for each increase (read up on
340 multicast to learn more. :)!&lt;/p&gt;
341
342 &lt;p&gt;Having cracked how to get Kodi to receive multicast streams, I
343 could use this VLC command to stream to the same multicast address.
344 The image quality is way better than the rtsp approach, but gstreamer
345 seem to be doing a better job.&lt;/p&gt;
346
347 &lt;blockquote&gt;&lt;pre&gt;
348 cvlc screen:// --sout &#39;#transcode{vcodec=mp4v,acodec=mpga,vb=800,ab=128}:rtp{mux=ts,dst=239.255.0.1,port=1234,sdp=sap}&#39;
349 &lt;/pre&gt;&lt;/blockquote&gt;
350
351 &lt;p&gt;As usual, if you use Bitcoin and want to show your support of my
352 activities, please send Bitcoin donations to my address
353 &lt;b&gt;&lt;a href=&quot;bitcoin:15oWEoG9dUPovwmUL9KWAnYRtNJEkP1u1b&quot;&gt;15oWEoG9dUPovwmUL9KWAnYRtNJEkP1u1b&lt;/a&gt;&lt;/b&gt;.&lt;/p&gt;
354 </description>
355 </item>
356
357 <item>
358 <title>What is the most supported MIME type in Debian in 2018?</title>
359 <link>http://people.skolelinux.org/pere/blog/What_is_the_most_supported_MIME_type_in_Debian_in_2018_.html</link>
360 <guid isPermaLink="true">http://people.skolelinux.org/pere/blog/What_is_the_most_supported_MIME_type_in_Debian_in_2018_.html</guid>
361 <pubDate>Mon, 9 Jul 2018 08:05:00 +0200</pubDate>
362 <description>&lt;p&gt;Five years ago,
363 &lt;a href=&quot;http://people.skolelinux.org/pere/blog/What_is_the_most_supported_MIME_type_in_Debian_.html&quot;&gt;I
364 measured what the most supported MIME type in Debian was&lt;/a&gt;, by
365 analysing the desktop files in all packages in the archive. Since
366 then, the DEP-11 AppStream system has been put into production, making
367 the task a lot easier. This made me want to repeat the measurement,
368 to see how much things changed. Here are the new numbers, for
369 unstable only this time:
370
371 &lt;p&gt;&lt;strong&gt;Debian Unstable:&lt;/strong&gt;&lt;/p&gt;
372
373 &lt;pre&gt;
374 count MIME type
375 ----- -----------------------
376 56 image/jpeg
377 55 image/png
378 49 image/tiff
379 48 image/gif
380 39 image/bmp
381 38 text/plain
382 37 audio/mpeg
383 34 application/ogg
384 33 audio/x-flac
385 32 audio/x-mp3
386 30 audio/x-wav
387 30 audio/x-vorbis+ogg
388 29 image/x-portable-pixmap
389 27 inode/directory
390 27 image/x-portable-bitmap
391 27 audio/x-mpeg
392 26 application/x-ogg
393 25 audio/x-mpegurl
394 25 audio/ogg
395 24 text/html
396 &lt;/pre&gt;
397
398 &lt;p&gt;The list was created like this using a sid chroot: &quot;cat
399 /var/lib/apt/lists/*sid*_dep11_Components-amd64.yml.gz| zcat | awk &#39;/^
400 - \S+\/\S+$/ {print $2 }&#39; | sort | uniq -c | sort -nr | head -20&quot;&lt;/p&gt;
401
402 &lt;p&gt;It is interesting to see how image formats have passed text/plain
403 as the most announced supported MIME type. These days, thanks to the
404 AppStream system, if you run into a file format you do not know, and
405 want to figure out which packages support the format, you can find the
406 MIME type of the file using &quot;file --mime &amp;lt;filename&amp;gt;&quot;, and then
407 look up all packages announcing support for this format in their
408 AppStream metadata (XML or .desktop file) using &quot;appstreamcli
409 what-provides mimetype &amp;lt;mime-type&amp;gt;. For example if you, like
410 me, want to know which packages support inode/directory, you can get a
411 list like this:&lt;/p&gt;
412
413 &lt;p&gt;&lt;blockquote&gt;&lt;pre&gt;
414 % appstreamcli what-provides mimetype inode/directory | grep Package: | sort
415 Package: anjuta
416 Package: audacious
417 Package: baobab
418 Package: cervisia
419 Package: chirp
420 Package: dolphin
421 Package: doublecmd-common
422 Package: easytag
423 Package: enlightenment
424 Package: ephoto
425 Package: filelight
426 Package: gwenview
427 Package: k4dirstat
428 Package: kaffeine
429 Package: kdesvn
430 Package: kid3
431 Package: kid3-qt
432 Package: nautilus
433 Package: nemo
434 Package: pcmanfm
435 Package: pcmanfm-qt
436 Package: qweborf
437 Package: ranger
438 Package: sirikali
439 Package: spacefm
440 Package: spacefm
441 Package: vifm
442 %
443 &lt;/pre&gt;&lt;/blockquote&gt;&lt;/p&gt;
444
445 &lt;p&gt;Using the same method, I can quickly discover that the Sketchup file
446 format is not yet supported by any package in Debian:&lt;/p&gt;
447
448 &lt;p&gt;&lt;blockquote&gt;&lt;pre&gt;
449 % appstreamcli what-provides mimetype application/vnd.sketchup.skp
450 Could not find component providing &#39;mimetype::application/vnd.sketchup.skp&#39;.
451 %
452 &lt;/pre&gt;&lt;/blockquote&gt;&lt;/p&gt;
453
454 &lt;p&gt;Yesterday I used it to figure out which packages support the STL 3D
455 format:&lt;/p&gt;
456
457 &lt;p&gt;&lt;blockquote&gt;&lt;pre&gt;
458 % appstreamcli what-provides mimetype application/sla|grep Package
459 Package: cura
460 Package: meshlab
461 Package: printrun
462 %
463 &lt;/pre&gt;&lt;/blockquote&gt;&lt;/p&gt;
464
465 &lt;p&gt;PS: A new version of Cura was uploaded to Debian yesterday.&lt;/p&gt;
466
467 &lt;p&gt;As usual, if you use Bitcoin and want to show your support of my
468 activities, please send Bitcoin donations to my address
469 &lt;b&gt;&lt;a href=&quot;bitcoin:15oWEoG9dUPovwmUL9KWAnYRtNJEkP1u1b&quot;&gt;15oWEoG9dUPovwmUL9KWAnYRtNJEkP1u1b&lt;/a&gt;&lt;/b&gt;.&lt;/p&gt;
470 </description>
471 </item>
472
473 <item>
474 <title>Debian APT upgrade without enough free space on the disk...</title>
475 <link>http://people.skolelinux.org/pere/blog/Debian_APT_upgrade_without_enough_free_space_on_the_disk___.html</link>
476 <guid isPermaLink="true">http://people.skolelinux.org/pere/blog/Debian_APT_upgrade_without_enough_free_space_on_the_disk___.html</guid>
477 <pubDate>Sun, 8 Jul 2018 12:10:00 +0200</pubDate>
478 <description>&lt;p&gt;Quite regularly, I let my Debian Sid/Unstable chroot stay untouch
479 for a while, and when I need to update it there is not enough free
480 space on the disk for apt to do a normal &#39;apt upgrade&#39;. I normally
481 would resolve the issue by doing &#39;apt install &amp;lt;somepackages&amp;gt;&#39; to
482 upgrade only some of the packages in one batch, until the amount of
483 packages to download fall below the amount of free space available.
484 Today, I had about 500 packages to upgrade, and after a while I got
485 tired of trying to install chunks of packages manually. I concluded
486 that I did not have the spare hours required to complete the task, and
487 decided to see if I could automate it. I came up with this small
488 script which I call &#39;apt-in-chunks&#39;:&lt;/p&gt;
489
490 &lt;p&gt;&lt;blockquote&gt;&lt;pre&gt;
491 #!/bin/sh
492 #
493 # Upgrade packages when the disk is too full to upgrade every
494 # upgradable package in one lump. Fetching packages to upgrade using
495 # apt, and then installing using dpkg, to avoid changing the package
496 # flag for manual/automatic.
497
498 set -e
499
500 ignore() {
501 if [ &quot;$1&quot; ]; then
502 grep -v &quot;$1&quot;
503 else
504 cat
505 fi
506 }
507
508 for p in $(apt list --upgradable | ignore &quot;$@&quot; |cut -d/ -f1 | grep -v &#39;^Listing...&#39;); do
509 echo &quot;Upgrading $p&quot;
510 apt clean
511 apt install --download-only -y $p
512 for f in /var/cache/apt/archives/*.deb; do
513 if [ -e &quot;$f&quot; ]; then
514 dpkg -i /var/cache/apt/archives/*.deb
515 break
516 fi
517 done
518 done
519 &lt;/pre&gt;&lt;/blockquote&gt;&lt;/p&gt;
520
521 &lt;p&gt;The script will extract the list of packages to upgrade, try to
522 download the packages needed to upgrade one package, install the
523 downloaded packages using dpkg. The idea is to upgrade packages
524 without changing the APT mark for the package (ie the one recording of
525 the package was manually requested or pulled in as a dependency). To
526 use it, simply run it as root from the command line. If it fail, try
527 &#39;apt install -f&#39; to clean up the mess and run the script again. This
528 might happen if the new packages conflict with one of the old
529 packages. dpkg is unable to remove, while apt can do this.&lt;/p&gt;
530
531 &lt;p&gt;It take one option, a package to ignore in the list of packages to
532 upgrade. The option to ignore a package is there to be able to skip
533 the packages that are simply too large to unpack. Today this was
534 &#39;ghc&#39;, but I have run into other large packages causing similar
535 problems earlier (like TeX).&lt;/p&gt;
536
537 &lt;p&gt;Update 2018-07-08: Thanks to Paul Wise, I am aware of two
538 alternative ways to handle this. The &quot;unattended-upgrades
539 --minimal-upgrade-steps&quot; option will try to calculate upgrade sets for
540 each package to upgrade, and then upgrade them in order, smallest set
541 first. It might be a better option than my above mentioned script.
542 Also, &quot;aptutude upgrade&quot; can upgrade single packages, thus avoiding
543 the need for using &quot;dpkg -i&quot; in the script above.&lt;/p&gt;
544
545 &lt;p&gt;As usual, if you use Bitcoin and want to show your support of my
546 activities, please send Bitcoin donations to my address
547 &lt;b&gt;&lt;a href=&quot;bitcoin:15oWEoG9dUPovwmUL9KWAnYRtNJEkP1u1b&quot;&gt;15oWEoG9dUPovwmUL9KWAnYRtNJEkP1u1b&lt;/a&gt;&lt;/b&gt;.&lt;/p&gt;
548 </description>
549 </item>
550
551 <item>
552 <title>The worlds only stone power plant?</title>
553 <link>http://people.skolelinux.org/pere/blog/The_worlds_only_stone_power_plant_.html</link>
554 <guid isPermaLink="true">http://people.skolelinux.org/pere/blog/The_worlds_only_stone_power_plant_.html</guid>
555 <pubDate>Sat, 30 Jun 2018 10:35:00 +0200</pubDate>
556 <description>&lt;p&gt;So far, at least hydro-electric power, coal power, wind power,
557 solar power, and wood power are well known. Until a few days ago, I
558 had never heard of stone power. Then I learn about a quarry in a
559 mountain in
560 &lt;a href=&quot;https://en.wikipedia.org/wiki/Bremanger&quot;&gt;Bremanger&lt;/a&gt; i
561 Norway, where
562 &lt;a href=&quot;https://www.bontrup.com/en/activities/raw-materials/bremanger-quarry/&quot;&gt;the
563 Bremanger Quarry&lt;/a&gt; company is extracting stone and dumping the stone
564 into a shaft leading to its shipping harbour. This downward movement
565 in this shaft is used to produce electricity. In short, it is using
566 falling rocks instead of falling water to produce electricity, and
567 according to its own statements it is producing more power than it is
568 using, and selling the surplus electricity to the Norwegian power
569 grid. I find the concept truly amazing. Is this the worlds only
570 stone power plant?&lt;/p&gt;
571
572 &lt;p&gt;As usual, if you use Bitcoin and want to show your support of my
573 activities, please send Bitcoin donations to my address
574 &lt;b&gt;&lt;a href=&quot;bitcoin:15oWEoG9dUPovwmUL9KWAnYRtNJEkP1u1b&quot;&gt;15oWEoG9dUPovwmUL9KWAnYRtNJEkP1u1b&lt;/a&gt;&lt;/b&gt;.&lt;/p&gt;
575 </description>
576 </item>
577
578 <item>
579 <title>Add-on to control the projector from within Kodi</title>
580 <link>http://people.skolelinux.org/pere/blog/Add_on_to_control_the_projector_from_within_Kodi.html</link>
581 <guid isPermaLink="true">http://people.skolelinux.org/pere/blog/Add_on_to_control_the_projector_from_within_Kodi.html</guid>
582 <pubDate>Tue, 26 Jun 2018 23:55:00 +0200</pubDate>
583 <description>&lt;p&gt;My movie playing setup involve &lt;a href=&quot;https://kodi.tv/&quot;&gt;Kodi&lt;/a&gt;,
584 &lt;a href=&quot;https://openelec.tv&quot;&gt;OpenELEC&lt;/a&gt; (probably soon to be
585 replaced with &lt;a href=&quot;https://libreelec.tv/&quot;&gt;LibreELEC&lt;/a&gt;) and an
586 Infocus IN76 video projector. My projector can be controlled via both
587 a infrared remote controller, and a RS-232 serial line. The vendor of
588 my projector, &lt;a href=&quot;https://www.infocus.com/&quot;&gt;InFocus&lt;/a&gt;, had been
589 sensible enough to document the serial protocol in its user manual, so
590 it is easily available, and I used it some years ago to write
591 &lt;a href=&quot;https://github.com/petterreinholdtsen/infocus-projector-control&quot;&gt;a
592 small script to control the projector&lt;/a&gt;. For a while now, I longed
593 for a setup where the projector was controlled by Kodi, for example in
594 such a way that when the screen saver went on, the projector was
595 turned off, and when the screen saver exited, the projector was turned
596 on again.&lt;/p&gt;
597
598 &lt;p&gt;A few days ago, with very good help from parts of my family, I
599 managed to find a Kodi Add-on for controlling a Epson projector, and
600 got in touch with its author to see if we could join forces and make a
601 Add-on with support for several projectors. To my pleasure, he was
602 positive to the idea, and we set out to add InFocus support to his
603 add-on, and make the add-on suitable for the official Kodi add-on
604 repository.&lt;/p&gt;
605
606 &lt;p&gt;The Add-on is now working (for me, at least), with a few minor
607 adjustments. The most important change I do relative to the master
608 branch in the github repository is embedding the
609 &lt;a href=&quot;https://github.com/pyserial/pyserial&quot;&gt;pyserial module&lt;/a&gt; in
610 the add-on. The long term solution is to make a &quot;script&quot; type
611 pyserial module for Kodi, that can be pulled in as a dependency in
612 Kodi. But until that in place, I embed it.&lt;/p&gt;
613
614 &lt;p&gt;The add-on can be configured to turn on the projector when Kodi
615 starts, off when Kodi stops as well as turn the projector off when the
616 screensaver start and on when the screesaver stops. It can also be
617 told to set the projector source when turning on the projector.
618
619 &lt;p&gt;If this sound interesting to you, check out
620 &lt;a href=&quot;https://github.com/fredrik-eriksson/kodi_projcontrol&quot;&gt;the
621 project github repository&lt;/a&gt;. Perhaps you can send patches to
622 support your projector too? As soon as we find time to wrap up the
623 latest changes, it should be available for easy installation using any
624 Kodi instance.&lt;/p&gt;
625
626 &lt;p&gt;For future improvements, I would like to add projector model
627 detection and the ability to adjust the brightness level of the
628 projector from within Kodi. We also need to figure out how to handle
629 the cooling period of the projector. My projector refuses to turn on
630 for 60 seconds after it was turned off. This is not handled well by
631 the add-on at the moment.&lt;/p&gt;
632
633 &lt;p&gt;As usual, if you use Bitcoin and want to show your support of my
634 activities, please send Bitcoin donations to my address
635 &lt;b&gt;&lt;a href=&quot;bitcoin:15oWEoG9dUPovwmUL9KWAnYRtNJEkP1u1b&quot;&gt;15oWEoG9dUPovwmUL9KWAnYRtNJEkP1u1b&lt;/a&gt;&lt;/b&gt;.&lt;/p&gt;
636 </description>
637 </item>
638
639 <item>
640 <title>youtube-dl for nedlasting fra NRK med undertekster - nice free software</title>
641 <link>http://people.skolelinux.org/pere/blog/youtube_dl_for_nedlasting_fra_NRK_med_undertekster___nice_free_software.html</link>
642 <guid isPermaLink="true">http://people.skolelinux.org/pere/blog/youtube_dl_for_nedlasting_fra_NRK_med_undertekster___nice_free_software.html</guid>
643 <pubDate>Sat, 28 Apr 2018 10:30:00 +0200</pubDate>
644 <description>&lt;p&gt;I &lt;a href=&quot;https://no.wikipedia.org/wiki/VHS&quot;&gt;VHS-kassettenes&lt;/a&gt;
645 tid var det rett frem å ta vare på et TV-program en ønsket å kunne se
646 senere, uten å være avhengig av at programmet ble sendt på nytt.
647 Kanskje ønsket en å se programmet på hytten der det ikke var
648 TV-signal, eller av andre grunner ha det tilgjengelig for fremtidig
649 fornøyelse. Dette er blitt vanskeligere med introduksjon av
650 digital-TV og webstreaming, der opptak til harddisk er utenfor de
651 flestes kontroll hvis de bruker ufri programvare og bokser kontrollert
652 av andre. Men for NRK her i Norge, finnes det heldigvis flere fri
653 programvare-alternativer, som jeg har
654 &lt;a href=&quot;http://people.skolelinux.org/pere/blog/Hvordan_enkelt_laste_ned_filmer_fra_NRK.html&quot;&gt;skrevet&lt;/a&gt;
655 &lt;a href=&quot;http://people.skolelinux.org/pere/blog/Hvordan_enkelt_laste_ned_filmer_fra_NRK_med_den__nye__l_sningen.html&quot;&gt;om&lt;/a&gt;
656 &lt;a href=&quot;http://people.skolelinux.org/pere/blog/Nedlasting_fra_NRK__som_Matroska_med_undertekster.html&quot;&gt;før&lt;/a&gt;.
657 Så lenge kilden for nedlastingen er lovlig lagt ut på nett (hvilket
658 jeg antar NRK gjør), så er slik lagring til privat bruk også lovlig i
659 Norge.&lt;/p&gt;
660
661 &lt;p&gt;Sist jeg så på saken, i 2016, nevnte jeg at
662 &lt;a href=&quot;https://rg3.github.com/youtube-dl/&quot;&gt;youtube-dl&lt;/a&gt; ikke kunne
663 bake undertekster fra NRK inn i videofilene, og at jeg derfor
664 foretrakk andre alternativer. Nylig oppdaget jeg at dette har endret
665 seg. Fordelen med youtube-dl er at den er tilgjengelig direkte fra
666 Linux-distribusjoner som &lt;a href=&quot;https://www.debian.org/&quot;&gt;Debian&lt;/a&gt;
667 og &lt;a href=&quot;https://www.ubuntu.com/&quot;&gt;Ubuntu&lt;/a&gt;, slik at en slipper å
668 finne ut selv hvordan en skal få dem til å virke.&lt;/p&gt;
669
670 &lt;p&gt;For å laste ned et NRK-innslag med undertekster, og få den norske
671 underteksten pakket inn i videofilen, så kan følgende kommando
672 brukes:&lt;/p&gt;
673
674 &lt;p&gt;&lt;pre&gt;
675 youtube-dl --write-sub --sub-format ttml \
676 --convert-subtitles srt --embed-subs \
677 https://tv.nrk.no/serie/ramm-ferdig-gaa/MUHU11000316/27-04-2018
678 &lt;/pre&gt;&lt;/p&gt;
679
680 &lt;p&gt;URL-eksemplet er dagens toppsak på tv.nrk.no. Resultatet er en
681 MP4-fil med filmen og undertekster som kan spilles av med VLC. Merk
682 at VLC ikke viser frem undertekster før du aktiverer dem. For å gjøre
683 det, høyreklikk med musa i fremviservinduet, velg menyvalget for
684 undertekst og så norsk språk. Jeg testet også &#39;--write-auto-sub&#39;,
685 men det kommandolinjeargumentet ser ikke ut til å fungere, så jeg
686 endte opp med settet med argumentlisten over, som jeg fant i en
687 feilrapport i youtube-dl-prosjektets samling over feilrapporter.&lt;/p&gt;
688
689 &lt;p&gt;Denne støtten i youtube-dl gjør det svært enkelt å lagre
690 NRK-innslag, det være seg nyheter, filmer, serier eller dokumentater,
691 for å ha dem tilgjengelig for fremtidig referanse og bruk, uavhengig
692 av hvor lenge innslagene ligger tilgjengelig hos NRK. Så får det ikke
693 hjelpe at NRKs jurister mener at det er
694 &lt;a href=&quot;http://people.skolelinux.org/pere/blog/Best___ikke_fortelle_noen_at_streaming_er_nedlasting___.html&quot;&gt;vesensforskjellig
695 å legge tilgjengelig for nedlasting og for streaming&lt;/a&gt;, når det rent
696 teknisk er samme sak.&lt;/p&gt;
697
698 &lt;p&gt;Programmet youtube-dl støtter også en rekke andre nettsteder, se
699 prosjektoversikten for
700 &lt;a href=&quot;http://rg3.github.io/youtube-dl/supportedsites.html&quot;&gt;en
701 komplett liste&lt;/a&gt;.&lt;/p&gt;
702 </description>
703 </item>
704
705 <item>
706 <title>Stortingsflertallet går inn for ny IP-basert sensurinfrastruktur i Norge</title>
707 <link>http://people.skolelinux.org/pere/blog/Stortingsflertallet_g_r_inn_for_ny_IP_basert_sensurinfrastruktur_i_Norge.html</link>
708 <guid isPermaLink="true">http://people.skolelinux.org/pere/blog/Stortingsflertallet_g_r_inn_for_ny_IP_basert_sensurinfrastruktur_i_Norge.html</guid>
709 <pubDate>Tue, 24 Apr 2018 15:00:00 +0200</pubDate>
710 <description>&lt;p&gt;&lt;a href=&quot;https://www.vg.no/sport/i/J1g8zj/stortingsvedtak-snart-ip-blokkerer-utenlandske-spillselskaper&quot;&gt;VG&lt;/a&gt;,
711 &lt;a href=&quot;https://www.dagbladet.no/nyheter/stortinget-blokkerer-utenlandske-spillselskaper/69740219&quot;&gt;Dagbladet&lt;/a&gt;
712 og
713 &lt;a href=&quot;https://www.nrk.no/ostfold/tar-opp-kampen-mot-utenlandske-spillselskap-1.14021381&quot;&gt;NRK&lt;/a&gt;
714 melder i dag at flertallet i Familie- og kulturkomiteen på Stortinget
715 har bestemt seg for å introdusere en ny sensurinfrastruktur i Norge.
716 Fra før har Norge en «frivillig» sensurinfrastruktur basert på
717 DNS-navn, der de største ISP-ene basert på en liste med DNS-navn
718 forgifter DNS-svar og omdirigerer til et annet IP-nummer enn det som
719 ligger i DNS. Nå kommer altså IP-basert omdirigering i tillegg. Når
720 infrastrukturen er på plass, er sensur av IP-adresser redusert et
721 spørsmål om hvilke IP-nummer som skal blokkeres. Listen over
722 IP-adresser vil naturligvis endre seg etter hvert som myndighetene
723 endrer seg. Det er ingen betryggende tanke.&lt;/p&gt;
724 </description>
725 </item>
726
727 </channel>
728 </rss>