1 <?xml version=
"1.0" encoding=
"ISO-8859-1"?>
2 <rss version='
2.0' xmlns:lj='http://www.livejournal.org/rss/lj/
1.0/'
>
4 <title>Petter Reinholdtsen - Entries from July
2018</title>
5 <description>Entries from July
2018</description>
6 <link>http://people.skolelinux.org/pere/blog/
</link>
10 <title>Streaming the Linux desktop to Kodi using VLC and RTSP
</title>
11 <link>http://people.skolelinux.org/pere/blog/Streaming_the_Linux_desktop_to_Kodi_using_VLC_and_RTSP.html
</link>
12 <guid isPermaLink=
"true">http://people.skolelinux.org/pere/blog/Streaming_the_Linux_desktop_to_Kodi_using_VLC_and_RTSP.html
</guid>
13 <pubDate>Thu,
12 Jul
2018 02:
00:
00 +
0200</pubDate>
14 <description><p
>A while back, I was asked by a friend how to stream the desktop to
15 my projector connected to Kodi. I sadly had to admit that I had no
16 idea, as it was a task I never had tried. Since then, I have been
17 looking for a way to do so, preferable without much extra software to
18 install on either side. Today I found a way that seem to kind of
19 work. Not great, but it is a start.
</p
>
21 <p
>I had a look at several approaches, for example
22 <a href=
"https://github.com/mfoetsch/dlna_live_streaming
">using uPnP
23 DLNA as described in
2011</a
>, but it required a uPnP server, fuse and
24 local storage enough to store the stream locally. This is not going
25 to work well for me, lacking enough free space, and it would
26 impossible for my friend to get working.
</p
>
28 <p
>Next, it occurred to me that perhaps I could use VLC to create a
29 video stream that Kodi could play. Preferably using
30 broadcast/multicast, to avoid having to change any setup on the Kodi
31 side when starting such stream. Unfortunately, the only recipe I
32 could find using multicast used the rtp protocol, and this protocol
33 seem to not be supported by Kodi.
</p
>
35 <p
>On the other hand, the rtsp protocol is working! Unfortunately I
36 have to specify the IP address of the streaming machine in both the
37 sending command and the file on the Kodi server. But it is showing my
38 desktop, and thus allow us to have a shared look on the big screen at
39 the programs I work on.
</p
>
41 <p
>I did not spend much time investigating codeces. I combined the
42 rtp and rtsp recipes from
43 <a href=
"https://wiki.videolan.org/Documentation:Streaming_HowTo/Command_Line_Examples/
">the
44 VLC Streaming HowTo/Command Line Examples
</a
>, and was able to get
45 this working on the desktop/streaming end.
</p
>
47 <blockquote
><pre
>
48 vlc screen:// --sout \
49 '#transcode{vcodec=mp4v,acodec=mpga,vb=
800,ab=
128}:rtp{dst=projector.local,port=
1234,sdp=rtsp://
192.168.11.4:
8080/test.sdp}
'
50 </pre
></blockquote
>
52 <p
>I ssh-ed into my Kodi box and created a file like this with the
53 same IP address:
</p
>
55 <blockquote
><pre
>
56 echo rtsp://
192.168.11.4:
8080/test.sdp \
57 > /storage/videos/screenstream.m3u
58 </pre
></blockquote
>
60 <p
>Note the
192.168.11.4 IP address is my desktops IP address. As far
61 as I can tell the IP must be hardcoded for this to work. In other
62 words, if someone elses machine is going to do the steaming, you have
63 to update screenstream.m4u on the Kodi machine and adjust the vlc
64 repice. To get started, locate the file in Kodi and select the m3u
65 file while the VLC stream is running. The desktop then show up in my
66 big screen. :)
</p
>
68 <p
>When using the same technique to stream a video file with audio,
69 the audio quality is really bad. No idea if the problem is package
70 loss or bad parameters for the transcode. I do not know VLC nor Kodi
71 enough to tell.
</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>What is the most supported MIME type in Debian in
2018?
</title>
81 <link>http://people.skolelinux.org/pere/blog/What_is_the_most_supported_MIME_type_in_Debian_in_2018_.html
</link>
82 <guid isPermaLink=
"true">http://people.skolelinux.org/pere/blog/What_is_the_most_supported_MIME_type_in_Debian_in_2018_.html
</guid>
83 <pubDate>Mon,
9 Jul
2018 08:
05:
00 +
0200</pubDate>
84 <description><p
>Five years ago,
85 <a href=
"http://people.skolelinux.org/pere/blog/What_is_the_most_supported_MIME_type_in_Debian_.html
">I
86 measured what the most supported MIME type in Debian was
</a
>, by
87 analysing the desktop files in all packages in the archive. Since
88 then, the DEP-
11 AppStream system has been put into production, making
89 the task a lot easier. This made me want to repeat the measurement,
90 to see how much things changed. Here are the new numbers, for
91 unstable only this time:
93 <p
><strong
>Debian Unstable:
</strong
></p
>
97 ----- -----------------------
109 30 audio/x-vorbis+ogg
110 29 image/x-portable-pixmap
112 27 image/x-portable-bitmap
120 <p
>The list was created like this using a sid chroot:
"cat
121 /var/lib/apt/lists/*sid*_dep11_Components-amd64.yml.gz| zcat | awk
'/^
122 - \S+\/\S+$/ {print $
2 }
' | sort | uniq -c | sort -nr | head -
20"</p
>
124 <p
>It is interesting to see how image formats have passed text/plain
125 as the most announced supported MIME type. These days, thanks to the
126 AppStream system, if you run into a file format you do not know, and
127 want to figure out which packages support the format, you can find the
128 MIME type of the file using
"file --mime
&lt;filename
&gt;
", and then
129 look up all packages announcing support for this format in their
130 AppStream metadata (XML or .desktop file) using
"appstreamcli
131 what-provides mimetype
&lt;mime-type
&gt;. For example if you, like
132 me, want to know which packages support inode/directory, you can get a
133 list like this:
</p
>
135 <p
><blockquote
><pre
>
136 % appstreamcli what-provides mimetype inode/directory | grep Package: | sort
143 Package: doublecmd-common
145 Package: enlightenment
165 </pre
></blockquote
></p
>
167 <p
>Using the same method, I can quickly discover that the Sketchup file
168 format is not yet supported by any package in Debian:
</p
>
170 <p
><blockquote
><pre
>
171 % appstreamcli what-provides mimetype application/vnd.sketchup.skp
172 Could not find component providing
'mimetype::application/vnd.sketchup.skp
'.
174 </pre
></blockquote
></p
>
176 <p
>Yesterday I used it to figure out which packages support the STL
3D
179 <p
><blockquote
><pre
>
180 % appstreamcli what-provides mimetype application/sla|grep Package
185 </pre
></blockquote
></p
>
187 <p
>PS: A new version of Cura was uploaded to Debian yesterday.
</p
>
189 <p
>As usual, if you use Bitcoin and want to show your support of my
190 activities, please send Bitcoin donations to my address
191 <b
><a href=
"bitcoin:
15oWEoG9dUPovwmUL9KWAnYRtNJEkP1u1b
">15oWEoG9dUPovwmUL9KWAnYRtNJEkP1u1b
</a
></b
>.
</p
>
196 <title>Debian APT upgrade without enough free space on the disk...
</title>
197 <link>http://people.skolelinux.org/pere/blog/Debian_APT_upgrade_without_enough_free_space_on_the_disk___.html
</link>
198 <guid isPermaLink=
"true">http://people.skolelinux.org/pere/blog/Debian_APT_upgrade_without_enough_free_space_on_the_disk___.html
</guid>
199 <pubDate>Sun,
8 Jul
2018 12:
10:
00 +
0200</pubDate>
200 <description><p
>Quite regularly, I let my Debian Sid/Unstable chroot stay untouch
201 for a while, and when I need to update it there is not enough free
202 space on the disk for apt to do a normal
'apt upgrade
'. I normally
203 would resolve the issue by doing
'apt install
&lt;somepackages
&gt;
' to
204 upgrade only some of the packages in one batch, until the amount of
205 packages to download fall below the amount of free space available.
206 Today, I had about
500 packages to upgrade, and after a while I got
207 tired of trying to install chunks of packages manually. I concluded
208 that I did not have the spare hours required to complete the task, and
209 decided to see if I could automate it. I came up with this small
210 script which I call
'apt-in-chunks
':
</p
>
212 <p
><blockquote
><pre
>
215 # Upgrade packages when the disk is too full to upgrade every
216 # upgradable package in one lump. Fetching packages to upgrade using
217 # apt, and then installing using dpkg, to avoid changing the package
218 # flag for manual/automatic.
223 if [
"$
1" ]; then
224 grep -v
"$
1"
230 for p in $(apt list --upgradable | ignore
"$@
" |cut -d/ -f1 | grep -v
'^Listing...
'); do
231 echo
"Upgrading $p
"
233 apt install --download-only -y $p
234 for f in /var/cache/apt/archives/*.deb; do
235 if [ -e
"$f
" ]; then
236 dpkg -i /var/cache/apt/archives/*.deb
241 </pre
></blockquote
></p
>
243 <p
>The script will extract the list of packages to upgrade, try to
244 download the packages needed to upgrade one package, install the
245 downloaded packages using dpkg. The idea is to upgrade packages
246 without changing the APT mark for the package (ie the one recording of
247 the package was manually requested or pulled in as a dependency). To
248 use it, simply run it as root from the command line. If it fail, try
249 'apt install -f
' to clean up the mess and run the script again. This
250 might happen if the new packages conflict with one of the old
251 packages. dpkg is unable to remove, while apt can do this.
</p
>
253 <p
>It take one option, a package to ignore in the list of packages to
254 upgrade. The option to ignore a package is there to be able to skip
255 the packages that are simply too large to unpack. Today this was
256 'ghc
', but I have run into other large packages causing similar
257 problems earlier (like TeX).
</p
>
259 <p
>Update
2018-
07-
08: Thanks to Paul Wise, I am aware of two
260 alternative ways to handle this. The
"unattended-upgrades
261 --minimal-upgrade-steps
" option will try to calculate upgrade sets for
262 each package to upgrade, and then upgrade them in order, smallest set
263 first. It might be a better option than my above mentioned script.
264 Also,
"aptutude upgrade
" can upgrade single packages, thus avoiding
265 the need for using
"dpkg -i
" in the script above.
</p
>
267 <p
>As usual, if you use Bitcoin and want to show your support of my
268 activities, please send Bitcoin donations to my address
269 <b
><a href=
"bitcoin:
15oWEoG9dUPovwmUL9KWAnYRtNJEkP1u1b
">15oWEoG9dUPovwmUL9KWAnYRtNJEkP1u1b
</a
></b
>.
</p
>