<?xml version="1.0" encoding="utf-8"?><feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en"><generator uri="https://gohugo.io/" version="0.80.0">Hugo</generator><title type="html">Michael Jansen, Drive By Coding</title><link href="https://michael-jansen.name/" rel="alternate" type="text/html" title="HTML"/><link href="https://michael-jansen.name/index.json" rel="alternate" type="application/json" title="JSON"/><link href="https://michael-jansen.name/index.xml" rel="alternate" type="application/rss+xml" title="RSS"/><link href="https://michael-jansen.name/atom.xml" rel="self" type="application/atom+xml" title="Atom"/><updated>2021-02-27T00:13:42+01:00</updated><id>https://michael-jansen.name/</id><entry><title type="html">MJ Inventory Released</title><link href="https://michael-jansen.name/blog/20210215-mj-inventory-release/?utm_source=atom_feed" rel="alternate" type="text/html"/><link href="https://michael-jansen.name/blog/20210128-reclass-configuration-db/?utm_source=atom_feed" rel="related" type="text/html" title="Configuration Database"/><link href="https://michael-jansen.name/blog/20210118-environment-modules/?utm_source=atom_feed" rel="related" type="text/html" title="Environment Modules"/><id>https://michael-jansen.name/blog/20210215-mj-inventory-release/</id><author><name>Mike</name></author><published>2021-02-26T23:17:08+01:00</published><updated>2021-02-26T23:17:08+01:00</updated><content type="html"><![CDATA[<blockquote>Open Source Project Announced</blockquote><p>Today I will finally announce the availability of my new open source application <b>MJ Inventory</b>. Yes … I am
still looking for a better name.</p>
<p>In the <a href="https://michael-jansen.name/blog/20210128-reclass-configuration-db/">previous post</a> I talked a bit about the motivation behind the
project. Now comes the release in the tradition of the bazaar. Release early, release often. Its still not completely
clear where this project is going but here it is. Let&rsquo;s see if someone else is finding it useful. Or even if it is
working for anyone but me :).</p>
<p>The application is written in the elixir programming language. The gui a phoenix liveview app.</p>
<p>There is a <a href="https://michael-jansen.name/assets/mj-inventory/mj_inventory.html">presentation available</a> that is intended to be a
mixture of introduction and documentation. It is also available in the git repository in the <i>doc/</i> folder.</p>
<p>The <a href="https://github.com/jansenm/mj-inventory/blob/development/README.md">Readme</a> file gives some documentation either and the
instructions on how to hopefully successfully building the application.</p>
<p>The project lives on <a href="https://github.com/jansenm/mj-inventory">github</a> for now.</p>
<p>Next step would be a video/screencast about it. But that turns out to be difficult :). Having not much experience with
that.</p>]]></content><category scheme="https://michael-jansen.name/categories/mj-inventory" term="mj-inventory" label="mj-inventory"/><category scheme="https://michael-jansen.name/tags/configuration-database" term="configuration-database" label="configuration-database"/><category scheme="https://michael-jansen.name/tags/tools" term="tools" label="tools"/><category scheme="https://michael-jansen.name/tags/devops" term="devops" label="devops"/></entry><entry><title type="html">Configuration Database</title><link href="https://michael-jansen.name/blog/20210128-reclass-configuration-db/?utm_source=atom_feed" rel="alternate" type="text/html"/><link href="https://michael-jansen.name/blog/20210118-environment-modules/?utm_source=atom_feed" rel="related" type="text/html" title="Environment Modules"/><id>https://michael-jansen.name/blog/20210128-reclass-configuration-db/</id><author><name>Mike</name></author><published>2021-01-28T20:58:42+01:00</published><updated>2021-01-28T20:58:42+01:00</updated><content type="html"><![CDATA[<p>I am about to release a new open source project. Unfortunately I am about to release it anytime soon
now for at least one month. So to put some pressure on myself lets talk about it publicly.</p>
<p>My day-to-day job is no longer programming. Started there but slowly got into Build and Configuration Management, then
Release Management and finally did some jobs as a deployer. You could say now I do anything AFTER the source code is
ready. Build, Release, Deployment, Monitoring and Test Automation (CI/CD).</p>
<p>In the last years, perhaps even decade, the idea of using development techniques during all stages of the delivery
pipeline became much more popular and gained a name: DevOps. I started from development so its kinda second nature to me to
use version control, separate configuration from code and do testing. Ok &hellip; on the last part there is still room for
improvement :).</p>
<p>One of the tools I used a lot for this in the last decade is reclass (<a href="https://reclass.pantsfullofunix.net/">https://reclass.pantsfullofunix.net/</a>). It was
developed as a drop in replacement for the included inventories of <a href="https://www.ansible.com/">ansible</a>, <a href="https://puppet.com/">puppet</a> and <a href="https://www.saltstack.com/">SaltStack</a> with much better
defined rules.</p>
<p>It is also useful without these tools. The end result is one big json or yaml file with your complete configuration. You
just read it and act accordingly. I used it over the times to:</p>
<ul>
<li>To generate jenkins jobs automatically utilizing <a href="https://plugins.jenkins.io/job-dsl/">Jenkins Job-DSL</a></li>
<li>To configure a python script, to separate the script from its configuration.</li>
<li>To generate documentation.</li>
<li>To drive complicated build setups that needed to build source code from about fifty repositories in a certain order.</li>
<li>And naturally as an inventory for ansible.</li>
</ul>
<p>Some of my colleagues call it a &ldquo;reclass fetish&rdquo;. Not sure why :).</p>
<p>I will not go into detail here now how it works. It defines the concept of classes and nodes, rules for inheritance and
how to merge the configuration. Lists get appended, Maps get merged but it is also possible to just override them.
<a href="https://reclass.pantsfullofunix.net/concepts.html">Check the documentation</a> for more.</p>
<p>The whole concept just has one problem. Its very elegant, very concise and very hard to understand if the inventory is
big, and you didn&rsquo;t create it. Or if you created it half a year ago. I always wanted a graphical tool that would help me
stay on top of my ever growing reclass configuration databases.</p>
<p>Later i could implement some additional features on top of what reclass currently provides. Even if reclass works
perfectly fine its kind of unmaintained right now. There are some forks out there that added functionality.</p>
<p>End of last year I actually started to develop this tool. A elixir / phoenix liveview application that in its first
iteration will be</p>
<ul>
<li>be 100% reclass compatible</li>
<li>add easy insight into reclass configuration databases.</li>
<li>does not allow editing the files.</li>
</ul>
<p>Having achieved this I plan to slowly enhance its functionality.</p>
<ul>
<li>Add the possibility to add/generate documentation</li>
<li>Add the possibility to edit the configuration in the webapp</li>
<li>Add more dynamic features. Like being able to generate list of nodes automatically with a query.</li>
</ul>
<p>In my next post I want to show a short video of the apps current state. The source code should be opened soon after. I
just have to decide on a license. Never open sourced an app like this so not sure what the best license is. Any pointer
welcome.</p>
<p>Michael</p>
]]></content><category scheme="https://michael-jansen.name/categories/mj-inventory" term="mj-inventory" label="mj-inventory"/><category scheme="https://michael-jansen.name/tags/configuration-database" term="configuration-database" label="configuration-database"/><category scheme="https://michael-jansen.name/tags/tools" term="tools" label="tools"/><category scheme="https://michael-jansen.name/tags/devops" term="devops" label="devops"/></entry><entry><title type="html">Systemd Plasma Applet</title><link href="https://michael-jansen.name/blog/20210127-plasma-systemd-applet-license/?utm_source=atom_feed" rel="alternate" type="text/html"/><link href="https://michael-jansen.name/blog/20210115-plasma-systemd-applet-bugfix/?utm_source=atom_feed" rel="related" type="text/html" title="Systemd Plasma Applet Release"/><link href="https://michael-jansen.name/blog/20210109-plasma-systemd-applet/?utm_source=atom_feed" rel="related" type="text/html" title="Applet Up For Adoption"/><link href="https://michael-jansen.name/blog/20160103-hello-again/?utm_source=atom_feed" rel="related" type="text/html" title="Hello Again"/><id>https://michael-jansen.name/blog/20210127-plasma-systemd-applet-license/</id><author><name>Mike</name></author><published>2021-01-27T11:36:21+01:00</published><updated>2021-01-27T11:36:21+01:00</updated><content type="html"><![CDATA[<blockquote>REUSE Compatible Licensing</blockquote><p>Just a short announcement that I pushed some commits to github <a href="https://github.com/jansenm/systemd-plasmoid">https://github.com/jansenm/systemd-plasmoid</a>  and tagged
a release 2.0.1. The first ever with a tag. Unfortunately I am not that sure I did that right so in case someone out
there packages this and needs more just complain.</p>
<p>The source code now is fully <a href="https://reuse.software/">reuse</a> compatible.</p>
<div class="highlight"><pre style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-shell" data-lang="shell">$ reuse lint
<span style="color:#75715e"># SUMMARY</span>

