<?xml version="1.0" encoding="utf-8"?><feed xmlns="http://www.w3.org/2005/Atom" ><generator uri="https://jekyllrb.com/" version="4.0.0">Jekyll</generator><link href="http://wnd.katei.fi//weblog/atom.xml" rel="self" type="application/atom+xml" /><link href="http://wnd.katei.fi//" rel="alternate" type="text/html" /><updated>2022-08-26T08:52:40+03:00</updated><id>http://wnd.katei.fi//weblog/atom.xml</id><title type="html">Random thoughts on software, technology, and stuff</title><subtitle>Random thoughts on software, technology, and stuff</subtitle><entry><title type="html">Timeouts and stream buffering with GNU coreutils</title><link href="http://wnd.katei.fi//weblog/2021-07-29-gnu-coreutils.html" rel="alternate" type="text/html" title="Timeouts and stream buffering with GNU coreutils" /><published>2021-07-29T14:26:32+03:00</published><updated>2021-07-29T15:07:03+03:00</updated><id>http://wnd.katei.fi//weblog/gnu-coreutils</id><content type="html" xml:base="http://wnd.katei.fi//weblog/2021-07-29-gnu-coreutils.html">&lt;p&gt;Use &lt;code class=&quot;highlighter-rouge&quot;&gt;timeout(1)&lt;/code&gt; to terminate application that runs for too long (and to sleep
for a fraction of a second), and &lt;code class=&quot;highlighter-rouge&quot;&gt;stdbuf(1)&lt;/code&gt; to disable buffering.&lt;/p&gt;

&lt;p&gt;Until now I’ve compiled a minimal tool (named usleep) when I’ve needed a script
to sleep for a fraction of a second. About a month ago I learned about
&lt;code class=&quot;highlighter-rouge&quot;&gt;timeout&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;I was working on a script that ran a commmand, and terminate it if it was
running for too long. I was doing this by forking the process, capturing its
pid, sleeping for a little bit, and checking whether the process was still
alive. The approach was fragile at best. After a bit of investigation I
discovered &lt;code class=&quot;highlighter-rouge&quot;&gt;timeout&lt;/code&gt;. Not only did it solve my issue out of the box, but it
also made another hack obsolete.&lt;/p&gt;

&lt;div class=&quot;language-shell highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;% &lt;span class=&quot;nb&quot;&gt;timeout &lt;/span&gt;0.2 curl &lt;span class=&quot;nt&quot;&gt;-s&lt;/span&gt; https://example.com &lt;span class=&quot;o&quot;&gt;&amp;gt;&lt;/span&gt;/dev/null &lt;span class=&quot;o&quot;&gt;||&lt;/span&gt; &lt;span class=&quot;nb&quot;&gt;echo &lt;/span&gt;fail
% &lt;span class=&quot;nb&quot;&gt;timeout&lt;/span&gt; .1 &lt;span class=&quot;nb&quot;&gt;sleep &lt;/span&gt;1
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;I often develop and test stream processors by generating output on command
line. Sometime I want to time the output generation, and sometimes I need time
resolution better than whole seconds. Until a month ago I used a trivial C
application. Now that’s no longer needed.&lt;/p&gt;

&lt;p&gt;Today I also discovered &lt;code class=&quot;highlighter-rouge&quot;&gt;stdbuf&lt;/code&gt;. &lt;code class=&quot;highlighter-rouge&quot;&gt;stdbuf&lt;/code&gt; can set stdin/stdout/stderr buffer
size to zero. This can also be super useful.&lt;/p&gt;

&lt;p&gt;Today I was running deleting a large set of
&lt;a href=&quot;https://www.borgbackup.org/&quot;&gt;BorgBackup&lt;/a&gt; archives, and wanted an estimate of
how long it would take. I knew how many lines of output Borg would produce, and
how many of those would be about actual work. I could use &lt;code class=&quot;highlighter-rouge&quot;&gt;pv(1)&lt;/code&gt;  to calculate
the estimate. There was a problem, however. The informative part of Borg output
was 1/5th of the entire output, and this made the ETA widely inaccurate. I
could use &lt;code class=&quot;highlighter-rouge&quot;&gt;sed&lt;/code&gt; to consume the irrelevant bits, but now the output would be
buffered and &lt;code class=&quot;highlighter-rouge&quot;&gt;pv&lt;/code&gt; would not receive realtime data. &lt;code class=&quot;highlighter-rouge&quot;&gt;stdbuf&lt;/code&gt; to the rescue!&lt;/p&gt;

