<?xml version="1.0" encoding="utf-8"?>
<?xml-stylesheet type="text/xsl" href="../assets/xml/rss.xsl" media="all"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Cobra's bits (Posts about linux)</title><link>https://cobra.pdes-net.org</link><description></description><atom:link href="https://cobra.pdes-net.org/categories/linux.xml" rel="self" type="application/rss+xml"></atom:link><language>en</language><copyright>Contents © 2024 &lt;a href="mailto:najahannah@gmail.com"&gt;Cobra&lt;/a&gt; 
&lt;a rel="license" href="https://creativecommons.org/licenses/by-nc-sa/4.0/"&gt;
&lt;img alt="Creative Commons License BY-NC-SA"
style="border-width:0; margin-bottom:12px;"
src="../images/by-nc-sa.svg"&gt;&lt;/a&gt;</copyright><lastBuildDate>Mon, 30 Dec 2024 14:50:43 GMT</lastBuildDate><generator>Nikola (getnikola.com)</generator><docs>http://blogs.law.harvard.edu/tech/rss</docs><item><title>Let's not encrypt?</title><link>https://cobra.pdes-net.org/posts/lets-not-encrypt.html</link><dc:creator>Cobra</dc:creator><description>&lt;p&gt;This blog is powered by &lt;a class="reference external" href="https://cobra.pdes-net.org/posts/new-server.html"&gt;Hiawatha&lt;/a&gt;, a &lt;a class="reference external" href="https://hiawatha.leisink.net/about/"&gt;light-weight webserver designed for security and ease of use&lt;/a&gt;. Consequently, Hiawatha comes with a script that allows one to easily request certificates from the Let's Encrypt initiative and (in conjunction with a daily cron job) to automagically renew them when the time has come.&lt;/p&gt;
&lt;p&gt;This setup has worked almost flawlessly &lt;a class="reference external" href="https://cobra.pdes-net.org/posts/lets-encrypt.html"&gt;for several years&lt;/a&gt;. In 2021, I've received an information from Let's Encrypt that they would modify (as planned) their chain of trust, requiring corresponding changes in the LE_ISSUERS option in the configuration file of the script designated for requesting or renewing certificates.&lt;/p&gt;
&lt;p&gt;I should have known that this change will happen every three years, but since I didn't receive any mail this time, it never occurred to me that the failure of renewal had this simple reason. Instead, I've searched everywhere for nonexisting error messages until I had run out of ideas. Without any options left, I've asked &lt;a class="reference external" href="https://haui.pdes-net.org/"&gt;Haui&lt;/a&gt; for help, convinced that he would see light where I could see only dark. And it indeed didn't take him long to identify an outdated LE_ISSUERS value in the configuration file as the culprit.&lt;/p&gt;
&lt;p&gt;We can easily look up the common name of the current certificate's issuer:&lt;/p&gt;
&lt;pre class="literal-block"&gt;openssl x509 -in /etc/hiawatha/tls/pdes-net.org.pem -noout -text | grep CN&lt;/pre&gt;
&lt;p&gt;But that won't help if the current certificate is not renewed because of an outdated issuer. The present situation was different in that I've requested new certificates in September as a temporary (HOHOHO) workaround. These new certificates were issued with the new CN of R10, as compared to the old R3 in the configuration file, making it clear that the latter is outdated. It would have been so easy if I hadn't been such a fool and categorically ruled out this possibility. 🫥&lt;/p&gt;
&lt;p&gt;Well, I may get old and useless, but I hope to recall once and for all that the authoritative instance for looking up the current issuer for Let's Encrypt can be found here: &lt;a class="reference external" href="https://letsencrypt.org/certificates/"&gt;https://letsencrypt.org/certificates/&lt;/a&gt;. And if I don't, I'm sure to remember that I can find this information in my own blog. 🫩&lt;/p&gt;</description><category>debian</category><category>encryption</category><category>linux</category><guid>https://cobra.pdes-net.org/posts/lets-not-encrypt.html</guid><pubDate>Mon, 30 Dec 2024 14:24:34 GMT</pubDate></item><item><title>Digital signatures</title><link>https://cobra.pdes-net.org/posts/digital-signatures.html</link><dc:creator>Cobra</dc:creator><description>&lt;p&gt;Our administration now requests all documents to be digitally signed, with a certificate that each employee receives from the DFN. Windows and Mac users employ Acrobat Reader for this purpose, but what software can be used under Linux?&lt;/p&gt;
&lt;p&gt;My first choice was &lt;a class="reference external" href="https://help.libreoffice.org/6.1/he/text/shared/guide/digitalsign_send.html?DbPAR=SHARED"&gt;LibreOffice&lt;/a&gt;, which has offered this functionality already for several years. Signing a pristine pdf works well indeed, apart from the fact that LibeOffice does not create a placeholder for the signature. However, signing a document that has already been signed by Window users turned out to be simply not possible (&lt;a class="reference external" href="https://bugs.documentfoundation.org/show_bug.cgi?id=58442"&gt;here's the 12 years old bug report&lt;/a&gt; – &lt;a class="reference external" href="https://bugs.documentfoundation.org/show_bug.cgi?id=58476"&gt;and here's the inverse one that is just as old&lt;/a&gt;).&lt;/p&gt;
&lt;p&gt;The next candidate was &lt;a class="reference external" href="https://faq.tickets.tu-dresden.de/otrs/public.pl?Action=PublicFAQZoom;ItemID=620"&gt;Okular&lt;/a&gt;, the PDF viewer of KDE, which has been &lt;a class="reference external" href="https://datashare.tu-dresden.de/index.php/s/j5BKKyJYZFBzGsB?dir=undefined&amp;amp;openfile=7555731"&gt;sponsored by the University of Dresden to implement this functionality&lt;/a&gt;. But only half-way, it seems to me. I could sign most (but not all) documents, but I couldn't configure the placeholder at all. As the font size in the signature box does not scale with the size of the box, the name of the person signing is often cut off. How difficult can it be to implement such a very basic and obvious requirement?&lt;/p&gt;
&lt;p&gt;Finally, I turned to &lt;a class="reference external" href="https://code-industry.net/masterpdfeditor-help/digital_signatures/"&gt;Master PDF Editor&lt;/a&gt;, which I've occasionally used in the past for annotations when Evince did not yet offer this possibility. I was actually not surprised that this feature-rich PDF editor also offers digital signatures, but I was pleased that the software comes with its own certificate storage and that the signature placeholder is highly configurable. For example, one can configure the placeholder to include one's own analogue signature as a background.&lt;/p&gt;
&lt;p&gt;Alas, using the Master PDF editor without any restrictions requires purchasing a license. The free version is unlimited, but leaves a watermark in documents that have been digitally signed or otherwise altered with the software. The licence is very fairly priced, but as the software is developed in Russia, even asking for one is frowned upon and politically inopportune. Fortunately, nobody has yet complained about the watermark in documents I have  digitally signed. 😈&lt;/p&gt;</description><category>encryption</category><category>linux</category><guid>https://cobra.pdes-net.org/posts/digital-signatures.html</guid><pubDate>Wed, 01 May 2024 12:12:11 GMT</pubDate></item><item><title>Backdoor in xz</title><link>https://cobra.pdes-net.org/posts/backdoor-in-xz.html</link><dc:creator>Cobra</dc:creator><description>&lt;blockquote&gt;
&lt;p&gt;&lt;a class="reference external" href="https://www.openwall.com/lists/oss-security/2024/03/29/4"&gt;The upstream xz repository and the xz tarballs have been backdoored.&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;a class="reference external" href="https://gist.github.com/thesamesam/223949d5a074ebc3dce9ee78baad9e27"&gt;This backdoor is very indirect and only shows up when a few known specific criteria are met. Others may be yet discovered! However, this backdoor is at least triggerable by remote unprivileged systems connecting to public SSH ports.&lt;/a&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;This supply-chain attack targets .deb- and .rpm-based distributions, but the backdoored versions of xz or xz-utils (5.6.0 and 5.6.1) have made it only into rolling-release distributions such as Fedora Rawhide, Debian Testing/Sid, OpenSuse Tumbleweed, and Archlinux (&lt;a class="reference external" href="https://archlinux.org/news/the-xz-package-has-been-backdoored/"&gt;where it is inactive&lt;/a&gt;).&lt;/p&gt;
&lt;p&gt;The server of this blog is running Debian Testing and had the compromised version of xz-utils installed since March 17. The backdoor was &lt;a class="reference external" href="https://www.openwall.com/lists/oss-security/2024/03/29/4"&gt;reported&lt;/a&gt; last Friday, March 29. I've installed the patch provided by Debian on Saturday, March 30, and examined the system logs, which do not show any evidence that the system has been compromised in any way. In fact, according to my current understanding, the system did not meet all the &lt;a class="reference external" href="https://vulcan.io/blog/alert-cve-2024-3094/"&gt;requirements&lt;/a&gt; for the backdoor to be executed. However, I will remain vigilant and let the users of the server know if further action needs to be taken.&lt;/p&gt;
&lt;p&gt;More links (in German): &lt;a class="reference external" href="https://www.heise.de/news/Hintertuer-in-xz-Bibliothek-gefaehrdet-SSH-Verbindungen-9671317.html"&gt;Heise 30.03.2024 09:35&lt;/a&gt;, &lt;a class="reference external" href="https://www.heise.de/news/xz-Attacke-Hintertuer-entraetselt-weitere-Details-zu-betroffenen-Distros-9671588.html"&gt;Heise 30.03.2024 22:28&lt;/a&gt;, &lt;a class="reference external" href="https://www.heise.de/hintergrund/Die-xz-Hintertuer-das-verborgene-Oster-Drama-der-IT-9673038.html"&gt;Heise 02.04.2024 17:10&lt;/a&gt;&lt;/p&gt;</description><category>archlinux</category><category>debian</category><category>info</category><category>linux</category><category>suse</category><guid>https://cobra.pdes-net.org/posts/backdoor-in-xz.html</guid><pubDate>Mon, 01 Apr 2024 11:50:12 GMT</pubDate></item><item><title>Kernel 6.6.9</title><link>https://cobra.pdes-net.org/posts/kernel-669.html</link><dc:creator>Cobra</dc:creator><description>&lt;p&gt;Yesterday, I've updated my systems to kernel 6.6.9 – two Intel-based desktops and one AMD-based notebook. When rebooting the latter, I immediately noticed that something was wrong. Logging in, for example, seemed to take twice as long, and the desktop needed much longer than the usual two or three seconds to come up. My Intel desktops, in contrast, behaved exactly as before.&lt;/p&gt;
&lt;p&gt;To substantiate my feeling that my notebook's performance had degraded significantly since the update, I used sysbench, or, more precisely, the command &lt;code class="docutils literal"&gt;sysbench cpu run&lt;/code&gt;. I would normally see a performance of about 4800 events per second on one core. But with kernel 6.6.9, all I've got were 440 events per second, more than a factor of 10 lower than the Ryzen 5800H in my notebook is supposed to deliver, and even three times lower than my 10-years old Intel desktops. No surprise the notebook felt so sluggish!&lt;/p&gt;
&lt;p&gt;I didn't bother to investigate this issue further, and I don't know the underlying cause, like whether it's related to the AMD processor or the maker of the notebook. I just rolled back to kernel 6.6.8 (&lt;code class="docutils literal"&gt;sudo pacman &lt;span class="pre"&gt;-U&lt;/span&gt; &lt;span class="pre"&gt;/var/cache/pacman/pkg/linux-6.6.8.arch1-1-x86_64.pkg.tar.zst&lt;/span&gt;&lt;/code&gt;) and the problem was gone.&lt;/p&gt;
&lt;p&gt;I expected problems with kernel 6.6.6, but the devil is in the details.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Update:&lt;/strong&gt; The performance is back to normal with kernel 6.6.10.&lt;/p&gt;</description><category>archlinux</category><category>linux</category><guid>https://cobra.pdes-net.org/posts/kernel-669.html</guid><pubDate>Fri, 05 Jan 2024 16:24:37 GMT</pubDate></item><item><title>Don't worry, be happy</title><link>https://cobra.pdes-net.org/posts/dont-worry-be-happy.html</link><dc:creator>Cobra</dc:creator><description>&lt;p&gt;It's Friday evening, 18:30. My fourth video meeting in a row has just concluded. Now I could finally work on the revision of a manuscript I wanted to get resubmitted during the weekend. This last revision was purely technical: the production editor requested that we move the present addresses of the authors to the back of the manuscript, instead of leaving them  beneath the list of authors on the title page as destined by the LaTeX class from the publisher. Now, any such request that forces me to work around or against the journal style provided by the publisher means that the reputation of the journal (&lt;a class="reference external" href="https://pubs.acs.org/journal/aanmf6"&gt;ACS Appl. Nano Mater.&lt;/a&gt;, in case you are curious) takes a steep dive. But anyway, I had to do it, and I was looking into the &lt;code class="docutils literal"&gt;footmisc&lt;/code&gt; package to get all &lt;code class="docutils literal"&gt;footnotemarks&lt;/code&gt; I needed when I realized that I hadn't done my ritual update in the morning for the lack of time. Starting it, I only peripherally noticed that the update involved TeXLive and brought a new kernel. In any case, this information didn't stop me from compiling the manuscript I was working on during the update. Repeatedly. Incessantly.&lt;/p&gt;
&lt;p&gt;At a certain point, the build command of Sublime Text didn't produce any reaction. No error message, nothing. I began to have a bad feeling. Indeed, while I could still move the mouse around, the entire Window system was unresponsive, and the update process – which was just about to build the fmt files – was hanging. I started to suspect that I had just committed the greatest blunder of this year, and indeed, when I rebooted, the system greeted me with the message that the kernel could not be found:&lt;/p&gt;
&lt;pre class="literal-block"&gt;Loading Linux linux...
error file /boot/vmlinuz-linux not found
loading initial ramdisk
error: you need to load the kernel first&lt;/pre&gt;
&lt;p&gt;Well, I knew that this SNAFU looked worse than it actually is. But since I was suddenly very tired, I decided to call it a day and do the repair on Saturday morning.&lt;/p&gt;
&lt;p&gt;On Saturday, I first needed a live Arch installation on a USB stick. The &lt;a class="reference external" href="https://archlinux.org/download/"&gt;ISO&lt;/a&gt; ist just 813 MB (as of release 2023.07.01) and downloaded in 30 s. There are &lt;a class="reference external" href="https://wiki.archlinux.org/title/USB_flash_installation_medium"&gt;several options to write the ISO to the stick&lt;/a&gt;, but I prefer &lt;code class="docutils literal"&gt;dd&lt;/code&gt;:&lt;/p&gt;
&lt;pre class="literal-block"&gt;dd bs=4M if=archlinux-archlinux-2023.07.01-x86_64.iso of=/dev/sdd conv=fsync oflag=direct status=progress&lt;/pre&gt;
&lt;p&gt;Note that the stick must not be mounted, and one writes to the stick (sdd), not a partition (sdd1).&lt;/p&gt;
&lt;p&gt;After booting from the thus created live media, I was just &lt;a class="reference external" href="https://wiki.archlinux.org/title/pacman#Pacman_crashes_during_an_upgrade"&gt;a few commands away&lt;/a&gt; from a restored system. I first wanted to have my WiFi working:&lt;/p&gt;
&lt;pre class="literal-block"&gt;iwctl --passphrase PASSPHRASE station DEVICE connect SSID&lt;/pre&gt;
&lt;p&gt;After that, I just needed to mount my drives (have a look with &lt;code class="docutils literal"&gt;lsblk&lt;/code&gt; before), delete the stale lock file from the previous failed update, and do an update in the mounted root directory:&lt;/p&gt;
&lt;pre class="literal-block"&gt;mount /dev/nvme01p2 /mnt
mount /dev/nvme01p1 /mnt/boot
mount -t proc /proc /mnt/proc
mount --rbind /sys /mnt/sys
mount --rbind /dev /mnt/dev