* Bad licenses:
* Deprecated licenses:
* Licenses without file extension:
* Missing licenses:
* Unused licenses:
* Used licenses: CC0-1.0, LGPL-2.1-or-later
* Read errors: <span style="color:#ae81ff">0</span>
* Files with copyright information: <span style="color:#ae81ff">42</span> / <span style="color:#ae81ff">42</span>
* Files with license information: <span style="color:#ae81ff">42</span> / <span style="color:#ae81ff">42</span>

Congratulations! Your project is compliant with version 3.0 of the REUSE Specification :-<span style="color:#f92672">)</span>
</code></pre></div>]]></content><category scheme="https://michael-jansen.name/categories/kde" term="kde" label="kde"/><category scheme="https://michael-jansen.name/tags/systemd-applet" term="systemd-applet" label="systemd-applet"/><category scheme="https://michael-jansen.name/tags/kde" term="kde" label="kde"/></entry><entry><title type="html">Environment Modules</title><link href="https://michael-jansen.name/blog/20210118-environment-modules/?utm_source=atom_feed" rel="alternate" type="text/html"/><id>https://michael-jansen.name/blog/20210118-environment-modules/</id><author><name>Mike</name></author><published>2021-01-18T21:59:07+01:00</published><updated>2021-01-18T21:59:07+01:00</updated><content type="html"><![CDATA[<blockquote>One of the forgotten tools</blockquote><p><a href="http://modules.sourceforge.net/">Environment Modules</a> is one of those open source projects that I wish more people
would know and use. I always wonder why tools like <a href="https://asdf-vm.com/#/">asdf</a> don&rsquo;t provide support for it instead
of rolling their own implementation. So lets increase awareness.</p>
<blockquote>
<p>The Environment Modules package provides for the dynamic modification of a user&rsquo;s environment via modulefiles.</p>
<p>&ndash; <cite><a href="http://modules.sourceforge.net/">Environment Modules Homepage</a></cite></p>
</blockquote>
<p>So what does it do? Here is a small example:</p>
<div class="highlight"><pre style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-shell" data-lang="shell">~ $ type ansible
bash: type: ansible: not found

