LEdoian's Blog - tilhttps://blog.ledoian.cz/2024-05-08T13:32:00+02:00Only NAT packets you can deliver responses for2024-05-08T13:32:00+02:002024-05-08T13:32:00+02:00LEdoiantag:blog.ledoian.cz,2024-05-08:/masquerade-with-filter.html<p>When setting up a masquerading nat, it is worth considering masquerading only packets from known networks. That is, instead of rule like <tt class="docutils literal">iifname <span class="pre">eth-inside</span> masquerade</tt> use something like <tt class="docutils literal">iifname <span class="pre">eth-inside</span> ip saddr 198.51.100.0/24 masquerade</tt>.</p> <p>I learned the hard way: my laptop in a masqueraded network picked …</p><p>When setting up a masquerading nat, it is worth considering masquerading only packets from known networks. That is, instead of rule like <tt class="docutils literal">iifname <span class="pre">eth-inside</span> masquerade</tt> use something like <tt class="docutils literal">iifname <span class="pre">eth-inside</span> ip saddr 198.51.100.0/24 masquerade</tt>.</p> <p>I learned the hard way: my laptop in a masqueraded network picked a wrong source address from a subnet the router had no knowledge about. The outbound packets passed through right, but the responses came in, undergone translation, and since the destination was unknown to the router, it used the <em>default</em> route, sending the packet back to the ISP.</p> <p>The result: IDS triggered by <em>many</em> packets from my router with source IP addresses from all around the Internet, all with destination to my private address. (The ISP was not happy about that.)</p> How to convert CBZ to PDF2024-02-17T16:55:00+01:002024-02-17T16:55:00+01:00LEdoiantag:blog.ledoian.cz,2024-02-17:/cbz-to-pdf.html<ol class="arabic simple"> <li>Extract the archive (cbz is just a zip, cbr is a rar, …)</li> <li><dl class="first docutils"> <dt>Convert individual pictures to PDF using <tt class="docutils literal">img2pdf</tt></dt> <dd><ul class="first last"> <li>Many other ways including <tt class="docutils literal">convert</tt> from ImageMagick tend to do weird stuff like breaking aspect ratios or adding margins</li> </ul> </dd> </dl> </li> <li>Merge files into the single PDF, e.g. using <tt class="docutils literal">qpdf <span class="pre">--empty</span> <span class="pre">--pages …</span></tt></li></ol><ol class="arabic simple"> <li>Extract the archive (cbz is just a zip, cbr is a rar, …)</li> <li><dl class="first docutils"> <dt>Convert individual pictures to PDF using <tt class="docutils literal">img2pdf</tt></dt> <dd><ul class="first last"> <li>Many other ways including <tt class="docutils literal">convert</tt> from ImageMagick tend to do weird stuff like breaking aspect ratios or adding margins</li> </ul> </dd> </dl> </li> <li>Merge files into the single PDF, e.g. using <tt class="docutils literal">qpdf <span class="pre">--empty</span> <span class="pre">--pages</span> *.pdf <span class="pre">--</span> output.pdf</tt>.</li> </ol> <div class="section" id="references"> <h2>References</h2> <ul class="simple"> <li><a class="reference external" href="https://askubuntu.com/questions/207172/how-to-convert-cbr-to-pdf">https://askubuntu.com/questions/207172/how-to-convert-cbr-to-pdf</a></li> <li><a class="reference external" href="https://superuser.com/questions/497293/how-to-convert-calibre-cbr-to-pdf-format-in-linux">https://superuser.com/questions/497293/how-to-convert-calibre-cbr-to-pdf-format-in-linux</a></li> </ul> </div> <div class="section" id="why"> <h2>Why</h2> <p>My eBook reader (PocketBook Touch Lux) does not seem to be able to handle cbz.</p> </div>