&lt;div class=&quot;language-shell highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;c&quot;&gt;# without magic&lt;/span&gt;

% &lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nb&quot;&gt;seq &lt;/span&gt;4&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;for &lt;/span&gt;a &lt;span class=&quot;k&quot;&gt;in&lt;/span&gt; &lt;span class=&quot;si&quot;&gt;$(&lt;/span&gt;&lt;span class=&quot;nb&quot;&gt;seq &lt;/span&gt;8&lt;span class=&quot;si&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;do &lt;/span&gt;&lt;span class=&quot;nb&quot;&gt;echo&lt;/span&gt; &lt;span class=&quot;nv&quot;&gt;$a&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;nb&quot;&gt;timeout&lt;/span&gt; .5 &lt;span class=&quot;nb&quot;&gt;sleep &lt;/span&gt;1&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;done&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt; | pv &lt;span class=&quot;nt&quot;&gt;-l&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-s12&lt;/span&gt;
1
2
3
4
1
2
3.00  0:00:01 &lt;span class=&quot;o&quot;&gt;[&lt;/span&gt;5.97 /s] &lt;span class=&quot;o&quot;&gt;[==================&amp;gt;&lt;/span&gt;                   &lt;span class=&quot;o&quot;&gt;]&lt;/span&gt; 50% ETA 0:00:01
4
5.00  0:00:02 &lt;span class=&quot;o&quot;&gt;[&lt;/span&gt;1.99 /s] &lt;span class=&quot;o&quot;&gt;[========================&amp;gt;&lt;/span&gt;             &lt;span class=&quot;o&quot;&gt;]&lt;/span&gt; 66% ETA 0:00:01
6
70.0  0:00:03 &lt;span class=&quot;o&quot;&gt;[&lt;/span&gt;1.99 /s] &lt;span class=&quot;o&quot;&gt;[==============================&amp;gt;&lt;/span&gt;       &lt;span class=&quot;o&quot;&gt;]&lt;/span&gt; 83% ETA 0:00:00
8
12.0  0:00:04 &lt;span class=&quot;o&quot;&gt;[&lt;/span&gt;2.00 /s] &lt;span class=&quot;o&quot;&gt;[====================================&amp;gt;]&lt;/span&gt; 100% ETA 0:00:00



&lt;span class=&quot;c&quot;&gt;# skip the head&lt;/span&gt;

% &lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nb&quot;&gt;seq &lt;/span&gt;4&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;for &lt;/span&gt;a &lt;span class=&quot;k&quot;&gt;in&lt;/span&gt; &lt;span class=&quot;si&quot;&gt;$(&lt;/span&gt;&lt;span class=&quot;nb&quot;&gt;seq &lt;/span&gt;8&lt;span class=&quot;si&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;do &lt;/span&gt;&lt;span class=&quot;nb&quot;&gt;echo&lt;/span&gt; &lt;span class=&quot;nv&quot;&gt;$a&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;nb&quot;&gt;timeout&lt;/span&gt; .5 &lt;span class=&quot;nb&quot;&gt;sleep &lt;/span&gt;1&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;done&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt; | &lt;span class=&quot;nb&quot;&gt;sed &lt;/span&gt;1,4d &lt;span class=&quot;se&quot;&gt;\&lt;/span&gt;
	| pv &lt;span class=&quot;nt&quot;&gt;-l&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-s8&lt;/span&gt;
0.00  0:00:04 &lt;span class=&quot;o&quot;&gt;[&lt;/span&gt;0.00 /s] &lt;span class=&quot;o&quot;&gt;[&amp;gt;&lt;/span&gt;                                     &lt;span class=&quot;o&quot;&gt;]&lt;/span&gt;  0% ETA 0:00:00
zsh: &lt;span class=&quot;nb&quot;&gt;exit &lt;/span&gt;124    &lt;span class=&quot;o&quot;&gt;(&lt;/span&gt; &lt;span class=&quot;nb&quot;&gt;seq &lt;/span&gt;4&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;for &lt;/span&gt;a &lt;span class=&quot;k&quot;&gt;in&lt;/span&gt; &lt;span class=&quot;si&quot;&gt;$(&lt;/span&gt;&lt;span class=&quot;nb&quot;&gt;seq &lt;/span&gt;8&lt;span class=&quot;si&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;do&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;nb&quot;&gt;echo&lt;/span&gt; &lt;span class=&quot;nv&quot;&gt;$a&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;nb&quot;&gt;timeout&lt;/span&gt; .5 &lt;span class=&quot;nb&quot;&gt;sleep &lt;/span&gt;1&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;done&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;)&lt;/span&gt; | 
zsh: terminated  &lt;span class=&quot;nb&quot;&gt;sed &lt;/span&gt;1,4d |
zsh: &lt;span class=&quot;nb&quot;&gt;exit &lt;/span&gt;32     pv &lt;span class=&quot;nt&quot;&gt;-l&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-s8&lt;/span&gt;



&lt;span class=&quot;c&quot;&gt;# skip the head, don't fail&lt;/span&gt;

% &lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nb&quot;&gt;seq &lt;/span&gt;4&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;for &lt;/span&gt;a &lt;span class=&quot;k&quot;&gt;in&lt;/span&gt; &lt;span class=&quot;si&quot;&gt;$(&lt;/span&gt;&lt;span class=&quot;nb&quot;&gt;seq &lt;/span&gt;8&lt;span class=&quot;si&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;do &lt;/span&gt;&lt;span class=&quot;nb&quot;&gt;echo&lt;/span&gt; &lt;span class=&quot;nv&quot;&gt;$a&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;nb&quot;&gt;timeout&lt;/span&gt; .5 &lt;span class=&quot;nb&quot;&gt;sleep &lt;/span&gt;1 &lt;span class=&quot;o&quot;&gt;||&lt;/span&gt; &lt;span class=&quot;nb&quot;&gt;true&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;done&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt; | &lt;span class=&quot;se&quot;&gt;\&lt;/span&gt;
	&lt;span class=&quot;nb&quot;&gt;sed &lt;/span&gt;1,4d | pv &lt;span class=&quot;nt&quot;&gt;-l&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-s8&lt;/span&gt;
1.00  0:00:04 &lt;span class=&quot;o&quot;&gt;[&lt;/span&gt;0.00 /s] &lt;span class=&quot;o&quot;&gt;[&amp;gt;&lt;/span&gt;                                     &lt;span class=&quot;o&quot;&gt;]&lt;/span&gt;  0% ETA 0:00:00
2
3
4
5
6
7
8
8.00  0:00:04 &lt;span class=&quot;o&quot;&gt;[&lt;/span&gt;1.99 /s] &lt;span class=&quot;o&quot;&gt;[====================================&amp;gt;]&lt;/span&gt; 100%



&lt;span class=&quot;c&quot;&gt;# skip the beginning, don't fail, don't buffer&lt;/span&gt;

% &lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nb&quot;&gt;seq &lt;/span&gt;4&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;for &lt;/span&gt;a &lt;span class=&quot;k&quot;&gt;in&lt;/span&gt; &lt;span class=&quot;si&quot;&gt;$(&lt;/span&gt;&lt;span class=&quot;nb&quot;&gt;seq &lt;/span&gt;8&lt;span class=&quot;si&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;do &lt;/span&gt;&lt;span class=&quot;nb&quot;&gt;echo&lt;/span&gt; &lt;span class=&quot;nv&quot;&gt;$a&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;nb&quot;&gt;timeout&lt;/span&gt; .5 &lt;span class=&quot;nb&quot;&gt;sleep &lt;/span&gt;1 &lt;span class=&quot;o&quot;&gt;||&lt;/span&gt; &lt;span class=&quot;nb&quot;&gt;true&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;done&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;se&quot;&gt;\&lt;/span&gt;
	| &lt;span class=&quot;nb&quot;&gt;stdbuf&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-o0&lt;/span&gt; &lt;span class=&quot;nb&quot;&gt;sed &lt;/span&gt;1,4d | pv &lt;span class=&quot;nt&quot;&gt;-l&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-s8&lt;/span&gt;
1
2
3.00  0:00:01 &lt;span class=&quot;o&quot;&gt;[&lt;/span&gt;1.99 /s] &lt;span class=&quot;o&quot;&gt;[========&amp;gt;&lt;/span&gt;                             &lt;span class=&quot;o&quot;&gt;]&lt;/span&gt; 25% ETA 0:00:03
4
5.00  0:00:02 &lt;span class=&quot;o&quot;&gt;[&lt;/span&gt;1.99 /s] &lt;span class=&quot;o&quot;&gt;[==================&amp;gt;&lt;/span&gt;                   &lt;span class=&quot;o&quot;&gt;]&lt;/span&gt; 50% ETA 0:00:02
6
7.00  0:00:03 &lt;span class=&quot;o&quot;&gt;[&lt;/span&gt;1.99 /s] &lt;span class=&quot;o&quot;&gt;[===========================&amp;gt;&lt;/span&gt;          &lt;span class=&quot;o&quot;&gt;]&lt;/span&gt; 75% ETA 0:00:01
8
8.00  0:00:04 &lt;span class=&quot;o&quot;&gt;[&lt;/span&gt;1.99 /s] &lt;span class=&quot;o&quot;&gt;[====================================&amp;gt;]&lt;/span&gt; 100%
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Hooray. \o/&lt;/p&gt;</content><author><name></name></author><category term="TIL" /><category term="GNU" /><summary type="html">Use timeout(1) to terminate application that runs for too long (and to sleep for a fraction of a second), and stdbuf(1) to disable buffering.</summary></entry><entry><title type="html">Photos from Marburg/Frankfurt, Germany, December 2012</title><link href="http://wnd.katei.fi//weblog/2020-05-17-marburg-photos.html" rel="alternate" type="text/html" title="Photos from Marburg/Frankfurt, Germany, December 2012" /><published>2020-05-17T15:38:36+03:00</published><updated>2020-05-17T15:41:23+03:00</updated><id>http://wnd.katei.fi//weblog/marburg-photos</id><content type="html" xml:base="http://wnd.katei.fi//weblog/2020-05-17-marburg-photos.html">&lt;p&gt;My first trip to anoter country with snow at location, more than 100 km from
Finland. Free accommodation was available in Marburg, so that’s where I’d be
going. No particular purpose, but local activities may have included a bit of
geocaching.&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;/photos/marburg_2012/&quot;&gt;See the photos.&lt;/a&gt;&lt;/p&gt;</content><author><name></name></author><category term="diary" /><category term="photos" /><summary type="html">My first trip to anoter country with snow at location, more than 100 km from Finland. Free accommodation was available in Marburg, so that’s where I’d be going. No particular purpose, but local activities may have included a bit of geocaching. See the photos.</summary></entry><entry><title type="html">Photos from Norway, August 2012</title><link href="http://wnd.katei.fi//weblog/2020-04-26-norway-photos.html" rel="alternate" type="text/html" title="Photos from Norway, August 2012" /><published>2020-04-26T17:17:53+03:00</published><updated>2020-04-26T17:27:40+03:00</updated><id>http://wnd.katei.fi//weblog/norway-photos</id><content type="html" xml:base="http://wnd.katei.fi//weblog/2020-04-26-norway-photos.html">&lt;p&gt;A seven day roadtrip to Norway. 3500 kilometres by an estate car with three
passengers (including driver), a tent, sleeping bags, and great scenery.
Admittedly much time was spent driving in Finland but it’s the thought that
counts.&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;/photos/norway_2012/&quot;&gt;See the photos.&lt;/a&gt;&lt;/p&gt;</content><author><name></name></author><category term="diary" /><category term="photos" /><summary type="html">A seven day roadtrip to Norway. 3500 kilometres by an estate car with three passengers (including driver), a tent, sleeping bags, and great scenery. Admittedly much time was spent driving in Finland but it’s the thought that counts. See the photos.</summary></entry><entry><title type="html">SSH connection multiplexing</title><link href="http://wnd.katei.fi//weblog/2020-04-07-ssh-connection-multiplexing.html" rel="alternate" type="text/html" title="SSH connection multiplexing" /><published>2020-04-07T00:22:25+03:00</published><updated>2020-04-07T00:46:34+03:00</updated><id>http://wnd.katei.fi//weblog/ssh-connection-multiplexing</id><content type="html" xml:base="http://wnd.katei.fi//weblog/2020-04-07-ssh-connection-multiplexing.html">&lt;p&gt;OpenSSH has built-in connection multiplexing. I’ve been using SSH for two
decades, and only now I realise SSH comes with connection multiplexing. See
&lt;code class=&quot;highlighter-rouge&quot;&gt;ssh_config&lt;/code&gt; option &lt;code class=&quot;highlighter-rouge&quot;&gt;ControlMaster&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;I use SSH daily. I create and use SSH tunnels daily. To name a few uses, I use
SSH tunnels for database connections, HTTP connections, and for SSH
connections. I used to connect to x11vnc over an SSH tunnel. I create tunnels
that require two hops. However, never have I used SSH connection multiplexing.
Until tonight.&lt;/p&gt;

&lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;Host foo
        Hostname        example.com
        ControlPath     /var/run/user/1000/%r@%h:%p
        ControlMaster   auto
        ControlPersist  10m
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;This simple config will /automagically/ start a master process on first
connection to &lt;code class=&quot;highlighter-rouge&quot;&gt;foo&lt;/code&gt;, and share that for future connections. Master is killed 10
minutes after the last client disconnect.&lt;/p&gt;

&lt;p&gt;I am sure there are benefits in having dedicated process for each connection. I
am sure there are drawbacks in connection multiplexing. For now, I’m just happy
to learn something new.&lt;/p&gt;</content><author><name></name></author><category term="SSH" /><category term="TIL" /><summary type="html">OpenSSH has built-in connection multiplexing. I’ve been using SSH for two decades, and only now I realise SSH comes with connection multiplexing. See ssh_config option ControlMaster. I use SSH daily. I create and use SSH tunnels daily. To name a few uses, I use SSH tunnels for database connections, HTTP connections, and for SSH connections. I used to connect to x11vnc over an SSH tunnel. I create tunnels that require two hops. However, never have I used SSH connection multiplexing. Until tonight. Host foo Hostname example.com ControlPath /var/run/user/1000/%r@%h:%p ControlMaster auto ControlPersist 10m This simple config will /automagically/ start a master process on first connection to foo, and share that for future connections. Master is killed 10 minutes after the last client disconnect. I am sure there are benefits in having dedicated process for each connection. I am sure there are drawbacks in connection multiplexing. For now, I’m just happy to learn something new.</summary></entry><entry><title type="html">Photos from Paris, France, March 2011</title><link href="http://wnd.katei.fi//weblog/2020-01-14-paris-photos.html" rel="alternate" type="text/html" title="Photos from Paris, France, March 2011" /><published>2020-01-14T23:13:11+02:00</published><updated>2020-03-20T00:06:43+02:00</updated><id>http://wnd.katei.fi//weblog/paris-photos</id><content type="html" xml:base="http://wnd.katei.fi//weblog/2020-01-14-paris-photos.html">&lt;p&gt;Random pictures from seemingly random locations.&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;/photos/paris_2011/&quot;&gt;See the photos.&lt;/a&gt;&lt;/p&gt;</content><author><name></name></author><category term="diary" /><category term="photos" /><summary type="html">Random pictures from seemingly random locations. See the photos.</summary></entry><entry><title type="html">TCP port scanner</title><link href="http://wnd.katei.fi//weblog/2020-01-13-portscan.html" rel="alternate" type="text/html" title="TCP port scanner" /><published>2020-01-13T20:37:32+02:00</published><updated>2020-01-13T20:43:09+02:00</updated><id>http://wnd.katei.fi//weblog/portscan</id><content type="html" xml:base="http://wnd.katei.fi//weblog/2020-01-13-portscan.html">&lt;p&gt;&lt;a href=&quot;https://gitlab.com/tsaviran/portscan/&quot;&gt;portscan&lt;/a&gt; is super simple TCP port scanner for a particular purpose.
It exists because I was too lazy to read &lt;a href=&quot;https://nmap.org/&quot;&gt;nmap&lt;/a&gt; manual about timing
options and I wanted to scan a host for open ports. Also, it was a perfect
opportunity to have another learning experience with Golang. This tool will
trigger each and every IDS along the way. You should use &lt;a href=&quot;https://nmap.org/&quot;&gt;nmap&lt;/a&gt; instead.&lt;/p&gt;

&lt;p&gt;Should you want to proceed against all the odds, you can &lt;a href=&quot;https://gitlab.com/tsaviran/portscan/&quot;&gt;find the sources at
GitLab&lt;/a&gt;).&lt;/p&gt;</content><author><name></name></author><category term="software" /><category term="Golang" /><summary type="html">portscan is super simple TCP port scanner for a particular purpose. It exists because I was too lazy to read nmap manual about timing options and I wanted to scan a host for open ports. Also, it was a perfect opportunity to have another learning experience with Golang. This tool will trigger each and every IDS along the way. You should use nmap instead. Should you want to proceed against all the odds, you can find the sources at GitLab).</summary></entry><entry><title type="html">Photos from Tallinn, Estonia, August 2010</title><link href="http://wnd.katei.fi//weblog/2020-01-13-tallinn-photos.html" rel="alternate" type="text/html" title="Photos from Tallinn, Estonia, August 2010" /><published>2020-01-13T20:22:26+02:00</published><updated>2020-01-13T20:26:08+02:00</updated><id>http://wnd.katei.fi//weblog/tallinn-photos</id><content type="html" xml:base="http://wnd.katei.fi//weblog/2020-01-13-tallinn-photos.html">&lt;p&gt;Small set of photos from Tallinn, Estonia, taken back in August 2010.&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;/photos/tallinn_2010/&quot;&gt;See the photos.&lt;/a&gt;&lt;/p&gt;</content><author><name></name></author><category term="diary" /><category term="photos" /><summary type="html">Small set of photos from Tallinn, Estonia, taken back in August 2010. See the photos.</summary></entry><entry><title type="html">xmlstream</title><link href="http://wnd.katei.fi//weblog/2019-12-27-xmlstream.html" rel="alternate" type="text/html" title="xmlstream" /><published>2019-12-27T02:20:18+02:00</published><updated>2019-12-28T16:27:42+02:00</updated><id>http://wnd.katei.fi//weblog/xmlstream</id><content type="html" xml:base="http://wnd.katei.fi//weblog/2019-12-27-xmlstream.html">&lt;p&gt;&lt;a href=&quot;https://gitlab.com/tsaviran/xmlstream&quot;&gt;xmlstream&lt;/a&gt; is a Golang package for
streaming XML output. It was created to replace raw text output of
&lt;a href=&quot;https://gitlab.com/tsaviran/gpx-to-kml&quot;&gt;gpx-to-kml&lt;/a&gt;. Conveniently both also
served as a little exercise at Golang. Little documentation exists as of yet.&lt;/p&gt;

&lt;p&gt;You can &lt;a href=&quot;https://gitlab.com/tsaviran/xmlstream&quot;&gt;find the sources at GitLab&lt;/a&gt;.&lt;/p&gt;</content><author><name></name></author><category term="software" /><category term="Golang" /><category term="XML" /><summary type="html">xmlstream is a Golang package for streaming XML output. It was created to replace raw text output of gpx-to-kml. Conveniently both also served as a little exercise at Golang. Little documentation exists as of yet. You can find the sources at GitLab.</summary></entry><entry><title type="html">Website overhaul</title><link href="http://wnd.katei.fi//weblog/2019-12-26-new-site.html" rel="alternate" type="text/html" title="Website overhaul" /><published>2019-12-26T02:27:11+02:00</published><updated>2019-12-26T02:28:13+02:00</updated><id>http://wnd.katei.fi//weblog/new-site</id><content type="html" xml:base="http://wnd.katei.fi//weblog/2019-12-26-new-site.html">&lt;p&gt;wnd.katei.fi website is now generated with &lt;a href=&quot;https://jekyllrb.com/&quot;&gt;Jekyll&lt;/a&gt; with photos handled
mostly by &lt;a href=&quot;http://sigal.saimon.org/&quot;&gt;Sigal&lt;/a&gt;. Jekyll is used unmodified, but with two custom
plugins. I had to modify Sigal slightly to make passing its output to Jekyll
more bearable. Both use custom themes. Finally, there’s a Makefile to
orchestrate builds, link checks, and pushing changes live. All this means site
layout has changed dramatically. While I personally strongly dislike browsing
Teh Web on mobile, I’ve spent quite a bit of effort to improve readability on
such devices. It’s not perfect still.&lt;/p&gt;

&lt;p&gt;As &lt;a href=&quot;/weblog/2018-02-24-katei.fi.html&quot;&gt;I decommissioned my personal server&lt;/a&gt;, I had to relocate my
website(s) as well. At the time I wanted to go with minimal effort, and not
worry about my dynamically generated weblog.&lt;/p&gt;

&lt;p&gt;On 23 September 2019, with the warm summer days only a distant memory, I
started working on a replacement. I turned to &lt;a href=&quot;https://jekyllrb.com/&quot;&gt;Jekyll&lt;/a&gt; to build the
bulk of it, and &lt;a href=&quot;http://sigal.saimon.org/&quot;&gt;Sigal&lt;/a&gt; to build the photo galleries. All this meant I’d
spend a bit of time to revamp the entire website.&lt;/p&gt;

&lt;p&gt;Neither tool comes without limitations. Jekyll &lt;em&gt;loves&lt;/em&gt; file suffixes. One
clearly can’t do without. This issue could be mitigated with HTTP server
configuration, but I don’t know if it’s worth the trouble. I also lost
autogenerated post category and date collections. Eventually, I resorted to
manually maintained page for the former, and decided to leave the latter for
another time - likely to be forgotten.&lt;/p&gt;

&lt;p&gt;As for Sigal, it is clearly designed to generate a finished product and not
something to be passed for another processor, like Jekyll. Also, it seems only
I care about providing image dimensions for &lt;code class=&quot;highlighter-rouge&quot;&gt;&amp;lt;img&amp;gt;&lt;/code&gt; tag as no ready-made theme
for Sigal generate these. Similarly it seems that JavaScript is a requirement
these days. Eventually I managed to hack a functional theme myself. As for lost
functionality, for now, I’ll go without photo tags and originals.&lt;/p&gt;

&lt;p&gt;Then there are the plugins for Jekyll - not to mention changes to Sigal. With
some motivation I’ll get to clean up and release these later. The entire site
still works (perfectly) without JavaScript, but there are some placed where
JavaScript is used when available. This mostly affects mobile.&lt;/p&gt;

&lt;p&gt;In addition to Jekyll and Sigal, mobile web also turned to be a major issue. It
wasn’t that my layout was using fixed sizes, but rather the fact that mobiles
would render paragraph text to different sizes depending on context. I also
took the opportunity to give a shot at some new(er) technologies and
techniques. These mostly affect my &lt;a href=&quot;/photos/&quot;&gt;photos&lt;/a&gt;, and not all shown or
accessable by conventional means. :-)&lt;/p&gt;

&lt;p&gt;I didn’t anticipate the entire process to take three months of calendar time.
It did. Obviously most of it was procrastination. Then there was my reluctance
to release anything with know issues. There are some rough edges; just try
switching between portrait and landscape. Old links should mostly work, but not
all. I may end up changing some links later. File timestamps are wrong.&lt;/p&gt;

&lt;p&gt;Still, with all the know issues, I’ve finally decided to release. This is one
step on my journey to accept compromise when I absolutely don’t have to. Maybe
this lowers the bar for tying the loose ends at another occasion. Maybe that
means more actual content. Maybe.&lt;/p&gt;</content><author><name></name></author><category term="software" /><category term="Jekyll" /><category term="Sigal" /><summary type="html">wnd.katei.fi website is now generated with Jekyll with photos handled mostly by Sigal. Jekyll is used unmodified, but with two custom plugins. I had to modify Sigal slightly to make passing its output to Jekyll more bearable. Both use custom themes. Finally, there’s a Makefile to orchestrate builds, link checks, and pushing changes live. All this means site layout has changed dramatically. While I personally strongly dislike browsing Teh Web on mobile, I’ve spent quite a bit of effort to improve readability on such devices. It’s not perfect still.</summary></entry><entry><title type="html">HTML and mobile browsers</title><link href="http://wnd.katei.fi//weblog/2019-10-24-mobile-browsers.html" rel="alternate" type="text/html" title="HTML and mobile browsers" /><published>2019-10-24T23:06:54+03:00</published><updated>2019-12-28T16:27:26+02:00</updated><id>http://wnd.katei.fi//weblog/mobile-browsers</id><content type="html" xml:base="http://wnd.katei.fi//weblog/2019-10-24-mobile-browsers.html">&lt;p&gt;I don’t understand HTML rendering anymore. I understand h1, h2, p structure.
However it seems that on mobile not all equal text is created equal.&lt;/p&gt;

&lt;p&gt;While I’ve been trying to rebuild my website will slightly more modern tools,
I’ve come to realise browsers today have a lot more say in how content is
rendered. Not only do developers have &lt;em&gt;much&lt;/em&gt; more control over specifics of how
stuff is rendered, but now browsers have their tentacles in this mess too.&lt;/p&gt;

&lt;p&gt;Admittedly in general mobile (or “responsive”) browsers are doing a fine job
resizing text elements to better fit on a small screen. They cleverly resize
elements to reduce the amount of otherwise empty wasted space. If you look at
my work on desktop I find it agreeable. If I look at the same page on mobile
using its desktop mode, there’s tons of empty space. In mobile mode, most of
the waste is gone and result looks good.&lt;/p&gt;

&lt;p&gt;As good as the logic is, sometimes its behaviour seems rather arbitrary to me.
&lt;a href=&quot;https://drafts.csswg.org/css-size-adjust/&quot;&gt;https://drafts.csswg.org/css-size-adjust/&lt;/a&gt;
explains the culprit nicely. That is, if you’d catch the fine details in it. I
don’t. Let me demonstrate my pain.&lt;/p&gt;

&lt;p&gt;Plain HTML page, no CSS. Header, optinally a text paragraph, lesser header, a
div with text (optionally) and some links. How large the glyphs are rendered in
the divs depend on the content. I can’t quite figure out the logic. Go figure.&lt;/p&gt;

&lt;p&gt;See how the page &lt;a href=&quot;/weblog/data/2019-10-24-html/with-text.html&quot;&gt;with text&lt;/a&gt; and
the other &lt;a href=&quot;/weblog/data/2019-10-24-html/without-text.html&quot;&gt;without text&lt;/a&gt;
renders on your device.&lt;/p&gt;

&lt;p&gt;Below are captures from developer mode of Chromium 76.0.3809.100 in mobile
mode. The third image is a capture from desktop view for comparison.&lt;/p&gt;

&lt;p&gt;
&lt;a href=&quot;/weblog/data/2019-10-24-html/with-text.png&quot;&gt;
&lt;img src=&quot;/weblog/data/2019-10-24-html/with-text.png&quot; width=&quot;360&quot; height=&quot;640&quot; alt=&quot;with text&quot; style=&quot;border: solid blue; padding: 0.1em; max-width: 25%; height: auto;&quot; /&gt;
&lt;/a&gt;
&lt;a href=&quot;/weblog/data/2019-10-24-html/without-text.png&quot;&gt;
&lt;img src=&quot;/weblog/data/2019-10-24-html/without-text.png&quot; width=&quot;360&quot; height=&quot;640&quot; alt=&quot;without text&quot; style=&quot;border: solid blue; padding: 0.1em; max-width: 25%; height: auto;&quot; /&gt;
&lt;/a&gt;
&lt;a href=&quot;/weblog/data/2019-10-24-html/desktop.png&quot;&gt;
&lt;img src=&quot;/weblog/data/2019-10-24-html/desktop.png&quot; width=&quot;360&quot; height=&quot;640&quot; alt=&quot;with text&quot; style=&quot;border: solid blue; padding: 0.1em; max-width: 25%; height: auto;&quot; /&gt;
&lt;/a&gt;
&lt;/p&gt;</content><author><name></name></author><category term="HTML" /><category term="web" /><category term="mobile" /><category term="browser" /><summary type="html">I don’t understand HTML rendering anymore. I understand h1, h2, p structure. However it seems that on mobile not all equal text is created equal.</summary></entry></feed>