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