~ $ module avail -l ansible/
- Package/Alias -----------------------.- Versions --------.- Last mod. -------
/home/mjansen/local/etc/modules:
ansible/2.8.15                          2.8                 2020/10/28 18:43:05
ansible/2.9.13                          2.9                 2020/10/28 18:43:15
ansible/2.10.1                          2.10:default        2020/10/28 18:42:56

~ $ module load ansible/2.9.13

~ $ ansible --version
ansible 2.9.13
  config file <span style="color:#f92672">=</span> None
  configured module search path <span style="color:#f92672">=</span> <span style="color:#f92672">[</span><span style="color:#e6db74">&#39;/home/mjansen/.ansible/plugins/modules&#39;</span>, <span style="color:#e6db74">&#39;/usr/share/ansible/plugins/modules&#39;</span><span style="color:#f92672">]</span>
  ansible python module location <span style="color:#f92672">=</span> /home/mjansen/local/opt/ansible/2.9.13/lib64/python3.8/site-packages/ansible
  executable location <span style="color:#f92672">=</span> /home/mjansen/local/opt/ansible/2.9.13/bin/ansible
  python version <span style="color:#f92672">=</span> 3.8.6 <span style="color:#f92672">(</span>default, Nov <span style="color:#ae81ff">09</span> 2020, 12:09:06<span style="color:#f92672">)</span> <span style="color:#f92672">[</span>GCC<span style="color:#f92672">]</span>

~ $ type ansible
ansible is hashed <span style="color:#f92672">(</span>/home/mjansen/local/opt/ansible/2.9.13/bin/ansible<span style="color:#f92672">)</span>

~ $ module unload ansible

~ $ type ansible
bash: type: ansible: not found
</code></pre></div><p>So in short environment modules allow you to alter your shell session dynamically by</p>
<ul>
<li>Altering the content of environment variables</li>
<li>Setting/Removing aliases</li>
<li>Create functions in the users environment</li>
<li>There is more in the <a href="https://linux.die.net/man/4/modulefile">modulefile man page</a>.</li>
</ul>
<p>Modulefiles are actually <a href="https://www.tcl.tk/">tcl</a> scripts. It is a slightly weird (imo) looking scripting language.
Tcl and environment modules are available forever. They are from the 1990s.</p>
<p>The ansible script above looks like this:</p>
<div class="highlight"><pre style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-tcl" data-lang="tcl"><span style="color:#75715e">#%Module1.0#####################################################################
</span><span style="color:#75715e">##
</span><span style="color:#75715e">## ANSIBLE VERSION
</span><span style="color:#75715e">##
</span><span style="color:#75715e"></span><span style="color:#66d9ef">proc</span> ModulesHelp <span style="color:#66d9ef">{</span> <span style="color:#66d9ef">}</span> <span style="color:#66d9ef">{</span>
        <span style="color:#66d9ef">global</span> version
        puts stderr <span style="color:#e6db74">&#34;\tActivates ansible v$version [ARA]&#34;</span>
<span style="color:#66d9ef">}</span>

<span style="color:#66d9ef">set</span>     home         $::env<span style="color:#66d9ef">(</span>HOME<span style="color:#66d9ef">)</span>
<span style="color:#66d9ef">set</span>     version      <span style="color:#ae81ff">2.9</span>.13
<span style="color:#66d9ef">set</span>     root         $home<span style="color:#f92672">/</span>local<span style="color:#f92672">/</span>opt<span style="color:#f92672">/</span>ansible<span style="color:#f92672">/</span>$version
<span style="color:#66d9ef">set</span>     ansible_callback_plugins <span style="color:#66d9ef">[</span>exec $root<span style="color:#f92672">/</span>bin<span style="color:#f92672">/</span>python3 <span style="color:#f92672">-</span>m ara.setup.callback_plugins<span style="color:#66d9ef">]</span>

module-whatis   <span style="color:#e6db74">&#34;Ansible V$version&#34;</span>

conflict ansible

append<span style="color:#f92672">-</span>path PATH $root<span style="color:#f92672">/</span>bin
setenv ANSIBLE_CALLBACK_PLUGINS $ansible_callback_plugins
</code></pre></div><p>So why should you care. As a <em>hypothetical</em> developer you probably need to install different versions of libraries and
tools to check your programs against or with. Like different Qt Versions or compiler. Most developer I know then proceed
to use shell scripts they source to deal with that. This does not allow easy unloading and switching. Utilizing
environment modules gives you a much more pleasant experience. My list currently looks like this:</p>
<div class="highlight"><pre style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-text" data-lang="text">- Package/Alias -----------------------.- Versions --------.- Last mod. -------
/home/mjansen/local/etc/modules:
ansible/2.8.15                          2.8                 2020/10/28 18:43:05
ansible/2.9.13                          2.9                 2020/10/28 18:43:15
ansible/2.10.1                          2.10:default        2020/10/28 18:42:56
catt                                                        2019/08/26 14:58:23
editor/vim                                                  2020/10/26 19:39:10
elixir_escripts                                             2020/11/11 05:29:32
elm/0.19.1-3                            0.19:0.19.1:default 2020/03/31 22:24:21
go/1.13.6                                                   2020/01/21 16:06:16
gopath                                                      2020/01/21 16:16:09
groovy/2.4.7                                                2019/08/26 14:58:23
groovy/2.5.7                                                2019/08/26 14:58:23
home_install                                                2020/02/23 16:20:05
hugo/0.76.5                                                 2020/10/28 18:46:11
hugo/0.80.0                                                 2021/01/09 21:07:52
java/jdk1.8.0_172                                           2019/08/26 14:58:23
jupyter                                                     2019/08/26 14:58:23
maven/3.3.9                                                 2019/08/26 14:58:23
minishift                                                   2020/03/29 16:29:17
novisual                                                    2019/08/26 14:58:23
reclass/1.4.1                                               2020/01/27 14:27:20
reclass/git                                                 2020/12/20 19:51:34
usr_local                                                   2020/01/29 13:36:42
vit                                                         2020/01/15 17:01:25
zeppelin/0.9.0-preview2                                     2020/10/29 16:42:13
</code></pre></div><p>Environment modules also has the concept of sessions which allows you to save and load different configurations. Either in
a central location (eg. <code>~/.module</code>) or to a file specified on the command line.</p>
<div class="highlight"><pre style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-shell" data-lang="shell">~ $ module save homepage

~ $ module savelist
Named collection list:
 1<span style="color:#f92672">)</span> homepage  

