<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>web design</title><link>https://terokarvinen.com/tags/web-design/</link><description>web design</description><language>en-us</language><lastBuildDate>Mon, 03 Aug 2026 20:22:31 +0300</lastBuildDate><image><url>https://terokarvinen.com/img/favicon.png</url><title>web design</title><link>https://terokarvinen.com/tags/web-design/</link></image><atom:link href="https://terokarvinen.com/tags/web-design/index.xml" rel="self" type="application/rss+xml"/><item><title>Card Size Gallery</title><link>https://terokarvinen.com/card-size-gallery/</link><pubDate>Mon, 03 Aug 2026 20:22:31 +0300</pubDate><guid>https://terokarvinen.com/card-size-gallery/</guid><description>
&lt;p>List of products is often shown as images on a grid. This pattern is called &amp;quot;cards&amp;quot;.&lt;/p>
&lt;p>Card Size Gallery allows you to test what different card formats look like.&lt;/p>
&lt;p>&lt;a href="card-sizes-grid.html">Try Card Size Gallery&lt;/a> - right in your browser.&lt;/p>
&lt;p>Clanker warning: I created this AI-assisted.&lt;/p>
&lt;p>&lt;a href="card-sizes-grid.html">
&lt;img src="https://terokarvinen.com/card-size-gallery/Test%20card%20sizes%20-%20grid%20of%20images_hucf46fc4697ff326a2efb2256be0582d9_254872_850x850_fit_box_3.png" width="775" height="850" alt=" " class="imgOne right">
&lt;/a>&lt;/p></description></item><item><title>Kokoro TTS - Voice Comparison</title><link>https://terokarvinen.com/kokoro-foss-tts-voice-comparison/</link><pubDate>Wed, 08 Jul 2026 17:10:54 +0300</pubDate><guid>https://terokarvinen.com/kokoro-foss-tts-voice-comparison/</guid><description>
&lt;p>Free, open weight models can generate speech. On your local machine.&lt;/p>
&lt;p>Listen to &lt;a href="https://terokarvinen.com/kokoro-voice-comparison/">voice samples of all Kokoro TTS voices&lt;/a> on the web.&lt;/p>
&lt;p>Optionally, install Kokoro with Podman.&lt;/p>
&lt;h2 id="listen-and-compare-voices-in-your-browser">Listen and Compare Voices in Your Browser&lt;/h2>
&lt;p>Search and filter by gender and language. The demo text is currently only in English.&lt;/p>
&lt;p>Kokoro is a free text-to-speech engine, architected by Li, Han, Raghavan, Mischler and Mesgarani; and trained by @rzvnzn. I just created the samples and the page to filter them. Their default flagship voice is af_heart (English, female), but there are many other interesting voices.&lt;/p>
&lt;p>&lt;a href="https://terokarvinen.com/kokoro-voice-comparison/">Listen Kokoro samples now&lt;/a>.&lt;/p>
&lt;p>&lt;a href="https://terokarvinen.com/kokoro-voice-comparison/">&lt;img src="kokoro-tts-foss-voice-comparison-samples-english-female.png" class="pad">&lt;/a>&lt;/p>
&lt;h2 id="run-kokoro-with-podman">Run Kokoro with Podman&lt;/h2>
&lt;p>These commands assume you already have Podman installed. Podman runs containers like Docker. It's safer than Docker, as it does not require root (or the infamous root-equivalent docker group).&lt;/p>
&lt;p>Let's download and run Brauns ready-made Kokoro container:&lt;/p>
&lt;pre>&lt;code>$ podman run -p 8880:8880 ghcr.io/remsky/kokoro-fastapi-cpu
&lt;/code>&lt;/pre>
&lt;p>Web user interface: &lt;a href="http://localhost:8880/web/">http://localhost:8880/web/&lt;/a>&lt;/p>
&lt;img src="fast-kokoro-web.jpg" class="pad">
&lt;p>API, usable with Python requests http://localhost:8880/v1&lt;/p>
&lt;h2 id="see-also">See also&lt;/h2>
&lt;p>Hacker News 2026: &lt;a href="https://news.ycombinator.com/item?id=48821576">Local, CPU-Friendly, High-Quality TTS (Text-to-Speech) with Kokoro&lt;/a>&lt;/p>
&lt;p>Li, Han, Raghavan, Mischler and Mesgarani, @rzvnzn 2026: &lt;a href="https://huggingface.co/hexgrad/Kokoro-82M">hexgrad/Kokoro-82M on HuggingFace&lt;/a>&lt;/p>
&lt;p>Braun 2026: &lt;a href="https://github.com/remsky/Kokoro-FastAPI">remsky / Kokoro-FastAPI on Github&lt;/a>&lt;/p></description></item><item><title>cdu - Jump up to project directory</title><link>https://terokarvinen.com/cdu-change-dir-up-to-project-dir/</link><pubDate>Mon, 06 Jul 2026 11:58:45 +0300</pubDate><guid>https://terokarvinen.com/cdu-change-dir-up-to-project-dir/</guid><description>
&lt;p>You're five levels deep in your git repo. You would like to get to the top level. 'cdu'.&lt;/p>
&lt;p>An up only directory jumper for zsh and bash. Nicely complements other directory jumpers, like zoxide, autojump or fasd.&lt;/p>
&lt;h2 id="usage-example">Usage example&lt;/h2>
&lt;pre>&lt;code>$ pwd
/home/tero/code/revincom/doc/design/subsystems/nav/fallbacks/sun
$ cdu
/home/tero/code/revincom
Found .git
&lt;/code>&lt;/pre>
&lt;p>If you have really deep repos, such as monorepos, cdu can help you even more.&lt;/p>
&lt;p>Deep in a Django project, cdu jumps to manage.py level first. The next cdu will take you to repo root.&lt;/p>
&lt;h2 id="a-new-cdu-change-dir-up">A new 'cdu', change dir up&lt;/h2>
&lt;p>I have used a longer bash version for years. This is a rewrite to support both zsh and bash. It's also shorter. Prettier and more features, but less tested than the old one.&lt;/p>
&lt;p>Save the source code to a dir where it runs (e.g. /usr/local/bin/changedirup). Make runnable (chmod ugo+rx /usr/local/bin/changedirup). Add to your .bashrc and .zshrc: 'alias cdu=&amp;quot;source changedirup&amp;quot;'. Log out and back.&lt;/p>
&lt;p>And now you can jump up with 'cdu'.&lt;/p>
&lt;h2 id="source-code-gpl">Source code, GPL&lt;/h2>
&lt;div class="highlight">&lt;pre tabindex="0" style="background-color:#f0f3f3;-moz-tab-size:4;-o-tab-size:4;tab-size:4;">&lt;code class="language-bash" data-lang="bash">&lt;span style="display:flex;">&lt;span>&lt;span style="color:#099">#!/bin/bash
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#099">&lt;/span>&lt;span style="color:#09f;font-style:italic"># changedirup - cd up to project top dir, &amp;#39;alias cdu=&amp;#34;source changedirup&amp;#34;&amp;#39;&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#09f;font-style:italic"># To persist it, add the alias to .zshrc or .bashrc&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#09f;font-style:italic"># Single usage also works with &amp;#39;source cdu&amp;#39; or &amp;#39;. cdu&amp;#39;&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#09f;font-style:italic"># Can be run again to go to even higher project dir. &lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#09f;font-style:italic"># cdu works with zsh and bash. Shebang #! is just for syntax highlight.&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#09f;font-style:italic"># SPDX-License-Identifier: GPL-3.0-or-later&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#09f;font-style:italic"># SPDX-FileCopyrightText: Copyright 2020-2026 Tero Karvinen https://TeroKarvinen.com&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#033">CDU_PWD_WAS&lt;/span>&lt;span style="color:#555">=&lt;/span>&lt;span style="color:#c30">&amp;#34;&lt;/span>&lt;span style="color:#069;font-weight:bold">$(&lt;/span>&lt;span style="color:#366">pwd&lt;/span>&lt;span style="color:#069;font-weight:bold">)&lt;/span>&lt;span style="color:#c30">&amp;#34;&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#366">cd&lt;/span> ..
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#069;font-weight:bold">while&lt;/span> true; &lt;span style="color:#069;font-weight:bold">do&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#069;font-weight:bold">for&lt;/span> f in .git Makefile .profile .bashrc README.md requirements.txt go.mod manage.py hosts.ini .project project.godot Dockerfile Cargo.toml index.theme config.toml default.gpr DICOMDIR ansible.cfg site.yml Vagrantfile package.json pyproject.toml zowe.yaml pom.xml build.gradle Gemfile composer.json docker-compose.yml compose.yaml .cobaltstrike.beacon_keys flake.nix .zshrc .ssh .sliver .sliver-client .msf4 havoc_default.yaotl .projectile .svn .hg .fossil .jj .editorconfig _darcs .bzr Cargo.lock .bash_profile
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#069;font-weight:bold">do&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#069;font-weight:bold">if&lt;/span> &lt;span style="color:#555">[&lt;/span> -e &lt;span style="color:#c30">&amp;#34;&lt;/span>&lt;span style="color:#033">$f&lt;/span>&lt;span style="color:#c30">&amp;#34;&lt;/span> &lt;span style="color:#555">]&lt;/span>; &lt;span style="color:#069;font-weight:bold">then&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#366">echo&lt;/span> &lt;span style="color:#c30">&amp;#34;Found &lt;/span>&lt;span style="color:#033">$f&lt;/span>&lt;span style="color:#c30">&amp;#34;&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#366">pwd&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#366">break&lt;/span> &lt;span style="color:#f60">2&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#069;font-weight:bold">fi&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#069;font-weight:bold">done&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#069;font-weight:bold">if&lt;/span> &lt;span style="color:#555">[&lt;/span> &lt;span style="color:#c30">&amp;#34;&lt;/span>&lt;span style="color:#069;font-weight:bold">$(&lt;/span>&lt;span style="color:#366">pwd&lt;/span>&lt;span style="color:#069;font-weight:bold">)&lt;/span>&lt;span style="color:#c30">&amp;#34;&lt;/span> &lt;span style="color:#555">=&lt;/span> &lt;span style="color:#c30">&amp;#34;/&amp;#34;&lt;/span> &lt;span style="color:#555">]&lt;/span>; &lt;span style="color:#069;font-weight:bold">then&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#366">cd&lt;/span> &lt;span style="color:#c30">&amp;#34;&lt;/span>&lt;span style="color:#033">$CDU_PWD_WAS&lt;/span>&lt;span style="color:#c30">&amp;#34;&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#366">echo&lt;/span> &lt;span style="color:#c30">&amp;#34;No project files found above. Working directory unchanged.&amp;#34;&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#366">pwd&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#366">break&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#069;font-weight:bold">fi&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#366">cd&lt;/span> .. &lt;span style="color:#555">||&lt;/span> &lt;span style="color:#366">break&lt;/span> &lt;span style="color:#09f;font-style:italic"># prevent infinite loop in the rare case cd fails for permissions&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#069;font-weight:bold">done&lt;/span>
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div></description></item><item><title>ppp Personal Project Portfolio</title><link>https://terokarvinen.com/ppp-personal-project-portfolio/</link><pubDate>Thu, 02 Jul 2026 11:52:15 +0300</pubDate><guid>https://terokarvinen.com/ppp-personal-project-portfolio/</guid><description>
&lt;p>Arrange your ideas into a skill tree.&lt;/p>
&lt;ul>
&lt;li>Pick little wins on your way to big goals&lt;/li>
&lt;li>Ship something at every step&lt;/li>
&lt;li>Turn ambition into output&lt;/li>
&lt;/ul>
&lt;p>&lt;a href="https://terokarvinen.com/ppp/">Open ppp in your browser&lt;/a>. Free, no login.&lt;/p>
&lt;h2 id="talk-nerd-to-me">Talk nerd to me&lt;/h2>
&lt;p>Single 50 kB HTML file with no dependencies. Use online or 100% offline. Your data stays yours: JSON export and import. Fully usable with keyboard-only - or mouse-only with keyboard just for typing names. A vibe-coded GUI editor for a directed acyclic graph with project-specific attributes: costs, deliverables, soft benefits. Public beta.&lt;/p>
&lt;p>Gain a bird's-eye view with ppp. I hope you have more ideas than time to do them. Use ppp to decide which path to pick next. Once you're committed, use &lt;a href="https://terokarvinen.com/2021/calendar-txt/">calendar.txt&lt;/a> and todo.txt for day-to-day and hour-to-hour.&lt;/p>
&lt;h2 id="try-ppp">Try ppp&lt;/h2>
&lt;p>&lt;a href="https://terokarvinen.com/ppp/">Try ppp&lt;/a>. Free web access, no login required. Optionally save the 50 kB HTML file for 100% offline use. Looking forward to your &lt;a href="#comments">comments&lt;/a>.&lt;/p>
&lt;p>&lt;a href="https://terokarvinen.com/ppp/">
&lt;img src="https://terokarvinen.com/ppp-personal-project-portfolio/ppp%20Personal%20Portfolio%20Manager%20-%20A%20skill%20tree%20for%20life_hu1fdde610736e2f1bce27e11014b13464_169827_1000x1000_fit_box_3.png" width="1000" height="477" alt=" " class="imgOne pad">
&lt;/a>&lt;/p></description></item><item><title>Apache installed with Ansible - quick notes</title><link>https://terokarvinen.com/apache-ansible/</link><pubDate>Thu, 09 Apr 2026 16:10:04 +0300</pubDate><guid>https://terokarvinen.com/apache-ansible/</guid><description>
&lt;img src="https://terokarvinen.com/apache-ansible/apache-httpd-logo_hu0274bb063ced1072a70ec8e201c9b197_74947_400x400_fit_box_3.png" width="206" height="400" alt=" " class="imgOne right">
&lt;p>Install Apache 2 web server automatically. Serves a web site on the front page of http://localhost. Pages can be edited as a normal user - without root or sudo.&lt;/p>
&lt;p>Simplified Ansible role. An example of &lt;em>package-file-server&lt;/em> pattern. Just notes, no tutorial.&lt;/p>
&lt;p>Using these short notes require a working Ansible configuration - &lt;a href="https://terokarvinen.com/hello-ansible/">Hello Ansible&lt;/a>.&lt;/p>
&lt;h2 id="package-file-service-pattern">Package-file-service pattern&lt;/h2>
&lt;p>Daemons, like Apache2 web server, are somewhat similar. They are configured with package-file-service pattern. Install the daemon, change configuration by editing files, start it.&lt;/p>
&lt;ul>
&lt;li>package - sudo apt-get install apache2&lt;/li>
&lt;li>files - sudoedit /etc/apache2/...&lt;/li>
&lt;li>service - sudo systemctl restart apache2&lt;/li>
&lt;/ul>
&lt;p>Changes to configuration files only take effect after you kick the daemon. Thus, &lt;em>file&lt;/em> in tasks/main.yml &lt;em>notify&lt;/em> the &lt;em>handler&lt;/em> &amp;quot;restart apache2&amp;quot;.&lt;/p>
&lt;h2 id="tree-of-rolesapache2">tree of roles/apache2/&lt;/h2>
&lt;pre>&lt;code>roles/apache2/ # All files related to &amp;quot;apache2&amp;quot; role
├── files/ # Master copies of files
│   └── example.com.conf
├── handlers/ # restarting services
│   └── main.yml
└── tasks/ # most ansible code
└── main.yml
&lt;/code>&lt;/pre>
&lt;h2 id="tasksmainyml">tasks/main.yml&lt;/h2>
&lt;div class="highlight">&lt;pre tabindex="0" style="background-color:#f0f3f3;-moz-tab-size:4;-o-tab-size:4;tab-size:4;">&lt;code class="language-yaml" data-lang="yaml">&lt;span style="display:flex;">&lt;span>- &lt;span style="color:#309;font-weight:bold">apt&lt;/span>:&lt;span style="color:#bbb">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#bbb"> &lt;/span>&lt;span style="color:#309;font-weight:bold">name&lt;/span>:&lt;span style="color:#bbb"> &lt;/span>apache2&lt;span style="color:#bbb">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#bbb"> &lt;/span>&lt;span style="color:#309;font-weight:bold">state&lt;/span>:&lt;span style="color:#bbb"> &lt;/span>present&lt;span style="color:#bbb">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#bbb">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#bbb">&lt;/span>- &lt;span style="color:#309;font-weight:bold">copy&lt;/span>:&lt;span style="color:#bbb">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#bbb"> &lt;/span>&lt;span style="color:#309;font-weight:bold">dest&lt;/span>:&lt;span style="color:#bbb"> &lt;/span>&lt;span style="color:#c30">&amp;#34;/etc/apache2/sites-available/example.com.conf&amp;#34;&lt;/span>&lt;span style="color:#bbb">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#bbb"> &lt;/span>&lt;span style="color:#309;font-weight:bold">src&lt;/span>:&lt;span style="color:#bbb"> &lt;/span>&lt;span style="color:#c30">&amp;#34;example.com.conf&amp;#34;&lt;/span>&lt;span style="color:#bbb">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#bbb"> &lt;/span>&lt;span style="color:#309;font-weight:bold">owner&lt;/span>:&lt;span style="color:#bbb"> &lt;/span>&lt;span style="color:#c30">&amp;#34;root&amp;#34;&lt;/span>&lt;span style="color:#bbb">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#bbb"> &lt;/span>&lt;span style="color:#309;font-weight:bold">group&lt;/span>:&lt;span style="color:#bbb"> &lt;/span>&lt;span style="color:#c30">&amp;#34;root&amp;#34;&lt;/span>&lt;span style="color:#bbb">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#bbb"> &lt;/span>&lt;span style="color:#309;font-weight:bold">mode&lt;/span>:&lt;span style="color:#bbb"> &lt;/span>&lt;span style="color:#c30">&amp;#34;0644&amp;#34;&lt;/span>&lt;span style="color:#bbb">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#bbb"> &lt;/span>&lt;span style="color:#309;font-weight:bold">notify&lt;/span>:&lt;span style="color:#bbb"> &lt;/span>restart apache2&lt;span style="color:#bbb">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#bbb">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#bbb">&lt;/span>- &lt;span style="color:#309;font-weight:bold">file&lt;/span>:&lt;span style="color:#bbb">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#bbb"> &lt;/span>&lt;span style="color:#309;font-weight:bold">src&lt;/span>:&lt;span style="color:#bbb"> &lt;/span>/etc/apache2/sites-available/example.com.conf&lt;span style="color:#bbb">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#bbb"> &lt;/span>&lt;span style="color:#309;font-weight:bold">dest&lt;/span>:&lt;span style="color:#bbb"> &lt;/span>/etc/apache2/sites-enabled/example.com.conf&lt;span style="color:#bbb">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#bbb"> &lt;/span>&lt;span style="color:#309;font-weight:bold">owner&lt;/span>:&lt;span style="color:#bbb"> &lt;/span>root&lt;span style="color:#bbb">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#bbb"> &lt;/span>&lt;span style="color:#309;font-weight:bold">group&lt;/span>:&lt;span style="color:#bbb"> &lt;/span>root&lt;span style="color:#bbb">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#bbb"> &lt;/span>&lt;span style="color:#309;font-weight:bold">state&lt;/span>:&lt;span style="color:#bbb"> &lt;/span>link&lt;span style="color:#bbb">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#bbb"> &lt;/span>&lt;span style="color:#309;font-weight:bold">notify&lt;/span>:&lt;span style="color:#bbb"> &lt;/span>restart apache2&lt;span style="color:#bbb">
&lt;/span>&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;h2 id="handlersmainyml">handlers/main.yml&lt;/h2>
&lt;div class="highlight">&lt;pre tabindex="0" style="background-color:#f0f3f3;-moz-tab-size:4;-o-tab-size:4;tab-size:4;">&lt;code class="language-yaml" data-lang="yaml">&lt;span style="display:flex;">&lt;span>- &lt;span style="color:#309;font-weight:bold">name&lt;/span>:&lt;span style="color:#bbb"> &lt;/span>restart apache2&lt;span style="color:#bbb">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#bbb"> &lt;/span>&lt;span style="color:#309;font-weight:bold">systemd&lt;/span>:&lt;span style="color:#bbb">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#bbb"> &lt;/span>&lt;span style="color:#309;font-weight:bold">name&lt;/span>:&lt;span style="color:#bbb"> &lt;/span>apache2&lt;span style="color:#bbb">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#bbb"> &lt;/span>&lt;span style="color:#309;font-weight:bold">state&lt;/span>:&lt;span style="color:#bbb"> &lt;/span>restarted&lt;span style="color:#bbb">
&lt;/span>&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;h2 id="filesexamplecomconf">files/example.com.conf&lt;/h2>
&lt;div class="highlight">&lt;pre tabindex="0" style="background-color:#f0f3f3;-moz-tab-size:4;-o-tab-size:4;tab-size:4;">&lt;code class="language-fallback" data-lang="fallback">&lt;span style="display:flex;">&lt;span># Managed file, changes will be overwritten
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&amp;lt;VirtualHost *:80&amp;gt;
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> ServerName example.com
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> DocumentRoot /home/tero/publicsite/
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &amp;lt;Directory /home/tero/publicsite/&amp;gt;
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> require all granted
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &amp;lt;/Directory&amp;gt;
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&amp;lt;/VirtualHost&amp;gt;
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;h2 id="adminstrivia">Adminstrivia&lt;/h2>
&lt;p>Apache httpd logo is a trademark of The Apache Software Foundation.&lt;/p></description></item><item><title>Passwordless Sudo with Ansible</title><link>https://terokarvinen.com/passwordless-sudo-with-ansible/</link><pubDate>Thu, 02 Apr 2026 16:44:50 +0300</pubDate><guid>https://terokarvinen.com/passwordless-sudo-with-ansible/</guid><description>
&lt;p>Sudo without password, automatically. Short example role for ansible.&lt;/p>
&lt;p>The role&lt;/p>
&lt;ul>
&lt;li>creates a new user in &amp;quot;sudoless&amp;quot; group&lt;/li>
&lt;li>adds a sudoers.d/ NOPASSWD rule for the group&lt;/li>
&lt;/ul>
&lt;h2 id="prerequisites">Prerequisites&lt;/h2>
&lt;p>Applying this example file requires you to have &lt;a href="https://terokarvinen.com/hello-ansible/">Ansible working&lt;/a>.&lt;/p>
&lt;p>Tero's rule #1 for IaC: &lt;em>Manual before auto.&lt;/em>&lt;/p>
&lt;p>So it's a good idea to try creating &lt;a href="https://terokarvinen.com/passwordless-sudo/">passwordless sudo manually&lt;/a> first.&lt;/p>
&lt;p>&lt;em>Draft: This article has commands written from memory. It has not gone trough quality assuarance and testing yet.&lt;/em>&lt;/p>
&lt;h2 id="tree">Tree&lt;/h2>
&lt;pre>&lt;code>$ tree -F
./
├── ansible.cfg
├── hosts.ini
├── roles/
│   ├── antero/
│   │   └── tasks/
│   │   └── main.yml
│   └── world/
│   └── tasks/
│   └── main.yml
└── site.yml
&lt;/code>&lt;/pre>
&lt;h2 id="role---antero">Role - antero&lt;/h2>
&lt;p>cat roles/antero/tasks/main.yml&lt;/p>
&lt;div class="highlight">&lt;pre tabindex="0" style="background-color:#f0f3f3;-moz-tab-size:4;-o-tab-size:4;tab-size:4;">&lt;code class="language-yaml" data-lang="yaml">&lt;span style="display:flex;">&lt;span>- &lt;span style="color:#309;font-weight:bold">group&lt;/span>:&lt;span style="color:#bbb">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#bbb"> &lt;/span>&lt;span style="color:#309;font-weight:bold">name&lt;/span>:&lt;span style="color:#bbb"> &lt;/span>&lt;span style="color:#c30">&amp;#34;sudoless&amp;#34;&lt;/span>&lt;span style="color:#bbb">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#bbb"> &lt;/span>&lt;span style="color:#309;font-weight:bold">state&lt;/span>:&lt;span style="color:#bbb"> &lt;/span>present&lt;span style="color:#bbb">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#bbb">&lt;/span>- &lt;span style="color:#309;font-weight:bold">user&lt;/span>:&lt;span style="color:#bbb">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#bbb"> &lt;/span>&lt;span style="color:#309;font-weight:bold">name&lt;/span>:&lt;span style="color:#bbb"> &lt;/span>&lt;span style="color:#c30">&amp;#34;antero&amp;#34;&lt;/span>&lt;span style="color:#bbb">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#bbb"> &lt;/span>&lt;span style="color:#309;font-weight:bold">state&lt;/span>:&lt;span style="color:#bbb"> &lt;/span>present&lt;span style="color:#bbb">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#bbb"> &lt;/span>&lt;span style="color:#309;font-weight:bold">groups&lt;/span>:&lt;span style="color:#bbb"> &lt;/span>[&lt;span style="color:#c30">&amp;#34;sudoless&amp;#34;&lt;/span>,&lt;span style="color:#bbb"> &lt;/span>&lt;span style="color:#c30">&amp;#34;sudo&amp;#34;&lt;/span>,&lt;span style="color:#bbb"> &lt;/span>&lt;span style="color:#c30">&amp;#34;adm&amp;#34;&lt;/span>]&lt;span style="color:#bbb">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#bbb">&lt;/span>- &lt;span style="color:#309;font-weight:bold">authorized_key&lt;/span>:&lt;span style="color:#bbb">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#bbb"> &lt;/span>&lt;span style="color:#309;font-weight:bold">user&lt;/span>:&lt;span style="color:#bbb"> &lt;/span>&lt;span style="color:#c30">&amp;#34;antero&amp;#34;&lt;/span>&lt;span style="color:#bbb">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#bbb"> &lt;/span>&lt;span style="color:#309;font-weight:bold">key&lt;/span>:&lt;span style="color:#bbb"> &lt;/span>&lt;span style="color:#c30">&amp;#34;ssh-ed25519 U2VlIHlvdSBhdCBUZXJvS2FydmluZW4uY29tIQ== tero@example.com&amp;#34;&lt;/span>&lt;span style="color:#bbb">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#bbb">&lt;/span>- &lt;span style="color:#309;font-weight:bold">copy&lt;/span>:&lt;span style="color:#bbb">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#bbb"> &lt;/span>&lt;span style="color:#309;font-weight:bold">dest&lt;/span>:&lt;span style="color:#bbb"> &lt;/span>&lt;span style="color:#c30">&amp;#34;/etc/sudoers.d/sudoless&amp;#34;&lt;/span>&lt;span style="color:#bbb">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#bbb"> &lt;/span>&lt;span style="color:#309;font-weight:bold">content&lt;/span>:&lt;span style="color:#bbb"> &lt;/span>&lt;span style="color:#c30">&amp;#34;%sudoless ALL = (ALL) NOPASSWD: ALL\n&amp;#34;&lt;/span>&lt;span style="color:#bbb">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#bbb"> &lt;/span>&lt;span style="color:#309;font-weight:bold">owner&lt;/span>:&lt;span style="color:#bbb"> &lt;/span>&lt;span style="color:#c30">&amp;#34;root&amp;#34;&lt;/span>&lt;span style="color:#bbb">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#bbb"> &lt;/span>&lt;span style="color:#309;font-weight:bold">group&lt;/span>:&lt;span style="color:#bbb"> &lt;/span>&lt;span style="color:#c30">&amp;#34;root&amp;#34;&lt;/span>&lt;span style="color:#bbb">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#bbb"> &lt;/span>&lt;span style="color:#309;font-weight:bold">mode&lt;/span>:&lt;span style="color:#bbb"> &lt;/span>&lt;span style="color:#c30">&amp;#34;0644&amp;#34;&lt;/span>&lt;span style="color:#bbb">
&lt;/span>&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;h2 id="first-run---chicken-or-egg">First run - chicken or egg?&lt;/h2>
&lt;p>For the first run, you don't yet have sudo without password.&lt;/p>
&lt;p>Let's make ansible try for sudo rights. Add &amp;quot;become: true&amp;quot; in the correct block in site.yml:&lt;/p>
&lt;div class="highlight">&lt;pre tabindex="0" style="background-color:#f0f3f3;-moz-tab-size:4;-o-tab-size:4;tab-size:4;">&lt;code class="language-yaml" data-lang="yaml">&lt;span style="display:flex;">&lt;span>- &lt;span style="color:#309;font-weight:bold">hosts&lt;/span>:&lt;span style="color:#bbb"> &lt;/span>all&lt;span style="color:#bbb">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#bbb"> &lt;/span>&lt;span style="color:#309;font-weight:bold">become&lt;/span>:&lt;span style="color:#bbb"> &lt;/span>&lt;span style="color:#069;font-weight:bold">true&lt;/span>&lt;span style="color:#bbb">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#bbb"> &lt;/span>&lt;span style="color:#309;font-weight:bold">roles&lt;/span>:&lt;span style="color:#bbb">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#bbb"> &lt;/span>- world&lt;span style="color:#bbb">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#bbb"> &lt;/span>- antero&lt;span style="color:#bbb">
&lt;/span>&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;pre>&lt;code>$ ansible-playbook site.yml
&lt;/code>&lt;/pre>
&lt;p>Now it should complain that sudo needs password. Ansible asks this with -K aka --ask-become-password.&lt;/p>
&lt;pre>&lt;code>$ ansible-playbook site.yml --ask-become-password
&lt;/code>&lt;/pre>
&lt;h2 id="tips">Tips&lt;/h2>
&lt;p>When you got it to work manually, you have your example. Copy it to automation!&lt;/p>
&lt;ul>
&lt;li>Copy paste paths.&lt;/li>
&lt;li>Copy files or file contents.&lt;/li>
&lt;li>Use 'stat' to check for modes (permissions). Do not guess octal permissions, you have to understand them to avoid privesc worries.&lt;/li>
&lt;/ul>
&lt;p>Some IaC programs only reliably understand octal modes (numbers), and only as strings. I would also recommend explicit leading zero meaning no special permissions (no setgid...). So &amp;quot;0644&amp;quot;, in quotes. Maybe it has improved over the years? Who knows.&lt;/p></description></item><item><title>Sudo without password</title><link>https://terokarvinen.com/passwordless-sudo/</link><pubDate>Thu, 02 Apr 2026 16:04:03 +0300</pubDate><guid>https://terokarvinen.com/passwordless-sudo/</guid><description>
&lt;p>Ansible needs root on the slave. One way is to allow 'sudo' without password.&lt;/p>
&lt;p>Summary for gurus (the rest of us can read the article):&lt;/p>
&lt;pre>&lt;code>$ cat /etc/sudoers.d/sudoless
%sudoless ALL = (ALL) NOPASSWD: ALL
&lt;/code>&lt;/pre>
&lt;p>&lt;em>Draft: This article has commands written from memory. It has not gone trough quality assuarance and testing yet.&lt;/em>&lt;/p>
&lt;img src="https://terokarvinen.com/passwordless-sudo/sudo-logo_hu90c7c77f1bb985b8b0dfccb8c62285a4_186853_400x400_fit_box_3.png" width="358" height="400" alt=" " class="imgOne right">
&lt;p>This short tutorial assumes you know the &lt;a href="https://terokarvinen.com/2020/command-line-basics-revisited/">basics of Linux command line&lt;/a> and have &lt;a href="https://terokarvinen.com/ssh-public-key-login-without-password/">installed openssh-server&lt;/a>.&lt;/p>
&lt;h2 id="create-the-new-user">Create the new user&lt;/h2>
&lt;p>Let's create a user and add it to &amp;quot;sudoless&amp;quot; group that we'll set up later. We'll call him antero, a neologism from &amp;quot;Ansible&amp;quot; and &amp;quot;Tero&amp;quot;, yours truly.&lt;/p>
&lt;p>Always use only good passwords. Never use bad passwords, even for a moment. Practice doing it right, don't practice doing it wrong.&lt;/p>
&lt;pre>&lt;code>$ sudo adduser antero
$ sudo groupadd sudoless
$ sudo adduser antero sudoless
&lt;/code>&lt;/pre>
&lt;h2 id="broken-sudo-insurance">Broken sudo insurance&lt;/h2>
&lt;p>Open a new window, ssh to target machine as needed. Then open a root shell using sudo.&lt;/p>
&lt;p>If we break sudo, this might be a way to fix it. Otherwise, broken sudo prevents us from using sudo to fix the broken files.&lt;/p>
&lt;pre>&lt;code>$ sudo -i # just while fiddling with sudoers
&lt;/code>&lt;/pre>
&lt;p>We don't wont to work in the root shell (where the prompt is a hash &amp;quot;#&amp;quot;).&lt;/p>
&lt;p>So leave the root shell window behind and go back to the normal window.&lt;/p>
&lt;h2 id="new-sudoers-rule">New sudoers rule&lt;/h2>
&lt;p>Let's create a sudoers rule that allows members of &amp;quot;sudoless&amp;quot; group use 'sudo' without password.&lt;/p>
&lt;p>Visudo runs our default $EDITOR. But has some checks for obvious errors.&lt;/p>
&lt;p>As usual, we'll use .d/ dirs if available. And luckily, sudoers has /etc/sudoers.d/.&lt;/p>
&lt;pre>&lt;code>$ sudo visudo /etc/sudoers.d/sudoless
&lt;/code>&lt;/pre>
&lt;p>Add our oneliner there&lt;/p>
&lt;pre>&lt;code>%sudoless ALL = (ALL) NOPASSWD: ALL
&lt;/code>&lt;/pre>
&lt;p>What does the sudoers line mean?&lt;/p>
&lt;table>
&lt;thead>
&lt;tr>
&lt;th>Token&lt;/th>
&lt;th>Meaning&lt;/th>
&lt;/tr>
&lt;/thead>
&lt;tbody>
&lt;tr>
&lt;td>%sudoless&lt;/td>
&lt;td>Percent &amp;quot;%&amp;quot; means group&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>ALL&lt;/td>
&lt;td>All computers&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>=&lt;/td>
&lt;td>Literal equals &amp;quot;=&amp;quot;, a separator&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>(ALL)&lt;/td>
&lt;td>Runas: may become any user, including root&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>NOPASSWD&lt;/td>
&lt;td>Tag: don't prompt for password&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>:&lt;/td>
&lt;td>Literal colon &amp;quot;:&amp;quot;, a separator&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>ALL&lt;/td>
&lt;td>All commands permitted&lt;/td>
&lt;/tr>
&lt;/tbody>
&lt;/table>
&lt;p>So it's something like:&lt;/p>
&lt;pre>&lt;code>%group COMPUTERS: (RUNAS) TAG: COMMANDS.
&lt;/code>&lt;/pre>
&lt;h2 id="test">Test&lt;/h2>
&lt;p>&lt;em>not tested == not done&lt;/em>&lt;/p>
&lt;p>New groups are effective only after logout-login. So if you're logged in as &amp;quot;antero&amp;quot;, log out and back.&lt;/p>
&lt;p>If you have recently given 'sudo' commands as &amp;quot;antero&amp;quot;, sudo will remember your credentials for a while. Use 'sudo -k' to forget them.&lt;/p>
&lt;pre>&lt;code>$ ssh antero@localhost
$ sudo -k
$ sudo echo &amp;quot;See you at TeroKarvinen.com&amp;quot;
See you at TeroKarvinen.com
&lt;/code>&lt;/pre>
&lt;p>No password asked? Great! You now have passwordless sudo. You could use it with Ansible.&lt;/p>
&lt;h2 id="adminstrivia">Adminstrivia&lt;/h2>
&lt;p>Sudo logo my Mark Stillman 2019, received under CC-BY-4.0.&lt;/p></description></item><item><title>DORA &amp; Threat Lead Penetration Testing with Marko</title><link>https://terokarvinen.com/buuri-2026-dora-and-threat-lead-penetration-testing/</link><pubDate>Tue, 31 Mar 2026 14:54:33 +0300</pubDate><guid>https://terokarvinen.com/buuri-2026-dora-and-threat-lead-penetration-testing/</guid><description>
&lt;p>Banks are now required to do red teaming exercises. Marko Buuri (Bank of Finland) showed us how TIBER-FI helps to create threat intel based red teaming exercises.&lt;/p>
&lt;p>Marko's visit was part of my &lt;a href="https://terokarvinen.com/tunkeutumistestaus/">Penetration Testing&lt;/a> course. You can &lt;a href="https://terokarvinen.com/newsletter/">join my list&lt;/a> to get invitations to similar events.&lt;/p>
&lt;h2 id="synopsis">Synopsis&lt;/h2>
&lt;img src="https://terokarvinen.com/buuri-2026-dora-and-threat-lead-penetration-testing/mark-buuri-talks-tiber-in-teros-pentest-course_hu09239795106670e281e38133c0de53b3_296907_400x400_fit_box.png" width="400" height="217" alt=" " class="imgOne right padSides">
&lt;p>Cybersecurity red team testing has evolved from underground art to regulated operations in the European financial sector. This lecture explores the requirement for advanced threat-led penetration testing in EU's DORA regulation, and practical guidance on how those projects are organized and delivered according to the TIBER-EU guidance across Europe.&lt;/p>
&lt;h2 id="slides">Slides&lt;/h2>
&lt;p>Buuri 2026: &lt;a href="buuri-2026-dora-and-threat-lead-penetration-testing--teros-pentest-course.pdf">DORA and TLPT testing - Lecture for Haaga-Helia on 31 March 2026&lt;/a> (pdf, 2 MB)&lt;/p>
&lt;h2 id="links">Links&lt;/h2>
&lt;p>&lt;a href="https://eur-lex.europa.eu/eli/reg/2022/2554/oj/eng">DORA (Regulation ... on digital operational resilience for the financial sector)&lt;/a>&lt;/p>
&lt;ul>
&lt;li>Article 26 defines threat-lead penetration testing. &amp;quot;Advanced testing of ICT tools, systems and processes based on TLPT&amp;quot;&lt;/li>
&lt;li>Article 27 defines the requirements for the testers. &amp;quot;Requirements for testers for the carrying out of TLPT&amp;quot;&lt;/li>
&lt;/ul>
&lt;p>Bank of Finland (Suomen Pankki): &lt;a href="https://www.suomenpankki.fi/tiberfi">TIBER-FI and TIBER-EU guidance&lt;/a>&lt;/p>
&lt;ul>
&lt;li>&lt;a href="https://www.suomenpankki.fi/globalassets/bof/en/money-and-payments/the-bank-of-finland-as-catalyst-payments-council/tiber-fi/tiber-fi-2.0-procedures-and-guidelines.pdf">TIBER-FI procedures and guidelines&lt;/a> (pdf, 1 MB)&lt;/li>
&lt;/ul>
&lt;p>Buuri 2026: &lt;a href="https://youtu.be/z6KIEEknKjM?si=7n8cNWynzMrEwdWZ">D26 - Releasing Your Inner TIBER in Regulated Adversary Simulations&lt;/a>. Video, 45 min. Disobey 2026.&lt;/p>
&lt;h2 id="slides-taster">Slides taster&lt;/h2>
&lt;p>You can &lt;a href="buuri-2026-dora-and-threat-lead-penetration-testing--teros-pentest-course.pdf">download the whole deck&lt;/a>.&lt;/p>
&lt;p>&lt;img src="slide-07-buuri-2026-dora-and-threat-lead-penetration-testing--teros-pentest-course.png" alt="">&lt;/p>
&lt;p>&lt;img src="slide-22-buuri-2026-dora-and-threat-lead-penetration-testing--teros-pentest-course.png" alt="">&lt;/p>
&lt;p>&lt;img src="slide-32-buuri-2026-dora-and-threat-lead-penetration-testing--teros-pentest-course.png" alt="">&lt;/p>
&lt;h2 id="bio">Bio&lt;/h2>
&lt;p>Marko Buuri is cyber security adviser in the Bank of Finland (Suomen Pankki). He has over 20 years of in-house and consulting cyber experience. Since 2020 he's been involved in implementing and operating TIBER-FI red team testing framework for the financial sector in Finland.&lt;/p></description></item><item><title>SSH public key - Login without password</title><link>https://terokarvinen.com/ssh-public-key-login-without-password/</link><pubDate>Thu, 26 Mar 2026 14:50:58 +0200</pubDate><guid>https://terokarvinen.com/ssh-public-key-login-without-password/</guid><description>
&lt;p>SSH is the leading solution for securily logging into servers.&lt;/p>
&lt;p>Many products use SSH in the background: git, rsync, ansible...&lt;/p>
&lt;p>Public key authentication is quite convenient. You don't need to type your password for every 'git push' or 'ansible-playbook'. Use correctly, it can also make your server more secure.&lt;/p>
&lt;p>This example is written for Debian 13-trixie.&lt;/p>
&lt;p>&lt;em>Draft: This article has commands written from memory. It has not gone trough quality assuarance and testing yet.&lt;/em>&lt;/p>
&lt;h2 id="install-ssh">Install SSH&lt;/h2>
&lt;p>Install the OpenSSH-server package&lt;/p>
&lt;pre>&lt;code>$ sudo apt-get update
$ sudo apt-get -y install ssh
&lt;/code>&lt;/pre>
&lt;p>Make SSH daemon start on boot (enable) and also start it now (--now)&lt;/p>
&lt;pre>&lt;code>$ sudo systemctl enable --now ssh
&lt;/code>&lt;/pre>
&lt;h3 id="test-ssh">Test SSH&lt;/h3>
&lt;p>Normally, you would say user@host, such as &lt;a href="mailto:tero@example.com">tero@example.com&lt;/a>. Here, we can leave out username, as it's the same on both machines.&lt;/p>
&lt;pre>&lt;code>$ ssh localhost
&lt;/code>&lt;/pre>
&lt;p>With 'w', you can see yourself logged in twice: once on the desktop, once trough ssh.&lt;/p>
&lt;pre>&lt;code>remote$ exit
&lt;/code>&lt;/pre>
&lt;h3 id="automatic-login-with-ssh-public-key">Automatic login with SSH public key&lt;/h3>
&lt;p>Generate a keypair&lt;/p>
&lt;pre>&lt;code>$ ssh-keygen # enter enter enter to accept the defaults
&lt;/code>&lt;/pre>
&lt;p>If you already have a keypair, don't overwrite it. The public key ($HOME/.ssh/id_*.pub) is literally public, you can use the same public key in all hosts. The public key ends with &amp;quot;.pub&amp;quot;.&lt;/p>
&lt;p>If you need the public key for VPS (virtual private server) provider, you can see and copy-paste your keys with 'head $HOME/.ssh/id*.pub'.&lt;/p>
&lt;p>Copy it to hosts where you can already log in.&lt;/p>
&lt;pre>&lt;code>$ ssh-copy-id localhost
&lt;/code>&lt;/pre>
&lt;p>Once you've entered your password for the last time, ssh-copy-id adds your public key into .ssh/authorized_keys on the remote machine. Now your key is authorized for logins.&lt;/p>
&lt;p>Your public key is used automatically&lt;/p>
&lt;pre>&lt;code>$ ssh localhost
&lt;/code>&lt;/pre>
&lt;p>Did you log in without giving your password?&lt;/p>
&lt;p>Well done, you've now automated login with SSH public keys.&lt;/p>
&lt;h2 id="troubleshooting">Troubleshooting&lt;/h2>
&lt;p>Here are some helpfull troubleshooting commands.&lt;/p>
&lt;p>Client side:&lt;/p>
&lt;pre>&lt;code>$ ssh -v localhost
&lt;/code>&lt;/pre>
&lt;p>Server side:&lt;/p>
&lt;pre>&lt;code>$ sudo journalctl --follow
$ sudo systemctl status ssh
&lt;/code>&lt;/pre></description></item><item><title>Hello Ansible</title><link>https://terokarvinen.com/hello-ansible/</link><pubDate>Thu, 26 Mar 2026 14:39:42 +0200</pubDate><guid>https://terokarvinen.com/hello-ansible/</guid><description>
&lt;p>Write infrastructure-as-code, control multiple machines easily.&lt;/p>
&lt;p>In this Ansible tutorial, we create a single file in /tmp/.&lt;/p>
&lt;p>In this whole tutorial, we'll create only &lt;a href="#endresult">4 folders and 4 short files&lt;/a>. But I'll show you how to build it step by step, so you can understand and adapt the process.&lt;/p>
&lt;p>&lt;em>Draft: This article has commands written from memory. It has not gone trough quality assuarance and testing yet.&lt;/em>&lt;/p>
&lt;h2 id="background">Background&lt;/h2>
&lt;p>Ansible is a configuration management tool. You write your infrastructure as code (IaC). You describe the end state, and ansible only makes changes if they are needed.&lt;/p>
&lt;p>Ansible works trough SSH. Thus, the slave computers only need SSH daemon and Python installed.&lt;/p>
&lt;p>This tutorial is tested with Debian 13-Trixie. You can probably adapt it to other Linuxes, like Kali or Ubuntu. We'll use ssh daemon on the same host for testing, so the master and the slave are the same computer here.&lt;/p>
&lt;h2 id="test-ssh-account-without-ansible">Test SSH account (without Ansible)&lt;/h2>
&lt;p>Ansible works trough SSH. Let's first test that we can use SSH without Ansbile.&lt;/p>
&lt;p>It's advertised as &amp;quot;agentless&amp;quot;, and indeed there is no slave daemon for ansible. It still needs SSH daemon and Python on slave machine. Ansible (the command) is only needed on master side. Master computer is also known as &amp;quot;controller&amp;quot; in Ansible lingo.&lt;/p>
&lt;p>It's a good idea to set up passwordless SSH authentication for the account used with ansible. Check out Karvinen 2026: &lt;a href="https://terokarvinen.com/ssh-public-key-login-without-password/">SSH public key - Login without password&lt;/a>.&lt;/p>
&lt;pre>&lt;code>$ ssh localhost
remote$ exit
&lt;/code>&lt;/pre>
&lt;h2 id="install-ansible">Install Ansible&lt;/h2>
&lt;p>Ansible is convenintly in Debian repositories.&lt;/p>
&lt;pre>&lt;code>$ sudo apt-get update
$ sudo apt-get install ansible micro bash-completion tree
&lt;/code>&lt;/pre>
&lt;p>Only ansible is really needed. Extras make it easier to work:
- micro (text editor)
- bash-completion (tab fills current word)
- tree (show a tree of files and folders)&lt;/p>
&lt;h2 id="test-ssh-with-ansible">Test SSH with Ansible&lt;/h2>
&lt;p>Let's make a folder for our Ansible configuration.&lt;/p>
&lt;pre>&lt;code>$ cd
$ mkdir ansible/
$ cd ansible/
&lt;/code>&lt;/pre>
&lt;p>Let's write a list of hosts we'll be controlling. Create &amp;quot;hosts.ini&amp;quot;, and add &amp;quot;localhost&amp;quot; there.&lt;/p>
&lt;pre>&lt;code>$ micro hosts.ini
$ cat hosts.ini
localhost
&lt;/code>&lt;/pre>
&lt;p>Later, we can add more hosts. One line per host. The hosts can be grouped, so we can have hosts in &amp;quot;web&amp;quot; category and five in &amp;quot;db&amp;quot;.&lt;/p>
&lt;p>Now we can make Ansible run a command on all hosts.&lt;/p>
&lt;pre>&lt;code>$ ansible all -a 'uptime' -i hosts.ini
...
localhost | CHANGED | rc=0 &amp;gt;&amp;gt;
15:24:39 up 14 days, 20:36, 2 users, load average: 0.55, 0.44, 0.47
&lt;/code>&lt;/pre>
&lt;p>We're just testing ansible here. If we just wanted to run command on remote machine, we could have 'ssh localhost &amp;quot;uptime&amp;quot;'.&lt;/p>
&lt;p>Did you see the uptime? Great, Ansible can now use SSH to one host.&lt;/p>
&lt;p>&amp;lt;a name=&amp;quot;pythonversion&amp;quot;&lt;/p>
&lt;h2 id="convenience-stop-whining-about-python-version">Convenience: Stop whining about Python version&lt;/h2>
&lt;p>Why does Ansible have to whine about Python version? Oh, it could change - who could have guessed...&lt;/p>
&lt;pre>&lt;code>$ ansible all -a 'uptime' -i hosts.ini
[WARNING]: Host 'localhost' is using the discovered Python interpreter at '/usr/bin/python3.13', but future installation of another Python interpreter could cause a different interpreter to be discovered. See https://docs.ansible.com/ansible-core/2.19/reference_appendices/interpreter_discovery.html for more information.
localhost | CHANGED | rc=0 &amp;gt;&amp;gt;
15:29:24 up 14 days, 20:41, 2 users, load average: 0.27, 0.29, 0.39
&lt;/code>&lt;/pre>
&lt;p>Let's tell it to use the obvious Python command. We can add variables to host groups in inventory. This one we'll add to all.&lt;/p>
&lt;pre>&lt;code>$ micro hosts.ini
$ cat hosts.ini
localhost
[all:vars]
ansible_python_interpreter=/usr/bin/python3
&lt;/code>&lt;/pre>
&lt;p>So our only host &amp;quot;localhost&amp;quot; at the top, and variables for all hosts at the bottom.&lt;/p>
&lt;p>Let's try again:&lt;/p>
&lt;pre>&lt;code>ansible$ ansible all -a 'uptime' -i hosts.ini
localhost | CHANGED | rc=0 &amp;gt;&amp;gt;
15:31:18 up 14 days, 20:43, 2 users, load average: 0.18, 0.27, 0.37
&lt;/code>&lt;/pre>
&lt;p>We can see that the Python version warning is gone.&lt;/p>
&lt;a name="autoinventory">
&lt;h2 id="convenience-just-use-my-hostsini">Convenience: Just use my hosts.ini&lt;/h2>
&lt;p>Don't want to write &amp;quot;-i hosts.ini&amp;quot; for each 'ansible' and 'ansible-playbook' command?&lt;/p>
&lt;p>You can add hosts.ini to ansible.cfg, so you don't need to add it to each command line.&lt;/p>
&lt;pre>&lt;code>$ micro ansible.cfg
$ cat ansible.cfg
[defaults]
inventory = hosts.ini
&lt;/code>&lt;/pre>
&lt;p>Now we don't need to add &amp;quot;-i hosts.ini&amp;quot; to every 'ansible' and 'ansbile-playbook' commands.&lt;/p>
&lt;pre>&lt;code>$ ansible all -a &amp;quot;uptime&amp;quot;
localhost | CHANGED | rc=0 &amp;gt;&amp;gt;
15:22:18 up 14 days, 20:34, 2 users, load average: 0.35, 0.37, 0.46
&lt;/code>&lt;/pre>
&lt;h2 id="siteyml---what-computers-get-which-roles">Site.yml - what computers get which roles&lt;/h2>
&lt;p>Site.yml lists wich groups of computers get which configuration (roles).&lt;/p>
&lt;p>We want all computers to get the role &amp;quot;hello&amp;quot;. We have not written the role yet.&lt;/p>
&lt;pre>&lt;code>$ micro site.yml
$ cat site.yml
- hosts: all
roles:
- hello
&lt;/code>&lt;/pre>
&lt;p>Let's run our new playbook, site.yml&lt;/p>
&lt;pre>&lt;code>$ ansible-playbook site.yml
[ERROR]: the role 'hello' was not found in /home/tero/code/terokarvinen-com/ansible/roles/:...
Origin: /home/tero/code/terokarvinen-com/ansible/site.yml:3:7
1 - hosts: all
2 roles:
3 - hello
^ column 7
&lt;/code>&lt;/pre>
&lt;p>Great, an error message! Most error messages bring us two letters: good news and bad news.&lt;/p>
&lt;ul>
&lt;li>Good news: ansible-playbook has read our file, site.yml. It's even quoting some text from it.&lt;/li>
&lt;li>Bad news: the role &amp;quot;hello&amp;quot; does not exist. Well, we have not written it yet.&lt;/li>
&lt;/ul>
&lt;h2 id="first-role---create-a-file">First role - create a file&lt;/h2>
&lt;p>Role is one configured thing, for example nginx, apache2, postgresql...&lt;/p>
&lt;p>But first, we'll create a &amp;quot;hello&amp;quot; role. It will create a file in /tmp/, on the slave computer. It's so simple it doesn't even need sudo.&lt;/p>
&lt;p>Roles are in roles/ folder. There could be roles/nginx/, roles/postgresql/... But here, we'll have roles/hello/.&lt;/p>
&lt;p>Each role folder will have standard subfolders. We'll just have tasks/. Often, we'll also see handlers/ for kicking daemons. The entry point, the code that get's run automatically, is in main.yml.&lt;/p>
&lt;pre>&lt;code>$ mkdir -p roles/hello/tasks/
$ micro roles/hello/tasks/main.yml
$ cat roles/hello/tasks/main.yml
- copy:
dest: /tmp/hello-ansible
content: &amp;quot;See you at TeroKarvinen.com!\n&amp;quot;
&lt;/code>&lt;/pre>
&lt;p>Let's run our playbook. Site.yml calls roles/hello/, tasks/main.yml is run automatically:&lt;/p>
&lt;pre>&lt;code>$ ansible-playbook site.yml
PLAY [all]
TASK [Gathering Facts]
ok: [localhost]
TASK [hello : copy]
changed: [localhost]
PLAY RECAP
localhost : ok=2 changed=1 unreachable=0 failed=0 skipped=0 rescued=0 ignored=0
&lt;/code>&lt;/pre>
&lt;p>Hey, it has &amp;quot;changed=1&amp;quot;. So it claims to have changed the file on the slave.&lt;/p>
&lt;p>Let's verify using a different tool.&lt;/p>
&lt;pre>&lt;code>$ ssh localhost 'cat /tmp/hello-ansible'
See you at TeroKarvinen.com!
&lt;/code>&lt;/pre>
&lt;p>Did you see the file on slave? Great, your first &amp;quot;Hello, Ansible world&amp;quot; has run.&lt;/p>
&lt;h2 id="convenience-show-me-what-you-do">Convenience: Show me what you do&lt;/h2>
&lt;p>Default is pretty terse:&lt;/p>
&lt;pre>&lt;code>TASK [hello : copy]
changed: [localhost]
&lt;/code>&lt;/pre>
&lt;p>A popular solution would be giving each task a name that repeats the code: &amp;quot;Copy our hello world text to the file /tmp/hello&amp;quot;. To me, this would be similar to this C code: &amp;quot;i++; // increment the value of i by one&amp;quot;. It would make sense to name a block of tasks in ansible, but this is not supported yet.&lt;/p>
&lt;p>Luckily, we can make ansible print what it does. Add display_args_to_stdout:&lt;/p>
&lt;pre>&lt;code>$ micro ansible.cfg
$ cat ansible.cfg
[defaults]
inventory = hosts.ini
display_args_to_stdout = true
&lt;/code>&lt;/pre>
&lt;p>Now, let's run our playbook again:&lt;/p>
&lt;pre>&lt;code>$ ansible-playbook site.yml
...
TASK [hello : copy dest=/tmp/hello-ansible, content=See you at TeroKarvinen.com!
]
ok: [localhost]
&lt;/code>&lt;/pre>
&lt;p>Now we can see what it does:&lt;/p>
&lt;pre>&lt;code>- old: &amp;quot;hello : copy&amp;quot;
- new: &amp;quot;hello : copy dest=/tmp/hello-ansible, content=See you at TeroKarvinen.com!&amp;quot;
&lt;/code>&lt;/pre>
&lt;a name="endresult">
&lt;h2 id="end-result">End result&lt;/h2>
&lt;p>This is what we have in the end&lt;/p>
&lt;pre>&lt;code>$ tree -F
./
├── ansible.cfg # generic configuration
├── hosts.ini # list of slave computers
├── roles/
│   └── hello/
│   └── tasks/
│   └── main.yml # code for &amp;quot;hello&amp;quot; role&amp;quot;
└── site.yml # which roles run on which slave
4 directories, 4 files
$ head -1000 ansible.cfg hosts.ini site.yml roles/hello/tasks/main.yml
==&amp;gt; ansible.cfg &amp;lt;== # generic configuration
[defaults]
inventory = hosts.ini
display_args_to_stdout = true
==&amp;gt; hosts.ini &amp;lt;== # list of slave computers
localhost
[all:vars]
ansible_python_interpreter=/usr/bin/python3
==&amp;gt; site.yml &amp;lt;== # which roles run on which slave
- hosts: all
roles:
- hello
==&amp;gt; roles/hello/tasks/main.yml &amp;lt;== # code for &amp;quot;hello&amp;quot; role
- copy:
dest: /tmp/hello-ansible
content: &amp;quot;See you at TeroKarvinen.com!\n&amp;quot;
&lt;/code>&lt;/pre>
&lt;p>And to run it all, we just run the playbook:&lt;/p>
&lt;pre>&lt;code>$ ansible-playbook site.yml
...
localhost : ok=2 changed=0 unreachable=0 failed=0 skipped=0 rescued=0 ignored=0
&lt;/code>&lt;/pre>
&lt;h2 id="troubleshooting-ansible">Troubleshooting Ansible&lt;/h2>
&lt;p>No trouble? No troubleshooting needed. Go enjoy your ansible!&lt;/p>
&lt;h3 id="no-inventory">No inventory&lt;/h3>
&lt;pre>&lt;code>$ ansible all -a &amp;quot;uptime&amp;quot;
[WARNING]: No inventory was parsed, only implicit localhost is available
[WARNING]: provided hosts list is empty, only localhost is available. Note that the implicit localhost does not match 'all'
$
&lt;/code>&lt;/pre>
&lt;p>See: &lt;a href="#autoinventory">Convenience: Just use my hosts.ini&lt;/a>&lt;/p>
&lt;p>Ansible does not detect hosts &lt;em>inventory&lt;/em> hosts.ini automatically. Use a command line flag for that:&lt;/p>
&lt;pre>&lt;code>$ ansible all -a &amp;quot;uptime&amp;quot; -i hosts.ini
...
localhost | CHANGED | rc=0 &amp;gt;&amp;gt;
15:17:49 up 14 days, 20:29, 2 users, load average: 0.25, 0.41, 0.51
&lt;/code>&lt;/pre>
&lt;p>You can add hosts.ini to ansible.cfg, so you don't need to add it to each command line.&lt;/p>
&lt;pre>&lt;code>$ micro ansible.cfg
$ cat ansible.cfg
[defaults]
inventory = hosts.ini
&lt;/code>&lt;/pre>
&lt;p>Now we don't need to add &amp;quot;-i hosts.ini&amp;quot; to every 'ansible' and 'ansbile-playbook' commands.&lt;/p>
&lt;pre>&lt;code>$ ansible all -a &amp;quot;uptime&amp;quot;
...
localhost | CHANGED | rc=0 &amp;gt;&amp;gt;
15:22:18 up 14 days, 20:34, 2 users, load average: 0.35, 0.37, 0.46
&lt;/code>&lt;/pre>
&lt;h3 id="discovered-python-interpreter">Discovered Python interpreter&lt;/h3>
&lt;pre>&lt;code>$ ansible all -a 'uptime' -i hosts.ini
[WARNING]: Host 'localhost' is using the discovered Python interpreter at '/usr/bin/python3.13', but future installation of another Python interpreter could cause a different interpreter to be discovered. See https://docs.ansible.com/ansible-core/2.19/reference_appendices/interpreter_discovery.html for more information.
&lt;/code>&lt;/pre>
&lt;p>See Convenience: &lt;a href="#pythonversion">Stop whining about Python version&lt;/a>.&lt;/p>
&lt;h3 id="indent-is-two-spaces-tabs-are-usually-invalid-in-yaml">Indent is two spaces: Tabs are usually invalid in YAML&lt;/h3>
&lt;p>[ERROR]: YAML parsing failed: Tabs are usually invalid in YAML.&lt;/p>
&lt;p>Yes, my brain hurts, too. Why can't YAML use tabs like normal people?&lt;/p>
&lt;p>You must indent with spaces. Each indent is two spaces. The error message will show where the mistake is:&lt;/p>
&lt;pre>&lt;code>[ERROR]: YAML parsing failed: Tabs are usually invalid in YAML.
Origin: ...ansible/site.yml:3:1
1 - hosts: all
2 roles:
3 - hello
^ column 1
&lt;/code>&lt;/pre>
&lt;h3 id="indent-ignores-the-dash-conflicting-action-statements">Indent ignores the dash: conflicting action statements&lt;/h3>
&lt;p>[ERROR]: conflicting action statements: copy, dest
Origin: ...ansible/roles/hello/tasks/main.yml:1:3&lt;/p>
&lt;p>1 - copy:
^ column 3&lt;/p>
&lt;pre>&lt;code>$ cat roles/hello/tasks/main.yml
- copy:
dest: /tmp/hello-ansible # WRONG - too little indent
content: &amp;quot;Blah&amp;quot; # WRONG - too little indent
&lt;/code>&lt;/pre>
&lt;p>We want to have &amp;quot;copy&amp;quot;, which has two children, &amp;quot;dest&amp;quot; and &amp;quot;content&amp;quot;.&lt;/p>
&lt;p>Correct:&lt;/p>
&lt;pre>&lt;code>- copy: # no indent, dash is first char on line
dest: /tmp/hello-ansible # four spaces on the left, two spaces from &amp;quot;c&amp;quot; in copy
content: &amp;quot;See you at TeroKarvinen.com!\n&amp;quot; # four spaces on the left, two from &amp;quot;c&amp;quot;
&lt;/code>&lt;/pre>
&lt;p>&amp;quot;But it looks like four&amp;quot; - I know, I know. It's two from the start of the word above, ignoring the dash.&lt;/p>
&lt;h3 id="sudo-needed">Sudo needed&lt;/h3>
&lt;p>After a wait: &amp;quot;Task failed: Module failed: Failed to lock apt for exclusive operation: Failed to lock directory&amp;quot; and other error messages.&lt;/p>
&lt;p>Ansible needs sudo on the slave to do administration. It does not complain when creating files on /tmp/, because anyone can create files there. But as soon as you start doing any normal sysop things, you will need sudo.&lt;/p>
&lt;p>Add &amp;quot;become: true&amp;quot;. That means becoming the sudo user on slave machine.&lt;/p>
&lt;pre>&lt;code>$ cat site.yml
- hosts: all
become: true
roles:
- apt
- sshd
# ...
&lt;/code>&lt;/pre>
&lt;p>Now it will probably complain it does not know your sudo password.&lt;/p>
&lt;pre>&lt;code>$ ansible-playbook site.yml --ask-become-pass
&lt;/code>&lt;/pre>
&lt;p>Now it asks your sudo password before running the commands.&lt;/p>
&lt;p>If you get tired of typing your sudo password, there are many ways around it, with different levels of security. For example, you can create an ansible specific user with passwordless sudo. Or use ansible vault. Or pass. Or even read sudo password from file, which sounds less than secure.&lt;/p></description></item></channel></rss>