<?xml version="1.0" encoding="UTF-8"?>
<!-- generator="FeedCreator 1.8" -->
<?xml-stylesheet href="https://www.baszerr.eu/lib/exe/css.php?s=feed" type="text/css"?>
<rss version="2.0">
    <channel xmlns:g="http://base.google.com/ns/1.0">
        <title>BaSzErr - blog:2023:12:14</title>
        <description></description>
        <link>https://www.baszerr.eu/</link>
        <lastBuildDate>Wed, 06 May 2026 07:55:00 +0000</lastBuildDate>
        <generator>FeedCreator 1.8</generator>
        <image>
            <url>https://www.baszerr.eu/lib/exe/fetch.php?media=wiki:dokuwiki.svg</url>
            <title>BaSzErr</title>
            <link>https://www.baszerr.eu/</link>
        </image>
        <item>
            <title>2023-12-14_-_humor</title>
            <link>https://www.baszerr.eu/doku.php?id=blog:2023:12:14:2023-12-14_-_humor</link>
            <description>
&lt;h1 class=&quot;sectionedit1&quot; id=&quot;humor&quot;&gt;2023-12-14 - humor&lt;/h1&gt;
&lt;div class=&quot;level1&quot;&gt;

&lt;p&gt;
some of the best stuff i&amp;#039;ve seen in a while. ;) enjoy!
&lt;/p&gt;

&lt;p&gt;
&lt;a href=&quot;https://www.baszerr.eu/lib/exe/detail.php?id=blog%3A2023%3A12%3A14%3A2023-12-14_-_humor&amp;amp;media=humour:a_perfect_date.jpg&quot; class=&quot;media&quot; title=&quot;humour:a_perfect_date.jpg&quot;&gt;&lt;img src=&quot;https://www.baszerr.eu/lib/exe/fetch.php?w=400&amp;amp;tok=5aab06&amp;amp;media=humour:a_perfect_date.jpg&quot; class=&quot;media&quot; loading=&quot;lazy&quot; title=&quot;a perfect date&quot; alt=&quot;a perfect date&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;
&lt;/p&gt;

&lt;p&gt;
&lt;a href=&quot;https://www.baszerr.eu/lib/exe/detail.php?id=blog%3A2023%3A12%3A14%3A2023-12-14_-_humor&amp;amp;media=humour:correlation_vs_causation.jpg&quot; class=&quot;media&quot; title=&quot;humour:correlation_vs_causation.jpg&quot;&gt;&lt;img src=&quot;https://www.baszerr.eu/lib/exe/fetch.php?w=400&amp;amp;tok=834320&amp;amp;media=humour:correlation_vs_causation.jpg&quot; class=&quot;media&quot; loading=&quot;lazy&quot; title=&quot;correlation is not causation&quot; alt=&quot;correlation is not causation&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;
&lt;/p&gt;

&lt;p&gt;
&lt;a href=&quot;https://www.baszerr.eu/lib/exe/detail.php?id=blog%3A2023%3A12%3A14%3A2023-12-14_-_humor&amp;amp;media=humour:quantum_mechanics.jpg&quot; class=&quot;media&quot; title=&quot;humour:quantum_mechanics.jpg&quot;&gt;&lt;img src=&quot;https://www.baszerr.eu/lib/exe/fetch.php?w=400&amp;amp;tok=06f1fb&amp;amp;media=humour:quantum_mechanics.jpg&quot; class=&quot;media&quot; loading=&quot;lazy&quot; title=&quot;quantum mechanics&quot; alt=&quot;quantum mechanics&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;
&lt;/p&gt;

&lt;/div&gt;
</description>
            <author>anonymous@undisclosed.example.com (Anonymous)</author>
            <pubDate>Thu, 14 Dec 2023 20:14:17 +0000</pubDate>
        </item>
        <item>
            <title>2023-12-14_-_openvpn_and_fast_reconnects</title>
            <link>https://www.baszerr.eu/doku.php?id=blog:2023:12:14:2023-12-14_-_openvpn_and_fast_reconnects</link>
            <description>