~ $ module saveshow homepage
-------------------------------------------------------------------
/home/mjansen/.module/homepage:

module use --append /home/mjansen/local/etc/modules
module load editor
module load gopath
module load go
module load hugo

-------------------------------------------------------------------
</code></pre></div><p>Modulefiles can even specify conflicts, so you don&rsquo;t load two different versions of a library or program. They can
also specify requirements, so you don&rsquo;t forget to load a python version before loading ansible.</p>
<p>If you want to try environment modules one word of warning. In opensuse after installing environment modules it is not
active. I guess the same applies to other distros. Shell initialization files for additional packages are a sore spot in
most distros. You have to activate it manually in your shell initialization file (eg. bashrc).</p>
<div class="highlight"><pre style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-bash" data-lang="bash"><span style="color:#75715e"># ACTIVATE ENVIRONMENT MODULES                                           # {{{2</span>
<span style="color:#75715e">###############################################################################</span>
<span style="color:#66d9ef">case</span> <span style="color:#e6db74">&#34;</span>$0<span style="color:#e6db74">&#34;</span> in
          -sh|sh|*/sh<span style="color:#f92672">)</span>  modules_shell<span style="color:#f92672">=</span>sh ;;
       -ksh|ksh|*/ksh<span style="color:#f92672">)</span>  modules_shell<span style="color:#f92672">=</span>ksh ;;
       -zsh|zsh|*/zsh<span style="color:#f92672">)</span>  modules_shell<span style="color:#f92672">=</span>zsh ;;
    -bash|bash|*/bash<span style="color:#f92672">)</span>  modules_shell<span style="color:#f92672">=</span>bash ;;
