<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:content="http://purl.org/rss/1.0/modules/content/"><channel><title>Uncategorized on Remko Lodder</title><link>/categories/uncategorized/</link><description>Recent content in Uncategorized on Remko Lodder</description><generator>Hugo -- gohugo.io</generator><language>en-us</language><copyright>Copyright © 2003-2026, Remko Lodder, all rights reserved.</copyright><lastBuildDate>Sat, 26 Sep 2020 00:00:00 +0000</lastBuildDate><atom:link href="https://www.evilcoder.org/categories/uncategorized/index.xml" rel="self" type="application/rss+xml"/><item><title>Emerging Threats Python script</title><link>/posts/2020-09-26-emerging-threats-python/</link><pubDate>Sat, 26 Sep 2020 00:00:00 +0000</pubDate><guid>https://www.evilcoder.org/posts/2020-09-26-emerging-threats-python/</guid><description>&lt;p&gt;For some time I am a perl fan, but perl is not that popular anymore so I
decided to try and see whether I can use Python as well. After moving my
systems from FreeBSD to Ubuntu and Debian (proxmox needs it) I also used the
&amp;rsquo;emerging-ipset-update.pl&amp;rsquo; script to drop emerging treats as soon as possible.&lt;/p&gt;
&lt;h2 id="python"&gt;Python&lt;/h2&gt;
&lt;p&gt;After or rather while following the Udemy&amp;rsquo;s &amp;lsquo;2020 Complete Python bootcamp:
From Zero to Hero&amp;rsquo; by Jose Portilla (Hi!) I decided that I could rewrite the
perl script into python. And so I did. Below is the version that resulted from
that effort. It can surely be smarter, so poke me on my email address if that
is possible and I&amp;rsquo;ll update this. Thanks Jose for your great course! I
appreciate it!&lt;/p&gt;</description><content:encoded><![CDATA[<p>For some time I am a perl fan, but perl is not that popular anymore so I
decided to try and see whether I can use Python as well. After moving my
systems from FreeBSD to Ubuntu and Debian (proxmox needs it) I also used the
&rsquo;emerging-ipset-update.pl&rsquo; script to drop emerging treats as soon as possible.</p>
<h2 id="python">Python</h2>
<p>After or rather while following the Udemy&rsquo;s &lsquo;2020 Complete Python bootcamp:
From Zero to Hero&rsquo; by Jose Portilla (Hi!) I decided that I could rewrite the
perl script into python. And so I did. Below is the version that resulted from
that effort. It can surely be smarter, so poke me on my email address if that
is possible and I&rsquo;ll update this. Thanks Jose for your great course! I
appreciate it!</p>
<h2 id="the-script">The script</h2>
<div class="highlight"><pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"><code class="language-python" data-lang="python"><span style="display:flex;"><span><span style="color:#75715e">#!/usr/bin/env python3</span>
</span></span><span style="display:flex;"><span><span style="color:#75715e">#</span>
</span></span><span style="display:flex;"><span>
</span></span><span style="display:flex;"><span><span style="color:#75715e">## 25/09/2020:</span>
</span></span><span style="display:flex;"><span><span style="color:#75715e">## Python based E.T parser by Remko Lodder &lt;remko@elvandar.org&gt;</span>
</span></span><span style="display:flex;"><span><span style="color:#75715e">##</span>
</span></span><span style="display:flex;"><span><span style="color:#75715e">## The script is based on the original perl script by Joshua Gimer and an unknown author who created</span>
</span></span><span style="display:flex;"><span><span style="color:#75715e">## my reference version: https://doc.emergingthreats.net/pub/Main/EmergingFirewallRules/emerging-ipset-update.pl.txt</span>
</span></span><span style="display:flex;"><span><span style="color:#75715e">##</span>
</span></span><span style="display:flex;"><span><span style="color:#75715e">## The netaddr functionality in the form of IPNetwork and cidr merge</span>
</span></span><span style="display:flex;"><span><span style="color:#75715e">## are taken from the website: http://www.korznikov.com/2014/08/creating-black-list-of-ips-for-iptables.html</span>
</span></span><span style="display:flex;"><span><span style="color:#75715e">## Thank you for the pointers there, which I shamelessly used to create this variant.</span>
</span></span><span style="display:flex;"><span><span style="color:#75715e">##</span>
</span></span><span style="display:flex;"><span><span style="color:#75715e">## The script fetches the ip addreses/ranges that are potential treats and creates an ipset list from it.</span>
</span></span><span style="display:flex;"><span><span style="color:#75715e">## The ipset list is then used by iptables to produce a working firewall set.</span>
</span></span><span style="display:flex;"><span>
</span></span><span style="display:flex;"><span><span style="color:#f92672">import</span> time
</span></span><span style="display:flex;"><span><span style="color:#f92672">import</span> urllib.request
</span></span><span style="display:flex;"><span><span style="color:#f92672">import</span> os
</span></span><span style="display:flex;"><span><span style="color:#f92672">import</span> re
</span></span><span style="display:flex;"><span><span style="color:#f92672">import</span> syslog
</span></span><span style="display:flex;"><span>
</span></span><span style="display:flex;"><span><span style="color:#f92672">from</span> netaddr <span style="color:#f92672">import</span> <span style="color:#f92672">*</span>
</span></span><span style="display:flex;"><span><span style="color:#f92672">from</span> socket <span style="color:#f92672">import</span> timeout
</span></span><span style="display:flex;"><span><span style="color:#f92672">from</span> urllib.request <span style="color:#f92672">import</span> Request, urlopen
</span></span><span style="display:flex;"><span><span style="color:#f92672">from</span> urllib.error <span style="color:#f92672">import</span> URLError, HTTPError
</span></span><span style="display:flex;"><span>
</span></span><span style="display:flex;"><span><span style="color:#75715e"># Prototype variables</span>
</span></span><span style="display:flex;"><span>n <span style="color:#f92672">=</span> <span style="color:#66d9ef">False</span>
</span></span><span style="display:flex;"><span>
</span></span><span style="display:flex;"><span><span style="color:#75715e"># Bootup messaging and syslog</span>
</span></span><span style="display:flex;"><span>syslog<span style="color:#f92672">.</span>openlog(logoption<span style="color:#f92672">=</span>syslog<span style="color:#f92672">.</span>LOG_PID, facility<span style="color:#f92672">=</span>syslog<span style="color:#f92672">.</span>LOG_INFO)
</span></span><span style="display:flex;"><span>syslog<span style="color:#f92672">.</span>syslog(<span style="color:#e6db74">&#39;Starting Emerging Threats (ET) IPTables update script....&#39;</span>)
</span></span><span style="display:flex;"><span>print (<span style="color:#e6db74">&#39;Starting Emerging Threats (ET) IPTables update script....&#39;</span>)
</span></span><span style="display:flex;"><span>
</span></span><span style="display:flex;"><span><span style="color:#75715e"># Two times a day timer</span>
</span></span><span style="display:flex;"><span>timer <span style="color:#f92672">=</span> <span style="color:#ae81ff">43200</span>
</span></span><span style="display:flex;"><span>
</span></span><span style="display:flex;"><span><span style="color:#75715e"># Sleep a bit after an timeout.</span>
</span></span><span style="display:flex;"><span>timeout_timer <span style="color:#f92672">=</span> <span style="color:#ae81ff">120</span>
</span></span><span style="display:flex;"><span>
</span></span><span style="display:flex;"><span><span style="color:#75715e"># The location of the Emerging Threats revison number file.</span>
</span></span><span style="display:flex;"><span>emerging_root <span style="color:#f92672">=</span> <span style="color:#e6db74">&#39;https://rules.emergingthreats.net/fwrules&#39;</span>
</span></span><span style="display:flex;"><span>emerging_fwrev <span style="color:#f92672">=</span> emerging_root <span style="color:#f92672">+</span> <span style="color:#e6db74">&#39;/FWrev&#39;</span>
</span></span><span style="display:flex;"><span>emerging_fwrules <span style="color:#f92672">=</span> emerging_root <span style="color:#f92672">+</span> <span style="color:#e6db74">&#39;/emerging-Block-IPs.txt&#39;</span>
</span></span><span style="display:flex;"><span>
</span></span><span style="display:flex;"><span><span style="color:#75715e"># Temporary files</span>
</span></span><span style="display:flex;"><span>tmp_dir <span style="color:#f92672">=</span> <span style="color:#e6db74">&#39;/tmp&#39;</span>
</span></span><span style="display:flex;"><span>rules_file <span style="color:#f92672">=</span> tmp_dir <span style="color:#f92672">+</span> <span style="color:#e6db74">&#39;/emerging_iptables2.txt&#39;</span>
</span></span><span style="display:flex;"><span>
</span></span><span style="display:flex;"><span><span style="color:#75715e"># Binary location</span>
</span></span><span style="display:flex;"><span>iptables <span style="color:#f92672">=</span> <span style="color:#e6db74">&#39;/sbin/iptables&#39;</span>
</span></span><span style="display:flex;"><span>ipset <span style="color:#f92672">=</span> <span style="color:#e6db74">&#39;/sbin/ipset&#39;</span>
</span></span><span style="display:flex;"><span>
</span></span><span style="display:flex;"><span><span style="color:#75715e"># Iptable chains</span>
</span></span><span style="display:flex;"><span>iptables_att_chain <span style="color:#f92672">=</span> <span style="color:#e6db74">&#39;ATTACKERS&#39;</span>
</span></span><span style="display:flex;"><span>iptables_drop_chain <span style="color:#f92672">=</span> <span style="color:#e6db74">&#39;ETLOGDROP&#39;</span>
</span></span><span style="display:flex;"><span>
</span></span><span style="display:flex;"><span><span style="color:#75715e"># ipset names</span>
</span></span><span style="display:flex;"><span>ipset_botccnet <span style="color:#f92672">=</span> <span style="color:#e6db74">&#39;botccnet&#39;</span>
</span></span><span style="display:flex;"><span>
</span></span><span style="display:flex;"><span><span style="color:#75715e"># Get the current IPTables ruleset revison number.</span>
</span></span><span style="display:flex;"><span><span style="color:#66d9ef">def</span> <span style="color:#a6e22e">get_fw_rev</span>():
</span></span><span style="display:flex;"><span>    response <span style="color:#f92672">=</span> urllib<span style="color:#f92672">.</span>request<span style="color:#f92672">.</span>urlopen(emerging_fwrev)
</span></span><span style="display:flex;"><span>    data <span style="color:#f92672">=</span> response<span style="color:#f92672">.</span>read()
</span></span><span style="display:flex;"><span>    text <span style="color:#f92672">=</span> data<span style="color:#f92672">.</span>decode(<span style="color:#e6db74">&#39;utf-8&#39;</span>)
</span></span><span style="display:flex;"><span>    <span style="color:#66d9ef">return</span> text
</span></span><span style="display:flex;"><span>
</span></span><span style="display:flex;"><span><span style="color:#75715e"># Get the firewall rules and ignore the errors</span>
</span></span><span style="display:flex;"><span><span style="color:#66d9ef">def</span> <span style="color:#a6e22e">get_fw_rules</span>():
</span></span><span style="display:flex;"><span>    <span style="color:#66d9ef">try</span>:
</span></span><span style="display:flex;"><span>      <span style="color:#66d9ef">with</span> urllib<span style="color:#f92672">.</span>request<span style="color:#f92672">.</span>urlopen(emerging_fwrules) <span style="color:#66d9ef">as</span> response, open(rules_file, <span style="color:#e6db74">&#39;wb&#39;</span>) <span style="color:#66d9ef">as</span> out_file:
</span></span><span style="display:flex;"><span>            data <span style="color:#f92672">=</span> response<span style="color:#f92672">.</span>read() <span style="color:#75715e"># a `bytes` object</span>
</span></span><span style="display:flex;"><span>            out_file<span style="color:#f92672">.</span>write(data)
</span></span><span style="display:flex;"><span>    <span style="color:#66d9ef">except</span> HTTPError <span style="color:#66d9ef">as</span> e:
</span></span><span style="display:flex;"><span>        print(<span style="color:#e6db74">&#39;There was an error: &#39;</span>, e<span style="color:#f92672">.</span>code)
</span></span><span style="display:flex;"><span>        <span style="color:#66d9ef">pass</span>
</span></span><span style="display:flex;"><span>    <span style="color:#66d9ef">except</span> URLError <span style="color:#66d9ef">as</span> e:
</span></span><span style="display:flex;"><span>        print(<span style="color:#e6db74">&#39;Something went wrong in reaching the server: &#39;</span>, e<span style="color:#f92672">.</span>reason)
</span></span><span style="display:flex;"><span>        <span style="color:#66d9ef">pass</span>
</span></span><span style="display:flex;"><span>    <span style="color:#66d9ef">except</span> <span style="color:#a6e22e">ConnectionResetError</span>:
</span></span><span style="display:flex;"><span>        print(<span style="color:#e6db74">&#39;---&gt; Connection reset, retrying in &#39;</span> <span style="color:#f92672">+</span> timeout_timer)
</span></span><span style="display:flex;"><span>        time<span style="color:#f92672">.</span>sleep (timeout_timer)
</span></span><span style="display:flex;"><span>        process_et_rules()
</span></span><span style="display:flex;"><span>        <span style="color:#66d9ef">pass</span>
</span></span><span style="display:flex;"><span>    <span style="color:#66d9ef">except</span> timeout:
</span></span><span style="display:flex;"><span>        print(<span style="color:#e6db74">&#39;---&gt; Connection timed out, retrying in &#39;</span> <span style="color:#f92672">+</span> timeout_timer)
</span></span><span style="display:flex;"><span>        time<span style="color:#f92672">.</span>sleep (timeout_timer)
</span></span><span style="display:flex;"><span>        process_et_rules()
</span></span><span style="display:flex;"><span>        <span style="color:#66d9ef">pass</span>
</span></span><span style="display:flex;"><span>
</span></span><span style="display:flex;"><span><span style="color:#75715e"># Be able to fork a process</span>
</span></span><span style="display:flex;"><span><span style="color:#66d9ef">def</span> <span style="color:#a6e22e">parent_child</span>():
</span></span><span style="display:flex;"><span>    n <span style="color:#f92672">=</span> os<span style="color:#f92672">.</span>fork()
</span></span><span style="display:flex;"><span>
</span></span><span style="display:flex;"><span>    <span style="color:#75715e"># If N is &gt;0 then a child had not yet been forked (we are in master process)</span>
</span></span><span style="display:flex;"><span>    <span style="color:#66d9ef">if</span> n <span style="color:#f92672">&gt;</span> <span style="color:#ae81ff">0</span>:
</span></span><span style="display:flex;"><span>
</span></span><span style="display:flex;"><span>        <span style="color:#75715e"># Setup first tables, they will not be readded later on.</span>
</span></span><span style="display:flex;"><span>        os<span style="color:#f92672">.</span>system(iptables <span style="color:#f92672">+</span> <span style="color:#e6db74">&#39; -N &#39;</span> <span style="color:#f92672">+</span> iptables_att_chain)
</span></span><span style="display:flex;"><span>        os<span style="color:#f92672">.</span>system(iptables <span style="color:#f92672">+</span> <span style="color:#e6db74">&#39; -N &#39;</span> <span style="color:#f92672">+</span> iptables_drop_chain)
</span></span><span style="display:flex;"><span>
</span></span><span style="display:flex;"><span>        <span style="color:#75715e"># Flush previously assigned iptables and ipset parameters</span>
</span></span><span style="display:flex;"><span>        os<span style="color:#f92672">.</span>system(iptables <span style="color:#f92672">+</span> <span style="color:#e6db74">&#39; -F &#39;</span> <span style="color:#f92672">+</span> iptables_drop_chain)
</span></span><span style="display:flex;"><span>        os<span style="color:#f92672">.</span>system(iptables <span style="color:#f92672">+</span> <span style="color:#e6db74">&#39; -F &#39;</span> <span style="color:#f92672">+</span> iptables_att_chain)
</span></span><span style="display:flex;"><span>        os<span style="color:#f92672">.</span>system(iptables <span style="color:#f92672">+</span> <span style="color:#e6db74">&#39; -D FORWARD -j &#39;</span> <span style="color:#f92672">+</span> iptables_att_chain)
</span></span><span style="display:flex;"><span>        os<span style="color:#f92672">.</span>system(iptables <span style="color:#f92672">+</span> <span style="color:#e6db74">&#39; -D INPUT -j &#39;</span> <span style="color:#f92672">+</span> iptables_att_chain)
</span></span><span style="display:flex;"><span>
</span></span><span style="display:flex;"><span>        <span style="color:#75715e"># Create new iptables and ipset parameters</span>
</span></span><span style="display:flex;"><span>        os<span style="color:#f92672">.</span>system(iptables <span style="color:#f92672">+</span> <span style="color:#e6db74">&#39; -I FORWARD 1 -j &#39;</span> <span style="color:#f92672">+</span> iptables_att_chain)
</span></span><span style="display:flex;"><span>        os<span style="color:#f92672">.</span>system(iptables <span style="color:#f92672">+</span> <span style="color:#e6db74">&#39; -I INPUT 1 -j &#39;</span> <span style="color:#f92672">+</span> iptables_att_chain)
</span></span><span style="display:flex;"><span>        os<span style="color:#f92672">.</span>system(iptables <span style="color:#f92672">+</span> <span style="color:#e6db74">&#39; -A &#39;</span> <span style="color:#f92672">+</span> iptables_drop_chain <span style="color:#f92672">+</span> <span style="color:#e6db74">&#39; -j LOG --log-prefix &#34;ET BLOCK: &#34;&#39;</span>)
</span></span><span style="display:flex;"><span>        os<span style="color:#f92672">.</span>system(iptables <span style="color:#f92672">+</span> <span style="color:#e6db74">&#39; -A &#39;</span> <span style="color:#f92672">+</span> iptables_drop_chain <span style="color:#f92672">+</span> <span style="color:#e6db74">&#39; -j DROP&#39;</span>)
</span></span><span style="display:flex;"><span>
</span></span><span style="display:flex;"><span>        <span style="color:#75715e"># Remove current ipset list, and recreate it.</span>
</span></span><span style="display:flex;"><span>        os<span style="color:#f92672">.</span>system(ipset <span style="color:#f92672">+</span> <span style="color:#e6db74">&#39; -X &#39;</span> <span style="color:#f92672">+</span> ipset_botccnet)
</span></span><span style="display:flex;"><span>        os<span style="color:#f92672">.</span>system(ipset <span style="color:#f92672">+</span> <span style="color:#e6db74">&#39; -N &#39;</span> <span style="color:#f92672">+</span> ipset_botccnet <span style="color:#f92672">+</span> <span style="color:#e6db74">&#39; nethash&#39;</span>)
</span></span><span style="display:flex;"><span>
</span></span><span style="display:flex;"><span>        <span style="color:#75715e"># Create the ipset matching chain</span>
</span></span><span style="display:flex;"><span>        os<span style="color:#f92672">.</span>system(iptables <span style="color:#f92672">+</span> <span style="color:#e6db74">&#39; -A &#39;</span> <span style="color:#f92672">+</span> iptables_att_chain <span style="color:#f92672">+</span> <span style="color:#e6db74">&#39; -p ALL -m set --match-set &#39;</span> <span style="color:#f92672">+</span> ipset_botccnet <span style="color:#f92672">+</span> <span style="color:#e6db74">&#39; src,src -j &#39;</span> <span style="color:#f92672">+</span> iptables_drop_chain)
</span></span><span style="display:flex;"><span>        os<span style="color:#f92672">.</span>system(iptables <span style="color:#f92672">+</span> <span style="color:#e6db74">&#39; -A &#39;</span> <span style="color:#f92672">+</span> iptables_att_chain <span style="color:#f92672">+</span> <span style="color:#e6db74">&#39; -p ALL -m set --match-set &#39;</span> <span style="color:#f92672">+</span> ipset_botccnet <span style="color:#f92672">+</span> <span style="color:#e6db74">&#39; dst,dst -j &#39;</span> <span style="color:#f92672">+</span> iptables_drop_chain)
</span></span><span style="display:flex;"><span>
</span></span><span style="display:flex;"><span>    <span style="color:#75715e"># else if N = 0 then that means that we are in child mode and can start processing the et rules.</span>
</span></span><span style="display:flex;"><span>    <span style="color:#66d9ef">else</span>:
</span></span><span style="display:flex;"><span>        process_et_rules()
</span></span><span style="display:flex;"><span>
</span></span><span style="display:flex;"><span><span style="color:#66d9ef">def</span> <span style="color:#a6e22e">process_et_rules</span>():
</span></span><span style="display:flex;"><span>    <span style="color:#75715e"># Reset revision number before starting.</span>
</span></span><span style="display:flex;"><span>    ip_list <span style="color:#f92672">=</span> []
</span></span><span style="display:flex;"><span>    rev_num <span style="color:#f92672">=</span> <span style="color:#ae81ff">0</span>
</span></span><span style="display:flex;"><span>
</span></span><span style="display:flex;"><span>    <span style="color:#66d9ef">while</span> <span style="color:#66d9ef">True</span>:
</span></span><span style="display:flex;"><span>        old_rev_num <span style="color:#f92672">=</span> rev_num
</span></span><span style="display:flex;"><span>        rev_num <span style="color:#f92672">=</span> get_fw_rev()
</span></span><span style="display:flex;"><span>
</span></span><span style="display:flex;"><span>        <span style="color:#66d9ef">if</span> int(rev_num) <span style="color:#f92672">&gt;</span> int(old_rev_num):
</span></span><span style="display:flex;"><span>            get_fw_rules()
</span></span><span style="display:flex;"><span>
</span></span><span style="display:flex;"><span>            <span style="color:#75715e"># loop through rules file, remove empty lines and process the remaining ip</span>
</span></span><span style="display:flex;"><span>            <span style="color:#75715e"># by using a regular expression that matches &lt;wordboundary&gt;ipaddress&lt;wordboundary&gt;</span>
</span></span><span style="display:flex;"><span>            <span style="color:#66d9ef">with</span> open(rules_file, <span style="color:#e6db74">&#34;r&#34;</span>) <span style="color:#66d9ef">as</span> read_file:
</span></span><span style="display:flex;"><span>                lines <span style="color:#f92672">=</span> [line <span style="color:#66d9ef">for</span> line <span style="color:#f92672">in</span> read_file<span style="color:#f92672">.</span>readlines() <span style="color:#66d9ef">if</span> line<span style="color:#f92672">.</span>strip()]
</span></span><span style="display:flex;"><span>                <span style="color:#66d9ef">for</span> line <span style="color:#f92672">in</span> lines:
</span></span><span style="display:flex;"><span>                    line <span style="color:#f92672">=</span> line<span style="color:#f92672">.</span>strip()
</span></span><span style="display:flex;"><span>                    <span style="color:#66d9ef">if</span> re<span style="color:#f92672">.</span>findall(<span style="color:#e6db74">r</span><span style="color:#e6db74">&#39;\b\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}\/?[0-9]{1,2}?\b&#39;</span>,line):
</span></span><span style="display:flex;"><span>                        ip_list <span style="color:#f92672">+=</span> [IPNetwork(line)]
</span></span><span style="display:flex;"><span>            ip_list <span style="color:#f92672">=</span> cidr_merge(ip_list)
</span></span><span style="display:flex;"><span>            amount_addresses <span style="color:#f92672">=</span> len(ip_list)
</span></span><span style="display:flex;"><span>
</span></span><span style="display:flex;"><span>            <span style="color:#75715e"># Flush entries in the ipset list.</span>
</span></span><span style="display:flex;"><span>            os<span style="color:#f92672">.</span>system(ipset <span style="color:#f92672">+</span> <span style="color:#e6db74">&#39; flush &#39;</span> <span style="color:#f92672">+</span>  ipset_botccnet)
</span></span><span style="display:flex;"><span>
</span></span><span style="display:flex;"><span>            <span style="color:#66d9ef">for</span> ip_address <span style="color:#f92672">in</span> ip_list:
</span></span><span style="display:flex;"><span>                <span style="color:#75715e"># Add new entries from the list.</span>
</span></span><span style="display:flex;"><span>                os<span style="color:#f92672">.</span>system(ipset <span style="color:#f92672">+</span> <span style="color:#e6db74">&#39; -A &#39;</span> <span style="color:#f92672">+</span>  ipset_botccnet <span style="color:#f92672">+</span> <span style="color:#e6db74">&#39; &#39;</span> <span style="color:#f92672">+</span> str(ip_address))
</span></span><span style="display:flex;"><span>
</span></span><span style="display:flex;"><span>            <span style="color:#75715e"># Summarize what we did, so that we have an idea how many addresses should be there.</span>
</span></span><span style="display:flex;"><span>            syslog<span style="color:#f92672">.</span>syslog(<span style="color:#e6db74">&#34;Wrote </span><span style="color:#e6db74">%d</span><span style="color:#e6db74"> addresses to the ipset list, using ET version </span><span style="color:#e6db74">%d</span><span style="color:#e6db74">, going to sleep....&#34;</span> <span style="color:#f92672">%</span> (amount_addresses,int(rev_num)))
</span></span><span style="display:flex;"><span>            time<span style="color:#f92672">.</span>sleep (timer)
</span></span><span style="display:flex;"><span>        <span style="color:#66d9ef">else</span>:
</span></span><span style="display:flex;"><span>            syslog<span style="color:#f92672">.</span>syslog(<span style="color:#e6db74">&#34;The old version: </span><span style="color:#e6db74">%d</span><span style="color:#e6db74"> is the same as the current version: </span><span style="color:#e6db74">%d</span><span style="color:#e6db74">... sleeping a bit and retry....&#34;</span> <span style="color:#f92672">%</span> (int(old_rev_num), int(rev_num)))
</span></span><span style="display:flex;"><span>            time<span style="color:#f92672">.</span>sleep (timer)
</span></span><span style="display:flex;"><span>
</span></span><span style="display:flex;"><span><span style="color:#75715e"># If a child is not yet found, fork</span>
</span></span><span style="display:flex;"><span><span style="color:#66d9ef">if</span> n <span style="color:#f92672">==</span> <span style="color:#ae81ff">0</span>:
</span></span><span style="display:flex;"><span>    parent_child()
</span></span></code></pre></div>]]></content:encoded></item><item><title>The end of JR-Hosting</title><link>/posts/2020-03-19-jrhosting-ended/</link><pubDate>Thu, 19 Mar 2020 00:00:00 +0000</pubDate><guid>https://www.evilcoder.org/posts/2020-03-19-jrhosting-ended/</guid><description>&lt;p&gt;At the end of the month, my company JR-Webscripting en Hosting, will cease to exist. Justin and
myself thought things over and with changes in our lives in the entire last year(s), we decided
that we needed to spend our time differently. The time and effort of running your own business in
the (flooded) hosting market is extremely difficult. You need scale, and offer an interesting price.
And it will cost you countless hours. For us, it was worth this effort for almost 15 years, but
the balance was lost not that long ago. While our reasons where not in the financial sector
(In my opinion, the main reason for stopping most businesses), it does play along. The margins are
small with our pricing scheme, and the benefits are low. Too low factually. What weight most for
me was the investment of time that I can no longer realise that easily.&lt;/p&gt;</description><content:encoded><![CDATA[<p>At the end of the month, my company JR-Webscripting en Hosting, will cease to exist. Justin and
myself thought things over and with changes in our lives in the entire last year(s), we decided
that we needed to spend our time differently. The time and effort of running your own business in
the (flooded) hosting market is extremely difficult. You need scale, and offer an interesting price.
And it will cost you countless hours. For us, it was worth this effort for almost 15 years, but
the balance was lost not that long ago. While our reasons where not in the financial sector
(In my opinion, the main reason for stopping most businesses), it does play along. The margins are
small with our pricing scheme, and the benefits are low. Too low factually. What weight most for
me was the investment of time that I can no longer realise that easily.</p>
<p>So, since the beginning of october we decided to inform our customers and ask them to move to another
provider at the end of the contract. All our customers migrated quickly and recently we migrated away
the last customer. That marked the end of the hosting servers, we have them on shutdown and they will
be removed in a little. The site is still available as placeholder on my host and mail for the domain
will still be incoming for a little more.</p>
<p>For our customers and interested parties: Thank you for the trust in the past 15 years! It had been
a blast.</p>
]]></content:encoded></item><item><title>In Memoriam Freddy Mercury 5-9-1946 - 24-11-1991</title><link>/posts/2019-11-24-im-freddy-mercury/</link><pubDate>Sun, 24 Nov 2019 23:09:32 +0000</pubDate><guid>https://www.evilcoder.org/posts/2019-11-24-im-freddy-mercury/</guid><description>&lt;p&gt;On my old blog, I tried to remember the passing of Freddy Mercury periodically.
I failed to do that for several years. Freddy, wherever you may be, rest in peace.
I still remember your music and listen to it very often. I visited the concerts
of the remaining band members of Queen, it&amp;rsquo;s still amazing, even without you.&lt;/p&gt;
&lt;p&gt;One day, we will meet!&lt;/p&gt;
&lt;p&gt;Image used from express.co.uk and referenced from them:
&lt;img loading="lazy" src="https://cdn.images.express.co.uk/img/dynamic/35/590x/Freddie-Mercury-death-His-final-hours-1208498.jpg?r=1574550506127" alt="Freddy Mercury" title="Freddy Mercury" /&gt;&lt;/p&gt;</description><content:encoded><![CDATA[<p>On my old blog, I tried to remember the passing of Freddy Mercury periodically.
I failed to do that for several years. Freddy, wherever you may be, rest in peace.
I still remember your music and listen to it very often. I visited the concerts
of the remaining band members of Queen, it&rsquo;s still amazing, even without you.</p>
<p>One day, we will meet!</p>
<p>Image used from express.co.uk and referenced from them:

  <img loading="lazy" src="https://cdn.images.express.co.uk/img/dynamic/35/590x/Freddie-Mercury-death-His-final-hours-1208498.jpg?r=1574550506127" alt="Freddy Mercury"  title="Freddy Mercury"  /></p>
]]></content:encoded></item><item><title>NLUUG 2019 Najaarsconferentie</title><link>/posts/2019-11-22-nluug-2019/</link><pubDate>Fri, 22 Nov 2019 23:09:32 +0000</pubDate><guid>https://www.evilcoder.org/posts/2019-11-22-nluug-2019/</guid><description>&lt;p&gt;As the title states (in dutch sorry it&amp;rsquo;s the original name, but you can translate it to: autumn conference NLUUG2019), I was at the NLUUG 2019.
My last visit with Snow (now Sue) was when it was still in &amp;ldquo;De Reehorst&amp;rdquo; in Ede. Which appeared to have been a few years ago. One of the
reasons for not visiting it more often is that I was soo much into FreeBSD that I didn&amp;rsquo;t look around that much. That changed this year
when I stopped volunteering for FreeBSD. I got my RHCSA and RHCE this year and as technical field manager I decided to show my face and talk with
people (and learn something myself as well).&lt;/p&gt;</description><content:encoded><![CDATA[<p>As the title states (in dutch sorry it&rsquo;s the original name, but you can translate it to: autumn conference NLUUG2019), I was at the NLUUG 2019.
My last visit with Snow (now Sue) was when it was still in &ldquo;De Reehorst&rdquo; in Ede. Which appeared to have been a few years ago. One of the
reasons for not visiting it more often is that I was soo much into FreeBSD that I didn&rsquo;t look around that much. That changed this year
when I stopped volunteering for FreeBSD. I got my RHCSA and RHCE this year and as technical field manager I decided to show my face and talk with
people (and learn something myself as well).</p>
<p>To quickly summarize the day: It was great but exhausting :-).. numberous talks with coworkers but also old friends (Hi Johan, Rene, Ronny, Alain, Cor, I mean you for
example!). For me this was a first time as technical field manager at a conference. The SUE team was the biggest team of them all I think so that was great to see.
Thank you all coworkers for your visit and your big enthusiasm. I hope that we can visit many more of these conferences!</p>
<p>About the talks:</p>
<p>The keynote (by David Blank-Edelman) at first was very interesting and eye-opening. Not only because of the talk, but also because of the employer of David, Microsoft. A while ago I found
that MS was seen more and more on open-source territory and I think this demonstrates that I am right about that. Nevertheless we got a serious talk about Site Reliability
Engineering and what angles you can look at it. The main thing that David demonstrated is that &ldquo;it depends&rdquo;. You need to find a way to first describe your company and
wishes, but also your clients. Reliability in this regard is measured at the client instead of internal monitoring/metric gathering. For example if you have 100 servers
and a few of them go down, are you in panic ? It depends! If the customer doesn&rsquo;t notice anything, just keep chilling. If the client does notice anything, like not being
able to access your site, or add items to the shopping cart.. then make sure it starts working again! You need to define SLI and SLO&rsquo;s (Service Level indicators, which
metrics at what &ldquo;item&rdquo; in the business chain and Service Level Objectives: How do you want things to perform, what is your goal). I think you can do that with proper setup
monitoring that not only checks availability but also does an actual login, or an actual shopping cart experience. When I worked for a major ISP in .NL they did that with
Selenium. The setup replicated a user login from various remote places.</p>
<p>My next talk was about making scripts better by my old coworker and friend Michael Boelen. I enjoyed this talk, I am experienced in writing shell scripts, but still I
learned a few things that I didnt know before. I also understand better on how to approach creating new scripts and what the caveats are for being posix compliant. Michael
had the crowd on his hand, he got a very interactive talk and still keeping track on the objective from his talk. It was appreciated Michael!</p>
<p>After that I visited the talk about &ldquo;treating documentation as code&rdquo; by Hagen Bauer. I visited that with in my huge documentation experience from FreeBSD. Hagen has a setup
where he uses asciidoctor and some modifications to print his documentation in various formats. It can use external input as well as just regular &lsquo;md&rsquo; kind of files. So
once prepared, you can more easily write documentation just in ascci/plain text and if you have set it up with a CI/CD pipeline for example you can auto generate new documentation
when you have a commit or change in your GIT repo. I think this lowers the barrier if there is a template and all you need to do is fill in an text file (With some markup).
If I ever have time, this is really interesting to understand better!</p>
<p>After Hagen&rsquo;s talk we had lunch. There were many things to choose from, a dangerous approach because of an after lunch dip risk.</p>
<p>Next up after the lunch was a talk from Koen de Jonge, board member for NLUUG. His talk was about a dream or idea: Community Hosted Open Source Infrastructure. (CHOSI.org).
This dream started with how we (I include myself there) used to learn and do things, touch real hardware, modify kernels, wait ages for an kernel or program compilation
completed and noticing that you made a mistake. Where nowadays people &ldquo;take care&rdquo; of you. The educational value of having in-depth knowledge about products is going away.
The cloud offers items that you dont have to touch at all. Ofcourse the cloud infra people need to do so, but that group of people is being reduced in the world. See for
example RHCE8, you learn ansible.. which is a great and fun thing to do, but you dont learn in-depth technical hacks on the commandline anymore. With this talk Koen tried
to take the audience to a world which we knew from the past and bring that back. The general idea is to have at least one or more racks with own equipment which you can use
to start all kinds of vm&rsquo;s, from linux to a bsd to solaris. With a &ldquo;bierviltje&rdquo; calculation he noticed the required funding which would be approx 12 euro per user. I am
very much interested!</p>
<p>Further down the road I visited the XS4all moet blijven talk from Anco Scholte ter Horst, current CEO of &ldquo;Freedom Internet&rdquo; (The new XS4all). Anco took us down the road
which was followed after announcing that XS4all needs to be assimilated by KPN. He told us about the fight they have put up to save the company, to see alternatives and
finally after another reply from KPN that they were going to assimilate XS4all and drop the company behind it, the birth of Freedom Internet. A very nice and driven talk
from Anco, the crowd was very interested including myself. Lets see where this is heading and hopefully they can do what they want to do!</p>
<p>Next in line I visited &ldquo;what does vNUMA actually mean?&rdquo; by Wim ten Have. Wim appears to be extremely technical and possesses knowledge that not many people have.
During this track I was from time to time very lost. Not because Wim didn&rsquo;t explain, but because I didn&rsquo;t cope the in depth knowledge. NUMA is known for making processors
able to directly access memory regions. In order to use that effectively you should combine CPU&rsquo;s that are near each other and share the same NUMA domain. vNUMA is an
addition to QEMU / KVM and enables automatic mapping of NUMA within a VM basically. (Someone correct me if I am wrong ;-)). Sadly, if you are not that experienced
you will loose much of the information presented.</p>
<p>Just before attending the last talk, I joined Martin Geusebroek&rsquo;s talk about &ldquo;Counter Social Engineering&rdquo;. Martin is an experienced HUMINT officer and extremely knowledgeable
about this subject. He gave multiple examples on how things work. There were a few demo&rsquo;s / recordings of social engineering stuff that actually worked. Next to that he
also did a &ldquo;remember the given names&rdquo;, where he did try to influence your brain. In the recap we were presented the given names. One of them was not in the list but your
head thought it was, because a lot of the words shared the same topic. Your brain fills in the details. That makes social engineers able to influence you without you actually
realising. When I worked at ING we had such trainings periodically and then for entire days. Always think who asks what and why. Try to properly verify someone&rsquo;s identity and
when in doubt, just get help from senior management. Even if the director is giving you a hard time, it&rsquo;s in his companies best interest if you are very firm and solid in your
work. Thanks Martin for bringing this topic to NLUUG!</p>
<p>and finally the closing keynote:
Tales (Fails) from the trenches… by Edwin den Andel. Edwin is a very classic hacker, in the sense that the name hacker was actually ment. Edwin is creative and thinks out of
the box to try and obtain information. Not for the worse but for the better. Nowadays hackers are seen as nerds that break into computers and steal stuff. Edwin and Zerocopter
behind him try to address that. They want to receive vulnerability information and highly suggest that you do not download entire datasets, but just one or two rows to proof
that you can access data. Else you will get into the dark mazes of the law and you might even be prosecuted. Next to advocating the right thing, Edwin also gave numberous
examples on how companies failed. I felt really connected with this topic and I think a lot of people found this the best talk of the day. Edwin easily presents his knowledge
and is easy to follow. Edwin, I enjoyed your talk a lot, thank you!</p>
<p>After all these talks people needed drinks and beverages. My employer SUE sponsored these and a lot of people stayed until it was time to wrap up.
Together with a few coworkers from SUE, we were the last ones to leave the conference. I hope to be able to rejoin the NLUUG conference next year, either in my current
role or in a new role.</p>
]]></content:encoded></item><item><title>Aandacht voor de leraar</title><link>/posts/2019-11-08-aandacht-voor-de-leraar/</link><pubDate>Fri, 08 Nov 2019 23:09:32 +0000</pubDate><guid>https://www.evilcoder.org/posts/2019-11-08-aandacht-voor-de-leraar/</guid><description>&lt;p&gt;Voor Sue is het opleiden van onze mensen belangrijk. Wij zorgen er dan ook voor dat onze collega&amp;rsquo;s door ons (Fieldmanagers) bezocht worden, om zaken op technisch vlak maar
ook opleidings vlak door te spreken en regelmatig te plannen waarmee en hoe iemand zich wil ontwikkelen. Vervolgens maken we dat als bedrijf mogelijk door opleidingen te
faciliteren, studiedagen al contractueel beschikbaar te stellen, de kosten te betalen van de opleiding EN de certificering.&lt;/p&gt;</description><content:encoded><![CDATA[<p>Voor Sue is het opleiden van onze mensen belangrijk. Wij zorgen er dan ook voor dat onze collega&rsquo;s door ons (Fieldmanagers) bezocht worden, om zaken op technisch vlak maar
ook opleidings vlak door te spreken en regelmatig te plannen waarmee en hoe iemand zich wil ontwikkelen. Vervolgens maken we dat als bedrijf mogelijk door opleidingen te
faciliteren, studiedagen al contractueel beschikbaar te stellen, de kosten te betalen van de opleiding EN de certificering.</p>
<p>In het bedrijfsleven, werkende voor Sue, ben ik dus gewend dat er een goede strikte focus is op ontwikkeling en opleiding.</p>
<p>Wij verzorgen regelmatig opleidingen in-house, en geven die of zelf met onze gecertificeerde collega&rsquo;s of er komt een leraar extern binnen om de opleiding te geven. De
groepen worden niet te groot gemaakt zodat een ieder de benodigde aandacht kan krijgen. Tijdens onze studie dagen/weken is het mogelijk om savonds te blijven mee eten
en met elkaar kennis te kunnen delen. Wij staan dus voor een kwalitatief hoogwaardig leertraject.</p>
<p>Mijn vrouw is leerkracht, een werkgebied waar ze voor gekozen heeft om onze toekomst (de mensen die ons straks moeten onderhouden!) te begeleiden en op te kunnen leiden
zodat ze een fijne periode in de maatschappij kunnen hebben, hun steentje kunnen bijdragen en goed opgeleid ten tonele komen.</p>
<p>Ik had verwacht dat in het onderwijs, waar de dienst &ldquo;het opleiden van onze toekomst&rdquo; is, een veel grotere focus heeft dan het commerciele bedrijfsleven.
Helaas is niets minder waar. Er zijn heel veel administratieve handelingen. Er komen steeds meer leerlingen in een groep, waardoor persoonlijke aandacht bijna niet realiseerbaar is.
Er moeten ontzettend veel zaken buiten schooltijd worden gedaan en geregeld. Ouders worden steeds mondiger en verwachten meer en meer van de leraar, ze worden zelfs boos als
het kind in kwestie niet op het niveau scoort die ze graag zien. Door al die zaken is het in mijn ogen ontzettend moeilijk om kwalitatief hoogwaardig onderwijs te kunnen leveren.</p>
<p>Ondanks de grote hoeveelheid werk en taken, is er een enorme onderwaarding voor het werk, een fulltime docent werkt in mijn ogen minstens 50% buiten schooltijd (geen lestijd!) extra.
We hebben het dan over dik 60 uur per week. In het bedrijfsleven zouden deze leraren daar een goed salaris en voorzieningen voor krijgen (het is immers de primaire dienst). In plaats
daarvan worden leraren beloond met meer werk, meer administratie, en meer kinderen in de klas.</p>
<p>Als wij straks zelf oud zijn, en we kunnen niet de aandacht geven die nodig is, wie is er dan nog goed genoeg opgeleid om ons te verzorgen?
Is het echt nodig dat we hierover twijfelen en ons zorgen maken? Niet als er een juiste en gelijkwaardige waardering voor het werk is.</p>
<p>Ik heb ontzettend veel respect voor de leraren die gestaakt hebben en acties opzetten om hier aandacht voor te vragen. Ja het is soms niet zo handig
als je kind thuis zit (geldt net zo goed voor ons), maar het is het waard. Het gaat over onze toekomst! De overheid en samenleving moet dit goed regelen, niet 1 malig maar
structureel. Ik hoop dat wij daarmee ook zorgeloos van onze oude dag kunnen genieten.</p>
<p>Dank,
Remko</p>
]]></content:encoded></item><item><title>Migrated to Linux</title><link>/posts/2019-09-10-migrated-to-linux/</link><pubDate>Tue, 10 Sep 2019 00:00:00 +0000</pubDate><guid>https://www.evilcoder.org/posts/2019-09-10-migrated-to-linux/</guid><description>&lt;p&gt;If you would have asked me a few years ago, whether I was going to migrate my servers to Linux?
I would have laughed and not even consider it. Since 2004 I have hosted all my own servers on the
FreeBSD OS. I had one CentOS machine, because OpenXchange on FreeBSD was not the best experience.
But now, in 2019, all my servers are running one of the Linux OS&amp;rsquo;es. Mainly Ubuntu.&lt;/p&gt;</description><content:encoded><![CDATA[<p>If you would have asked me a few years ago, whether I was going to migrate my servers to Linux?
I would have laughed and not even consider it. Since 2004 I have hosted all my own servers on the
FreeBSD OS. I had one CentOS machine, because OpenXchange on FreeBSD was not the best experience.
But now, in 2019, all my servers are running one of the Linux OS&rsquo;es. Mainly Ubuntu.</p>
<h2 id="how-did-we-get-there">How did we get there?</h2>
<p>Short summary: I did not feel at home anymore.</p>
<p>Larger summary: The creation of the Code of Conduct within FreeBSD made me frown a lot, and still does. It&rsquo;s
largely American oriented and does not take non-American stuff in consideration, or not enough.
The current leadership is more worried about personal social media posts and how to respond to
that then about guiding the project into the next phase. The world is not entirely American and
different people with different cultures were welcome within FreeBSD. My personal feeling is that
that is no longer the case.</p>
<p>I realise that if you read this, this might make you frown as well. I am a long standing community
member, which covers a large part of my adult life. Does all this outweigh my long-term connection
to the project? Yes.</p>
<p>Beyond the &ldquo;social&rdquo; side of the project, I also think that while being conservative, we missed the boat
on multiple occassions. Things come in late, or are not &ldquo;addressed&rdquo; at all. Take containers. They are
the current hype for microservices. There is no way to do something with that within FreeBSD. FreeBSD
has jails, which is a more heavy weight container-kind-of-solution. Or better said it is a more lightweight
virtual machine instead.</p>
<p>Tools that use containers, like Gitlab CI/CD and many other things make use of those services. FreeBSD
just does not have them. It&rsquo;s not sexy enough to run it in your DC. Sadly I do not see much activity
company wise in the Netherlands either that suggests that I am wrong. Most things that I do see in my
professional life are Linux related machines.</p>
<h2 id="is-this-the-end-for-me">Is this the end for me?</h2>
<p>With my current FreeBSD implementations, yes. All my machines are migrated to Linux, there are no
exceptions anymore. This makes it easier for my automation tooling, because everything runs on the
same foundation and files can be found on the same place. Same goes for packages etc.</p>
<p>Farewell FreeBSD, you have served me well and I think that I earned the right to use it by all my
contributions. I hope that a less politically minded core team stands up at some point and changes
the game. Perhaps that will make me rejoin the project that I once was so proud of.</p>
]]></content:encoded></item><item><title>In Memoriam Paul Schenkeveld 1963-2015</title><link>/posts/2019-11-24-im-paul-schenkeveld/</link><pubDate>Sun, 24 Feb 2019 23:09:32 +0000</pubDate><guid>https://www.evilcoder.org/posts/2019-11-24-im-paul-schenkeveld/</guid><description>&lt;p&gt;A few years ago, I was informed that Paul Schenkeveld had passed away. That
was very unpleasant news ofcourse. I knew Paul for some years, at the D-BUG
or NLUUG BSD days he was one of the organisers and I was one of the speakers
back then. In addition he was one of the main organisers of the 2011 EuroBSDCon in
Maarssen. I always saw Paul.. and then Cor.. or the other way around.&lt;/p&gt;</description><content:encoded><![CDATA[<p>A few years ago, I was informed that Paul Schenkeveld had passed away. That
was very unpleasant news ofcourse. I knew Paul for some years, at the D-BUG
or NLUUG BSD days he was one of the organisers and I was one of the speakers
back then. In addition he was one of the main organisers of the 2011 EuroBSDCon in
Maarssen. I always saw Paul.. and then Cor.. or the other way around.</p>
<p>So when I saw Cor at the NLUUG a few days ago.. I missed Paul ofcourse. I had
not seen Cor for a few years and not after Paul&rsquo;s passing.
Seeing Cor alone instantly reminded me of Paul. You are still missed Paul.
Rest in peace!</p>
<p>Image taken from db.net where both Paul (Left) and Cor (Right) appeared on
photo.</p>
<p>
  <img loading="lazy" src="http://www.db.net/gallery/BSDCan/BSDCan_2010_day_2/Images/6.jpg" alt="Paul and Cor"  title="Paul and Cor on BSDCan 2010"  /></p>
]]></content:encoded></item><item><title>FreeBSD Dutch Documentation Project</title><link>/2017/03/22/freebsd-dutch-documentation-project/</link><pubDate>Wed, 22 Mar 2017 14:01:11 +0000</pubDate><guid>https://www.evilcoder.org/2017/03/22/freebsd-dutch-documentation-project/</guid><description>&lt;p&gt;So. It had been a while before I had proper time to look into the Dutch translation efforts again.&lt;/p&gt;
&lt;h2 id="history"&gt;History&lt;/h2&gt;
&lt;p&gt;Due to various reasons not discussed here, I was not able to see to a proper translation. Rene did a lot of work (thank you for that Rene!).&lt;/p&gt;
&lt;h2 id="the-po-system"&gt;The PO system&lt;/h2&gt;
&lt;p&gt;First of all, i am going to discuss a bit about the PO system, which is a gettext way of doing translations. It chops texts into msgstr’s (message strings) and then translates those strings using msgid’s. Same lines are translated the same, this might be a good option, unless the context changed between the lines and then you might get ‘google translate’ kind of ways.&lt;/p&gt;</description><content:encoded><![CDATA[<p>So. It had been a while before I had proper time to look into the Dutch translation efforts again.</p>
<h2 id="history">History</h2>
<p>Due to various reasons not discussed here, I was not able to see to a proper translation. Rene did a lot of work (thank you for that Rene!).</p>
<h2 id="the-po-system">The PO system</h2>
<p>First of all, i am going to discuss a bit about the PO system, which is a gettext way of doing translations. It chops texts into msgstr’s (message strings) and then translates those strings using msgid’s. Same lines are translated the same, this might be a good option, unless the context changed between the lines and then you might get ‘google translate’ kind of ways.</p>
<p>Back to the story…</p>
<p>After getting time again to see this through I noticed that we started using the “PO” system, using gettext. Our handbook (for example) is now translated into one huge book.xml file which is then cut into msgstr’s that can be translated to msgid’s. For this I use the poedit application (the PRO version) so that I have counters and translation suggestions from the online Translation Memory(TM) that we all develop. I also contribute the FreeBSD translations back to the TM so that everyone can profit from it.</p>
<p>I am now first synchronising the Glossary because that didn’t change much with the current online translation and working my way back to what had been translated already and translating the missing bits and pieces in between. Mike (co worker at Snow) also did a tremendous job in getting this into better shape the last year which had not yet been merged back to the online variants because it was not yet complete. I can use that information though to generate a manual handbook variant of that version and use that to even further use the current translation effort into the gettext/po system.</p>
<h2 id="biting-the-bullet">Biting the bullet</h2>
<p>As one of the first translation teams to use this, I expect to hit some rocks on the road. For example, there are lines that do not need translation, mailing list names are the same in every language, perhaps the description changes but not the ‘realnames’. Same goes for my entity (&amp;a.remko) which does not change, nor my PGPkey. And if those things change, they require changing over all translation efforts as well as the original english version. We are looking into a way to ‘ignore’ them for the po system but include them when building. So that pgpkeys and such are always up to date.</p>
<p>I also had been discussing this with Vaclav the developer of poedit, and he mentioned that it does not matter much, because when a line changes and you update the po, those lines will be invalidated and need ‘retranslation’ for the entire string. So that all gets us in interesting situations that we did not encounter before. I am biting the bullet myself after we have discussed this a few years ago and I hope that the entire project can benefit from that.</p>
<h2 id="alternative-options-pre-translate-merge-current-translations-automatically">Alternative options, pre-translate, merge current translations automatically?</h2>
<p>And yes, a valid question would be, cannot you merge the current translated information into the po system automatically. If every word was on the exact same spot and line, yes this might be an option. Sadly because of grammer and different wording (longer/shorter) this changes rapidly from line 1 already and is thus not easily done. If you have suggestions however, we are always willing to listen. Please join us on <a href="mailto:translators@FreeBSD.org">translators@FreeBSD.org</a> so that we can discuss those things better :-).</p>
]]></content:encoded></item><item><title>Kobo readers using the internet</title><link>/2017/03/22/kobo-readers-using-the-internet/</link><pubDate>Wed, 22 Mar 2017 13:13:49 +0000</pubDate><guid>https://www.evilcoder.org/2017/03/22/kobo-readers-using-the-internet/</guid><description>&lt;p&gt;So I have this situation, where I couldn’t get my kobo reader to connect to the internet and fetch updates and/or use kobo+ for example.&lt;/p&gt;
&lt;p&gt;I started debugging with Ubiquiti ages ago to see where the problem lies. In the meantime I was unable to continue with this, but I had an interesting thought yesterday. I sniffed the traffic from the hardware (mac) address of the ereader and noticed that it tried to resolve: &lt;a href="http://www.msftncsi.com"&gt;http://www.msftncsi.com&lt;/a&gt; and fetch /ncsi.txt. The site is a microsoft network connection information page that informs microsoft systems whether or not an active internet connection is seen.&lt;/p&gt;</description><content:encoded><![CDATA[<p>So I have this situation, where I couldn’t get my kobo reader to connect to the internet and fetch updates and/or use kobo+ for example.</p>
<p>I started debugging with Ubiquiti ages ago to see where the problem lies. In the meantime I was unable to continue with this, but I had an interesting thought yesterday. I sniffed the traffic from the hardware (mac) address of the ereader and noticed that it tried to resolve: <a href="http://www.msftncsi.com">http://www.msftncsi.com</a> and fetch /ncsi.txt. The site is a microsoft network connection information page that informs microsoft systems whether or not an active internet connection is seen.</p>
<p>Somehow it seems that Kobo is also using that for it’s android based readers as well. Without it, the network connection just disconnects and does nothing. That is somewhat upsetting because the device is just perfectly able to connect to the network(s) and has relative free internet access. One thing is that I filter on DNS responses and exclude known malware/spam hosts and analytics sites like google. This reduces the amount of advertorials on the internet and bogus trackers. It seems that msftncsi.com is also on that list and thus gets an NXDOMAIN when querying for it.</p>
<p>I do not entirely understand why an ereader would need this kind of information before being able to connect to the internet. The device should associate with a WiFi access point and get an address and the like. Whether or not that gives continued access to the internet is something that is a next step. So instead of giving up, it could just mark the WiFi symbol with an exclamation mark (!) to report that something might not work and/or just try to connect to the kobo internet environment. That would be more common use of the internet then depending on an internet file which might be blocked (such as in my case).</p>
<p>For now I changed my caching mikrotik’s to include msftncsi.com as a static entry and point that to my webserver and service the file instead. That makes sure the Kobo can connect to the environment and gives me full access over that file instead of some bogus remote site that might do nasty things (without me knowing).</p>
<p>Ofcourse I asked (nice and polite) Kobo to change this interesting behaviour.</p>
]]></content:encoded></item><item><title>Happy 2017!</title><link>/2017/01/04/happy-2017/</link><pubDate>Wed, 04 Jan 2017 19:59:39 +0000</pubDate><guid>https://www.evilcoder.org/2017/01/04/happy-2017/</guid><description>&lt;p&gt;After ‘relaunching’ my Blog I have been occupied with other activities. So I just took a little time to say “Happy 2017” to all of you. Perhaps there will be more entries this upcoming year.. 🙂&lt;/p&gt;</description><content:encoded>&lt;p>After ‘relaunching’ my Blog I have been occupied with other activities. So I just took a little time to say “Happy 2017” to all of you. Perhaps there will be more entries this upcoming year.. 🙂&lt;/p>
</content:encoded></item><item><title>Reorganised and back online</title><link>/2016/11/22/reorganised-and-back-online/</link><pubDate>Tue, 22 Nov 2016 12:45:12 +0000</pubDate><guid>https://www.evilcoder.org/2016/11/22/reorganised-and-back-online/</guid><description>&lt;p&gt;It took a gentle while to get the blog back up and running. I first considered
cleaning out the original blog, but that would have taken a lot of time and
effort. So instead I just vaporised the old blog (well, not really, but the
interwebs can no longer access it), and decided to rebuild the website. Please
feel welcome here, if I feel up for it, I might convert a few older blog
entries from the old blog to this new one. Do not expect periodic updates,
they will not happen probably.&lt;/p&gt;</description><content:encoded>&lt;p>It took a gentle while to get the blog back up and running. I first considered
cleaning out the original blog, but that would have taken a lot of time and
effort. So instead I just vaporised the old blog (well, not really, but the
interwebs can no longer access it), and decided to rebuild the website. Please
feel welcome here, if I feel up for it, I might convert a few older blog
entries from the old blog to this new one. Do not expect periodic updates,
they will not happen probably.&lt;/p>
</content:encoded></item><item><title>About my blogs</title><link>/2003/01/09/about-my-blogs/</link><pubDate>Thu, 09 Jan 2003 10:35:09 +0000</pubDate><guid>https://www.evilcoder.org/2003/01/09/about-my-blogs/</guid><description>&lt;p&gt;Back in 2003 I wrote the first bits of the site that you are visiting now. As an homage to that time I added a screenshot from the internet archive for future reference.
This will be back at some point.&lt;/p&gt;</description><content:encoded>&lt;p>Back in 2003 I wrote the first bits of the site that you are visiting now. As an homage to that time I added a screenshot from the internet archive for future reference.
This will be back at some point.&lt;/p>
</content:encoded></item></channel></rss>