&lt;h1 class=&quot;sectionedit1&quot; id=&quot;openvpn_and_fast_reconnects&quot;&gt;2023-12-14 - OpenVPN and fast reconnects&lt;/h1&gt;
&lt;div class=&quot;level1&quot;&gt;

&lt;p&gt;
i use VPN for all my outgoing traffic. there are however times, when VPN connection dies for some random reasons and we need to reconnect. of course – tough luck – this usually happens when you&amp;#039;re busy doing other stuff (eg. telko). while i can go to router and restart and / or SSH to kick-restart OpenVPN service, this ain&amp;#039;t perfect as it takes time and it can be done by me only – rest of the family is at my mercy.
&lt;/p&gt;

&lt;/div&gt;
&lt;!-- EDIT{&amp;quot;target&amp;quot;:&amp;quot;section&amp;quot;,&amp;quot;name&amp;quot;:&amp;quot;2023-12-14 - OpenVPN and fast reconnects&amp;quot;,&amp;quot;hid&amp;quot;:&amp;quot;openvpn_and_fast_reconnects&amp;quot;,&amp;quot;codeblockOffset&amp;quot;:0,&amp;quot;secid&amp;quot;:1,&amp;quot;range&amp;quot;:&amp;quot;1-479&amp;quot;} --&gt;
&lt;h2 class=&quot;sectionedit2&quot; id=&quot;cron&quot;&gt;cron&lt;/h2&gt;
&lt;div class=&quot;level2&quot;&gt;

&lt;p&gt;
my first approach to auto detect failed connect and restart was just using &lt;code&gt;cron&lt;/code&gt;, to ping some should-always-be-there servers, and if all fail, restart OpenVPN. this however was limited, as job was running once per 10 minutes + it took a moment to determine network is down (a couple timeouts typically). while in theory i could go down to 1min interval in cron, this often buffered more “instances” when connection was down, causing cascade of restarts, even when connection was already back. it did stabilize, but it was annoying enough that i disabled it.
&lt;/p&gt;

&lt;/div&gt;
&lt;!-- EDIT{&amp;quot;target&amp;quot;:&amp;quot;section&amp;quot;,&amp;quot;name&amp;quot;:&amp;quot;cron&amp;quot;,&amp;quot;hid&amp;quot;:&amp;quot;cron&amp;quot;,&amp;quot;codeblockOffset&amp;quot;:0,&amp;quot;secid&amp;quot;:2,&amp;quot;range&amp;quot;:&amp;quot;480-1060&amp;quot;} --&gt;
&lt;h2 class=&quot;sectionedit3&quot; id=&quot;openvpn&quot;&gt;OpenVPN&lt;/h2&gt;
&lt;div class=&quot;level2&quot;&gt;

&lt;p&gt;
there are obviously &lt;code&gt;ping&lt;/code&gt; options for OpenVPN, so that connection can self-monitor. cool, but by provider pushes these settings for me, and it&amp;#039;s in many-minutes range, while i really want it to happen swiftly. fortunately turned out that starting with OpenVPN 2.4.0, there&amp;#039;s a &lt;code&gt;pull-filter ignore &amp;lt;command&amp;gt;&lt;/code&gt; syntax, that allows you to selectively ignore &lt;code&gt;push&lt;/code&gt;ed configs, so:
&lt;/p&gt;
&lt;pre class=&quot;code&quot;&gt;pull-filter ignore ping
pull-filter ignore ping-restart
ping 2
ping-restart 13
ping-timer-rem&lt;/pre&gt;

&lt;p&gt;
it was quite good, BUT restarts were never successful, if remote end dies (one can simulate this with explicit &lt;code&gt;DROP&lt;/code&gt; rule in &lt;code&gt;iptables&lt;/code&gt;). &lt;abbr title=&quot;Too long; didn&amp;#039;t read&quot;&gt;TL;DR&lt;/abbr&gt; – turned out that &lt;code&gt;persist-tun&lt;/code&gt; option was the issue. so another fix:
&lt;/p&gt;
&lt;pre class=&quot;code&quot;&gt;#persist-key
#persist-tun
pull-filter ignore persist-key
pull-filter ignore persist-tun&lt;/pre&gt;

