1
0
Fork 0
You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
blog/output/feeds/all.atom.xml

596 lines
42 KiB
XML

2 years ago
<?xml version="1.0" encoding="utf-8"?>
9 months ago
<feed xmlns="http://www.w3.org/2005/Atom"><title>LEdoian's Blog</title><link href="https://blog.ledoian.cz/" rel="alternate"></link><link href="https://blog.ledoian.cz/feeds/all.atom.xml" rel="self"></link><id>https://blog.ledoian.cz/</id><updated>2024-02-17T16:55:00+01:00</updated><entry><title>How to convert CBZ to PDF</title><link href="https://blog.ledoian.cz/cbz-to-pdf.html" rel="alternate"></link><published>2024-02-17T16:55:00+01:00</published><updated>2024-02-17T16:55:00+01:00</updated><author><name>LEdoian</name></author><id>tag:blog.ledoian.cz,2024-02-17:/cbz-to-pdf.html</id><summary type="html">&lt;ol class="arabic simple"&gt;
&lt;li&gt;Extract the archive (cbz is just a zip, cbr is a rar, …)&lt;/li&gt;
&lt;li&gt;&lt;dl class="first docutils"&gt;
&lt;dt&gt;Convert individual pictures to PDF using &lt;tt class="docutils literal"&gt;img2pdf&lt;/tt&gt;&lt;/dt&gt;
&lt;dd&gt;&lt;ul class="first last"&gt;
&lt;li&gt;Many other ways including &lt;tt class="docutils literal"&gt;convert&lt;/tt&gt; from ImageMagick tend to do weird stuff like breaking aspect ratios or adding margins&lt;/li&gt;
&lt;/ul&gt;
&lt;/dd&gt;
&lt;/dl&gt;
&lt;/li&gt;
&lt;li&gt;Merge files into the single PDF, e.g. using &lt;tt class="docutils literal"&gt;qpdf &lt;span class="pre"&gt;--empty&lt;/span&gt; &lt;span class="pre"&gt;--pages …&lt;/span&gt;&lt;/tt&gt;&lt;/li&gt;&lt;/ol&gt;</summary><content type="html">&lt;ol class="arabic simple"&gt;
&lt;li&gt;Extract the archive (cbz is just a zip, cbr is a rar, …)&lt;/li&gt;
&lt;li&gt;&lt;dl class="first docutils"&gt;
&lt;dt&gt;Convert individual pictures to PDF using &lt;tt class="docutils literal"&gt;img2pdf&lt;/tt&gt;&lt;/dt&gt;
&lt;dd&gt;&lt;ul class="first last"&gt;
&lt;li&gt;Many other ways including &lt;tt class="docutils literal"&gt;convert&lt;/tt&gt; from ImageMagick tend to do weird stuff like breaking aspect ratios or adding margins&lt;/li&gt;
&lt;/ul&gt;
&lt;/dd&gt;
&lt;/dl&gt;
&lt;/li&gt;
&lt;li&gt;Merge files into the single PDF, e.g. using &lt;tt class="docutils literal"&gt;qpdf &lt;span class="pre"&gt;--empty&lt;/span&gt; &lt;span class="pre"&gt;--pages&lt;/span&gt; *.pdf &lt;span class="pre"&gt;--&lt;/span&gt; output.pdf&lt;/tt&gt;.&lt;/li&gt;
&lt;/ol&gt;
&lt;div class="section" id="references"&gt;
&lt;h2&gt;References&lt;/h2&gt;
&lt;ul class="simple"&gt;
&lt;li&gt;&lt;a class="reference external" href="https://askubuntu.com/questions/207172/how-to-convert-cbr-to-pdf"&gt;https://askubuntu.com/questions/207172/how-to-convert-cbr-to-pdf&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a class="reference external" href="https://superuser.com/questions/497293/how-to-convert-calibre-cbr-to-pdf-format-in-linux"&gt;https://superuser.com/questions/497293/how-to-convert-calibre-cbr-to-pdf-format-in-linux&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/div&gt;
&lt;div class="section" id="why"&gt;
&lt;h2&gt;Why&lt;/h2&gt;
&lt;p&gt;My eBook reader (PocketBook Touch Lux) does not seem to be able to handle cbz.&lt;/p&gt;
&lt;/div&gt;
</content><category term="til"></category><category term="comics"></category><category term="software"></category></entry><entry><title>Do not forget about IPv6 DNS</title><link href="https://blog.ledoian.cz/forgetting-dns6.html" rel="alternate"></link><published>2024-01-24T03:20:00+01:00</published><updated>2024-01-24T03:20:00+01:00</updated><author><name>LEdoian</name></author><id>tag:blog.ledoian.cz,2024-01-24:/forgetting-dns6.html</id><summary type="html">&lt;p&gt;Do you think IPv6-only internet works OK? I am going to tell you that it does
10 months ago
not, but it is not immediately visible. TL;DR: The internet can be broken also
by forgetting to add AAAA records of the &lt;em&gt;nameservers&lt;/em&gt;. This creates IPv4
requirement for the resolving even when the …&lt;/p&gt;</summary><content type="html">&lt;p&gt;Do you think IPv6-only internet works OK? I am going to tell you that it does
not, but it is not immediately visible. TL;DR: The internet can be broken also
by forgetting to add AAAA records of the &lt;em&gt;nameservers&lt;/em&gt;. This creates IPv4
requirement for the resolving even when the target is reachable using IPv6.&lt;/p&gt;
&lt;div class="section" id="quick-recap"&gt;
&lt;h2&gt;Quick recap&lt;/h2&gt;
&lt;p&gt;Connecting to a website is easy, right? You type in the name, you get the front page.&lt;/p&gt;
&lt;div class="figure"&gt;
&lt;object data="https://blog.ledoian.cz/images/forgetting-dns6/image1.svg" style="width: 50%;" type="image/svg+xml"&gt;&lt;/object&gt;
&lt;p class="caption"&gt;This is a very naïve idea of connecting to a server.&lt;/p&gt;
&lt;/div&gt;
&lt;p&gt;OK, it is a bit harder: the computer needs an IP address, so we need to use
this magic box called DNS. The flow looks something like this:&lt;/p&gt;
&lt;div class="figure"&gt;
&lt;object data="https://blog.ledoian.cz/images/forgetting-dns6/image2.svg" style="width: 50%;" type="image/svg+xml"&gt;&lt;/object&gt;
&lt;p class="caption"&gt;Slightly better, now we at least know the machine-readable address.&lt;/p&gt;
&lt;/div&gt;
&lt;p&gt;And for IPv6-only everything on the picture has to have IPv6 connectivity and AAAA DNS records.&lt;/p&gt;
&lt;div class="section" id="reaching-ipv4-land-from-ipv6-only"&gt;
&lt;h3&gt;Reaching IPv4 land from IPv6-only&lt;/h3&gt;
&lt;p&gt;There are few^H^H^Hmany sites that still only support IPv4. To reach them, we
need someone who can reach both the IPv4- and IPv6-land to go there on our
behalf a proxy. This proxy can be ad-hoc (I often use &lt;tt class="docutils literal"&gt;ssh &lt;span class="pre"&gt;-D&lt;/span&gt;&lt;/tt&gt;) or there
are well-known protocols like NAT64 with DNS64 to do that in a standard and
lightweight manner. &lt;a class="footnote-reference" href="#nat44" id="footnote-reference-1"&gt;[1]&lt;/a&gt;
In that case, the connection looks like this:&lt;/p&gt;
&lt;div class="figure"&gt;
&lt;object data="https://blog.ledoian.cz/images/forgetting-dns6/image3.svg" style="width: 100%;" type="image/svg+xml"&gt;&lt;/object&gt;
&lt;p class="caption"&gt;And now we can reach the whole internet.&lt;/p&gt;
&lt;/div&gt;
&lt;p&gt;You might already know that you need some workaround like this to reach GitHub.
What I think you might not know, you need similar workaround to reach the Wikipedia.&lt;/p&gt;
&lt;p&gt;Disclaimer: I like Wikipedia and this is not meant to shame them, just use as
an example. I am aware of several other sites suffering from the same problem,
including at least one IPv6 test. &lt;a class="footnote-reference" href="#test-aaaa" id="footnote-reference-2"&gt;[2]&lt;/a&gt; (It would be nice if they added
the missing piece in the puzzle, though.)&lt;/p&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div class="section" id="enter-dns"&gt;
&lt;h2&gt;Enter DNS&lt;/h2&gt;
&lt;p&gt;Our picture has one unexplored magic box: the DNS. As per the definition (which
I just made up and was not bothered to even fully formulate):&lt;/p&gt;
&lt;blockquote&gt;
yada yada distributed database of records attached to the strings domain
names. The records hold various information about the domain depending on the type.&lt;/blockquote&gt;
&lt;p&gt;There are three interesting types of records: A records give IPv4 addresses,
AAAA give IPv6 addresses and NS give names of servers who know about the
particular subtree of the database. And to actually resolve the final AAAA
record the (recursive) resolver starts at the &lt;em&gt;root zone&lt;/em&gt; and tries to find
the answer. &lt;a class="footnote-reference" href="#dns-simplification" id="footnote-reference-3"&gt;[3]&lt;/a&gt; The resolution algorithm can be visualised like this:&lt;/p&gt;
&lt;div class="figure"&gt;
&lt;object data="https://blog.ledoian.cz/images/forgetting-dns6/image4.svg" style="width: 100%;" type="image/svg+xml"&gt;&lt;/object&gt;
&lt;p class="caption"&gt;Yeah, it's a mess.&lt;/p&gt;
&lt;/div&gt;
&lt;p&gt;There is one extra tricky bit: the NS records contain &lt;em&gt;names&lt;/em&gt;, not addresses,
so when resolving we need &lt;em&gt;two&lt;/em&gt; queries for each layer (very simplified):
first we ask for the final domain (&lt;tt class="docutils literal"&gt;blog.ledoian.cz&lt;/tt&gt;) and get a NS record
(when the server does not have the answer) and then we need to ask for the A or
AAAA record of the name from that record, so that we can connect to the server
mentioned in the NS record. (This allows a nameserver to be made redundant
and/or reside on other types of network.)&lt;/p&gt;
&lt;p&gt;You might start to see the issue. When the DNS was just a black box, we could
paint the whole picture green and call it a day. And from the regular user's
point of view, that is the case, just use some public DNS like 1.1.1.1, 8.8.8.8
or 9.9.9.9. Oh, right, I meant these easy-to-remember addresses:
2606:4700:4700::1111, 2001:4860:4860::8888 and 2620:fe::fe, respectively. The
point is, they will give you the answer because they are dual-stack, not IPv6-only.&lt;/p&gt;
&lt;p&gt;In a way, those servers (or other dual-stack resolvers) act like another proxy,
similar to the SSH, NAT64 and NAT44 ones mentioned earlier. This may not be
much of a problem for many people. But if you have any reason to use your own
recursive DNS server (privacy reasons, DNSSEC validation, ISP provides bad
service, you are the ISP, …) &lt;em&gt;inside&lt;/em&gt; an IPv6-only network, you &lt;em&gt;will&lt;/em&gt; have
issues. &lt;a class="footnote-reference" href="#dns-behind-nat64" id="footnote-reference-4"&gt;[4]&lt;/a&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;div class="section" id="example-wikipedia"&gt;
&lt;h2&gt;Example: Wikipedia&lt;/h2&gt;
&lt;p&gt;Let's now see this in action. You know Wikipedia, right? And you can reach
Wikipedia on IPv6, right? It has an AAAA record (don't mind the CNAME, that
means that the server is really called some other way):&lt;/p&gt;
&lt;pre class="literal-block"&gt;
$ dig en.wikipedia.org AAAA
[…]
en.wikipedia.org. 18737 IN CNAME dyna.wikimedia.org.
dyna.wikimedia.org. 323 IN AAAA 2a02:ec80:600:ed1a::1
&lt;/pre&gt;
&lt;p&gt;And this record does work:&lt;/p&gt;
&lt;pre class="literal-block"&gt;
$ ncat --ssl 2a02:ec80:600:ed1a::1 443 &amp;lt;&amp;lt;GO
GET /wiki/Main_Page HTTP/1.1
Host: en.wikipedia.org
GO
HTTP/1.1 200 OK
[…]
content-language: en
content-type: text/html; charset=UTF-8
content-length: 98078
&amp;lt;!DOCTYPE html&amp;gt;
[…]
&lt;/pre&gt;
&lt;p&gt;But we can dig deeper: let's see what servers we are really asking:&lt;/p&gt;
&lt;pre class="literal-block"&gt;
$ dig en.wikipedia.org AAAA +trace
; &amp;lt;&amp;lt;&amp;gt;&amp;gt; DiG … &amp;lt;&amp;lt;&amp;gt;&amp;gt; en.wikipedia.org AAAA +trace
;; global options: +cmd
. 78918 IN NS e.root-servers.net.
. 78918 IN NS f.root-servers.net.
. 78918 IN NS g.root-servers.net.
. 78918 IN NS h.root-servers.net.
. 78918 IN NS i.root-servers.net.
. 78918 IN NS j.root-servers.net.
. 78918 IN NS k.root-servers.net.
. 78918 IN NS l.root-servers.net.
. 78918 IN NS m.root-servers.net.
. 78918 IN NS a.root-servers.net.
. 78918 IN NS b.root-servers.net.
. 78918 IN NS c.root-servers.net.
. 78918 IN NS d.root-servers.net.
;; Received 525 bytes from … in 0 ms
org. 172800 IN NS c0.org.afilias-nst.info.
org. 172800 IN NS a2.org.afilias-nst.info.
org. 172800 IN NS a0.org.afilias-nst.info.
org. 172800 IN NS b0.org.afilias-nst.org.
org. 172800 IN NS b2.org.afilias-nst.org.
org. 172800 IN NS d0.org.afilias-nst.org.
;; Received 788 bytes from 202.12.27.33#53(m.root-servers.net) in 24 ms
wikipedia.org. 3600 IN NS ns0.wikimedia.org.
wikipedia.org. 3600 IN NS ns1.wikimedia.org.
wikipedia.org. 3600 IN NS ns2.wikimedia.org.
;; Received 658 bytes from 2001:500:48::1#53(b2.org.afilias-nst.org) in 20 ms
en.wikipedia.org. 86400 IN CNAME dyna.wikimedia.org.
;; Received 94 bytes from 208.80.153.231#53(ns1.wikimedia.org) in 132 ms
&lt;/pre&gt;
&lt;p&gt;Hey, there are IPv4 addresses in there! I know, this is cheating, the output is
from a dual-stack machine. But we can still simulate IPv6-only resolution
by adding &lt;tt class="docutils literal"&gt;&lt;span class="pre"&gt;-6&lt;/span&gt;&lt;/tt&gt; flag:&lt;/p&gt;
&lt;pre class="literal-block"&gt;
$ dig en.wikipedia.org AAAA +trace -6
; &amp;lt;&amp;lt;&amp;gt;&amp;gt; DiG … &amp;lt;&amp;lt;&amp;gt;&amp;gt; en.wikipedia.org AAAA +trace -6
;; global options: +cmd
. 78915 IN NS d.root-servers.net.
. 78915 IN NS e.root-servers.net.
. 78915 IN NS f.root-servers.net.
. 78915 IN NS g.root-servers.net.
. 78915 IN NS h.root-servers.net.
. 78915 IN NS i.root-servers.net.
. 78915 IN NS j.root-servers.net.
. 78915 IN NS k.root-servers.net.
. 78915 IN NS l.root-servers.net.
. 78915 IN NS m.root-servers.net.
. 78915 IN NS a.root-servers.net.
. 78915 IN NS b.root-servers.net.
. 78915 IN NS c.root-servers.net.
;; Received 525 bytes from … in 0 ms
org. 172800 IN NS d0.org.afilias-nst.org.
org. 172800 IN NS c0.org.afilias-nst.info.
org. 172800 IN NS b2.org.afilias-nst.org.
org. 172800 IN NS a0.org.afilias-nst.info.
org. 172800 IN NS b0.org.afilias-nst.org.
org. 172800 IN NS a2.org.afilias-nst.info.
;; Received 816 bytes from 2001:500:2::c#53(c.root-servers.net) in 8 ms
wikipedia.org. 3600 IN NS ns0.wikimedia.org.
wikipedia.org. 3600 IN NS ns1.wikimedia.org.
wikipedia.org. 3600 IN NS ns2.wikimedia.org.
couldn't get address for 'ns0.wikimedia.org': not found
couldn't get address for 'ns1.wikimedia.org': not found
couldn't get address for 'ns2.wikimedia.org': not found
dig: couldn't get address for 'ns0.wikimedia.org': no more
&lt;/pre&gt;
&lt;p&gt;Some of those IPv4 addresses were benign the respective servers are reachable
both using IPv4 and IPv6 address or there is an alternative server that is
reachable using IPv6. That is the case for the root nameserver in the second
case, we used C, which has IPv6 address (2001:500:2::c). In fact, the M server
also has IPv6 address, but dig chose the IPv4 one (it should not matter):&lt;/p&gt;
&lt;pre class="literal-block"&gt;
$ dig m.root-servers.net AAAA
[…]
m.root-servers.net. 77991 IN AAAA 2001:dc3::35
&lt;/pre&gt;
&lt;p&gt;But the latter case is the bigger issue. For the domain &lt;tt class="docutils literal"&gt;wikipedia.org&lt;/tt&gt; there
are three nameservers:&lt;/p&gt;
&lt;pre class="literal-block"&gt;
$ dig wikipedia.org NS -6
[…]
wikipedia.org. 86400 IN NS ns0.wikimedia.org.
wikipedia.org. 86400 IN NS ns1.wikimedia.org.
wikipedia.org. 86400 IN NS ns2.wikimedia.org.
&lt;/pre&gt;
&lt;p&gt;This is the last answer that we could get on an IPv6-only network, because none of
these three servers has AAAA record (some of them may have IPv6 address unknown to us):&lt;/p&gt;
&lt;pre class="literal-block"&gt;
$ dig ns0.wikimedia.org AAAA
[…]
;; Got answer:
;; -&amp;gt;&amp;gt;HEADER&amp;lt;&amp;lt;- opcode: QUERY, status: NOERROR, id: 59468
;; flags: qr rd ra; QUERY: 1, ANSWER: 0, AUTHORITY: 1, ADDITIONAL: 1
&lt;/pre&gt;
&lt;p&gt;The NOERROR status says the domain name exists, but we got zero answers for
AAAA records. This is the case for all three nameservers. And here is the
ultimate picture of what is happening and what goes wrong.&lt;/p&gt;
&lt;div class="figure"&gt;
&lt;object data="https://blog.ledoian.cz/images/forgetting-dns6/image5.svg" style="width: 100%;" type="image/svg+xml"&gt;&lt;/object&gt;
&lt;p class="caption"&gt;The breakage in action&lt;/p&gt;
&lt;/div&gt;
&lt;p&gt;Also note that the connection from the laptop to the DNS resolver may in fact
consist of a chain of several (caching, non-recursive) DNS resolvers, so that
the final DNS resolver can have dual-stack connectivity.&lt;/p&gt;
&lt;/div&gt;
&lt;div class="section" id="the-problems-with-this-state"&gt;
&lt;h2&gt;The problems with this state&lt;/h2&gt;
&lt;p&gt;So, what is the deal. We &lt;em&gt;just&lt;/em&gt; need to have a dual-stack DNS resolver
somewhere, and that's it, no? Well, yes but actually yes.&lt;/p&gt;
&lt;p&gt;There are two problems with this: First, this means that any new ISP needs to
have &lt;em&gt;at least some&lt;/em&gt; IPv4 address, even if they intend to just use IPv6
services. IPv4 addresses are scarce, &lt;a class="reference external" href="https://blog.apnic.net/2021/12/16/opinion-ipv4-address-markets/"&gt;expensive&lt;/a&gt; and small
blocks &lt;a class="reference external" href="https://labs.ripe.net/author/stephen_strowes/visibility-of-ipv4-and-ipv6-prefix-lengths-in-2019/"&gt;don't route well&lt;/a&gt;,
which is not great both from the
new ISP's and from overal routing's point of view. It also hinders IPv6
deployment and postpones IPv4 abandonment, needlessly.&lt;/p&gt;
&lt;p&gt;The second issue is that this is not very visible. We are building IPv6 world,
but deep inside it still relies on IPv4, which might lead to great surprise
when we start cutting off IPv4 internet. And it might lead to false sense of
having IPv6 deployed, which is not true to the whole extent.&lt;/p&gt;
&lt;p&gt;Insert &amp;quot;It was DNS&amp;quot; meme here.&lt;/p&gt;
&lt;/div&gt;
&lt;div class="section" id="solution"&gt;
&lt;h2&gt;Solution&lt;/h2&gt;
&lt;p&gt;The solution of this state is simple: get IPv6 connectivity to your
authoritative DNS server (or use another) and do not forget to add an AAAA
record for it in DNS. If the DNS server already has IPv6 it is probably just
a matter of adding a single line to the zone file (and a second one for the DNSSEC
signature), which should not be a big deal.&lt;/p&gt;
&lt;p&gt;Unfortunately, this needs to be done for the whole DNS chain.
Especially domain names at universities are infamous for very nested domains.
A domain name may look like
&lt;tt class="docutils literal"&gt;&lt;span class="pre"&gt;machine.department.location.faculty.university.some-common.suffix&lt;/span&gt;&lt;/tt&gt;. That
tree is deep and so is the resolution of this problem.&lt;/p&gt;
&lt;/div&gt;
&lt;div class="section" id="amusing-bug-of-almost-good-deployment"&gt;
&lt;h2&gt;Amusing bug of almost good deployment&lt;/h2&gt;
&lt;p&gt;We have seen there may be multiple NS records for a domain and thus
multiple nameservers. This is good for redundancy. But this does not mean that
the servers will have the same records they are only supposed to give
equivalent answers (as far as I know).&lt;/p&gt;
&lt;p&gt;I have come across a silly misconfiguration: a domain which has several
nameservers, which serve a &lt;em&gt;slightly&lt;/em&gt; different set of NS records for its
subdomain. Specifically, the servers which were only reachable using IPv4 were
&lt;em&gt;exactly&lt;/em&gt; the servers that knew about one additional nameserver for the
subdomain, which, incidentally, was the &lt;em&gt;only&lt;/em&gt; one that was IPv6-capable.&lt;/p&gt;
&lt;p&gt;So, while all the correct records were present in DNS (somewhat/somewhere), this still
meant that IPv6-only resolution was doomed to fail because the IPv6 nameserver
chain was broken. (This has already been fixed.)&lt;/p&gt;
&lt;hr class="docutils" /&gt;
&lt;table class="docutils footnote" frame="void" id="nat44" rules="none"&gt;
&lt;colgroup&gt;&lt;col class="label" /&gt;&lt;col /&gt;&lt;/colgroup&gt;
&lt;tbody valign="top"&gt;
&lt;tr&gt;&lt;td class="label"&gt;&lt;a class="fn-backref" href="#footnote-reference-1"&gt;[1]&lt;/a&gt;&lt;/td&gt;&lt;td&gt;This is very much the same as when you try to reach the
IPv4-public-land from IPv4-private-land, that is, from a private range of IP
addresses. This is called either just NAT, or NAT44 to denote IPv4-to-IPv4 NAT.&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;table class="docutils footnote" frame="void" id="test-aaaa" rules="none"&gt;
&lt;colgroup&gt;&lt;col class="label" /&gt;&lt;col /&gt;&lt;/colgroup&gt;
&lt;tbody valign="top"&gt;
&lt;tr&gt;&lt;td class="label"&gt;&lt;a class="fn-backref" href="#footnote-reference-2"&gt;[2]&lt;/a&gt;&lt;/td&gt;&lt;td&gt;There are several more tests that do not even have the AAAA
record, lol.&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;table class="docutils footnote" frame="void" id="dns-simplification" rules="none"&gt;
&lt;colgroup&gt;&lt;col class="label" /&gt;&lt;col /&gt;&lt;/colgroup&gt;
&lt;tbody valign="top"&gt;
&lt;tr&gt;&lt;td class="label"&gt;&lt;a class="fn-backref" href="#footnote-reference-3"&gt;[3]&lt;/a&gt;&lt;/td&gt;&lt;td&gt;In my example, there is a single recursive DNS
resolver external to my machine in order not to complicate it too much.
The real deployment is often trickier.&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;table class="docutils footnote" frame="void" id="dns-behind-nat64" rules="none"&gt;
&lt;colgroup&gt;&lt;col class="label" /&gt;&lt;col /&gt;&lt;/colgroup&gt;
&lt;tbody valign="top"&gt;
&lt;tr&gt;&lt;td class="label"&gt;&lt;a class="fn-backref" href="#footnote-reference-4"&gt;[4]&lt;/a&gt;&lt;/td&gt;&lt;td&gt;I have not yet tried to run a recursive DNS in a network
with DNS64 and NAT64. Could be fun :-D My wild guess is that I would need
CLAT (i.e. the full 464XLAT deployment) to make that work, since the
resolver is connecting directly to IPv4 addresses and would need to learn to
use NAT64 to resolve them. (The CLAT could be built right into the resolver,
though).&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;/div&gt;
</content><category term="networking"></category><category term="ipv6-only"></category><category term="dns"></category></entry><entry><title>About this blog</title><link href="https://blog.ledoian.cz/about-blog.html" rel="alternate"></link><published>2024-01-10T16:47:00+01:00</published><updated>2024-01-10T16:47:00+01:00</updated><author><name>LEdoian</name></author><id>tag:blog.ledoian.cz,2024-01-10:/about-blog.html</id><summary type="html">&lt;p&gt;This is my blog and this article describes its setup and other details about my
11 months ago
intentions. The actual &lt;a class="reference internal" href="#the-setup"&gt;setup&lt;/a&gt; is probably the most
interesting tech-wise.&lt;/p&gt;
&lt;div class="section" id="what-is-this"&gt;
&lt;h2&gt;What is this?&lt;/h2&gt;
&lt;p&gt;My own space on the internet where I can post whatever and link others to it.
It might end up containing rants …&lt;/p&gt;&lt;/div&gt;</summary><content type="html">&lt;p&gt;This is my blog and this article describes its setup and other details about my
intentions. The actual &lt;a class="reference internal" href="#the-setup"&gt;setup&lt;/a&gt; is probably the most
interesting tech-wise.&lt;/p&gt;
&lt;div class="section" id="what-is-this"&gt;
&lt;h2&gt;What is this?&lt;/h2&gt;
&lt;p&gt;My own space on the internet where I can post whatever and link others to it.
It might end up containing rants, guides, ideas, or maybe nothing at all in the
end. Only the future will tell.&lt;/p&gt;
&lt;p&gt;The blog might even serve as my personal web page/introduction. Maybe. Maybe not…&lt;/p&gt;
&lt;p&gt;The main motivation is to have low-effort way to post random stuff. Which leads
to my requirements for this thing.&lt;/p&gt;
&lt;/div&gt;
&lt;div class="section" id="requirements"&gt;
&lt;h2&gt;Requirements&lt;/h2&gt;
&lt;p&gt;(The requirements are a bit too idealistic, so not all of them were satisfied…)&lt;/p&gt;
&lt;ul class="simple"&gt;
&lt;li&gt;low-effort, me-friendly, low-maintenance I don't want to have to learn too
many new technologies to use this. This includes the required technologies:
Python, Markdown/reStructuredText, Jinja2, git, …&lt;/li&gt;
&lt;li&gt;Technical and math content ~~friendly~~ compatible I expect that to appear
here.&lt;/li&gt;
&lt;li&gt;Static site for security, coolness factor and control. Also static on the
front-end, because I don't like JavaScript and/or running untrusted code on
my machine (even when in a sandbox). The SSG should likely be aimed at
creating blogs, not documentation. Also, self-contained, as in not depending
on third-party sites.&lt;/li&gt;
&lt;li&gt;No moving parts in the infrastructure (or as few as possible) if it works
on my machine, it should just get mirrored to the public site with as few
modifications as possible.&lt;/li&gt;
&lt;li&gt;Transparent I should be able to understand it, maybe others could also use
it as a resource or take inspiration. (At one point, this deployment itself
started being interesting, so if I can share the background as well as the
final webpage, it would be cool.)&lt;/li&gt;
&lt;li&gt;Followable I know you internet guys like to ~~stalk~~ follow people :-)&lt;/li&gt;
&lt;li&gt;Aligned with my values: minimalist, simple, extensible/hackable, FLOSS&lt;/li&gt;
&lt;li&gt;If the platform could distinguish translations and do strikethroughs, it would
be nice, but that is not a hard requirement.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;There are several features of conventional blogs that I consider to be a
non-goals or even anti-goals. Mostly it is about interactivity I don't aim
for having any kind of comments here, or really anything that would require
JavaScript or complex HTML/CSS. And appearance goes past me as well, I instead
try to let the browser decide how to display this page more on that &lt;a class="reference internal" href="#design-considerations"&gt;below&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;The workflow I wanted to achieve is something like: Write the content, git it,
build it (locally, no CI/CD), push it, done. Single write, single push, very
simple.&lt;/p&gt;
&lt;p&gt;And I managed to achieve something like that, via learning (too much?) about
git.&lt;/p&gt;
&lt;!-- TODO: fix the worktree bug already! --&gt;
&lt;/div&gt;
&lt;div class="section" id="the-setup"&gt;
&lt;h2&gt;The setup&lt;/h2&gt;
&lt;p&gt;Naturally for a sysadmin/netadmin, the setup consists of 7 ~~ISO/OSI~~ layers:&lt;/p&gt;
&lt;ol class="arabic simple"&gt;
&lt;li&gt;&lt;strong&gt;Physical layer&lt;/strong&gt;: cheap Hetzner VPS. Not physical, but whatever.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Network layer&lt;/strong&gt;: Nginx&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Persistence layer&lt;/strong&gt;: &lt;a class="reference external" href="https://gitea.ledoian.cz/LEdoian/blog"&gt;this git repo&lt;/a&gt;. I will elaborate below why can
you see this both rendered here and in the source form in Forgejo.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Content layer&lt;/strong&gt;: Markdown or reStructuredText files.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Business logic layer&lt;/strong&gt;: &lt;a class="reference external" href="https://getpelican.com"&gt;Pelican&lt;/a&gt;. It's rather
popular and written in Python, I didn't look further.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Presentation layer&lt;/strong&gt;: I hacked my own theme, because I didn't like any in
the &lt;a class="reference external" href="https://github.com/getpelican/pelican-themes"&gt;pelican-themes repo&lt;/a&gt;.
I was a bit inspired by the layout of &lt;a class="reference external" href="https://eev.ee/blog"&gt;eevee's blog&lt;/a&gt;, but I wanted a dark theme. And as you can see, I
can't do quality frontend, so it ended up horrible… :-D&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Stalking layer&lt;/strong&gt;: Pelican's built-in RSS and Atom feed generators. Not
linked from anywhere at the moment, but &lt;a class="reference external" href="https://gitea.ledoian.cz/LEdoian/blog/src/branch/blog/output/feeds"&gt;the repo will tell you&lt;/a&gt; what
hides under the &lt;tt class="docutils literal"&gt;/feeds/&lt;/tt&gt; path. Or you can utilize the repo (for personal
use the content's license is not decided at the moment)…&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;Most of this is straightforward, the fancy part is my repo. The repo contains
both source and rendered content, so that I can point Nginx right at a checkout
and have Git solve both persistence and deployment without additional moving
parts.&lt;/p&gt;
&lt;p&gt;There are two tricks in the configuration of Git repositories: pushing to a
checked out repo is enabled by configuring &lt;tt class="docutils literal"&gt;receive.denyCurrentBranch =
updateInstead&lt;/tt&gt; in the target repository (which is just a normal repo, not a
bare one), and then I just told my source repositories &lt;a class="footnote-reference" href="#multiple-src" id="footnote-reference-1"&gt;[1]&lt;/a&gt; to use
two push targets for the remote (the first line &lt;em&gt;replaces&lt;/em&gt; the original push
address for some reason):&lt;/p&gt;
&lt;pre class="literal-block"&gt;
git remote set-url --add --push blog_remote gitea&amp;#64;gitea.ledoian.cz:LEdoian/blog.git
git remote set-url --add --push blog_remote blog_user&amp;#64;blog.ledoian.cz:blog_dir
&lt;/pre&gt;
&lt;p&gt;The blog user is just a user with SSH access via authorized keys, no special
sauce there. Nginx is then pointed to serve &lt;tt class="docutils literal"&gt;~blog_user/blog_dir/output/&lt;/tt&gt; at
&lt;tt class="docutils literal"&gt;blog.ledoian.cz&lt;/tt&gt;. (The &lt;tt class="docutils literal"&gt;&lt;span class="pre"&gt;git-remote(1)&lt;/span&gt;&lt;/tt&gt; manpage requires me to have both
repositories in sync, but as long as I configure all my repositories this way,
I should be safe, and I think I could get away with my blog checkout getting
behind accidentally.)&lt;/p&gt;
&lt;/div&gt;
&lt;div class="section" id="my-workflow-and-lots-of-drafts"&gt;
&lt;h2&gt;My workflow and lots of drafts&lt;/h2&gt;
&lt;p&gt;It's Git so it's only natural for me to use various branches and repositories
even for a dumb blog. There are in fact 4 stages an article may go through &lt;a class="footnote-reference" href="#skipping-stages" id="footnote-reference-2"&gt;[2]&lt;/a&gt;:&lt;/p&gt;
&lt;ol class="arabic"&gt;
&lt;li&gt;&lt;p class="first"&gt;A private draft: lives on a branch &lt;tt class="docutils literal"&gt;priv/something&lt;/tt&gt;, may contain private
infos (like when I would just copy-paste from terminal without redaction)
and this branch will probably never be merged to the main repo. Nothing
about these branches is guaranteed.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;&lt;p class="first"&gt;A public WIP draft: uses a branch called &lt;tt class="docutils literal"&gt;pub/something&lt;/tt&gt; which is pushed
to Forgejo (and in fact also to the blog itself, but that is just an
implementation detail). The draft is either does not build or is very
incomplete and I expect to add stuff in a way that could break the build, so
I put it on a separate branch. The branch will be probably merged to the
main branch (called &lt;tt class="docutils literal"&gt;blog&lt;/tt&gt;) when it is ready.&lt;/p&gt;
&lt;p&gt;The &lt;tt class="docutils literal"&gt;pub/…&lt;/tt&gt; branches can be created either manually or by cherry-picking
from the respective &lt;tt class="docutils literal"&gt;priv/…&lt;/tt&gt; branch, but that will likely not be
distinguishable. (I am too lazy to keep the references even in the commit
logs.)&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;&lt;p class="first"&gt;When a draft is almost ready (or the content has simple syntax), it gets
placed on the &lt;tt class="docutils literal"&gt;blog&lt;/tt&gt; branch. The only thing that designates it as a draft
is &lt;tt class="docutils literal"&gt;status: draft&lt;/tt&gt; in the frontmatter, which means that the article will
get rendered and put somewhere on the public blog, but not reachable from
the title page (&amp;quot;unlisted&amp;quot;).&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;&lt;p class="first"&gt;Of course, eventually (and hopefully) the article gets published for
everyone to see. At that point, it is complete (or at least that is what I
thought when marking it as published). Possibly it might be updated in the
future, but no such update is anticipated at the moment of publishing. &lt;a class="footnote-reference" href="#update-this" id="footnote-reference-3"&gt;[3]&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;I use Git to synchronize my private branches among machines, so there are
actually two &amp;quot;server-side&amp;quot; repositories (private and public one) and thus two
remotes. &lt;a class="footnote-reference" href="#private-branches-wish" id="footnote-reference-4"&gt;[4]&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;As for the actual workflow, for the main branch it usually consists of: writing
content, committing it, building the web, checking it locally, committing the
built blog and pushing it. Sometimes I do the commits together, but I always
separate the rendering/building commits from the content-creating ones, so that
I can handle those differently if needed (i.e. there is no point in
cherry-picking the built content, I can generate it). &lt;a class="footnote-reference" href="#git-purists" id="footnote-reference-5"&gt;[5]&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;For other branches I use some applicable subset of the steps above, probably.&lt;/p&gt;
&lt;/div&gt;
&lt;div class="section" id="design-considerations"&gt;
&lt;h2&gt;Design considerations&lt;/h2&gt;
&lt;p&gt;The appearance of the blog is maybe not nice. That is for two reasons: I don't
have the right idea about how to make it much better and I want to have a
rather simple CSS for the web. The latter wish is because I tend to tweak
appearance of sites I visit using my own styles, so I would like you to be able
to do the same.&lt;/p&gt;
&lt;p&gt;And for the former reason, if you have any ideas / improvements (including user
styles), hit me at &lt;a class="reference external" href="mailto:blog&amp;#64;pokemon.ledoian.cz"&gt;blog&amp;#64;pokemon.ledoian.cz&lt;/a&gt; :-)&lt;/p&gt;
&lt;p&gt;My overall idea is a dark-by-default &lt;a class="footnote-reference" href="#light-theme" id="footnote-reference-6"&gt;[6]&lt;/a&gt; minimalist page with a single menu on the
right containig all the relevant links. The page should not dictate too much
but rather let the user agent decide the rendering (&lt;a class="reference external" href="https://html.spec.whatwg.org/multipage/rendering.html#rendering"&gt;it does anyway…&lt;/a&gt;).&lt;/p&gt;
&lt;p&gt;I want my blog to render similarly in Gecko-, WebKit- and Blink-based browsers
(e.g. Firefox, Badwolf, Qutebrowser). Others should be usable.
Browser-/engine-specific styles are not welcome let's keep it simple. And no
JavaScript…&lt;/p&gt;
&lt;/div&gt;
&lt;div class="section" id="work-in-progress-todos"&gt;
&lt;h2&gt;Work in progress / TODOs&lt;/h2&gt;
&lt;p&gt;This thing is at the moment very barebones, which is sufficient for the main
purpose. However, I would like to have some features here, one day, hopefully:&lt;/p&gt;
&lt;ul class="simple"&gt;
&lt;li&gt;Dates in the article headers (and maybe more improvements of the theme, see
above)&lt;/li&gt;
&lt;li&gt;Stable category and tag names and a page with a description of them. As of
now I haven't really invented a system of sorting my content, which leads to
a mess… Please don't rely on categories having any particular name / URL for
now.&lt;/li&gt;
&lt;li&gt;Link the RSS feeds from somewhere&lt;/li&gt;
&lt;li&gt;Personal info with links to my other profiles&lt;/li&gt;
&lt;li&gt;Some linking to the Fediverse and using it for comments (since there will be
no comments here)&lt;/li&gt;
&lt;li&gt;Sensible translations, maybe (if I/someone ever get to write the same content
again in a different language…)&lt;/li&gt;
&lt;li&gt;Improve the list of talks I've given (create some kind of sensible table maybe?)&lt;/li&gt;
&lt;li&gt;Decide on a licence for the content (If you want to utilize something here
before I do that, please ask me, I think we can find a way :-))&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;If you are so upset with this blog (or maybe bored) that you want to improve
it, send me patches / ideas. I don't expect anyone to do that, though :-D (And
I do not promise you that I will use the patch, even if it matches all my
opinions above. I also have some gut feelings about what I like…)&lt;/p&gt;
&lt;p&gt;Also, tell me if you hate something else about my page. I want to at least know
whom I upset :-D (but I will probably also think about your gripes and whether
I can and should try to avoid them…)&lt;/p&gt;
&lt;hr class="docutils" /&gt;
&lt;table class="docutils footnote" frame="void" id="multiple-src" rules="none"&gt;
&lt;colgroup&gt;&lt;col class="label" /&gt;&lt;col /&gt;&lt;/colgroup&gt;
&lt;tbody valign="top"&gt;
&lt;tr&gt;&lt;td class="label"&gt;&lt;a class="fn-backref" href="#footnote-reference-1"&gt;[1]&lt;/a&gt;&lt;/td&gt;&lt;td&gt;I also use multiple machines on which I can write stuff.&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;table class="docutils footnote" frame="void" id="skipping-stages" rules="none"&gt;
&lt;colgroup&gt;&lt;col class="label" /&gt;&lt;col /&gt;&lt;/colgroup&gt;
&lt;tbody valign="top"&gt;
&lt;tr&gt;&lt;td class="label"&gt;&lt;a class="fn-backref" href="#footnote-reference-2"&gt;[2]&lt;/a&gt;&lt;/td&gt;&lt;td&gt;&lt;p class="first"&gt;I am lazy and chaotic (good), so the stages are optional
and non-linear, and sometimes involve paper. This article is a prime
example: parts of it were on two different private branches, but at the end
I wrote it from scratch directly on the main branch. And the requirements
were written on a paper originally.&lt;/p&gt;
&lt;p class="last"&gt;Nevertheless, the general idea still holds and may inspire others, so it
makes sense to keep this part in the article. (Also, this footnote might not
make sense before reading the definition of the stages, but I didn't find a
better place to put it…)&lt;/p&gt;
&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;table class="docutils footnote" frame="void" id="update-this" rules="none"&gt;
&lt;colgroup&gt;&lt;col class="label" /&gt;&lt;col /&gt;&lt;/colgroup&gt;
&lt;tbody valign="top"&gt;
&lt;tr&gt;&lt;td class="label"&gt;&lt;a class="fn-backref" href="#footnote-reference-3"&gt;[3]&lt;/a&gt;&lt;/td&gt;&lt;td&gt;Well, given this article contains some future plans, I
actually anticipate update of this one, but maybe not in the near future. So
the outline is not really correct, but I make the rules :-) (There
were some build breaks on the main branch, too :-D)&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;table class="docutils footnote" frame="void" id="private-branches-wish" rules="none"&gt;
&lt;colgroup&gt;&lt;col class="label" /&gt;&lt;col /&gt;&lt;/colgroup&gt;
&lt;tbody valign="top"&gt;
&lt;tr&gt;&lt;td class="label"&gt;&lt;a class="fn-backref" href="#footnote-reference-4"&gt;[4]&lt;/a&gt;&lt;/td&gt;&lt;td&gt;I would love if my Forgejo could have &amp;quot;private
branches&amp;quot;, but I understand that the overhead for doing this is not nice,
since it would need to be able to decide for any object, whether it is
public or not (you can do &lt;tt class="docutils literal"&gt;git fetch &amp;lt;remote&amp;gt; &lt;span class="pre"&gt;&amp;lt;object-hash&amp;gt;&lt;/span&gt;&lt;/tt&gt;) and somehow
keep track even with rebases, merges, force-pushes, many branches, … Having
a separate private repository is not a big problem in comparison.&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;table class="docutils footnote" frame="void" id="git-purists" rules="none"&gt;
&lt;colgroup&gt;&lt;col class="label" /&gt;&lt;col /&gt;&lt;/colgroup&gt;
&lt;tbody valign="top"&gt;
&lt;tr&gt;&lt;td class="label"&gt;&lt;a class="fn-backref" href="#footnote-reference-5"&gt;[5]&lt;/a&gt;&lt;/td&gt;&lt;td&gt;Git purists might want to tell me that committing build
artifacts is not good practice. I know and I explicitly don't care in case
of this repo, because here I prioritise my own comfort of being able to
check everything locally and then be reasonably sure the deployed version
will also work, all this with only a single push somewhere. Of course, one
could argue that with that there is no reason to create two commits, but it
does not really bother me to run something like &lt;tt class="docutils literal"&gt;git commit &lt;span class="pre"&gt;-m&amp;quot;render&amp;quot;&lt;/span&gt;
output/&lt;/tt&gt; when I am sure it works, and this keeps readable diffs separate
from the non-readable ones (i.e. the changes in generated HTML).&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;table class="docutils footnote" frame="void" id="light-theme" rules="none"&gt;
&lt;colgroup&gt;&lt;col class="label" /&gt;&lt;col /&gt;&lt;/colgroup&gt;
&lt;tbody valign="top"&gt;
&lt;tr&gt;&lt;td class="label"&gt;&lt;a class="fn-backref" href="#footnote-reference-6"&gt;[6]&lt;/a&gt;&lt;/td&gt;&lt;td&gt;Having the page be dark-by-default is my preference, but I
respect that others may prefer light sites. However, I have not yet
determined what colors should be used (probably still cyan / blue / maybe
purple-ish, but I don't know what shade) nor understood how to use
&lt;tt class="docutils literal"&gt;&lt;span class="pre"&gt;&amp;#64;media(prefers-color-scheme)&lt;/span&gt;&lt;/tt&gt; in a maintainable and simple way (in the
context of my theme). So naturally, this is postponed to the future…&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;/div&gt;
</content><category term="technology"></category><category term="meta"></category><category term="infrastructure"></category></entry><entry><title>Smršť 2023 (CZ)</title><link href="https://blog.ledoian.cz/smrst2023-cs.html" rel="alternate"></link><published>2023-12-02T18:00:00+01:00</published><updated>2023-12-02T18:00:00+01:00</updated><author><name>LEdoian</name></author><id>tag:blog.ledoian.cz,2023-12-02:/smrst2023-cs.html</id><content type="html">&lt;p&gt;Na &lt;a class="reference external" href="https://ksp.mff.cuni.cz/akce/smrst/2023/"&gt;Smršti&lt;/a&gt; jsem přednášel o distribuci SW a o technicky zajímavých železničních neštěstích.&lt;/p&gt;
1 year ago
&lt;div class="section" id="materialy"&gt;
&lt;h2&gt;Materiály&lt;/h2&gt;
&lt;ul class="simple"&gt;
&lt;li&gt;&lt;a class="reference external" href="https://blog.ledoian.cz/static/talks/smrst2023/talk.pdf"&gt;Slidy ke přednášce o neštěstích&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;(Pozn.: Možná se ještě změní adresa téhle stránky, protože je to celé WIP…)&lt;/p&gt;
&lt;/div&gt;
</content><category term="talks"></category><category term="smršť"></category><category term="trains"></category><category term="software-engineering"></category></entry></feed>