<?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>why = WHY_NOT;</title><link>https://blog.svedr.in/</link><description>Computers, Python and other stuff</description><atom:link href="https://blog.svedr.in/rss.xml" rel="self" type="application/rss+xml"></atom:link><language>en</language><lastBuildDate>Sun, 15 Feb 2026 11:29:07 GMT</lastBuildDate><generator>Nikola (getnikola.com)</generator><docs>http://blogs.law.harvard.edu/tech/rss</docs><item><title>Code folding with Regions in Python using Kate</title><link>https://blog.svedr.in/posts/code-folding-with-regions-in-python-using-kate/</link><dc:creator>Svedrin</dc:creator><description>&lt;div&gt;&lt;p&gt;I once again ended up having to edit a somewhat large Python file.
Since I don’t believe in Clean Code’s methodology of splitting things up
into thousands of micro-functions and then having to pass tons of
variables around as arguments all the time, I’m actually happy with
that. Also it’s kinda what code folding was invented for. Unfortunately
I usually don’t find it all that helpful, because it doesn’t fold the
way I want it to.&lt;/p&gt;
&lt;p&gt;I like what C# does with &lt;code&gt;#region&lt;/code&gt; and
&lt;code&gt;#endregion&lt;/code&gt;, where you can freely define a section of code
to be folded away, exactly how it makes sense to &lt;em&gt;you&lt;/em&gt; the human,
who this feature is designed for, rather than the machine that gets to
execute the code and thinks in different patterns than you do.&lt;/p&gt;
&lt;p&gt;So, I found a way to enable Kate to do this in Python. Here’s
how.&lt;/p&gt;
&lt;p&gt;&lt;a href="https://blog.svedr.in/posts/code-folding-with-regions-in-python-using-kate/"&gt;Read more…&lt;/a&gt; (1 min remaining to read)&lt;/p&gt;&lt;/div&gt;</description><category>programming</category><guid>https://blog.svedr.in/posts/code-folding-with-regions-in-python-using-kate/</guid><pubDate>Fri, 13 Feb 2026 21:30:11 GMT</pubDate></item><item><title>Migrating from sqlite to MariaDB</title><link>https://blog.svedr.in/posts/migrating-from-sqlite-to-mariadb/</link><dc:creator>Svedrin</dc:creator><description>&lt;div&gt;&lt;p&gt;Here’s a clean way to migrate an SQLite DB to MariaDB.&lt;/p&gt;
&lt;p&gt;&lt;a href="https://blog.svedr.in/posts/migrating-from-sqlite-to-mariadb/"&gt;Read more…&lt;/a&gt; (1 min remaining to read)&lt;/p&gt;&lt;/div&gt;</description><category>databases</category><guid>https://blog.svedr.in/posts/migrating-from-sqlite-to-mariadb/</guid><pubDate>Sun, 28 Dec 2025 14:31:07 GMT</pubDate></item><item><title>Configuring a VXLAN interface on a Linux machine</title><link>https://blog.svedr.in/posts/configuring-a-vxlan-interface-on-a-linux-machine/</link><dc:creator>Svedrin</dc:creator><description>&lt;div&gt;&lt;p&gt;Sometimes you’d like to span a layer2 network across two locations,
but you don’t want to (or can’t) use VLANs. An excellent alternative in
this situation is VXLAN, which transports the payload traffic via
standard ole UDP packets on port 4789. This works easily with unmanaged
switches (or switches you don’t have admin access to), and can even be
routed across other networks or VPNs. Here’s how to set things up
between two Linux boxes, and a FortiGate firewall to top it off.&lt;/p&gt;
&lt;p&gt;&lt;a href="https://blog.svedr.in/posts/configuring-a-vxlan-interface-on-a-linux-machine/"&gt;Read more…&lt;/a&gt; (6 min remaining to read)&lt;/p&gt;&lt;/div&gt;</description><category>linux</category><category>networking</category><guid>https://blog.svedr.in/posts/configuring-a-vxlan-interface-on-a-linux-machine/</guid><pubDate>Sun, 23 Jun 2024 10:04:03 GMT</pubDate></item><item><title>Running Path MTU Discovery from Windows</title><link>https://blog.svedr.in/posts/running-path-mtu-discovery-from-windows/</link><dc:creator>Svedrin</dc:creator><description>&lt;div&gt;&lt;p&gt;When debugging network connectivity issues, sometimes it would be
helpful to know what’s the largest packet that can be transferred from
one host to another without being fragmented. This is especially helpful
when Jumbo Frames or VPNs are involved. The method to find this size is
called &lt;a href="https://en.wikipedia.org/wiki/Path_MTU_Discovery"&gt;Path
MTU Discovery&lt;/a&gt; (PMTUD). It is performed by your OS of choice in the
background, but you can also do it manually. In Linux this is easily
done, but it’s also possible from Windows. Here’s how.&lt;/p&gt;
&lt;p&gt;&lt;a href="https://blog.svedr.in/posts/running-path-mtu-discovery-from-windows/"&gt;Read more…&lt;/a&gt; (3 min remaining to read)&lt;/p&gt;&lt;/div&gt;</description><category>linux</category><category>networking</category><category>windows</category><guid>https://blog.svedr.in/posts/running-path-mtu-discovery-from-windows/</guid><pubDate>Thu, 18 Apr 2024 08:49:25 GMT</pubDate></item><item><title>A nicer way to access Windows file servers from Linux</title><link>https://blog.svedr.in/posts/a-nicer-way-to-access-windows-file-servers-from-linux/</link><dc:creator>Svedrin</dc:creator><description>&lt;div&gt;&lt;p&gt;I recently came across &lt;a href="https://manpages.ubuntu.com/manpages/trusty/man1/smbnetfs.1.html"&gt;smbnetfs&lt;/a&gt;.
Initially I had only been looking for a way to mount a Windows file
share from userspace, so that I wouldn’t have to deal with permissions
for my non-root user accessing a mountpoint. smbnetfs can do a lot more
than just that though: It gives you the equivalent of Windows’s
“Network” feature, allowing you to access the whole network via a single
mount. Since the documentation is a bit sparse, here’s how I set it
up.&lt;/p&gt;
&lt;p&gt;&lt;a href="https://blog.svedr.in/posts/a-nicer-way-to-access-windows-file-servers-from-linux/"&gt;Read more…&lt;/a&gt; (1 min remaining to read)&lt;/p&gt;&lt;/div&gt;</description><category>directory</category><guid>https://blog.svedr.in/posts/a-nicer-way-to-access-windows-file-servers-from-linux/</guid><pubDate>Wed, 20 Mar 2024 19:02:20 GMT</pubDate></item><item><title>Sysadmin Life Hack: Syslog and NodeRed, a match made in heaven</title><link>https://blog.svedr.in/posts/sysadmin-life-hack-syslog-and-nodered-a-match-made-in-heaven/</link><dc:creator>Svedrin</dc:creator><description>&lt;div&gt;&lt;p&gt;I recently wanted to react to events detected by some obscure
hardware monitoring device, using NodeRED. I was not exactly sure how to
achieve this, because the device doesn’t really offer any method of
accessing it via an API or something. Of course these devices often can
send mail or SNMP traps, but I didn’t want to involve a mail server or
deal with OIDs, so I kept looking for a different solution.&lt;/p&gt;
&lt;p&gt;Another protocol that is actually quite widely supported is syslog.
Since I had a &lt;code&gt;syslog-ng&lt;/code&gt; instance running to send logs to
Loki, I wondered if it would be possible to also send the logs to MQTT.
Indeed this works, and it allowed me to implement my use-case quite
easily. But ever since, I kept finding new applications for this: The
syslog protocol is ubiquitous, and even the cheapest routers support
it.&lt;/p&gt;
&lt;p&gt;I’m going to lay out a few details on how it works.&lt;/p&gt;
&lt;p&gt;&lt;a href="https://blog.svedr.in/posts/sysadmin-life-hack-syslog-and-nodered-a-match-made-in-heaven/"&gt;Read more…&lt;/a&gt; (2 min remaining to read)&lt;/p&gt;&lt;/div&gt;</description><category>linux</category><category>networking</category><guid>https://blog.svedr.in/posts/sysadmin-life-hack-syslog-and-nodered-a-match-made-in-heaven/</guid><pubDate>Sat, 24 Feb 2024 20:18:15 GMT</pubDate></item><item><title>Dump all Ansible hostvars for a host</title><link>https://blog.svedr.in/posts/dump-all-ansible-hostvars-for-a-host/</link><dc:creator>Svedrin</dc:creator><description>&lt;div&gt;&lt;p&gt;If you want to dump all the hostvars for an Ansible host, try
this:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;ansible -i inventory -m command -a "echo \"{{ hostvars | to_nice_json }}\"" yourhost&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;a href="https://blog.svedr.in/posts/dump-all-ansible-hostvars-for-a-host/"&gt;Read more…&lt;/a&gt; (1 min remaining to read)&lt;/p&gt;&lt;/div&gt;</description><category>linux</category><guid>https://blog.svedr.in/posts/dump-all-ansible-hostvars-for-a-host/</guid><pubDate>Wed, 17 Mar 2021 12:41:12 GMT</pubDate></item><item><title>Running the nextcloud client under systemd</title><link>https://blog.svedr.in/posts/running-the-nextcloud-client-under-systemd/</link><dc:creator>Svedrin</dc:creator><description>&lt;div&gt;&lt;p&gt;Since my nextcloud sync client kept crashing due to &lt;a href="https://help.nextcloud.com/t/desktop-app-too-many-files-open/85084"&gt;too
many open files&lt;/a&gt;, I wanted to have something auto-restart it. Also, I
recently stumbled across the awesome fact that nowadays, every Linux
Desktop session also includes its very own systemd user instance, so I
put the nextcloud client under its supervision. Here’s how.&lt;/p&gt;
&lt;p&gt;&lt;a href="https://blog.svedr.in/posts/running-the-nextcloud-client-under-systemd/"&gt;Read more…&lt;/a&gt; (1 min remaining to read)&lt;/p&gt;&lt;/div&gt;</description><category>linux</category><guid>https://blog.svedr.in/posts/running-the-nextcloud-client-under-systemd/</guid><pubDate>Tue, 02 Feb 2021 09:15:01 GMT</pubDate></item><item><title>Ceph Bluestore/Filestore latency</title><link>https://blog.svedr.in/posts/ceph-BluestoreFilestore-latency/</link><dc:creator>Svedrin</dc:creator><description>&lt;div&gt;&lt;p&gt;We’ve been looking deeply into Ceph Storage latency, comparing
BlueStore and FileStore, and looking at methods how to get below the
magic 2ms write latency mark in our Proxmox clusters. Here’s what we
found.&lt;/p&gt;
&lt;p&gt;The endeavour was sparked by our desire to run ZooKeeper on our
Proxmox Clusters. ZooKeeper is highly sensitive to IO latency: If writes
are too slow, it will log messages like this one:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;fsync-ing the write ahead log in SyncThread:1 took 1376ms which will adversely effect operation latency.File size is 67108880 bytes. See the ZooKeeper troubleshooting guide&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Subsequently, ZooKeeper nodes will consider themselves broken and
restart. If the thing that’s slow is your Ceph cluster, this means that
all three VMs will be affected at the same time, and you’ll end up
losing your ZooKeeper cluster altogether.&lt;/p&gt;
&lt;p&gt;We mitigated this by moving ZooKeeper to local disks, and getting rid
of the Ceph layer in between. But that is obviously not a satisfactory
solution, so we’ve spent some time looking into Ceph latency.&lt;/p&gt;
&lt;p&gt;Unfortunately, there’s not a lot of advice to be found other than
“buy faster disks”. This didn’t seem to cut it for us: Our hosts were
reporting 0.1ms of disk latency, while the VMs measured 2ms of latency.
If our hosts had weighed in at 1.8ms, I’d be willing to believe that we
have a disk latency issue - but not with the discrepancy that we were
seeing. So let’s dive in and see if we can find other issues.&lt;/p&gt;
&lt;p&gt;&lt;a href="https://blog.svedr.in/posts/ceph-BluestoreFilestore-latency/"&gt;Read more…&lt;/a&gt; (11 min remaining to read)&lt;/p&gt;&lt;/div&gt;</description><category>linux</category><category>storage</category><category>virtualization</category><guid>https://blog.svedr.in/posts/ceph-BluestoreFilestore-latency/</guid><pubDate>Mon, 01 Feb 2021 10:08:06 GMT</pubDate></item><item><title>Enforcing correct DNS upstreams for internal zones</title><link>https://blog.svedr.in/posts/enforcing-correct-dns-upstreams-for-internal-zones/</link><dc:creator>Svedrin</dc:creator><description>&lt;div&gt;&lt;p&gt;When you’re frequently working with internal DNS zones of a company
whose DNS server sits behind a VPN, you’ll probably soon encounter DNS
shenanigans where you’ll find that resolving internal domain names is a
lot more tricky than it should be. I’ve found a way that works using
&lt;code&gt;dnsmasq&lt;/code&gt;, but I also found that you need to be careful to
keep an overly-eager NetworkManager in check.&lt;/p&gt;
&lt;p&gt;&lt;a href="https://blog.svedr.in/posts/enforcing-correct-dns-upstreams-for-internal-zones/"&gt;Read more…&lt;/a&gt; (2 min remaining to read)&lt;/p&gt;&lt;/div&gt;</description><category>linux</category><guid>https://blog.svedr.in/posts/enforcing-correct-dns-upstreams-for-internal-zones/</guid><pubDate>Mon, 12 Oct 2020 08:28:34 GMT</pubDate></item></channel></rss>