&lt;p&gt;
so now we have OpenVPN that correctly detects failed connection, drops it, restarts it… or sometimes gives up and exits client. since it was &lt;code&gt;exit 0&lt;/code&gt;, &lt;code&gt;systemd&lt;/code&gt; does not restart VPN… and connection is permanently dead.
&lt;/p&gt;

&lt;p&gt;
btw:
&lt;/p&gt;
&lt;pre class=&quot;code&quot;&gt;ping-exit 13&lt;/pre&gt;

&lt;p&gt;
had the same outcome - &lt;code&gt;exit 0&lt;/code&gt;, and &lt;code&gt;systemd&lt;/code&gt; in &lt;em&gt;this is fine&lt;/em&gt; mode. ok – &lt;code&gt;systemd&lt;/code&gt; magic time, then…
&lt;/p&gt;

&lt;/div&gt;
&lt;!-- EDIT{&amp;quot;target&amp;quot;:&amp;quot;section&amp;quot;,&amp;quot;name&amp;quot;:&amp;quot;OpenVPN&amp;quot;,&amp;quot;hid&amp;quot;:&amp;quot;openvpn&amp;quot;,&amp;quot;codeblockOffset&amp;quot;:0,&amp;quot;secid&amp;quot;:3,&amp;quot;range&amp;quot;:&amp;quot;1061-2257&amp;quot;} --&gt;
&lt;h2 class=&quot;sectionedit4&quot; id=&quot;systemd&quot;&gt;systemd&lt;/h2&gt;
&lt;div class=&quot;level2&quot;&gt;

&lt;p&gt;
while obvious part was to just edit OpenVPN service settings in &lt;code&gt;systemd&lt;/code&gt;, the problem is that this will evaporate with next OpenVPN update (that comes with service definition). fortunately there&amp;#039;s a lesser-known &lt;code&gt;systemd&lt;/code&gt; trick, to create overrides for a given service! just do this:
&lt;/p&gt;
&lt;pre class=&quot;code bash&quot;&gt;&lt;span class=&quot;kw2&quot;&gt;mkdir&lt;/span&gt; &lt;span class=&quot;sy0&quot;&gt;/&lt;/span&gt;etc&lt;span class=&quot;sy0&quot;&gt;/&lt;/span&gt;systemd&lt;span class=&quot;sy0&quot;&gt;/&lt;/span&gt;system&lt;span class=&quot;sy0&quot;&gt;/&lt;/span&gt;openvpn&lt;span class=&quot;sy0&quot;&gt;@&lt;/span&gt;myvpn.service.d
&lt;span class=&quot;kw3&quot;&gt;cd&lt;/span&gt; &lt;span class=&quot;re1&quot;&gt;$_&lt;/span&gt;
&lt;span class=&quot;kw2&quot;&gt;vi&lt;/span&gt; override.conf
systemctl daemon-reload&lt;/pre&gt;

&lt;p&gt;
where &lt;code&gt;override.conf&lt;/code&gt; goes like this:
&lt;/p&gt;
&lt;pre class=&quot;code&quot;&gt;[Service]
RestartSec=1s
Restart=always&lt;/pre&gt;

&lt;p&gt;
so now we restart every 1s, if service turns off, for whatever reason.
&lt;/p&gt;

&lt;p&gt;
one last thing, is to disable default rate-limiting in &lt;code&gt;systemd&lt;/code&gt;, to make sure we try to connect as hard as possible. full &lt;code&gt;override.conf&lt;/code&gt; then looks like this:
&lt;/p&gt;
&lt;pre class=&quot;code&quot;&gt;[Service]
RestartSec=1s
Restart=always
StartLimitIntervalSec=0
StartLimitBurst=0&lt;/pre&gt;

&lt;p&gt;
another &lt;code&gt;systemctl daemon-reload&lt;/code&gt; + one more &lt;code&gt;systemctl restart openvpn@myvpn&lt;/code&gt; and we&amp;#039;re golden! :)
&lt;/p&gt;

