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>A bit more on privacy respecting health monitor / fitness tracker
</title>
11 <link>http://people.skolelinux.org/pere/blog/A_bit_more_on_privacy_respecting_health_monitor___fitness_tracker.html
</link>
12 <guid isPermaLink=
"true">http://people.skolelinux.org/pere/blog/A_bit_more_on_privacy_respecting_health_monitor___fitness_tracker.html
</guid>
13 <pubDate>Mon,
13 Aug
2018 09:
00:
00 +
0200</pubDate>
14 <description><p
>A few days ago, I wondered if there are any privacy respecting
15 health monitors and/or fitness trackers available for sale these days.
16 I would like to buy one, but do not want to share my personal data
17 with strangers, nor be forced to have a mobile phone to get data out
18 of the unit. I
've received some ideas, and would like to share them
21 One interesting data point was a pointer to a Free Software app for
23 <a href=
"https://github.com/Freeyourgadget/Gadgetbridge/
">Gadgetbridge
</a
>.
24 It provide cloudless collection and storing of data from a variety of
26 <a href=
"https://github.com/Freeyourgadget/Gadgetbridge/#supported-devices
">list
27 of supported devices
</a
> is a good indicator for units where the
28 protocol is fairly open, as it is obviously being handled by Free
29 Software. Other units are reportedly encrypting the collected
30 information with their own public key, making sure only the vendor
31 cloud service is able to extract data from the unit. The people
32 contacting me about it said they were using
33 <a href=
"https://us.amazfit.com/shop/bip?variant=
336750">Amazfit
35 <a href=
"http://www.xiaomimi6phone.com/xiaomi-mi-band-
3-features-release-date-rumors/
">Xiaomi
36 Band
3</a
>.
</p
>
38 <p
>I also got a suggestion to look at some of the units from Garmin.
39 I was told their GPS watches can be connected via USB and show up as a
40 USB storage device with
41 <a href=
"https://www.gpsbabel.org/htmldoc-development/fmt_garmin_fit.html
">Garmin
42 FIT files
</a
> containing the collected measurements. While
43 proprietary, FIT files apparently can be read at least by
44 <a href=
"https://www.gpsbabel.org
">GPSBabel
</a
> and the
45 <a href=
"https://apps.nextcloud.com/apps/gpxpod
">GpxPod
</a
> Nextcloud
46 app. It is unclear to me if they can read step count and heart rate
47 data. The person I talked to was using a Garmin
48 <a href=
"https://buy.garmin.com/en-US/US/p/
564291">Garmin Forerunner
49 935</a
>, which is a fairly expensive unit. I doubt it is worth it for
50 a unit where the vendor clearly is trying its best to move from open
51 to closed systems. I still remember when Garmin dropped NMEA support
52 in its GPSes.
</p
>
54 <p
>A final idea was to build ones own unit, perhaps by basing it on a
55 wearable hardware platforms like
56 <a href=
"https://learn.adafruit.com/flora-geo-watch
">the Flora Geo
57 Watch
</a
>. Sound like fun, but I had more money than time to spend on
58 the topic, so I suspect it will have to wait for another time.
</p
>
60 <p
>While I was working on tracking down links, I came across an
61 inspiring TED talk by Dave Debronkart about
62 <a href=
"https://archive.org/details/DavedeBronkart_2010X
">being a
63 e-patient
</a
>, and discovered the web site
64 <a href=
"https://participatorymedicine.org/epatients/
">Participatory
65 Medicine
</a
>. If you too want to track your own health and fitness
66 without having information about your private life floating around on
67 computers owned by others, I recommend checking it out.
</p
>
69 <p
>As usual, if you use Bitcoin and want to show your support of my
70 activities, please send Bitcoin donations to my address
71 <b
><a href=
"bitcoin:
15oWEoG9dUPovwmUL9KWAnYRtNJEkP1u1b
">15oWEoG9dUPovwmUL9KWAnYRtNJEkP1u1b
</a
></b
>.
</p
>
76 <title>Privacy respecting health monitor / fitness tracker?
</title>
77 <link>http://people.skolelinux.org/pere/blog/Privacy_respecting_health_monitor___fitness_tracker_.html
</link>
78 <guid isPermaLink=
"true">http://people.skolelinux.org/pere/blog/Privacy_respecting_health_monitor___fitness_tracker_.html
</guid>
79 <pubDate>Tue,
7 Aug
2018 16:
00:
00 +
0200</pubDate>
80 <description><p
>Dear lazyweb,
</p
>
82 <p
>I wonder, is there a fitness tracker / health monitor available for
83 sale today that respect the users privacy? With this I mean a
84 watch/bracelet capable of measuring pulse rate and other
85 fitness/health related values (and by all means, also the correct time
86 and location if possible), which is
<strong
>only
</strong
> provided for
87 me to extract/read from the unit with computer without a radio beacon
88 and Internet connection. In other words, it do not depend on a cell
89 phone app, and do make the measurements available via other peoples
90 computer (aka
"the cloud
"). The collected data should be available
91 using only free software. I
'm not interested in depending on some
92 non-free software that will leave me high and dry some time in the
93 future. I
've been unable to find any such unit. I would like to buy
94 it. The ones I have seen for sale here in Norway are proud to report
95 that they share my health data with strangers (aka
"cloud enabled
").
96 Is there an alternative? I
'm not interested in giving money to people
97 requiring me to accept
"privacy terms
" to allow myself to measure my
100 <p
>As usual, if you use Bitcoin and want to show your support of my
101 activities, please send Bitcoin donations to my address
102 <b
><a href=
"bitcoin:
15oWEoG9dUPovwmUL9KWAnYRtNJEkP1u1b
">15oWEoG9dUPovwmUL9KWAnYRtNJEkP1u1b
</a
></b
>.
</p
>
107 <title>Sharing images with friends and family using RSS and EXIF/XMP metadata
</title>
108 <link>http://people.skolelinux.org/pere/blog/Sharing_images_with_friends_and_family_using_RSS_and_EXIF_XMP_metadata.html
</link>
109 <guid isPermaLink=
"true">http://people.skolelinux.org/pere/blog/Sharing_images_with_friends_and_family_using_RSS_and_EXIF_XMP_metadata.html
</guid>
110 <pubDate>Tue,
31 Jul
2018 23:
30:
00 +
0200</pubDate>
111 <description><p
>For a while now, I have looked for a sensible way to share images
112 with my family using a self hosted solution, as it is unacceptable to
113 place images from my personal life under the control of strangers
114 working for data hoarders like Google or Dropbox. The last few days I
115 have drafted an approach that might work out, and I would like to
116 share it with you. I would like to publish images on a server under
117 my control, and point some Internet connected display units using some
118 free and open standard to the images I published. As my primary
119 language is not limited to ASCII, I need to store metadata using
120 UTF-
8. Many years ago, I hoped to find a digital photo frame capable
121 of reading a RSS feed with image references (aka using the
122 &lt;enclosure
&gt; RSS tag), but was unable to find a current supplier
123 of such frames. In the end I gave up that approach.
</p
>
125 <p
>Some months ago, I discovered that
126 <a href=
"https://www.jwz.org/xscreensaver/
">XScreensaver
</a
> is able to
127 read images from a RSS feed, and used it to set up a screen saver on
128 my home info screen, showing images from the Daily images feed from
129 NASA. This proved to work well. More recently I discovered that
130 <a href=
"https://kodi.tv
">Kodi
</a
> (both using
131 <a href=
"https://www.openelec.tv/
">OpenELEC
</a
> and
132 <a href=
"https://libreelec.tv
">LibreELEC
</a
>) provide the
133 <a href=
"https://github.com/grinsted/script.screensaver.feedreader
">Feedreader
</a
>
134 screen saver capable of reading a RSS feed with images and news. For
135 fun, I used it this summer to test Kodi on my parents TV by hooking up
136 a Raspberry PI unit with LibreELEC, and wanted to provide them with a
137 screen saver showing selected pictures from my selection.
</p
>
139 <p
>Armed with motivation and a test photo frame, I set out to generate
140 a RSS feed for the Kodi instance. I adjusted my
<a
141 href=
"https://freedombox.org/
">Freedombox
</a
> instance, created
142 /var/www/html/privatepictures/, wrote a small Perl script to extract
143 title and description metadata from the photo files and generate the
144 RSS file. I ended up using Perl instead of python, as the
145 libimage-exiftool-perl Debian package seemed to handle the EXIF/XMP
146 tags I ended up using, while python3-exif did not. The relevant EXIF
147 tags only support ASCII, so I had to find better alternatives. XMP
148 seem to have the support I need.
</p
>
150 <p
>I am a bit unsure which EXIF/XMP tags to use, as I would like to
151 use tags that can be easily added/updated using normal free software
152 photo managing software. I ended up using the tags set using this
153 exiftool command, as these tags can also be set using digiKam:
</p
>
155 <blockquote
><pre
>
156 exiftool -headline=
'The RSS image title
' \
157 -description=
'The RSS image description.
' \
158 -subject+=for-family photo.jpeg
159 </pre
></blockquote
>
161 <p
>I initially tried the
"-title
" and
"keyword
" tags, but they were
162 invisible in digiKam, so I changed to
"-headline
" and
"-subject
". I
163 use the keyword/subject
'for-family
' to flag that the photo should be
164 shared with my family. Images with this keyword set are located and
165 copied into my Freedombox for the RSS generating script to find.
</p
>
167 <p
>Are there better ways to do this? Get in touch if you have better
168 suggestions.
</p
>
170 <p
>As usual, if you use Bitcoin and want to show your support of my
171 activities, please send Bitcoin donations to my address
172 <b
><a href=
"bitcoin:
15oWEoG9dUPovwmUL9KWAnYRtNJEkP1u1b
">15oWEoG9dUPovwmUL9KWAnYRtNJEkP1u1b
</a
></b
>.
</p
>
177 <title>Simple streaming the Linux desktop to Kodi using GStreamer and RTP
</title>
178 <link>http://people.skolelinux.org/pere/blog/Simple_streaming_the_Linux_desktop_to_Kodi_using_GStreamer_and_RTP.html
</link>
179 <guid isPermaLink=
"true">http://people.skolelinux.org/pere/blog/Simple_streaming_the_Linux_desktop_to_Kodi_using_GStreamer_and_RTP.html
</guid>
180 <pubDate>Thu,
12 Jul
2018 17:
55:
00 +
0200</pubDate>
181 <description><p
>Last night, I wrote
182 <a href=
"http://people.skolelinux.org/pere/blog/Streaming_the_Linux_desktop_to_Kodi_using_VLC_and_RTSP.html
">a
183 recipe to stream a Linux desktop using VLC to a instance of Kodi
</a
>.
184 During the day I received valuable feedback, and thanks to the
185 suggestions I have been able to rewrite the recipe into a much simpler
186 approach requiring no setup at all. It is a single script that take
187 care of it all.
</p
>
189 <p
>This new script uses GStreamer instead of VLC to capture the
190 desktop and stream it to Kodi. This fixed the video quality issue I
191 saw initially. It further removes the need to add a m3u file on the
192 Kodi machine, as it instead connects to
193 <a href=
"https://kodi.wiki/view/JSON-RPC_API/v8
">the JSON-RPC API in
194 Kodi
</a
> and simply ask Kodi to play from the stream created using
195 GStreamer. Streaming the desktop to Kodi now become trivial. Copy
196 the script below, run it with the DNS name or IP address of the kodi
197 server to stream to as the only argument, and watch your screen show
198 up on the Kodi screen. Note, it depend on multicast on the local
199 network, so if you need to stream outside the local network, the
200 script must be modified. Also note, I have no idea if audio work, as
201 I only care about the picture part.
</p
>
203 <blockquote
><pre
>
206 # Stream the Linux desktop view to Kodi. See
207 # http://people.skolelinux.org/pere/blog/Streaming_the_Linux_desktop_to_Kodi_using_VLC_and_RTSP.html
208 # for backgorund information.
210 # Make sure the stream is stopped in Kodi and the gstreamer process is
211 # killed if something go wrong (for example if curl is unable to find the
212 # kodi server). Do the same when interrupting this script.
216 params=
"$
3"
217 curl --silent --header
'Content-Type: application/json
' \
218 --data-binary
"{ \
"id\
":
1, \
"jsonrpc\
": \
"2.0\
", \
"method\
": \
"$cmd\
", \
"params\
": $params }
" \
219 "http://$host/jsonrpc
"
222 if [ -n
"$kodihost
" ] ; then
223 # Stop the playing when we end
224 playerid=$(kodicmd
"$kodihost
" Player.GetActivePlayers
"{}
" |
225 jq .result[].playerid)
226 kodicmd
"$kodihost
" Player.Stop
"{ \
"playerid\
" : $playerid }
" > /dev/null
228 if [
"$gstpid
" ]
&& kill -
0 "$gstpid
" >/dev/null
2>&1; then
229 kill
"$gstpid
"
232 trap cleanup EXIT INT
234 if [ -n
"$
1" ]; then
245 pasrc=$(pactl list | grep -A2
'Source #
' | grep
'Name: .*\.monitor$
' | \
246 cut -d
" " -f2|head -
1)
247 gst-launch-
1.0 ximagesrc use-damage=
0 ! video/x-raw,framerate=
30/
1 ! \
248 videoconvert ! queue2 ! \
249 x264enc bitrate=
8000 speed-preset=superfast tune=zerolatency qp-min=
30 \
250 key-int-max=
15 bframes=
2 ! video/x-h264,profile=high ! queue2 ! \
251 mpegtsmux alignment=
7 name=mux ! rndbuffersize max=
1316 min=
1316 ! \
252 udpsink host=$mcast port=$mcastport ttl-mc=$mcastttl auto-multicast=
1 sync=
0 \
253 pulsesrc device=$pasrc ! audioconvert ! queue2 ! avenc_aac ! queue2 ! mux. \
254 > /dev/null
2>&1 &
257 # Give stream a second to get going
260 # Ask kodi to start streaming using its JSON-RPC API
261 kodicmd
"$kodihost
" Player.Open \
262 "{\
"item\
": { \
"file\
": \
"udp://@$mcast:$mcastport\
" } }
" > /dev/null
264 # wait for gst to end
265 wait
"$gstpid
"
266 </pre
></blockquote
>
268 <p
>I hope you find the approach useful. I know I do.
</p
>
270 <p
>As usual, if you use Bitcoin and want to show your support of my
271 activities, please send Bitcoin donations to my address
272 <b
><a href=
"bitcoin:
15oWEoG9dUPovwmUL9KWAnYRtNJEkP1u1b
">15oWEoG9dUPovwmUL9KWAnYRtNJEkP1u1b
</a
></b
>.
</p
>
277 <title>Streaming the Linux desktop to Kodi using VLC and RTSP
</title>
278 <link>http://people.skolelinux.org/pere/blog/Streaming_the_Linux_desktop_to_Kodi_using_VLC_and_RTSP.html
</link>
279 <guid isPermaLink=
"true">http://people.skolelinux.org/pere/blog/Streaming_the_Linux_desktop_to_Kodi_using_VLC_and_RTSP.html
</guid>
280 <pubDate>Thu,
12 Jul
2018 02:
00:
00 +
0200</pubDate>
281 <description><p
>PS: See
282 <ahref=
"http://people.skolelinux.org/pere/blog/Simple_streaming_the_Linux_desktop_to_Kodi_using_GStreamer_and_RTP.html
">the
283 followup post
</a
> for a even better approach.
</p
>
285 <p
>A while back, I was asked by a friend how to stream the desktop to
286 my projector connected to Kodi. I sadly had to admit that I had no
287 idea, as it was a task I never had tried. Since then, I have been
288 looking for a way to do so, preferable without much extra software to
289 install on either side. Today I found a way that seem to kind of
290 work. Not great, but it is a start.
</p
>
292 <p
>I had a look at several approaches, for example
293 <a href=
"https://github.com/mfoetsch/dlna_live_streaming
">using uPnP
294 DLNA as described in
2011</a
>, but it required a uPnP server, fuse and
295 local storage enough to store the stream locally. This is not going
296 to work well for me, lacking enough free space, and it would
297 impossible for my friend to get working.
</p
>
299 <p
>Next, it occurred to me that perhaps I could use VLC to create a
300 video stream that Kodi could play. Preferably using
301 broadcast/multicast, to avoid having to change any setup on the Kodi
302 side when starting such stream. Unfortunately, the only recipe I
303 could find using multicast used the rtp protocol, and this protocol
304 seem to not be supported by Kodi.
</p
>
306 <p
>On the other hand, the rtsp protocol is working! Unfortunately I
307 have to specify the IP address of the streaming machine in both the
308 sending command and the file on the Kodi server. But it is showing my
309 desktop, and thus allow us to have a shared look on the big screen at
310 the programs I work on.
</p
>
312 <p
>I did not spend much time investigating codeces. I combined the
313 rtp and rtsp recipes from
314 <a href=
"https://wiki.videolan.org/Documentation:Streaming_HowTo/Command_Line_Examples/
">the
315 VLC Streaming HowTo/Command Line Examples
</a
>, and was able to get
316 this working on the desktop/streaming end.
</p
>
318 <blockquote
><pre
>
319 vlc screen:// --sout \
320 '#transcode{vcodec=mp4v,acodec=mpga,vb=
800,ab=
128}:rtp{dst=projector.local,port=
1234,sdp=rtsp://
192.168.11.4:
8080/test.sdp}
'
321 </pre
></blockquote
>
323 <p
>I ssh-ed into my Kodi box and created a file like this with the
324 same IP address:
</p
>
326 <blockquote
><pre
>
327 echo rtsp://
192.168.11.4:
8080/test.sdp \
328 > /storage/videos/screenstream.m3u
329 </pre
></blockquote
>
331 <p
>Note the
192.168.11.4 IP address is my desktops IP address. As far
332 as I can tell the IP must be hardcoded for this to work. In other
333 words, if someone elses machine is going to do the steaming, you have
334 to update screenstream.m3u on the Kodi machine and adjust the vlc
335 recipe. To get started, locate the file in Kodi and select the m3u
336 file while the VLC stream is running. The desktop then show up in my
337 big screen. :)
</p
>
339 <p
>When using the same technique to stream a video file with audio,
340 the audio quality is really bad. No idea if the problem is package
341 loss or bad parameters for the transcode. I do not know VLC nor Kodi
342 enough to tell.
</p
>
344 <p
><strong
>Update
2018-
07-
12</strong
>: Johannes Schauer send me a few
345 succestions and reminded me about an important step. The
"screen:
"
346 input source is only available once the vlc-plugin-access-extra
347 package is installed on Debian. Without it, you will see this error
348 message:
"VLC is unable to open the MRL
'screen://
'. Check the log
349 for details.
" He further found that it is possible to drop some parts
350 of the VLC command line to reduce the amount of hardcoded information.
351 It is also useful to consider using cvlc to avoid having the VLC
352 window in the desktop view. In sum, this give us this command line on
355 <blockquote
><pre
>
356 cvlc screen:// --sout \
357 '#transcode{vcodec=mp4v,acodec=mpga,vb=
800,ab=
128}:rtp{sdp=rtsp://:
8080/}
'
358 </pre
></blockquote
>
360 <p
>and this on the Kodi end
<p
>
362 <blockquote
><pre
>
363 echo rtsp://
192.168.11.4:
8080/ \
364 > /storage/videos/screenstream.m3u
365 </pre
></blockquote
>
367 <p
>Still bad image quality, though. But I did discover that streaming
368 a DVD using dvdsimple:///dev/dvd as the source had excellent video and
369 audio quality, so I guess the issue is in the input or transcoding
370 parts, not the rtsp part. I
've tried to change the vb and ab
371 parameters to use more bandwidth, but it did not make a
372 difference.
</p
>
374 <p
>I further received a suggestion from Einar Haraldseid to try using
375 gstreamer instead of VLC, and this proved to work great! He also
376 provided me with the trick to get Kodi to use a multicast stream as
377 its source. By using this monstrous oneliner, I can stream my desktop
378 with good video quality in reasonable framerate to the
239.255.0.1
379 multicast address on port
1234:
381 <blockquote
><pre
>
382 gst-launch-
1.0 ximagesrc use-damage=
0 ! video/x-raw,framerate=
30/
1 ! \
383 videoconvert ! queue2 ! \
384 x264enc bitrate=
8000 speed-preset=superfast tune=zerolatency qp-min=
30 \
385 key-int-max=
15 bframes=
2 ! video/x-h264,profile=high ! queue2 ! \
386 mpegtsmux alignment=
7 name=mux ! rndbuffersize max=
1316 min=
1316 ! \
387 udpsink host=
239.255.0.1 port=
1234 ttl-mc=
1 auto-multicast=
1 sync=
0 \
388 pulsesrc device=$(pactl list | grep -A2
'Source #
' | \
389 grep
'Name: .*\.monitor$
' | cut -d
" " -f2|head -
1) ! \
390 audioconvert ! queue2 ! avenc_aac ! queue2 ! mux.
391 </pre
></blockquote
>
393 <p
>and this on the Kodi end
<p
>
395 <blockquote
><pre
>
396 echo udp://@
239.255.0.1:
1234 \
397 > /storage/videos/screenstream.m3u
398 </pre
></blockquote
>
400 <p
>Note the trick to pick a valid pulseaudio source. It might not
401 pick the one you need. This approach will of course lead to trouble
402 if more than one source uses the same multicast port and address.
403 Note the ttl-mc=
1 setting, which limit the multicast packages to the
404 local network. If the value is increased, your screen will be
405 broadcasted further, one network
"hop
" for each increase (read up on
406 multicast to learn more. :)!
</p
>
408 <p
>Having cracked how to get Kodi to receive multicast streams, I
409 could use this VLC command to stream to the same multicast address.
410 The image quality is way better than the rtsp approach, but gstreamer
411 seem to be doing a better job.
</p
>
413 <blockquote
><pre
>
414 cvlc screen:// --sout
'#transcode{vcodec=mp4v,acodec=mpga,vb=
800,ab=
128}:rtp{mux=ts,dst=
239.255.0.1,port=
1234,sdp=sap}
'
415 </pre
></blockquote
>
417 <p
>As usual, if you use Bitcoin and want to show your support of my
418 activities, please send Bitcoin donations to my address
419 <b
><a href=
"bitcoin:
15oWEoG9dUPovwmUL9KWAnYRtNJEkP1u1b
">15oWEoG9dUPovwmUL9KWAnYRtNJEkP1u1b
</a
></b
>.
</p
>
424 <title>What is the most supported MIME type in Debian in
2018?
</title>
425 <link>http://people.skolelinux.org/pere/blog/What_is_the_most_supported_MIME_type_in_Debian_in_2018_.html
</link>
426 <guid isPermaLink=
"true">http://people.skolelinux.org/pere/blog/What_is_the_most_supported_MIME_type_in_Debian_in_2018_.html
</guid>
427 <pubDate>Mon,
9 Jul
2018 08:
05:
00 +
0200</pubDate>
428 <description><p
>Five years ago,
429 <a href=
"http://people.skolelinux.org/pere/blog/What_is_the_most_supported_MIME_type_in_Debian_.html
">I
430 measured what the most supported MIME type in Debian was
</a
>, by
431 analysing the desktop files in all packages in the archive. Since
432 then, the DEP-
11 AppStream system has been put into production, making
433 the task a lot easier. This made me want to repeat the measurement,
434 to see how much things changed. Here are the new numbers, for
435 unstable only this time:
437 <p
><strong
>Debian Unstable:
</strong
></p
>
441 ----- -----------------------
453 30 audio/x-vorbis+ogg
454 29 image/x-portable-pixmap
456 27 image/x-portable-bitmap
464 <p
>The list was created like this using a sid chroot:
"cat
465 /var/lib/apt/lists/*sid*_dep11_Components-amd64.yml.gz| zcat | awk
'/^
466 - \S+\/\S+$/ {print $
2 }
' | sort | uniq -c | sort -nr | head -
20"</p
>
468 <p
>It is interesting to see how image formats have passed text/plain
469 as the most announced supported MIME type. These days, thanks to the
470 AppStream system, if you run into a file format you do not know, and
471 want to figure out which packages support the format, you can find the
472 MIME type of the file using
"file --mime
&lt;filename
&gt;
", and then
473 look up all packages announcing support for this format in their
474 AppStream metadata (XML or .desktop file) using
"appstreamcli
475 what-provides mimetype
&lt;mime-type
&gt;. For example if you, like
476 me, want to know which packages support inode/directory, you can get a
477 list like this:
</p
>
479 <p
><blockquote
><pre
>
480 % appstreamcli what-provides mimetype inode/directory | grep Package: | sort
487 Package: doublecmd-common
489 Package: enlightenment
509 </pre
></blockquote
></p
>
511 <p
>Using the same method, I can quickly discover that the Sketchup file
512 format is not yet supported by any package in Debian:
</p
>
514 <p
><blockquote
><pre
>
515 % appstreamcli what-provides mimetype application/vnd.sketchup.skp
516 Could not find component providing
'mimetype::application/vnd.sketchup.skp
'.
518 </pre
></blockquote
></p
>
520 <p
>Yesterday I used it to figure out which packages support the STL
3D
523 <p
><blockquote
><pre
>
524 % appstreamcli what-provides mimetype application/sla|grep Package
529 </pre
></blockquote
></p
>
531 <p
>PS: A new version of Cura was uploaded to Debian yesterday.
</p
>
533 <p
>As usual, if you use Bitcoin and want to show your support of my
534 activities, please send Bitcoin donations to my address
535 <b
><a href=
"bitcoin:
15oWEoG9dUPovwmUL9KWAnYRtNJEkP1u1b
">15oWEoG9dUPovwmUL9KWAnYRtNJEkP1u1b
</a
></b
>.
</p
>
540 <title>Debian APT upgrade without enough free space on the disk...
</title>
541 <link>http://people.skolelinux.org/pere/blog/Debian_APT_upgrade_without_enough_free_space_on_the_disk___.html
</link>
542 <guid isPermaLink=
"true">http://people.skolelinux.org/pere/blog/Debian_APT_upgrade_without_enough_free_space_on_the_disk___.html
</guid>
543 <pubDate>Sun,
8 Jul
2018 12:
10:
00 +
0200</pubDate>
544 <description><p
>Quite regularly, I let my Debian Sid/Unstable chroot stay untouch
545 for a while, and when I need to update it there is not enough free
546 space on the disk for apt to do a normal
'apt upgrade
'. I normally
547 would resolve the issue by doing
'apt install
&lt;somepackages
&gt;
' to
548 upgrade only some of the packages in one batch, until the amount of
549 packages to download fall below the amount of free space available.
550 Today, I had about
500 packages to upgrade, and after a while I got
551 tired of trying to install chunks of packages manually. I concluded
552 that I did not have the spare hours required to complete the task, and
553 decided to see if I could automate it. I came up with this small
554 script which I call
'apt-in-chunks
':
</p
>
556 <p
><blockquote
><pre
>
559 # Upgrade packages when the disk is too full to upgrade every
560 # upgradable package in one lump. Fetching packages to upgrade using
561 # apt, and then installing using dpkg, to avoid changing the package
562 # flag for manual/automatic.
567 if [
"$
1" ]; then
568 grep -v
"$
1"
574 for p in $(apt list --upgradable | ignore
"$@
" |cut -d/ -f1 | grep -v
'^Listing...
'); do
575 echo
"Upgrading $p
"
577 apt install --download-only -y $p
578 for f in /var/cache/apt/archives/*.deb; do
579 if [ -e
"$f
" ]; then
580 dpkg -i /var/cache/apt/archives/*.deb
585 </pre
></blockquote
></p
>
587 <p
>The script will extract the list of packages to upgrade, try to
588 download the packages needed to upgrade one package, install the
589 downloaded packages using dpkg. The idea is to upgrade packages
590 without changing the APT mark for the package (ie the one recording of
591 the package was manually requested or pulled in as a dependency). To
592 use it, simply run it as root from the command line. If it fail, try
593 'apt install -f
' to clean up the mess and run the script again. This
594 might happen if the new packages conflict with one of the old
595 packages. dpkg is unable to remove, while apt can do this.
</p
>
597 <p
>It take one option, a package to ignore in the list of packages to
598 upgrade. The option to ignore a package is there to be able to skip
599 the packages that are simply too large to unpack. Today this was
600 'ghc
', but I have run into other large packages causing similar
601 problems earlier (like TeX).
</p
>
603 <p
>Update
2018-
07-
08: Thanks to Paul Wise, I am aware of two
604 alternative ways to handle this. The
"unattended-upgrades
605 --minimal-upgrade-steps
" option will try to calculate upgrade sets for
606 each package to upgrade, and then upgrade them in order, smallest set
607 first. It might be a better option than my above mentioned script.
608 Also,
"aptutude upgrade
" can upgrade single packages, thus avoiding
609 the need for using
"dpkg -i
" in the script above.
</p
>
611 <p
>As usual, if you use Bitcoin and want to show your support of my
612 activities, please send Bitcoin donations to my address
613 <b
><a href=
"bitcoin:
15oWEoG9dUPovwmUL9KWAnYRtNJEkP1u1b
">15oWEoG9dUPovwmUL9KWAnYRtNJEkP1u1b
</a
></b
>.
</p
>
618 <title>The worlds only stone power plant?
</title>
619 <link>http://people.skolelinux.org/pere/blog/The_worlds_only_stone_power_plant_.html
</link>
620 <guid isPermaLink=
"true">http://people.skolelinux.org/pere/blog/The_worlds_only_stone_power_plant_.html
</guid>
621 <pubDate>Sat,
30 Jun
2018 10:
35:
00 +
0200</pubDate>
622 <description><p
>So far, at least hydro-electric power, coal power, wind power,
623 solar power, and wood power are well known. Until a few days ago, I
624 had never heard of stone power. Then I learn about a quarry in a
626 <a href=
"https://en.wikipedia.org/wiki/Bremanger
">Bremanger
</a
> i
628 <a href=
"https://www.bontrup.com/en/activities/raw-materials/bremanger-quarry/
">the
629 Bremanger Quarry
</a
> company is extracting stone and dumping the stone
630 into a shaft leading to its shipping harbour. This downward movement
631 in this shaft is used to produce electricity. In short, it is using
632 falling rocks instead of falling water to produce electricity, and
633 according to its own statements it is producing more power than it is
634 using, and selling the surplus electricity to the Norwegian power
635 grid. I find the concept truly amazing. Is this the worlds only
636 stone power plant?
</p
>
638 <p
>As usual, if you use Bitcoin and want to show your support of my
639 activities, please send Bitcoin donations to my address
640 <b
><a href=
"bitcoin:
15oWEoG9dUPovwmUL9KWAnYRtNJEkP1u1b
">15oWEoG9dUPovwmUL9KWAnYRtNJEkP1u1b
</a
></b
>.
</p
>
645 <title>Add-on to control the projector from within Kodi
</title>
646 <link>http://people.skolelinux.org/pere/blog/Add_on_to_control_the_projector_from_within_Kodi.html
</link>
647 <guid isPermaLink=
"true">http://people.skolelinux.org/pere/blog/Add_on_to_control_the_projector_from_within_Kodi.html
</guid>
648 <pubDate>Tue,
26 Jun
2018 23:
55:
00 +
0200</pubDate>
649 <description><p
>My movie playing setup involve
<a href=
"https://kodi.tv/
">Kodi
</a
>,
650 <a href=
"https://openelec.tv
">OpenELEC
</a
> (probably soon to be
651 replaced with
<a href=
"https://libreelec.tv/
">LibreELEC
</a
>) and an
652 Infocus IN76 video projector. My projector can be controlled via both
653 a infrared remote controller, and a RS-
232 serial line. The vendor of
654 my projector,
<a href=
"https://www.infocus.com/
">InFocus
</a
>, had been
655 sensible enough to document the serial protocol in its user manual, so
656 it is easily available, and I used it some years ago to write
657 <a href=
"https://github.com/petterreinholdtsen/infocus-projector-control
">a
658 small script to control the projector
</a
>. For a while now, I longed
659 for a setup where the projector was controlled by Kodi, for example in
660 such a way that when the screen saver went on, the projector was
661 turned off, and when the screen saver exited, the projector was turned
664 <p
>A few days ago, with very good help from parts of my family, I
665 managed to find a Kodi Add-on for controlling a Epson projector, and
666 got in touch with its author to see if we could join forces and make a
667 Add-on with support for several projectors. To my pleasure, he was
668 positive to the idea, and we set out to add InFocus support to his
669 add-on, and make the add-on suitable for the official Kodi add-on
670 repository.
</p
>
672 <p
>The Add-on is now working (for me, at least), with a few minor
673 adjustments. The most important change I do relative to the master
674 branch in the github repository is embedding the
675 <a href=
"https://github.com/pyserial/pyserial
">pyserial module
</a
> in
676 the add-on. The long term solution is to make a
"script
" type
677 pyserial module for Kodi, that can be pulled in as a dependency in
678 Kodi. But until that in place, I embed it.
</p
>
680 <p
>The add-on can be configured to turn on the projector when Kodi
681 starts, off when Kodi stops as well as turn the projector off when the
682 screensaver start and on when the screesaver stops. It can also be
683 told to set the projector source when turning on the projector.
685 <p
>If this sound interesting to you, check out
686 <a href=
"https://github.com/fredrik-eriksson/kodi_projcontrol
">the
687 project github repository
</a
>. Perhaps you can send patches to
688 support your projector too? As soon as we find time to wrap up the
689 latest changes, it should be available for easy installation using any
690 Kodi instance.
</p
>
692 <p
>For future improvements, I would like to add projector model
693 detection and the ability to adjust the brightness level of the
694 projector from within Kodi. We also need to figure out how to handle
695 the cooling period of the projector. My projector refuses to turn on
696 for
60 seconds after it was turned off. This is not handled well by
697 the add-on at the moment.
</p
>
699 <p
>As usual, if you use Bitcoin and want to show your support of my
700 activities, please send Bitcoin donations to my address
701 <b
><a href=
"bitcoin:
15oWEoG9dUPovwmUL9KWAnYRtNJEkP1u1b
">15oWEoG9dUPovwmUL9KWAnYRtNJEkP1u1b
</a
></b
>.
</p
>
706 <title>youtube-dl for nedlasting fra NRK med undertekster - nice free software
</title>
707 <link>http://people.skolelinux.org/pere/blog/youtube_dl_for_nedlasting_fra_NRK_med_undertekster___nice_free_software.html
</link>
708 <guid isPermaLink=
"true">http://people.skolelinux.org/pere/blog/youtube_dl_for_nedlasting_fra_NRK_med_undertekster___nice_free_software.html
</guid>
709 <pubDate>Sat,
28 Apr
2018 10:
30:
00 +
0200</pubDate>
710 <description><p
>I
<a href=
"https://no.wikipedia.org/wiki/VHS
">VHS-kassettenes
</a
>
711 tid var det rett frem å ta vare på et TV-program en ønsket å kunne se
712 senere, uten å være avhengig av at programmet ble sendt på nytt.
713 Kanskje ønsket en å se programmet på hytten der det ikke var
714 TV-signal, eller av andre grunner ha det tilgjengelig for fremtidig
715 fornøyelse. Dette er blitt vanskeligere med introduksjon av
716 digital-TV og webstreaming, der opptak til harddisk er utenfor de
717 flestes kontroll hvis de bruker ufri programvare og bokser kontrollert
718 av andre. Men for NRK her i Norge, finnes det heldigvis flere fri
719 programvare-alternativer, som jeg har
720 <a href=
"http://people.skolelinux.org/pere/blog/Hvordan_enkelt_laste_ned_filmer_fra_NRK.html
">skrevet
</a
>
721 <a href=
"http://people.skolelinux.org/pere/blog/Hvordan_enkelt_laste_ned_filmer_fra_NRK_med_den__nye__l_sningen.html
">om
</a
>
722 <a href=
"http://people.skolelinux.org/pere/blog/Nedlasting_fra_NRK__som_Matroska_med_undertekster.html
">før
</a
>.
723 Så lenge kilden for nedlastingen er lovlig lagt ut på nett (hvilket
724 jeg antar NRK gjør), så er slik lagring til privat bruk også lovlig i
727 <p
>Sist jeg så på saken, i
2016, nevnte jeg at
728 <a href=
"https://rg3.github.com/youtube-dl/
">youtube-dl
</a
> ikke kunne
729 bake undertekster fra NRK inn i videofilene, og at jeg derfor
730 foretrakk andre alternativer. Nylig oppdaget jeg at dette har endret
731 seg. Fordelen med youtube-dl er at den er tilgjengelig direkte fra
732 Linux-distribusjoner som
<a href=
"https://www.debian.org/
">Debian
</a
>
733 og
<a href=
"https://www.ubuntu.com/
">Ubuntu
</a
>, slik at en slipper å
734 finne ut selv hvordan en skal få dem til å virke.
</p
>
736 <p
>For å laste ned et NRK-innslag med undertekster, og få den norske
737 underteksten pakket inn i videofilen, så kan følgende kommando
741 youtube-dl --write-sub --sub-format ttml \
742 --convert-subtitles srt --embed-subs \
743 https://tv.nrk.no/serie/ramm-ferdig-gaa/MUHU11000316/
27-
04-
2018
744 </pre
></p
>
746 <p
>URL-eksemplet er dagens toppsak på tv.nrk.no. Resultatet er en
747 MP4-fil med filmen og undertekster som kan spilles av med VLC. Merk
748 at VLC ikke viser frem undertekster før du aktiverer dem. For å gjøre
749 det, høyreklikk med musa i fremviservinduet, velg menyvalget for
750 undertekst og så norsk språk. Jeg testet også
'--write-auto-sub
',
751 men det kommandolinjeargumentet ser ikke ut til å fungere, så jeg
752 endte opp med settet med argumentlisten over, som jeg fant i en
753 feilrapport i youtube-dl-prosjektets samling over feilrapporter.
</p
>
755 <p
>Denne støtten i youtube-dl gjør det svært enkelt å lagre
756 NRK-innslag, det være seg nyheter, filmer, serier eller dokumentater,
757 for å ha dem tilgjengelig for fremtidig referanse og bruk, uavhengig
758 av hvor lenge innslagene ligger tilgjengelig hos NRK. Så får det ikke
759 hjelpe at NRKs jurister mener at det er
760 <a href=
"http://people.skolelinux.org/pere/blog/Best___ikke_fortelle_noen_at_streaming_er_nedlasting___.html
">vesensforskjellig
761 å legge tilgjengelig for nedlasting og for streaming
</a
>, når det rent
762 teknisk er samme sak.
</p
>
764 <p
>Programmet youtube-dl støtter også en rekke andre nettsteder, se
765 prosjektoversikten for
766 <a href=
"http://rg3.github.io/youtube-dl/supportedsites.html
">en
767 komplett liste
</a
>.
</p
>