<span style="color:#66d9ef">esac</span>

source /usr/share/Modules/init/$modules_shell
test -r /usr/share/Modules/init/<span style="color:#f92672">{</span>$modules_shell<span style="color:#f92672">}</span>_completion <span style="color:#f92672">&amp;&amp;</span> source /usr/share/Modules/init/<span style="color:#f92672">{</span>$modules_shell<span style="color:#f92672">}</span>_completion
</code></pre></div>]]></content><category scheme="https://michael-jansen.name/categories/devops-tools" term="devops-tools" label="devops-tools"/><category scheme="https://michael-jansen.name/tags/tools" term="tools" label="tools"/><category scheme="https://michael-jansen.name/tags/devops" term="devops" label="devops"/></entry><entry><title type="html">Systemd Plasma Applet Release</title><link href="https://michael-jansen.name/blog/20210115-plasma-systemd-applet-bugfix/?utm_source=atom_feed" rel="alternate" type="text/html"/><link href="https://michael-jansen.name/blog/20210109-plasma-systemd-applet/?utm_source=atom_feed" rel="related" type="text/html" title="Applet Up For Adoption"/><link href="https://michael-jansen.name/blog/20160103-hello-again/?utm_source=atom_feed" rel="related" type="text/html" title="Hello Again"/><id>https://michael-jansen.name/blog/20210115-plasma-systemd-applet-bugfix/</id><author><name>Mike</name></author><published>2021-01-16T22:16:30+01:00</published><updated>2021-01-16T22:16:30+01:00</updated><content type="html"><![CDATA[<blockquote>Systemd Applet Bugfix Release</blockquote><p>Given no one seems to be interested in working on the applet (boo) I decided to tackle
the bug myself. Apparently the fact it worked previously was the result of happenstance.</p>
<p>The systemd manager processes only send out signals after at least one process told them to do
so. It seems that some process did that on my computer before but no more. From the doc:</p>
<blockquote>
<p>Subscribe() enables most bus signals to be sent out. Clients which are interested in signals need to call this
function. Signals are only sent out if at least one client invoked this function. Unsubscribe() undoes the signal
subscription that Subscribe() implements. It is not necessary to invoke Unsubscribe() as clients are tracked. Signals
are no longer sent out as soon as all clients which previously asked for Subscribe() either closed the bus connection or
invoked Unsubscribe().</p>
</blockquote>
<p>After adding the call now the applet notices state changes for units on the session manager
too.</p>
<p>Next step is proper licensing. Getting it <a href="https://reuse.software/">reuse compatible</a>.</p>
<p>Then moving it over to kde infrastructure.</p>
]]></content><category scheme="https://michael-jansen.name/categories/kde" term="kde" label="kde"/><category scheme="https://michael-jansen.name/tags/systemd-applet" term="systemd-applet" label="systemd-applet"/><category scheme="https://michael-jansen.name/tags/kde" term="kde" label="kde"/></entry><entry><title type="html">Applet Up For Adoption</title><link href="https://michael-jansen.name/blog/20210109-plasma-systemd-applet/?utm_source=atom_feed" rel="alternate" type="text/html"/><link href="https://michael-jansen.name/blog/20160103-hello-again/?utm_source=atom_feed" rel="related" type="text/html" title="Hello Again"/><id>https://michael-jansen.name/blog/20210109-plasma-systemd-applet/</id><author><name>Mike</name></author><published>2021-01-09T21:21:35+01:00</published><updated>2021-01-09T21:21:35+01:00</updated><content type="html"><![CDATA[<p>A year ago I felt like getting back into c++ and kde development. Scratching one of
my itches seemed to be the right path back. For quite some time I was looking for a plasma
applet that allows to control and monitor systemd units. Preferably for both system
and session service managers.</p>
<p>The attempt actually led to a result which was neither pretty nor perfect, but it worked. I put it
on github <a href="https://github.com/jansenm/systemd-plasmoid">https://github.com/jansenm/systemd-plasmoid</a> and used it locally. No formal announcement was ever done
and my plan to put it into kde infrastructure kinda never realized too.</p>
<p>Fast-forward nearly a year and some aspect of the applet stopped working. It no longer notices
if you stop a service manually on the session service manager. For the system service manager
it works. Unfortunately I realized I am no longer interested in this kind of programming. And
that i kinda forgot everything i learned a year ago :).</p>
<p>The solution. Make an announcement to check if someone else is interested in taking over the
applet.</p>
<p>So are YOU interested in taking over? I consider it a very useful applet and would hate to see
it perish. I would assist in moving it over to kde infrastructure.</p>
<p>Btw &hellip; is it applet or widget? There seems to be some inconsistent naming.</p>
]]></content><category scheme="https://michael-jansen.name/categories/kde" term="kde" label="kde"/><category scheme="https://michael-jansen.name/tags/systemd-applet" term="systemd-applet" label="systemd-applet"/><category scheme="https://michael-jansen.name/tags/kde" term="kde" label="kde"/></entry><entry><title type="html">openSUSE Leap: LibVirt And NetworkManager</title><link href="https://michael-jansen.name/blog/20160116-libvirt-network-trigger/?utm_source=atom_feed" rel="alternate" type="text/html"/><link href="https://michael-jansen.name/blog/20160103-hello-again/?utm_source=atom_feed" rel="related" type="text/html" title="Hello Again"/><id>https://michael-jansen.name/blog/20160116-libvirt-network-trigger/</id><author><name>Mike</name></author><published>2016-01-16T17:00:00+01:00</published><updated>2016-01-16T17:00:00+01:00</updated><content type="html"><![CDATA[<p>I recently switched to Leap from 13.2.  First time i have seen the next generation of kde and plasma.  So far i like the
experience.  But i miss some stuff :(.  If some dev out there  needs an idea for his next little plasma widget project
please consider porting <a href="http://kde-look.org/content/show.php/Service+Monitor?content=125203">service monitor</a>.  That widget alone could bring me back to kde4 :).</p>
<p>As i did a clean reinstall once again <a href="wikipedia_en%3Eresolv.conf">resolv.conf</a> was not updated when starting my libvirt networks so no dns resolve
of vm names.  Not sure if that is a bug or expected behaviour but i had it with 13.2 too and consider it a REAL bug.  Or
at least major annoyance.</p>
<p>Adding the ip address statically to resolv.conf is not a option.  This is a notebook so most services do not get
started on default.  Which includes libvirtd.</p>
<p>The solution i came up with is to add a <a href="https://www.libvirt.org/hooks.html">libvirt hook</a> that registers the libvirt dnsmasq instance with netconfig when
starting libvirt networks and removing it when stopping it.  Not much explanation &hellip; just code for your convenience.</p>
<p>The script could be improved i guess.  Check if dhcp is configured for the network and so on or if dnsmasq is
configured for the network in libvirt. But for me it works as is.</p>
<div class="highlight"><pre style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-shell" data-lang="shell"><span style="color:#75715e">#!/bin/sh
</span><span style="color:#75715e"></span><span style="color:#75715e"># vim: et sw=0</span>
<span style="color:#75715e"># See https://www.libvirt.org/hooks.html</span>
OBJECT<span style="color:#f92672">=</span><span style="color:#e6db74">&#34;</span><span style="color:#e6db74">${</span>1<span style="color:#e6db74">}</span><span style="color:#e6db74">&#34;</span>
OPERATION<span style="color:#f92672">=</span><span style="color:#e6db74">&#34;</span><span style="color:#e6db74">${</span>2<span style="color:#e6db74">}</span><span style="color:#e6db74">&#34;</span>
SUB_OPERATION<span style="color:#f92672">=</span><span style="color:#e6db74">&#34;</span><span style="color:#e6db74">${</span>3<span style="color:#e6db74">}</span><span style="color:#e6db74">&#34;</span>
EXTRA_ARGS<span style="color:#f92672">=</span><span style="color:#e6db74">&#34;</span><span style="color:#e6db74">${</span>4<span style="color:#e6db74">}</span><span style="color:#e6db74">&#34;</span>
<span style="color:#75715e"># Get the configuration from STDIN</span>
config<span style="color:#f92672">=</span><span style="color:#66d9ef">$(</span>cat<span style="color:#66d9ef">)</span>
<span style="color:#75715e"># Extract the interface and ip addr</span>
iface<span style="color:#f92672">=</span><span style="color:#66d9ef">$(</span>sed -ne <span style="color:#e6db74">&#34;s/^.*bridge *name=&#39;\([a-zA-Z0-9_]*\).*</span>$<span style="color:#e6db74">/\1/p;&#34;</span> <span style="color:#f92672">&lt;&lt;&lt;</span><span style="color:#e6db74">&#34;</span><span style="color:#e6db74">${</span>config<span style="color:#e6db74">}</span><span style="color:#e6db74">&#34;</span><span style="color:#66d9ef">)</span>
ipaddr<span style="color:#f92672">=</span><span style="color:#66d9ef">$(</span>sed -ne <span style="color:#e6db74">&#34;s/^.*ip *address *= *&#39;\([0-9.]*\).*</span>$<span style="color:#e6db74">/\1/p;&#34;</span>   <span style="color:#f92672">&lt;&lt;&lt;</span><span style="color:#e6db74">&#34;</span><span style="color:#e6db74">${</span>config<span style="color:#e6db74">}</span><span style="color:#e6db74">&#34;</span><span style="color:#66d9ef">)</span>
<span style="color:#66d9ef">function</span> check_suboperation<span style="color:#f92672">()</span> <span style="color:#f92672">{</span>
  local operation<span style="color:#f92672">=</span> shift;
  local expected<span style="color:#f92672">=</span> shift;
  <span style="color:#66d9ef">if</span> <span style="color:#f92672">[</span> <span style="color:#e6db74">&#34;</span><span style="color:#e6db74">${</span>oper<span style="color:#e6db74">}</span><span style="color:#e6db74">&#34;</span> !<span style="color:#f92672">=</span> <span style="color:#e6db74">&#34;</span><span style="color:#e6db74">${</span>expected<span style="color:#e6db74">}</span><span style="color:#e6db74">&#34;</span> <span style="color:#f92672">]</span>; <span style="color:#66d9ef">then</span>
    echo <span style="color:#e6db74">&#34;WARN: Unknown sub-operation </span><span style="color:#e6db74">${</span>oper<span style="color:#e6db74">}</span><span style="color:#e6db74"> encountered!&#34;</span> &gt;&amp;<span style="color:#ae81ff">2</span>
    exit <span style="color:#ae81ff">1</span>
  <span style="color:#66d9ef">fi</span>
<span style="color:#f92672">}</span>
<span style="color:#66d9ef">case</span> <span style="color:#e6db74">&#34;</span><span style="color:#e6db74">${</span>OPERATION<span style="color:#e6db74">}</span><span style="color:#e6db74">&#34;</span> in
  started<span style="color:#f92672">)</span>
    check_suboperation <span style="color:#e6db74">&#34;</span><span style="color:#e6db74">${</span>SUB_OPERATION<span style="color:#e6db74">}</span><span style="color:#e6db74">&#34;</span> <span style="color:#e6db74">&#34;begin&#34;</span>
    netconfig modify -v --service libvirt --interface <span style="color:#e6db74">&#34;</span><span style="color:#e6db74">${</span>iface<span style="color:#e6db74">}</span><span style="color:#e6db74">&#34;</span> -v <span style="color:#f92672">&lt;&lt;&lt;</span> <span style="color:#e6db74">&#34;DNSSERVERS=&#39;</span><span style="color:#e6db74">${</span>ipaddr<span style="color:#e6db74">}</span><span style="color:#e6db74">&#39;&#34;</span>
    ;;
  stopped<span style="color:#f92672">)</span>
    check_suboperation <span style="color:#e6db74">&#34;</span><span style="color:#e6db74">${</span>SUB_OPERATION<span style="color:#e6db74">}</span><span style="color:#e6db74">&#34;</span> <span style="color:#e6db74">&#34;begin&#34;</span>
    netconfig remove -v --service libvirt --interface <span style="color:#e6db74">&#34;</span><span style="color:#e6db74">${</span>iface<span style="color:#e6db74">}</span><span style="color:#e6db74">&#34;</span> -v <span style="color:#f92672">&lt;&lt;&lt;</span> <span style="color:#e6db74">&#34;DNSSERVERS=&#39;</span><span style="color:#e6db74">${</span>ipaddr<span style="color:#e6db74">}</span><span style="color:#e6db74">&#39;&#34;</span>
    ;;
<span style="color:#66d9ef">esac</span>
exit <span style="color:#ae81ff">0</span>
</code></pre></div><p>This script is put under the <a href="%7Bfilename%7D/pages/unlicense.rst">unlicense license</a>.</p>
]]></content><category scheme="https://michael-jansen.name/categories/blog" term="blog" label="blog"/><category scheme="https://michael-jansen.name/tags/blog" term="blog" label="blog"/><category scheme="https://michael-jansen.name/tags/opensuse" term="opensuse" label="opensuse"/><category scheme="https://michael-jansen.name/tags/libvirt" term="libvirt" label="libvirt"/><category scheme="https://michael-jansen.name/tags/netcontrol" term="netcontrol" label="netcontrol"/></entry><entry><title type="html">Hello Again</title><link href="https://michael-jansen.name/blog/20160103-hello-again/?utm_source=atom_feed" rel="alternate" type="text/html"/><id>https://michael-jansen.name/blog/20160103-hello-again/</id><author><name>Mike</name></author><published>2016-01-03T18:00:00+01:00</published><updated>2016-01-03T18:00:00+01:00</updated><content type="html"><![CDATA[<p>Long time &hellip; no see. Actually two years no blog entry. Real life and especially the job demanded all my time. On top of
it the real life job was filled up with boring and uninteresting work not worth blogging about. But thankfully that
changed.</p>
<p>I hope to be able to blog more in the next months. It will be less build-tool and more <a href="https://ansible.com">ansible</a>, <a href="https://jenkins-ci.org">jenkins</a>,
<a href="https://docker.com">docker</a> and automation in general. And python. And IDEA.</p>
<h2 id="build-tool-is-gone">Build-tool is gone</h2>
<p>Btw. for those of you out there that actually used build-tool here the official announcement: <strong>Its dead</strong>. And dead
does not even get it right. Its gone. As in i no longer have the source code. Apparently gitorious AND rubyforge went
down while i was away. My desktop too and out of a sense of false security i thought its safe out there in the wild wild
internet :). The gems are naturally still available but not useful anymore.</p>
<h2 id="new-blog">New Blog</h2>
<p>I moved my blog from <a href="http://modx.com">ModX</a> (which i took down quite some time ago) to the <a href="http://getpelican.com">pelican static site generator</a> . A lack of
time and a unfamiliarity with it let me fall behind security updates so badly taking down the site was the only option
left.</p>
<p>The decision was between using a hosted blog or a static site generator in a language i am familiar with. Which means
pelican was the natural selection.</p>
<p>And so far i am loving it. Much easier.</p>
]]></content><category scheme="https://michael-jansen.name/categories/blog" term="blog" label="blog"/><category scheme="https://michael-jansen.name/tags/kde" term="kde" label="kde"/><category scheme="https://michael-jansen.name/tags/blog" term="blog" label="blog"/><category scheme="https://michael-jansen.name/tags/pelican" term="pelican" label="pelican"/><category scheme="https://michael-jansen.name/tags/build-tool" term="build-tool" label="build-tool"/></entry></feed>