&lt;/div&gt;
&lt;!-- EDIT{&amp;quot;target&amp;quot;:&amp;quot;section&amp;quot;,&amp;quot;name&amp;quot;:&amp;quot;systemd&amp;quot;,&amp;quot;hid&amp;quot;:&amp;quot;systemd&amp;quot;,&amp;quot;codeblockOffset&amp;quot;:0,&amp;quot;secid&amp;quot;:4,&amp;quot;range&amp;quot;:&amp;quot;2258-&amp;quot;} --&gt;</description>
            <author>anonymous@undisclosed.example.com (Anonymous)</author>
            <pubDate>Thu, 14 Dec 2023 19:49:03 +0000</pubDate>
        </item>
        <item>
            <title>2023-12-14_-_soks</title>
            <link>https://www.baszerr.eu/doku.php?id=blog:2023:12:14:2023-12-14_-_soks</link>
            <description>
&lt;h1 class=&quot;sectionedit1&quot; id=&quot;soks&quot;&gt;2023-12-14 - SOKS&lt;/h1&gt;
&lt;div class=&quot;level1&quot;&gt;

&lt;p&gt;
you probably know &lt;a href=&quot;https://en.wikipedia.org/wiki/Arthur C. Clarke&quot; class=&quot;interwiki iw_wp&quot; title=&quot;https://en.wikipedia.org/wiki/Arthur C. Clarke&quot;&gt;Arthur C. Clarke&lt;/a&gt;&amp;#039;s saying that “sufficiently advanced technology is indistinguishable from magic”. that was my exact impression when couple of days ago i&amp;#039;ve read &lt;a href=&quot;https://www.popularmechanics.com/military/navy-ships/a28724/submarine-sonar-soks/&quot; class=&quot;urlextern&quot; title=&quot;https://www.popularmechanics.com/military/navy-ships/a28724/submarine-sonar-soks/&quot; rel=&quot;ugc nofollow&quot;&gt;how Soviet&amp;#039;s SOKS was used to track USA submarines&lt;/a&gt;. &lt;a href=&quot;https://en.wikipedia.org/wiki/SOKS&quot; class=&quot;interwiki iw_wp&quot; title=&quot;https://en.wikipedia.org/wiki/SOKS&quot;&gt;SOKS&lt;/a&gt; is a device dating back to 1969 (!!) that allows to tack submarines by finding trail that they leave underwater by:
&lt;/p&gt;
&lt;ol&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; traces of radiation from reactor&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; salt concentration changes (mixing water when huge object passes by)&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; temperature changes (reactor cooling can heat up water by up to 10*C)&lt;/div&gt;
&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;
&lt;a href=&quot;https://www.baszerr.eu/lib/exe/detail.php?id=blog%3A2023%3A12%3A14%3A2023-12-14_-_soks&amp;amp;media=blog:2023:12:14:soks.jpg&quot; class=&quot;media&quot; title=&quot;blog:2023:12:14:soks.jpg&quot;&gt;&lt;img src=&quot;https://www.baszerr.eu/lib/exe/fetch.php?w=400&amp;amp;tok=fc3880&amp;amp;media=blog:2023:12:14:soks.jpg&quot; class=&quot;media&quot; loading=&quot;lazy&quot; title=&quot;SOKS&quot; alt=&quot;SOKS&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;
&lt;/p&gt;

&lt;p&gt;
i do not know what blew my mind more in this story:
&lt;/p&gt;
&lt;ul&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; the fact that&amp;#039;s even possible?&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; the fact that has been accomplished in 1969?&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; the fact that this was done using Soviet technology of the time?&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; the fact that it has been (partially!) declassified only in 2017?&lt;/div&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;
wonder what they are using and working on now, half a century later.
&lt;/p&gt;

&lt;/div&gt;
</description>
            <author>anonymous@undisclosed.example.com (Anonymous)</author>
            <pubDate>Thu, 14 Dec 2023 20:01:40 +0000</pubDate>
        </item>
    </channel>
</rss>
