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