rm /var/lib/pacman/db.lck

pacman --sysroot /mnt -Syu&lt;/pre&gt;
&lt;p&gt;Took all in all half an hour, but I would still have preferred to avoid this situation altogether. The lesson is: avoid working on the system when you're all stressed out. Particularly &lt;a class="reference external" href="https://www.opsview.com/resources/system-administrator/blog/3-reasons-not-make-major-it-changes-fridays"&gt;on Friday night&lt;/a&gt;.&lt;/p&gt;</description><category>archlinux</category><category>linux</category><category>thoughts</category><guid>https://cobra.pdes-net.org/posts/dont-worry-be-happy.html</guid><pubDate>Sat, 29 Jul 2023 13:12:40 GMT</pubDate></item><item><title>Ich glotz TV</title><link>https://cobra.pdes-net.org/posts/ich-glotz-tv.html</link><dc:creator>Cobra</dc:creator><description>&lt;p&gt;Well, actually I've essentially stopped watching linear TV about 20 years ago. My Loewe CRT TV set I'd bought in 1994 didn't take kindly to that and twice suffered from dried-up electrolyte capacitors. “You have to switch on the TV at least &lt;em&gt;sometimes&lt;/em&gt;”, said the electronics guy who repaired the set. When it happened the third time, I didn't bother anymore, but lived without dedicated TV set for the next 5 years. My first flat-screen TV purchased in 2010 suffered the same fate when it all of a sudden developed dead pixel rows, resulting in a rapidly increasing number of black lines across the display.&lt;/p&gt;
&lt;p&gt;It was not until 2018 when I finally gave in and bought a new TV set with the explicit purpose to enjoy the FIFA World Cup held this year. You all know that from a German perspective, this word cup was as much of a disaster as the following one in 2022. Regardless, the 65" QLED panel with three-sided ambilight is perfect for enjoying the occasional movie from my NAS or Amazon Prime Video.&lt;/p&gt;
&lt;p&gt;This panel creates a high level of immersion due to its sheer size and the light surrounding it, providing a near cinematic experience for movies in FullHD and 4K resolution. For anything else the immersion may be a bit overwhelming, particularly if one is not willing to fully focus on the action displayed. For me, that's often the case when watching a football match, or a documentary on publicly broadcasted TV, and I would prefer to be able to watch the TV channel on my notebook with one eye while doing other stuff in the background.&lt;/p&gt;
&lt;p&gt;Instead of a flull-fledged IPTV application such as &lt;a class="reference external" href="https://aur.archlinux.org/packages/hypnotix"&gt;hypnotix,&lt;/a&gt; I thought that a simple script may be more suitable to my needs. The script I've found on &lt;a class="reference external" href="https://wiki.archlinux.de/title/Live-Tv"&gt;archlinux.de&lt;/a&gt; was basically just what I needed. I've merely integrated the download of the current URLs (done by a python script by Axel-Erfurt I've reproduced below), cleaned up a bit, and formatted it for zenity. I've also excluded some redundant channels to keep the list from cluttering.&lt;/p&gt;
&lt;div class="code"&gt;&lt;pre class="code bash"&gt;&lt;a id="rest_code_c6129af31b474b1d83a5f44773bd9c6c-1" name="rest_code_c6129af31b474b1d83a5f44773bd9c6c-1" href="https://cobra.pdes-net.org/posts/ich-glotz-tv.html#rest_code_c6129af31b474b1d83a5f44773bd9c6c-1"&gt;&lt;/a&gt;&lt;span class="ch"&gt;#!/bin/bash&lt;/span&gt;
&lt;a id="rest_code_c6129af31b474b1d83a5f44773bd9c6c-2" name="rest_code_c6129af31b474b1d83a5f44773bd9c6c-2" href="https://cobra.pdes-net.org/posts/ich-glotz-tv.html#rest_code_c6129af31b474b1d83a5f44773bd9c6c-2"&gt;&lt;/a&gt;
&lt;a id="rest_code_c6129af31b474b1d83a5f44773bd9c6c-3" name="rest_code_c6129af31b474b1d83a5f44773bd9c6c-3" href="https://cobra.pdes-net.org/posts/ich-glotz-tv.html#rest_code_c6129af31b474b1d83a5f44773bd9c6c-3"&gt;&lt;/a&gt;&lt;span class="c1"&gt;# Original livetv script by tuxnix and Mis,&lt;/span&gt;
&lt;a id="rest_code_c6129af31b474b1d83a5f44773bd9c6c-4" name="rest_code_c6129af31b474b1d83a5f44773bd9c6c-4" href="https://cobra.pdes-net.org/posts/ich-glotz-tv.html#rest_code_c6129af31b474b1d83a5f44773bd9c6c-4"&gt;&lt;/a&gt;&lt;span class="c1"&gt;# see `https://wiki.archlinux.de/title/Live-Tv &amp;lt;https://wiki.archlinux.de/title/Live-Tv&amp;gt;`_&lt;/span&gt;
&lt;a id="rest_code_c6129af31b474b1d83a5f44773bd9c6c-5" name="rest_code_c6129af31b474b1d83a5f44773bd9c6c-5" href="https://cobra.pdes-net.org/posts/ich-glotz-tv.html#rest_code_c6129af31b474b1d83a5f44773bd9c6c-5"&gt;&lt;/a&gt;&lt;span class="c1"&gt;# liveiptvstations.py by Axel-Erfurt,&lt;/span&gt;
&lt;a id="rest_code_c6129af31b474b1d83a5f44773bd9c6c-6" name="rest_code_c6129af31b474b1d83a5f44773bd9c6c-6" href="https://cobra.pdes-net.org/posts/ich-glotz-tv.html#rest_code_c6129af31b474b1d83a5f44773bd9c6c-6"&gt;&lt;/a&gt;&lt;span class="c1"&gt;# see `https://gist.github.com/Axel-Erfurt/5106f9bbef1fca1d63bb74a849607128 &amp;lt;https://gist.github.com/Axel-Erfurt/5106f9bbef1fca1d63bb74a849607128&amp;gt;`_&lt;/span&gt;
&lt;a id="rest_code_c6129af31b474b1d83a5f44773bd9c6c-7" name="rest_code_c6129af31b474b1d83a5f44773bd9c6c-7" href="https://cobra.pdes-net.org/posts/ich-glotz-tv.html#rest_code_c6129af31b474b1d83a5f44773bd9c6c-7"&gt;&lt;/a&gt;&lt;span class="c1"&gt;# Also see `https://wiki.ubuntuusers.de/Internet-TV/Stationen/ &amp;lt;https://wiki.ubuntuusers.de/Internet-TV/Stationen/&amp;gt;`_&lt;/span&gt;
&lt;a id="rest_code_c6129af31b474b1d83a5f44773bd9c6c-8" name="rest_code_c6129af31b474b1d83a5f44773bd9c6c-8" href="https://cobra.pdes-net.org/posts/ich-glotz-tv.html#rest_code_c6129af31b474b1d83a5f44773bd9c6c-8"&gt;&lt;/a&gt;
&lt;a id="rest_code_c6129af31b474b1d83a5f44773bd9c6c-9" name="rest_code_c6129af31b474b1d83a5f44773bd9c6c-9" href="https://cobra.pdes-net.org/posts/ich-glotz-tv.html#rest_code_c6129af31b474b1d83a5f44773bd9c6c-9"&gt;&lt;/a&gt;&lt;span class="nv"&gt;script_path&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="k"&gt;$(&lt;/span&gt;dirname&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="nv"&gt;$0&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="k"&gt;)&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt;
&lt;a id="rest_code_c6129af31b474b1d83a5f44773bd9c6c-10" name="rest_code_c6129af31b474b1d83a5f44773bd9c6c-10" href="https://cobra.pdes-net.org/posts/ich-glotz-tv.html#rest_code_c6129af31b474b1d83a5f44773bd9c6c-10"&gt;&lt;/a&gt;&lt;span class="nv"&gt;script_name&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="k"&gt;$(&lt;/span&gt;basename&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="nv"&gt;$0&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="k"&gt;)&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt;
&lt;a id="rest_code_c6129af31b474b1d83a5f44773bd9c6c-11" name="rest_code_c6129af31b474b1d83a5f44773bd9c6c-11" href="https://cobra.pdes-net.org/posts/ich-glotz-tv.html#rest_code_c6129af31b474b1d83a5f44773bd9c6c-11"&gt;&lt;/a&gt;
&lt;a id="rest_code_c6129af31b474b1d83a5f44773bd9c6c-12" name="rest_code_c6129af31b474b1d83a5f44773bd9c6c-12" href="https://cobra.pdes-net.org/posts/ich-glotz-tv.html#rest_code_c6129af31b474b1d83a5f44773bd9c6c-12"&gt;&lt;/a&gt;&lt;span class="c1"&gt;# Pull down a current list of IPTV channels&lt;/span&gt;
&lt;a id="rest_code_c6129af31b474b1d83a5f44773bd9c6c-13" name="rest_code_c6129af31b474b1d83a5f44773bd9c6c-13" href="https://cobra.pdes-net.org/posts/ich-glotz-tv.html#rest_code_c6129af31b474b1d83a5f44773bd9c6c-13"&gt;&lt;/a&gt;liveiptvstations.py&lt;span class="w"&gt; &lt;/span&gt;&amp;gt;&lt;span class="w"&gt; &lt;/span&gt;channellist.txt
&lt;a id="rest_code_c6129af31b474b1d83a5f44773bd9c6c-14" name="rest_code_c6129af31b474b1d83a5f44773bd9c6c-14" href="https://cobra.pdes-net.org/posts/ich-glotz-tv.html#rest_code_c6129af31b474b1d83a5f44773bd9c6c-14"&gt;&lt;/a&gt;
&lt;a id="rest_code_c6129af31b474b1d83a5f44773bd9c6c-15" name="rest_code_c6129af31b474b1d83a5f44773bd9c6c-15" href="https://cobra.pdes-net.org/posts/ich-glotz-tv.html#rest_code_c6129af31b474b1d83a5f44773bd9c6c-15"&gt;&lt;/a&gt;&lt;span class="c1"&gt;# Basic formatting&lt;/span&gt;
&lt;a id="rest_code_c6129af31b474b1d83a5f44773bd9c6c-16" name="rest_code_c6129af31b474b1d83a5f44773bd9c6c-16" href="https://cobra.pdes-net.org/posts/ich-glotz-tv.html#rest_code_c6129af31b474b1d83a5f44773bd9c6c-16"&gt;&lt;/a&gt;sed&lt;span class="w"&gt; &lt;/span&gt;-i&lt;span class="w"&gt; &lt;/span&gt;-e&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s1"&gt;'N;s/:\n/ /'&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;-e&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s1"&gt;'s/^/FALSE /'&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;channellist.txt
&lt;a id="rest_code_c6129af31b474b1d83a5f44773bd9c6c-17" name="rest_code_c6129af31b474b1d83a5f44773bd9c6c-17" href="https://cobra.pdes-net.org/posts/ich-glotz-tv.html#rest_code_c6129af31b474b1d83a5f44773bd9c6c-17"&gt;&lt;/a&gt;sed&lt;span class="w"&gt; &lt;/span&gt;-i&lt;span class="w"&gt; &lt;/span&gt;-e&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"s/ARD Alpha/ARD.alpha/"&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;-e&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"s/ARD ONE/ARD.one/"&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;-e&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"s/MDR Sachsen/MDR/"&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;-e&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"s/BR Süd/BR/"&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;-e&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"s/NDR Hamburg/NDR/"&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;-e&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"s/RBB Berlin/RBB/"&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;-e&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"s/SWR BW/SWR/"&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;-e&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"s/WDR (Deutschland)/WDR/"&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;channellist.txt
&lt;a id="rest_code_c6129af31b474b1d83a5f44773bd9c6c-18" name="rest_code_c6129af31b474b1d83a5f44773bd9c6c-18" href="https://cobra.pdes-net.org/posts/ich-glotz-tv.html#rest_code_c6129af31b474b1d83a5f44773bd9c6c-18"&gt;&lt;/a&gt;
&lt;a id="rest_code_c6129af31b474b1d83a5f44773bd9c6c-19" name="rest_code_c6129af31b474b1d83a5f44773bd9c6c-19" href="https://cobra.pdes-net.org/posts/ich-glotz-tv.html#rest_code_c6129af31b474b1d83a5f44773bd9c6c-19"&gt;&lt;/a&gt;&lt;span class="c1"&gt;# Remove some redundant channels (optional, but beware they need formatting if included)&lt;/span&gt;
&lt;a id="rest_code_c6129af31b474b1d83a5f44773bd9c6c-20" name="rest_code_c6129af31b474b1d83a5f44773bd9c6c-20" href="https://cobra.pdes-net.org/posts/ich-glotz-tv.html#rest_code_c6129af31b474b1d83a5f44773bd9c6c-20"&gt;&lt;/a&gt;sed&lt;span class="w"&gt; &lt;/span&gt;-i&lt;span class="w"&gt; &lt;/span&gt;-e&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"/Tagesschau/d"&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;-e&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"/ARTE.FR/d"&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;-e&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"/ORF/d"&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;-e&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"/Brandenburg/d"&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;-e&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"/Anhalt/d"&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;-e&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"/Thüringen/d"&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;-e&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"/Mecklenburg-Vorpommern/d"&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;-e&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"/Niedersachsen/d"&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;-e&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"/Schleswig-Holstein/d"&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;-e&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"/Lokalzeit/d"&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;-e&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"/weltweit/d"&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;-e&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"/BR Nord/d"&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;-e&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"/SWR RP/d"&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;channellist.txt
&lt;a id="rest_code_c6129af31b474b1d83a5f44773bd9c6c-21" name="rest_code_c6129af31b474b1d83a5f44773bd9c6c-21" href="https://cobra.pdes-net.org/posts/ich-glotz-tv.html#rest_code_c6129af31b474b1d83a5f44773bd9c6c-21"&gt;&lt;/a&gt;
&lt;a id="rest_code_c6129af31b474b1d83a5f44773bd9c6c-22" name="rest_code_c6129af31b474b1d83a5f44773bd9c6c-22" href="https://cobra.pdes-net.org/posts/ich-glotz-tv.html#rest_code_c6129af31b474b1d83a5f44773bd9c6c-22"&gt;&lt;/a&gt;&lt;span class="c1"&gt;#create oneliner for zenity&lt;/span&gt;
&lt;a id="rest_code_c6129af31b474b1d83a5f44773bd9c6c-23" name="rest_code_c6129af31b474b1d83a5f44773bd9c6c-23" href="https://cobra.pdes-net.org/posts/ich-glotz-tv.html#rest_code_c6129af31b474b1d83a5f44773bd9c6c-23"&gt;&lt;/a&gt;&lt;span class="nv"&gt;channel_list&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="k"&gt;$(&lt;/span&gt;paste&lt;span class="w"&gt; &lt;/span&gt;-s&lt;span class="w"&gt; &lt;/span&gt;-d&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s1"&gt;' '&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;channellist.txt&lt;span class="k"&gt;)&lt;/span&gt;
&lt;a id="rest_code_c6129af31b474b1d83a5f44773bd9c6c-24" name="rest_code_c6129af31b474b1d83a5f44773bd9c6c-24" href="https://cobra.pdes-net.org/posts/ich-glotz-tv.html#rest_code_c6129af31b474b1d83a5f44773bd9c6c-24"&gt;&lt;/a&gt;
&lt;a id="rest_code_c6129af31b474b1d83a5f44773bd9c6c-25" name="rest_code_c6129af31b474b1d83a5f44773bd9c6c-25" href="https://cobra.pdes-net.org/posts/ich-glotz-tv.html#rest_code_c6129af31b474b1d83a5f44773bd9c6c-25"&gt;&lt;/a&gt;&lt;span class="nv"&gt;stream_url&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="k"&gt;$(&lt;/span&gt;zenity&lt;span class="w"&gt; &lt;/span&gt;--list&lt;span class="w"&gt; &lt;/span&gt;--title&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"Live IPTV channels"&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;--text&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"Choose a channel:"&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;--radiolist&lt;span class="w"&gt;  &lt;/span&gt;--column&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;""&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;--column&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"Channel"&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;--column&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"URL"&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;--print-column&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="m"&gt;3&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nv"&gt;$channel_list&lt;/span&gt;&lt;span class="k"&gt;)&lt;/span&gt;
&lt;a id="rest_code_c6129af31b474b1d83a5f44773bd9c6c-26" name="rest_code_c6129af31b474b1d83a5f44773bd9c6c-26" href="https://cobra.pdes-net.org/posts/ich-glotz-tv.html#rest_code_c6129af31b474b1d83a5f44773bd9c6c-26"&gt;&lt;/a&gt;
&lt;a id="rest_code_c6129af31b474b1d83a5f44773bd9c6c-27" name="rest_code_c6129af31b474b1d83a5f44773bd9c6c-27" href="https://cobra.pdes-net.org/posts/ich-glotz-tv.html#rest_code_c6129af31b474b1d83a5f44773bd9c6c-27"&gt;&lt;/a&gt;&lt;span class="k"&gt;if&lt;/span&gt;&lt;span class="o"&gt;((&lt;/span&gt;&lt;span class="nv"&gt;$?&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;==&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="m"&gt;0&lt;/span&gt;&lt;span class="o"&gt;))&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="k"&gt;then&lt;/span&gt;
&lt;a id="rest_code_c6129af31b474b1d83a5f44773bd9c6c-28" name="rest_code_c6129af31b474b1d83a5f44773bd9c6c-28" href="https://cobra.pdes-net.org/posts/ich-glotz-tv.html#rest_code_c6129af31b474b1d83a5f44773bd9c6c-28"&gt;&lt;/a&gt;&lt;span class="w"&gt;        &lt;/span&gt;mpv&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="si"&gt;${&lt;/span&gt;&lt;span class="nv"&gt;stream_url&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt;
&lt;a id="rest_code_c6129af31b474b1d83a5f44773bd9c6c-29" name="rest_code_c6129af31b474b1d83a5f44773bd9c6c-29" href="https://cobra.pdes-net.org/posts/ich-glotz-tv.html#rest_code_c6129af31b474b1d83a5f44773bd9c6c-29"&gt;&lt;/a&gt;&lt;span class="w"&gt;        &lt;/span&gt;&lt;span class="nb"&gt;exec&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="si"&gt;${&lt;/span&gt;&lt;span class="nv"&gt;script_path&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="s2"&gt;/&lt;/span&gt;&lt;span class="si"&gt;${&lt;/span&gt;&lt;span class="nv"&gt;script_name&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt;
&lt;a id="rest_code_c6129af31b474b1d83a5f44773bd9c6c-30" name="rest_code_c6129af31b474b1d83a5f44773bd9c6c-30" href="https://cobra.pdes-net.org/posts/ich-glotz-tv.html#rest_code_c6129af31b474b1d83a5f44773bd9c6c-30"&gt;&lt;/a&gt;&lt;span class="k"&gt;else&lt;/span&gt;
&lt;a id="rest_code_c6129af31b474b1d83a5f44773bd9c6c-31" name="rest_code_c6129af31b474b1d83a5f44773bd9c6c-31" href="https://cobra.pdes-net.org/posts/ich-glotz-tv.html#rest_code_c6129af31b474b1d83a5f44773bd9c6c-31"&gt;&lt;/a&gt;&lt;span class="w"&gt;        &lt;/span&gt;&lt;span class="nb"&gt;echo&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"Leaving LiveTV"&lt;/span&gt;
&lt;a id="rest_code_c6129af31b474b1d83a5f44773bd9c6c-32" name="rest_code_c6129af31b474b1d83a5f44773bd9c6c-32" href="https://cobra.pdes-net.org/posts/ich-glotz-tv.html#rest_code_c6129af31b474b1d83a5f44773bd9c6c-32"&gt;&lt;/a&gt;&lt;span class="k"&gt;fi&lt;/span&gt;
&lt;/pre&gt;&lt;/div&gt;
&lt;div class="code"&gt;&lt;pre class="code python"&gt;&lt;a id="rest_code_ad69224b6803496194900c1a33e3536b-1" name="rest_code_ad69224b6803496194900c1a33e3536b-1" href="https://cobra.pdes-net.org/posts/ich-glotz-tv.html#rest_code_ad69224b6803496194900c1a33e3536b-1"&gt;&lt;/a&gt;&lt;span class="ch"&gt;#!/usr/bin/python&lt;/span&gt;
&lt;a id="rest_code_ad69224b6803496194900c1a33e3536b-2" name="rest_code_ad69224b6803496194900c1a33e3536b-2" href="https://cobra.pdes-net.org/posts/ich-glotz-tv.html#rest_code_ad69224b6803496194900c1a33e3536b-2"&gt;&lt;/a&gt;&lt;span class="c1"&gt;# -*- coding: utf-8 -*-&lt;/span&gt;
&lt;a id="rest_code_ad69224b6803496194900c1a33e3536b-3" name="rest_code_ad69224b6803496194900c1a33e3536b-3" href="https://cobra.pdes-net.org/posts/ich-glotz-tv.html#rest_code_ad69224b6803496194900c1a33e3536b-3"&gt;&lt;/a&gt;&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="nn"&gt;requests&lt;/span&gt;
&lt;a id="rest_code_ad69224b6803496194900c1a33e3536b-4" name="rest_code_ad69224b6803496194900c1a33e3536b-4" href="https://cobra.pdes-net.org/posts/ich-glotz-tv.html#rest_code_ad69224b6803496194900c1a33e3536b-4"&gt;&lt;/a&gt;&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="nn"&gt;json&lt;/span&gt;
&lt;a id="rest_code_ad69224b6803496194900c1a33e3536b-5" name="rest_code_ad69224b6803496194900c1a33e3536b-5" href="https://cobra.pdes-net.org/posts/ich-glotz-tv.html#rest_code_ad69224b6803496194900c1a33e3536b-5"&gt;&lt;/a&gt;
&lt;a id="rest_code_ad69224b6803496194900c1a33e3536b-6" name="rest_code_ad69224b6803496194900c1a33e3536b-6" href="https://cobra.pdes-net.org/posts/ich-glotz-tv.html#rest_code_ad69224b6803496194900c1a33e3536b-6"&gt;&lt;/a&gt;&lt;span class="c1"&gt;# see https://gist.github.com/Axel-Erfurt/5106f9bbef1fca1d63bb74a849607128&lt;/span&gt;
&lt;a id="rest_code_ad69224b6803496194900c1a33e3536b-7" name="rest_code_ad69224b6803496194900c1a33e3536b-7" href="https://cobra.pdes-net.org/posts/ich-glotz-tv.html#rest_code_ad69224b6803496194900c1a33e3536b-7"&gt;&lt;/a&gt;
&lt;a id="rest_code_ad69224b6803496194900c1a33e3536b-8" name="rest_code_ad69224b6803496194900c1a33e3536b-8" href="https://cobra.pdes-net.org/posts/ich-glotz-tv.html#rest_code_ad69224b6803496194900c1a33e3536b-8"&gt;&lt;/a&gt;&lt;span class="n"&gt;url&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;"https://raw.githubusercontent.com/mediathekview/MServer/master/dist/live-streams.json"&lt;/span&gt;
&lt;a id="rest_code_ad69224b6803496194900c1a33e3536b-9" name="rest_code_ad69224b6803496194900c1a33e3536b-9" href="https://cobra.pdes-net.org/posts/ich-glotz-tv.html#rest_code_ad69224b6803496194900c1a33e3536b-9"&gt;&lt;/a&gt;
&lt;a id="rest_code_ad69224b6803496194900c1a33e3536b-10" name="rest_code_ad69224b6803496194900c1a33e3536b-10" href="https://cobra.pdes-net.org/posts/ich-glotz-tv.html#rest_code_ad69224b6803496194900c1a33e3536b-10"&gt;&lt;/a&gt;&lt;span class="n"&gt;data&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;requests&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;get&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;url&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;text&lt;/span&gt;
&lt;a id="rest_code_ad69224b6803496194900c1a33e3536b-11" name="rest_code_ad69224b6803496194900c1a33e3536b-11" href="https://cobra.pdes-net.org/posts/ich-glotz-tv.html#rest_code_ad69224b6803496194900c1a33e3536b-11"&gt;&lt;/a&gt;
&lt;a id="rest_code_ad69224b6803496194900c1a33e3536b-12" name="rest_code_ad69224b6803496194900c1a33e3536b-12" href="https://cobra.pdes-net.org/posts/ich-glotz-tv.html#rest_code_ad69224b6803496194900c1a33e3536b-12"&gt;&lt;/a&gt;&lt;span class="n"&gt;js&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;json&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;loads&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;data&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;a id="rest_code_ad69224b6803496194900c1a33e3536b-13" name="rest_code_ad69224b6803496194900c1a33e3536b-13" href="https://cobra.pdes-net.org/posts/ich-glotz-tv.html#rest_code_ad69224b6803496194900c1a33e3536b-13"&gt;&lt;/a&gt;
&lt;a id="rest_code_ad69224b6803496194900c1a33e3536b-14" name="rest_code_ad69224b6803496194900c1a33e3536b-14" href="https://cobra.pdes-net.org/posts/ich-glotz-tv.html#rest_code_ad69224b6803496194900c1a33e3536b-14"&gt;&lt;/a&gt;&lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;parse_object_pairs&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;pairs&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
&lt;a id="rest_code_ad69224b6803496194900c1a33e3536b-15" name="rest_code_ad69224b6803496194900c1a33e3536b-15" href="https://cobra.pdes-net.org/posts/ich-glotz-tv.html#rest_code_ad69224b6803496194900c1a33e3536b-15"&gt;&lt;/a&gt;        &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="n"&gt;pairs&lt;/span&gt;
&lt;a id="rest_code_ad69224b6803496194900c1a33e3536b-16" name="rest_code_ad69224b6803496194900c1a33e3536b-16" href="https://cobra.pdes-net.org/posts/ich-glotz-tv.html#rest_code_ad69224b6803496194900c1a33e3536b-16"&gt;&lt;/a&gt;
&lt;a id="rest_code_ad69224b6803496194900c1a33e3536b-17" name="rest_code_ad69224b6803496194900c1a33e3536b-17" href="https://cobra.pdes-net.org/posts/ich-glotz-tv.html#rest_code_ad69224b6803496194900c1a33e3536b-17"&gt;&lt;/a&gt;&lt;span class="n"&gt;decoder&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;json&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;JSONDecoder&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;object_pairs_hook&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="n"&gt;parse_object_pairs&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;a id="rest_code_ad69224b6803496194900c1a33e3536b-18" name="rest_code_ad69224b6803496194900c1a33e3536b-18" href="https://cobra.pdes-net.org/posts/ich-glotz-tv.html#rest_code_ad69224b6803496194900c1a33e3536b-18"&gt;&lt;/a&gt;&lt;span class="n"&gt;obj&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;decoder&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;decode&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;data&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;a id="rest_code_ad69224b6803496194900c1a33e3536b-19" name="rest_code_ad69224b6803496194900c1a33e3536b-19" href="https://cobra.pdes-net.org/posts/ich-glotz-tv.html#rest_code_ad69224b6803496194900c1a33e3536b-19"&gt;&lt;/a&gt;
&lt;a id="rest_code_ad69224b6803496194900c1a33e3536b-20" name="rest_code_ad69224b6803496194900c1a33e3536b-20" href="https://cobra.pdes-net.org/posts/ich-glotz-tv.html#rest_code_ad69224b6803496194900c1a33e3536b-20"&gt;&lt;/a&gt;&lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="n"&gt;value&lt;/span&gt; &lt;span class="ow"&gt;in&lt;/span&gt; &lt;span class="n"&gt;obj&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;:]:&lt;/span&gt;
&lt;a id="rest_code_ad69224b6803496194900c1a33e3536b-21" name="rest_code_ad69224b6803496194900c1a33e3536b-21" href="https://cobra.pdes-net.org/posts/ich-glotz-tv.html#rest_code_ad69224b6803496194900c1a33e3536b-21"&gt;&lt;/a&gt;        &lt;span class="nb"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sa"&gt;f&lt;/span&gt;&lt;span class="s1"&gt;'&lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="n"&gt;value&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;][&lt;/span&gt;&lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;replace&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;" Livestream"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;""&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="s1"&gt;:&lt;/span&gt;&lt;span class="se"&gt;\n&lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="n"&gt;value&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;][&lt;/span&gt;&lt;span class="mi"&gt;8&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="s1"&gt;'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/pre&gt;&lt;/div&gt;</description><category>desktop</category><category>linux</category><guid>https://cobra.pdes-net.org/posts/ich-glotz-tv.html</guid><pubDate>Sun, 29 Jan 2023 14:00:13 GMT</pubDate></item><item><title>Units</title><link>https://cobra.pdes-net.org/posts/units.html</link><dc:creator>Cobra</dc:creator><description>&lt;p&gt;As a physicist, it is very useful to be able to perform calculations quickly, whether it is by pure mental arithmetic or on the back of an envelope. I'm immensely grateful for the training I've received in school that allows me to perform such calculations with relative ease. When I see my students struggling with even the most trivial of these calculations and having to rely on their smartphones to get a result, I get the impression that the education system is dismissing these skills as obsolete in our digital age. A big mistake, if you ask me.&lt;/p&gt;
&lt;p&gt;Don't get me wrong: when I need accurate results, I also resort to &lt;a class="reference external" href="https://cobra.pdes-net.org/posts/rpn.html"&gt;calculators&lt;/a&gt; or calculator apps on &lt;a class="reference external" href="https://cobra.pdes-net.org/posts/resistance-is-futile.html"&gt;Android&lt;/a&gt; or &lt;a class="reference external" href="https://cobra.pdes-net.org/posts/calculators.html"&gt;Arch&lt;/a&gt;. And as an added benefit, some of them handle not only numbers, but also the units. This is really helpful, because converting numerical results from all sorts of obscure units to SI is often necessary when consulting older references, and it's as tedious as it is frustrating - just look at the &lt;a class="reference external" href="https://en.wikipedia.org/wiki/Centimetre%E2%80%93gram%E2%80%93second_system_of_units"&gt;Wikipedia page of the cgs system&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;Apart from Mathematica, I know of three command-line programs (one of which, namely, qalc, is also available with a graphical user interface) for doing calculations with units: the veteran &lt;a class="reference external" href="https://www.gnu.org/software/units/"&gt;units,&lt;/a&gt; the modern &lt;a class="reference external" href="https://qalculate.github.io/"&gt;qalc,&lt;/a&gt; and the new and hip &lt;a class="reference external" href="https://insect.sh/"&gt;insect.&lt;/a&gt; Here's an example of these three tools dealing with the conversion of the surface tension (in N/m) of water to surface energy (in eV/Å²), which for a liquid is one and the same despite the different units.&lt;/p&gt;
&lt;a class="reference external image-reference" href="https://cobra.pdes-net.org/images/units.webp"&gt;
&lt;img alt="../images/units.webp" class="align-center" src="https://cobra.pdes-net.org/images/units.webp" style="width: 600px;"&gt;
&lt;/a&gt;</description><category>linux</category><category>mathematics</category><guid>https://cobra.pdes-net.org/posts/units.html</guid><pubDate>Sun, 19 Jun 2022 12:17:54 GMT</pubDate></item><item><title>Uptime</title><link>https://cobra.pdes-net.org/posts/uptime.html</link><dc:creator>Cobra</dc:creator><description>&lt;p&gt;This blog runs on a very affordable vServer hosted by netcup. For such low-end servers, no uptime guarantees are given by any hoster. Nevertheless, I always get mails whenever the server is down either for maintenance or because its temporarily out of order, and my feeling is that this happens only rarely. But just out of curiosity, I'd like to know what the actual uptime is.&lt;/p&gt;
&lt;p&gt;A two page article in c't 26/2021 introduced me to uptime-kuma, which seemed to fit nicely what I was looking for. The only part I didn't like was the statement “Der einfachste und schnellste Weg Uptime-Kuma zu installieren, führt über Docker und Docker-Compose” followed by an installation procedure that I would call anything else then simple and fast. Fortunately, this statement applies only to the distributions favored by the c't. On Arch, the following two commands install and start uptime-kuma as a service:&lt;/p&gt;
&lt;pre class="literal-block"&gt;yay -S uptime-kuma
systemctl enable --now uptime-kuma.service&lt;/pre&gt;
&lt;p&gt;After configuring the services to monitor and a day of collecting data, their uptime status is displayed on &lt;a class="reference external" href="https://localhost/3001"&gt;https://localhost/3001&lt;/a&gt; as shown below for the web and IRC servers on pdes-net.org:&lt;/p&gt;
&lt;a class="reference external image-reference" href="https://cobra.pdes-net.org/images/kuma1.webp"&gt;
&lt;img alt="../images/kuma1.webp" class="align-center" src="https://cobra.pdes-net.org/images/kuma1.webp" style="width: 800px;"&gt;
&lt;/a&gt;
&lt;div class="line-block"&gt;
&lt;div class="line"&gt;&lt;br&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;a class="reference external image-reference" href="https://cobra.pdes-net.org/images/kuma2.webp"&gt;
&lt;img alt="../images/kuma2.webp" class="align-center" src="https://cobra.pdes-net.org/images/kuma2.webp" style="width: 800px;"&gt;
&lt;/a&gt;
&lt;div class="line-block"&gt;
&lt;div class="line"&gt;&lt;br&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;a class="reference external image-reference" href="https://cobra.pdes-net.org/images/kuma3.webp"&gt;
&lt;img alt="../images/kuma3.webp" class="align-center" src="https://cobra.pdes-net.org/images/kuma3.webp" style="width: 800px;"&gt;
&lt;/a&gt;</description><category>desktop</category><category>linux</category><category>web</category><guid>https://cobra.pdes-net.org/posts/uptime.html</guid><pubDate>Sun, 01 May 2022 13:41:26 GMT</pubDate></item><item><title>Too many meetings</title><link>https://cobra.pdes-net.org/posts/too-many-meetings.html</link><dc:creator>Cobra</dc:creator><description>&lt;p&gt;The number of meetings I'm requested to attend has increased by roughly a factor of five over the last two decades. Instead of five meetings per week I'm currently having five per day on average. It thus doesn't come as a surprise that I depend on an electronic calendar to organize and get reminded of all these appointments.&lt;/p&gt;
&lt;p&gt;On my desktops, I'm using the integrated calendar of &lt;a class="reference external" href="https://en.wikipedia.org/wiki/GNOME_Evolution"&gt;evolution&lt;/a&gt; since seven years. Over the time, this implementation of a PIM for the Gnome desktop has proven itself to be reliable and stable, in contrast to &lt;a class="reference external" href="https://en.wikipedia.org/wiki/Kontact"&gt;Kontact&lt;/a&gt;, its KDE counterpart I've &lt;a class="reference external" href="https://cobra.pdes-net.org/posts/revolution.html"&gt;tried to use before&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;In any case, having a calendar on my desktops is not sufficient anymore, as future appointments are typically arranged after Zoom meetings that I usually attend with my &lt;a class="reference external" href="https://cobra.pdes-net.org/posts/maxi.html"&gt;notebook&lt;/a&gt;. And even that is not enough: I may want to check my appointments on a whim in the middle of the night, where only my &lt;a class="reference external" href="https://cobra.pdes-net.org/posts/resistance-is-futile.html"&gt;smartphone&lt;/a&gt; is immediately accessible. In either case, I do not need a full-blown PIM, but just a calendar client synchronizing with both owncloud/nextcloud and zimbra.&lt;/p&gt;
&lt;p&gt;On Linux/GTK, I thought that &lt;a class="reference external" href="https://www.linuxadictos.com/en/la-aplicacion-de-calendarios-de-gnome-empieza-el-2020-bien-organizado.html"&gt;gnome-calendar&lt;/a&gt; would be the natural candidate with this functionality. To my surprise it's straightforward to add an owncloud/nextcloud account with the associated calendar, but zimbra is not part of the online account collection of Gnome, nor is a generic CalDAV server. I found that almost impossible to believe, but it's in fact a &lt;a class="reference external" href="https://gitlab.gnome.org/GNOME/gnome-online-accounts/-/issues/1"&gt;longstanding bug&lt;/a&gt; (eight years!) that has still to be acknowledged and addressed by the developers. Fortunately, there's a simple workaround: after installing evolution and adding the zimbra CalDAV server there, it also shows up in gnome-calendar. Apart from this issue, gnome-calendar delivers exactly what I wanted.&lt;/p&gt;
&lt;p&gt;This entire affair is a whole lot easier on Android. &lt;a class="reference external" href="https://f-droid.org/en/packages/at.bitfire.davdroid/"&gt;Davx5&lt;/a&gt; available on F-Droid provides a convenient backend for any number of CalDAV servers, and any calendar app will serve as frontend. It works just as well as gnome-calendar on my notebook, but without any unexpected obstacles during the configuration of the calendars.&lt;/p&gt;
&lt;p&gt;I'm now reminded of outstanding appointments wherever I walk and talk. That's progess! Or is it?&lt;/p&gt;</description><category>desktop</category><category>linux</category><category>web</category><guid>https://cobra.pdes-net.org/posts/too-many-meetings.html</guid><pubDate>Sun, 13 Mar 2022 13:01:13 GMT</pubDate></item><item><title>Upgrading virtualenvs in fish</title><link>https://cobra.pdes-net.org/posts/upgrading-virtualenvs-in-fish.html</link><dc:creator>Cobra</dc:creator><description>&lt;p&gt;Python major version upgrades such as the one from 3.9 to 3.10 a few weeks ago require rebuilding any virtual environments created earlier. The &lt;a class="reference external" href="https://cobra.pdes-net.org/posts/a-one-liner-to-upgrade-your-virtualenvs.html#"&gt;generic one-liner I gave in an earlier post&lt;/a&gt; works in all shells, but as an avid user of the &lt;a class="reference external" href="https://cobra.pdes-net.org/posts/seafood.html"&gt;fish shell&lt;/a&gt;, I'm of course employing &lt;a class="reference external" href="https://virtualfish.readthedocs.io/en/latest/index.html"&gt;virtualfish&lt;/a&gt; for managing my virtual environments. And &lt;a class="reference external" href="https://virtualfish.readthedocs.io/en/latest/usage.html#upgrading-virtual-environments"&gt;upgrading&lt;/a&gt; them in fish is even easier than with the one-liner above:&lt;/p&gt;
&lt;pre class="literal-block"&gt;vf upgrade --rebuild&lt;/pre&gt;
&lt;p&gt;Prior to that, one also needs to rebuild the virtualfish for the python version upgrade:&lt;/p&gt;
&lt;pre class="literal-block"&gt;yay --rebuild -S virtualfish&lt;/pre&gt;
&lt;p&gt;Afterwards, one can see to the update of the content of the virtualenv as documented in my &lt;a class="reference external" href="https://cobra.pdes-net.org/posts/a-one-liner-to-upgrade-your-virtualenvs.html#"&gt;earlier post&lt;/a&gt;. Compared to the entire recreation of the virtualenv, this whole procedure is as painless as fast – which makes the whole concept of virtualenvs an eminently practical one.&lt;/p&gt;</description><category>linux</category><category>presentations</category><category>web</category><guid>https://cobra.pdes-net.org/posts/upgrading-virtualenvs-in-fish.html</guid><pubDate>Wed, 29 Dec 2021 15:55:32 GMT</pubDate></item></channel></rss>