Thursday, March 7, 2019

Exclude files from being exported into the zip/tar source archives on github.com

GitHub.com (and probably GitLab too) provides various ways to export the Git branch contents or tags and releases as Zip- or Tar-archives. When creating a release, these tar-/zipballs are automatically created and added to the release. I often find archives, which contain a lot of files not useful to the end user, like .github directories, Git (.gitignore, .gitattributes) or CI related files (.travis.yml, .appveyor.yml). Sometimes they also contain directories (e.g. for test files), upstream hosts in Git, but does not need for the source distribution. But there is an easy way to keep these files out of the automatically created source archives and keep the latter clean by using the export-ignore attribute in the .gitattributes files:

# don't export the github-pages source
/docs export-ignore
# export some other irrelevant directories
/foo export-ignore
# don't export the files necessary for CI
Gemfile export-ignore
.appveyor.yml export-ignore
.travis.yml export-ignore
# ignore Git related files
.gitattributes export-ignore
.gitignore export-ignore

Sunday, February 24, 2019

Jekyll and GitHub pages: access the download URL (aka browser_download_url) for an asset of your latest release via site.github

Add the download URL of an asset of your latest release

Often there is the question to get the download URL for an asset (e.g. a setup-file) of the latest release of a project. In my case I provide an executable, which includes the version number in its name together with the source as ZIP- and Tarball-archive. Others provide versioned source tarballs or executables, which are different from the Git repository source tarballs.

project-X.Y.Z-setup.exe
project-X.Y.Z-src.tar.gz

Now to get the download URL(s) for the asset(s) using the GitHub API one can get and process this URL (replacing USER and PROJECT/var> with the GitHub user account and projectname accordingly):

https://api.github.com/repos/USER/PROJECT/releases/latest

Note, that the assets download URL is provided by the browser_download_url object in the assets objects list:

{
  ...
  "assets": [
    {
      ...
      "browser_download_url": "...",
      ...
    }
  ]
}

The content provided by the API is also available to Jekyll sites hosted on GitHub pages via the site.github namespace. You can easily check all the content of this namespace using this approach (somewhere in your code):

{{ site.github | inspect }}

You'll find, that you can even access detailed author and project information. Now to get the download URL of my asset, I just access the first list entry using this:

{{ site.github.latest_release.assets[0].browser_download_url }}

or this approach (less typing):

{% assign release = site.github.latest_release %}
{{ release.assets[0].browser_download_url }}

I use this to create structured data in JSON-LD for a software application. I can even access the file size, the creation and publication date of my asset. The following shows the JSON-LD snippet I add to one of my GitHub project pages (I replaced fixed content with dots):

{% assign release = site.github.latest_release %}
{
  "@context": "http://schema.org/",
  "@type": "SoftwareApplication",
  "name": "...",
  "softwareVersion": "{{ release.tag_name | strip | remove: 'v' }}",
  "alternateName": [
    "...",
    "{{ release.name }}"
  ],
  "description": "...",
  "applicationCategory": "...",
  "inLanguage": ["..", ".."],
  "operatingSystem": [
    "...",
    "..."
  ],
  "downloadUrl": "{{ release.assets[0].browser_download_url }}",
  "fileSize": "{{ release.assets[0].size | divided_by: 1024 }}",
  "releaseNotes": "{{ release.html_url }}",
  "license": "...",
  "url": "{{ site.github.repository_url }}",
  "datePublished": "{{ release.published_at }}",
  "dateCreated": "{{ release.created_at }}",
  "author":    {%- include json/person.json -%},
  "publisher": {%- include json/publisher.json -%}
}

If there is more than one asset (the GitHub repository source tarball and zipball are not assets) one probably has to use a more flexibale approach then accessing the first list entry via asset[0] as shown above. If there are several assets and the asset file name is created the same way for every release but includes the version number (see the file name examples from the beginning of this post), there is another approach, that might be to used. One can process:

{{ site.github.latest_release.tag_name }}

and create the download URL like this

{{ site.github.releases_url }}/download/latest/foo-{{ site.github.latest_release.tag_name | strip | remove 'v' }}-setup.exe
{{ site.github.releases_url }}/download/latest/foo-{{ site.github.latest_release.tag_name | strip | remove 'v' }}-src.tar.gz

Because it is common to tag the version as vX.Y.Z the leading v is removed from the version tag in the examples above.

Using the approach above one can even loop over site.github.releaes and create a changelog/news page automatically for all releases! Maybe you can share your ideas about the suggested approaches on my GIST page.

Monday, April 30, 2018

Re-enabling right click functionality for my Thinkpad touchpad

I have a Lenovo Thinkpad Yoga 11e running Debian Sid. The touchpad has a left and a right click area at the bottem. For some reason, the right click ability recently stopped working. I have not yet found the reason, but I was able to fix it by adding the emphasized lines in /usr/share/X11/xorg.conf.d/70-synaptics.conf.


Section "InputClass"
        Identifier "Default clickpad buttons"
        MatchDriver "synaptics"
        Option "ClickPad" "true"
        Option "EmulateMidButtonTime" "0"
        Option "SoftButtonAreas" "50% 0 82% 0 0 0 0 0"
        Option "SecondarySoftButtonAreas" "58% 0 0 15% 42% 58% 0 15%"
EndSection
Edit

Nope. Stopped working again and both bottom areas act as left click. As it is working as a left click, I guess, the touchpad is physically ok. So I have no idea, what's going on :(

Edit 2

Thanks to Cole Robinson and the link he provided I found the reason and a fix. GNOME 3.28 uses the clickfinger behaviour by default now. By setting the click method from the 'fingers' (clickfinger) method back to 'areas', either using gsettings or gnome-tweaks, the right click ability is back after rebooting the system.

PS: With the new default clickfinger method, the right- and middle click are emulated using a two- and three-finger tap.

Monday, February 5, 2018

Get your namespace_id(s) for salsa.debian.org

In addition to Christoph Bergs script, to import packages to salsa.debian.org, I'd like to provide some more ways to determine the namesapce_id parameter you'll need.

Say that GROUP is the name of the group or a string of the groups name and that TOKEN is a personal access token you created. So this will work much faster:

curl --request GET -d "search=GROUP" -s https://salsa.debian.org/api/v4/groups | jq '.[].id'

If the group is not public, you need to add your token:

curl [..] --header "PRIVATE-TOKEN: TOKEN" [..]

The command might provide several IDs, if the search term matches several groups. In this case, you might want to have a look at the raw output without piping it to jq or look at the result of ...

https://salsa.debian.org/api/v4/groups/?search=GROUP

... in a browser. Interestingly, the latter doesn't provide any output in the browser, if you are not part of the group. But it provides the necessary information using curl. Bug or feature?

Another way that works is, to look at the output of...

https://salsa.debian.org/api/v4/namespaces

... when you are logged in or ...

curl --request GET --header "PRIVATE-TOKEN: TOKEN" https://salsa.debian.org/api/v4/namespaces

This has the advantage of also getting the namespace_id for your personal repository, say for e.g. importing projects hosted on https://people.debian.org/~USER/ or https://anonscm.debian.org/cgit/users/USER/.

Wednesday, January 31, 2018

Migrating the debichem group subversion repository to Git - Part 1: svn-all-fast-export basics

With the deprecation of alioth.debian.org the subversion service hosted there will be shut down too. According to lintian the estimated date is May 1st 2018 and there are currently more then 1500 source packages affected. In the debichem group we've used the subversion service since 2006. Our repository contains around 7500 commits done by around 20 different alioth user accounts and the packaging history of around 70 to 80 packages, including packaging attempts. I've spent the last days to prepare the Git migration, comparing different tools, controlling the created repositories and testing possibilities to automate the process as much as possible. The resulting scripts can currently be found here.

Of course I began as described at the Debian Wiki. But following this guide, using git-svn and converting the tags with the script supplied under rubric Convert remote tags and branches to local one gave me really weird results. The tags were pointing to the wrong commit-IDs. I thought, that git-svn was to blame and reported this as bug #887881. In the following mail exchange Andreas Kaesorg explained to me, that the issue is caused by so-called mixed-revision-tags in our repository as shown in the following example:

$ svn log -v -r7405
------------------------------------------------------------------------
r7405 | dleidert | 2018-01-17 18:14:57 +0100 (Mi, 17. Jan 2018) | 1 Zeile
Geänderte Pfade:
   A /tags/shelxle/1.0.888-1 (von /unstable/shelxle:7396)
   R /tags/shelxle/1.0.888-1/debian/changelog (von /unstable/shelxle/debian/changelog:7404)
   R /tags/shelxle/1.0.888-1/debian/control (von /unstable/shelxle/debian/control:7403)
   D /tags/shelxle/1.0.888-1/debian/patches/qt5.patch
   R /tags/shelxle/1.0.888-1/debian/patches/series (von /unstable/shelxle/debian/patches/series:7402)
   R /tags/shelxle/1.0.888-1/debian/rules (von /unstable/shelxle/debian/rules:7403)

[svn-buildpackage] Tagging shelxle 1.0.888-1
------------------------------------------------------------------------

Looking into the git log, the tags deteremined by git-svn are really not in their right place in the history line, even before running the script to convert the branches into real Git tags. So IMHO git-svn is not able to cope with this kind of situation. Because it also cannot handle our branch model, where we use /branch/package/, I began to look for different tools and found svn-all-fast-export, a tool created (by KDE?) to convert even large subversion repositories based on a ruleset. My attempt using this tool was so successful (not to speak of, how fast it is), that I want to describe it more. Maybe it will prove to be useful for others as well and it won't hurt to give some more information about this poorly documented tool :)

Step 1: Setting up a local subversion mirror

First I suggest setting up a local copy of the subversion repository to migrate, that is kept in sync with the remote repository. This can be achieved using the svnsync command. There are several howtos for this, so I won't describe this step here. Please check out this guide. In my case I have such a copy in /srv/svn/debichem.

Step 2: Creating the identity map

svn-all-fast-export needs at least two files to work. One is the so called identity map. This file contains the mapping between subversion user IDs (login names) and the (Git) committer info, like real name and mail address. The format is the same as used by git-svn:

loginname = author name <mail address>

e.g.

dleidert = Daniel Leidert <dleidert@debian.org>

The list of subversion user IDs can be obtained the same way as described in the Wiki:

svn log SVN_URL | awk -F'|' '/^r[0-9]+/ { print $2 }' | sort -u

Just replace the placeholder SVN_URL with your subversion URL. Here is the complete file for the debichem group.

Step 3: Creating the rules

The most important thing is the second file, which contains the processing rules. There is really not much documentation out there. So when in doubt, one has to read the source file src/ruleparser.cpp. I'll describe, what I already found out. If you are impatient, here is my result so far.

The basic rules are:

create repository REPOSITORY
...
end repository

and

match PATTERN
...
end match

The first rule creates a bare git repository with the name you've chosen (above represented by REPOSITORY). It can have one child, that is the repository description to be put into the repositories description file. There are AFAIK no other elements allowed here. So in case of e.g. ShelXle the rule might look like this:

create repository shelxle
description packaging of ShelXle, a graphical user interface for SHELXL
end repository

You'll have to create every repository, before you can put something into it. Else svn-all-fast-export will exit with an error. JFTR: It won't complain, if you create a repository, but don't put anything into it. You will just end up with an empty Git repository.

Now the second type of rule is the most important one. Based on regular expression match patterns (above represented by PATTERN), one can define actions, including the possibility to limit these actions to repositories, branches and revisions. The patterns are applied in their order of appearance. Thus if a matching pattern is found, other patterns matching but appearing later in the rules file, won't apply! So a special rule should always be put above a general rule. The patterns, that can be used, seem to be of type QRegExp and seem like basic Perl regular expressions including e.g. capturing, backreferences and lookahead capabilities. For a multi-package subversion repository with standard layout (that is /PACKAGE/{trunk,tags,branches}/), clean naming and subversion history, the rules could be:

match /([^/]+)/trunk/
  repository \1
  branch master
end match

match /([^/]+)/tags/([^/]+)/
  repository \1
  branch refs/tags/debian/\2
  annotated true
end match

match /([^/]+)/branches/([^/]+)/
  repository \1
  branch \2
end match

The first rule captures the (source) package name from the path and puts it into the backreference \1. It applies to the trunk directory history and will put everything it finds there into the repository named after the directory - here we simply use the backreference \1 to that name - and there into the master branch. Note, that svn-all-fast-export will error out, if it tries to access a repository, which has not been created. So make sure, all repositories are created as shown with the create repository rule. The second rule captures the (source) package name from the path too and puts it into the backreference \1. But in backreference \2 it further captures (and applies to) all the tag directories under the /tags/ directory. Usually these have a Debian package version as name. With the branch statement as shown in this rule, the tags, which are really just branches in subversion, are automatically converted to annotated Git tags (another advantage of svn-all-fast-export over git-svn). Without enabling the annotated statement, the tags created will be lightweight tags. So the tag name (here: debian/VERSION) is determined via backreference \2. The third rule is almost the same, except that everything found in the matching path will be pushed into a Git branch named after the top-level directory captured from the subversion path.

Now in an ideal world, this might be enough and the actual conversion can be done. The command should only be executed in an empty directory. I'll assume, that the identity map is called authors and the rules file is called rules and that both are in the parent directory. I'll also assume, that the local subversion mirror of the packaging repository is at /srv/svn/mymirror. So ...

svn-all-fast-export --stats --identity-map=../authors.txt --rules=../debichem.rules --stats /srv/svn/mymirror

... will create one or more bare Git repositories (depending on your rules file) in the current directory. After the command succeeded, you can test the results ...

git -C REPOSITORY/ --bare show-ref
git -C REPOSITORY/ --bare log --all --graph

... and you will find your repositories description (if you added one to the rules file) in REPOSITORY/description:

cat REPOSITORY/description

Please note, that not all the debian version strings are well formed Git reference names and therefor need fixing. There might also be gaps shown in the Git history log. Or maybe the command didn't even suceed or complained (without you noticing it) or you ended up with an empty repository, although the matching rules applied. I encountered all of these issues and I'll describe the cause and fixes in the next blog article.

But if everything went well (you have no history gaps, the tags are in their right place within the linearized history and the repository looks fine) and you can and want to proceed, you might want to skip to the next step.

In the debichem group we used a different layout. The packaging directories were under /{unstable,experimental,wheezy,lenny,non-free}/PACKAGE/. This translates to /unstable/PACKAGE/ and /non-free/PACKAGE/ being the trunk directories and the others being the branches. The tags are in /tags/PACKAGE/. And packages, that are yet to upload are located in /wnpp/PACKAGE/. With this layout, the basic rules are:

# trunk handling
# e.g. /unstable/espresso/
# e.g. /non-free/molden/
match /(?:unstable|non-free)/([^/]+)/
  repository \1
  branch master
end match

# handling wnpp
# e.g. /wnpp/osra/
match /(wnpp)/([^/]+)/
  repository \2
  branch \1
end match

# branch handling
# e.g. /wheezy/espresso/
match /(lenny|wheezy|experimental)/([^/]+)/
  repository \2
  branch \1
end match

# tags handling
# e.g. /tags/espresso/VERSION/
match /tags/([^/]+)/([^/]+)/
  repository \1
  annotated true
  branch refs/tags/debian/\2
  substitute branch s/~/_/
  substitute branch s/:/_/
end match

In the first rule, there is a non-capturing expression (?: ... ), which simply means, that the rule applies to /unstable/ and /non-free/. Thus the backreference \1 refers to second part of the path, the package directory name. The contents found are pushed to the master branch. In the second rule, the contents from the wnpp directory are not pushed to master, but instead to a branch called wnpp. This was necessary because of overlaps between /unstable/ and /wnpp/ history and already shows, that the repositories history makes things complicated. In the third rule, the first backreference \1 determines the branch (note the capturing expression in contrast to the first rule) and the second backreference \2 the package repository to act on. The last rule is similar, but now \1 determines the package repository and \2 the tag name (debian package version) based on the matching path. The example also shows another issue, which I'd like to explain more in the next article: some characters we use in debian package versions, e.g. the tilde sign and the colon, are not allowed within Git tag names and must therefor be substituted, which is done by the substitute branch EXPRESSION instructions.

Step 4: Cleaning the bare repository

The tool documentation suggests to run ...

git -C REPOSITORY/ repack -a -d -f

... before you upload this bare repository to another location. But Stuart Prescott told me on the debichem list, that this might not be enough and still leave some garbage behind. I'm not experienved enough to judge here, but his suggestion is, to clone the repository, either a bare clone or clone and init a new bare. I used the first approach:

git -C REPOSITORY/ --bare clone --bare REPOSITORY.git
git -C REPOSITORY.git/ repack -a -d -f

Please note, that this won't copy the repositories description file. You'll have to copy it manually, if you wanna keep it. The resulting bare repository can be uploaded (e.g. to git.debian.org as personal repository:

cp REPOSITORY/description REPOSITORY.git/description 
touch REPOSITORY.git/git-daemon-export-ok
rsync -avz REPOSITORY.git git.debian.org:~/public_git/

Or you clone the repository, add a remote origin and push everything there. It is even possible to use the gitlab API at salsa.debian.org to create a project and push there. I'll save the latter for another post. If you are hasty, you'll find a script here.

Sunday, January 14, 2018

Make 'bts' (devscripts) accept TLS connection to mail server with self signed certificate

My mail server runs with a self signed certificate. So bts, configured like this ...

BTS_SMTP_HOST=mail.wgdd.de:587
BTS_SMTP_AUTH_USERNAME='user'
BTS_SMTP_AUTH_PASSWORD='pass'

...lately refused to send mails with this error:

bts: failed to open SMTP connection to mail.wgdd.de:587
(SSL connect attempt failed error:1416F086:SSL routines:tls_process_server_certificate:certificate verify failed)

After searching a bit, I found a way to fix this locally without turning off the server certificate verification. The fix belongs into the send_mail() function. When calling the Net::SMTPS->new() constructor, it is possible to add the fingerprint of my self signed certificate like this (bold):

if (have_smtps) {
    $smtp = Net::SMTPS->new($host, Port => $port,
        Hello => $smtphelo, doSSL => 'starttls',
        SSL_fingerprint => 'sha1$hex-fingerprint')
        or die "$progname: failed to open SMTP connection to $smtphost\n($@)\n";
} else {
    $smtp = Net::SMTP->new($host, Port => $port, Hello => $smtphelo)
        or die "$progname: failed to open SMTP connection to $smtphost\n($@)\n";
}

Pretty happy to being able to use the bts command again.

Tuesday, December 19, 2017

Silikonreste/Silikonklebereste im Aquarium entfernen

Dies ist ein Tip, um Silikonreste von ehemals verklebten Innenfiltern und Strukturwänden sauber und rückstandslos zu entfernen. Die fragliche Stelle muss trocken sein, also mindestens über der Wasseroberfläche liegen.

Zunächst nehme ich einen Ceranfeld- oder Glasschaber. Im Prinzip ist dies nicht anderes als ein Gerät, mit einer scharfen Rasierklinge im Kopf. Mit dem Schaber wird zunächst das Silikon soweit wie möglich vorsichtig abgetragen. Bei korrekter Anwendung ist das für das Glas selbst auch ungefährlich. In der Regel verbleibt danach nur noch eine sehr dünne Schicht Silikon auf dem Glas. Um diese nun ebenfalls zu entfernen, trage ich vorsichtig mit einem Pinsel Silikonentferner (fertiges Lösemittelgemisch aus dem Baumarkt) auf die fragliche Stelle auf und lasse es einwirken. Hierbei sollte man grundsätzlich sehr vorsichtig sein, da ja alle Verklebungen am Aquarium aus Silikon sind. Nach der vorgeschriebenen Einwirkzeit kann nun auch die dünne Silikonschicht mit dem Schaber recht einfach entfernt werden. Evtl. ist an wenigen Stellen die Behandlung zu wiederholen. Die Stelle kann und sollte im Anschluss mit Aceton o. ä. vorsichtig gereinigt werden, um die Resten des Silikonentferners ebenfalls zu entfernen. Wer möchte, wischt feucht nach. Das Glas ist danach rückstandsfrei sauber.

Das Ganze funktioniert im Übrigen auch auf dem Innenfilter selbst. Allerdings sind hier bei der mechanischen Bearbeitung mit dem Schaber Kratzer möglich!

Monday, December 18, 2017

Lesson learned today

If you connect your Canon EOS digital camera via USB to your computer and nothing happens, this might bue de to the WIFI/WLAN function being enabled on your camera. I forgot, that enabling WIFI turns off USB and HDMI.

Friday, December 8, 2017

Sub-menus with Bloggers Simple Template (Part 1)

In this post I'm going to explain, how I added a sub-menu to my blogs page list. It is a common question, how to do this. And there are some solutions out there. But I decided to do a few things differently this might be interesting for others too.

Lets first take a look at the existing widget code. For some reason, the Pagelist widget only allows a list with one level of entries. It has already been asked, if there is a way to adjust the widget code, which looks like this:

        <b:widget id='PageList1' locked='false' title='Pages' type='PageList'>
          <b:widget-settings>
            <b:widget-setting name='pageListJson'><![CDATA[{'home': {'href': 'http://www.wgdd.de/', 'title': 'Home', 'position': 0}, '4785025671937868325': {'href': 'http://www.wgdd.de/p/aquarien.html', 'title': 'Aquarien', 'position': 1}, '3693528163117485839': {'href': 'http://www.wgdd.de/p/heart-of-gold.html', 'title': 'Hardware (Debian)', 'position': 2}}]]></b:widget-setting>
            <b:widget-setting name='homeTitle'>Home</b:widget-setting>
          </b:widget-settings>
          <b:includable id='main'>
  <b:if cond='data:title != ""'><h2><data:title/></h2></b:if>
  <div class='widget-content'>
    <b:if cond='data:mobile'>
      <select expr:id='data:widget.instanceId + "_select"'>
        <b:loop values='data:links' var='link'>
          <option expr:value='data:link.href'>
            <b:attr cond='data:link.isCurrentPage' name='selected' value='selected'/>
            <data:link.title/>
          </option>
        </b:loop>
      </select>
      <span class='pagelist-arrow'>&#9660;</span>
    <b:else/>
      <ul>
        <b:loop values='data:links' var='link'>
          <li>
            <b:class cond='data:link.isCurrentPage' name='selected'/>
            <a expr:href='data:link.href'><data:link.title/></a>
          </li>
        </b:loop>
      </ul>
    </b:if>

I'll try to explain the code (to my understanding). The variable pageListJson contains the page list as a structure of instanceIDs linked to hashes with key-value-pairs for each page. The value to the key href contains the URL of the page and title the chosen title. The variable is filled by whatever changes you make to the Pagelist widget. The data in this structure is later accessed by values named data:*. There is another variable called homeTitle, which is how you titled your homepage (e.g. Home or Startseite or similar - you configured this in the Pagelist widget). After this, there is the main widget code that creates the resulting HTML web code. If you gave your widget a title, it will be output as <h2> header. And depending, if the code is created for a mobile target or not, the list items are put in a form (mobile device):

<div class='widget PageList' data-version='1' id='PageList1'>
<h2>Pages</h2>
<div class='widget-content'>
<select id='PageList1_select'>
<option selected='selected' value='http://www.wgdd.de/?m=1'>Home</option>
<option value='http://www.wgdd.de/p/aquarien.html?m=1'>Aquarien</option>
<option value='http://www.wgdd.de/p/heart-of-gold.html?m=1'>Hardware (Debian)</option>
</select>

or a list (website):

<div class='widget PageList' data-version='1' id='PageList1'>
<h2>Pages</h2>
<div class='widget-content'>
<ul>
<li class='selected'>
<a href='http://www.wgdd.de/'>Home</a>
</li>
<li>
<a href='http://www.wgdd.de/p/aquarien.html'>Aquarien</a>
</li>
<li>
<a href='http://www.wgdd.de/p/heart-of-gold.html'>Hardware (Debian)</a>
</li>
</ul>

To answer the original question, if the widget code can be adjusted: no solution has been offered yet and I also cannot think of any way to adjust this code to get a submenu properly. There is also the fact, that pageListJson gets its data from the Pagelist widget and the widget won't support any multi-level data structure. The problem could probably easily be fixed by the Google developers I guess, which would also have the advantage of properly supporting this structure in the mobile output (we'll get to that later), but for some reason, the feature has never been added to blogger. So I'm going to make the same approach everybody else does, using an HTML widget and lists. However, my goal was to use the existing CSS code for the Pagelist widget including the usage of the already existing variables for tab colors and stuff. So lets take a look at the existing code first. This is what is already there in the <b:skin>...</b:skin> element holding the CSS and template style stuff (I've shortened the outout to the relevant parts):

    <b:skin><![CDATA[/*
-----------------------------------------------
Blogger Template Style
Name:     Simple
Designer: Blogger
URL:      www.blogger.com
----------------------------------------------- */

/* Variable definitions
   ====================
[..]

   <Group description="Tabs Text" selector=".tabs-inner .widget li a">
     <Variable name="tabs.font" description="Font" type="font"
         default="normal normal 14px Arial, Tahoma, Helvetica, FreeSans, sans-serif" value="normal normal 14px Arial, Tahoma, Helvetica, FreeSans, sans-serif"/>
     <Variable name="tabs.text.color" description="Text Color" type="color" default="#999999" value="#999999"/>
     <Variable name="tabs.selected.text.color" description="Selected Color" type="color" default="#000000" value="#000000"/>
   </Group>

   <Group description="Tabs Background" selector=".tabs-outer .PageList">
     <Variable name="tabs.background.color" description="Background Color" type="color" default="#f5f5f5" value="#f5f5f5"/>
     <Variable name="tabs.selected.background.color" description="Selected Color" type="color" default="#eeeeee" value="#eeeeee"/>
   </Group>

[..]

   <Group description="Accents" selector=".content-inner">
     <Variable name="tabs.border.color" description="Tabs Border Color" type="color" default="$(body.rule.color)" value="#eeeeee"/>
   </Group>

[..]

   <Variable name="tabs.margin.top" description="Tabs Margin Top" type="length" default="0" min="0" max="100px" value="0"/>
   <Variable name="tabs.margin.side" description="Tabs Side Margin" type="length" default="30px" min="0" max="100px" value="30px"/>
   <Variable name="tabs.background.gradient" description="Tabs Background Gradient" type="url"
       default="url(https://resources.blogblog.com/blogblog/data/1kt/simple/gradients_light.png)" value="url(https://resources.blogblog.com/blogblog/data/1kt/simple/gradients_light.png)"/>
   <Variable name="tabs.border.width" description="Tabs Border Width" type="length" default="1px" min="0" max="10px" value="1px"/>
   <Variable name="tabs.bevel.border.width" description="Tabs Bevel Border Width" type="length" default="1px" min="0" max="10px" value="1px"/>

[..]

/* Tabs
----------------------------------------------- */
.tabs-inner .section:first-child {
  border-top: $(header.bottom.border.size) solid $(tabs.border.color);
}

.tabs-inner .section:first-child ul {
  margin-top: -$(header.border.size);
  border-top: $(header.border.size) solid $(tabs.border.color);
  border-left: $(header.border.horizontalsize) solid $(tabs.border.color);
  border-right: $(header.border.horizontalsize) solid $(tabs.border.color);
}

.tabs-inner .widget ul {
  background: $(tabs.background.color) $(tabs.background.gradient) repeat-x scroll 0 -800px;
  _background-image: none;
  border-bottom: $(tabs.border.width) solid $(tabs.border.color);

  margin-top: $(tabs.margin.top);
  margin-left: -$(tabs.margin.side);
  margin-right: -$(tabs.margin.side);
}

.tabs-inner .widget li a {
  display: inline-block;

  padding: .6em 1em;

  font: $(tabs.font);
  color: $(tabs.text.color);

  border-$startSide: $(tabs.border.width) solid $(content.background.color);
  border-$endSide: $(tabs.bevel.border.width) solid $(tabs.border.color);
}

.tabs-inner .widget li:first-child a {
  border-$startSide: none;
}

.tabs-inner .widget li.selected a, .tabs-inner .widget li a:hover {
  color: $(tabs.selected.text.color);
  background-color: $(tabs.selected.background.color);
  text-decoration: none;
}

[..]

]]></b:skin>

So there are some already defined variables in the simple blogger template, e.g. tabs.background.color to define the tab background color or tabs.text.color for the tab text color. As you can see, the widget uses the variable values then in the template CSS. And in the resulting website the variables will be replaced by their values.

Ok, so that's where we are. I don't want to re-invent the wheel, so I'm going to make use of these existing variables and code. But I'll have to adjust it to support nested lists. More in another post. Stay tuned...

Tuesday, October 31, 2017

Troubleshoot

I have no idea, what these errors mean. $searchengine and manual pages didn't reveal anything.

That's the first one. It occurs during boot time. Might be a bug somewhere, recently introduced in Debian Sid.

kernel: [ ... ] cgroup: cgroup2: unknown option "nsdelegate"

And that's the second one. It simply occurred. No real issue with NFS though.

kernel: [ ... ] nfs: RPC call returned error 22
kernel: [ ... ] NFS: state manager: check lease failed on NFSv4 server XXX.XXX.XXX.XXX with error 5

Any explanation is appreciated.

Tuesday, September 26, 2017

Waldfunde - Buchen-Streckfuß

Raupe des Buchen-Streckfuß Raupe des Buchen-Streckfuß
Buchen-Streckfuß / Buchenrotfuß / Rotfuß / Calliteara pudibunda
Dresdner Heide, Dresden, Deutschland
September 2017

Sunday, September 10, 2017

Waldfunde

HexeneiZwei Hexeneier mit sichtbarer GlibaStinkmorchel (Phallus impudicus)
Hexeneier der Stinkmorchel / Phallus impudicus
Dresdner Heide, Dresden, Deutschland

Friday, September 8, 2017

Waldfunde

Waldfunde

Danke an Walter Schön für die Hilfe bei der Bestimmung.

Friday, August 14, 2015

Gammaeule und Hausmutter

Schon seit Monaten treiben grüne Raupen ihr "Unwesen" in meinen Kräutern und dem Salat. Aufgrund ihrer (eher unauffälligen) Zeichnung und des charakteristischen "Katzenbuckels" bei der Fortbewegung vermutete ich, dass es sich um die Larven der Gammaeule handeln könnte. Kurzentschlossen habe ich mir eine Fauna-Box (auch Faunarium) besorgt:

Fauna-Box in der ÜbersichtFraßbereich in der Fauna-BoxPuppen in der Fauna-Box

Auf der einen Seite befindet sich der Fraßbereich. Als Unterlage dient Küchenpapier, das befeuchtet wird. Das Futter ist Löwenzahn - auch Salat ist möglich; die Gammeeule hat viele Futterpflanzen - und wird frisch und trocken in einer kleinen Glasflasche mit Wasser bereitgestellt. Das Futter muss täglich gewechselt werden. Auch die Unterlage wird täglich getauscht und der Kot entfernt. Deswegen auch die Trennung der Faunabox in zwei Bereiche! Die andere Seite der Box kann zunächst mit zerknülltem (Küchen-)Papier belegt werden. Die Raupen der Gammaeule suchen sich zur Verpuppung einen geschützten Bereich (Papier, manchmal auch Blatt der Futterpflanze) und spinnen sich ein. Man kann die Puppen nach einer Weile vorsichtig vom Untergrund trennen, wenn man möchte oder der Standort ungünstig ist. Ich konnte keine Schäden dadurch beobachten.

Nach dem Schlupf ist eine Kletterhilfe scheinbar nicht notwendig. Die Zeit, bis der Falter schlüpft, beträgt nur einige Tage (evtl. 1-2 Wochen?). Dann kan man ihn bewundern :) Es handelt sich tatsächlich um die Gammaeule (im ersten Bild oben befindet sich eine Raupe):

Gammaeule - Schmetterling und Raupe auf LöwenzahnGammaeule auf Löwenzahn

Die Fraßschäden, die die Raupen der Gammaeule bei mir hinterlassen haben, betrafen vor allem den Salat (Lollo Bionda+Rosso), das Thai-Basilikum, teilweise Genoveser- und rotes Baslikum, Kohlrabi, Borretsch sowie die Buschbohnen. Ich kann es verkraften :) und verzichte daher auch weiterhin auf ihre chemische Bekämpfung (Ablesen hilft zur Not auch).

An einem Löwenzahn fand ich eine weitere Raupe. Ich vermute eine Hausmutter, die letztes Jahr in großer Zahl an meinen Paprikas zu finden war. Leider scheint diese einen anderen Ort für die Verpuppung zu benötigen und sich in der Fauna-Box nicht sehr wohl zu fühlen. Sie frisst nicht mehr, sucht aber auch nicht das Küchenpapier oder das Futter auf. Eine Verpuppung findet (noch) nicht statt. Sie ist träge und wirkt eher trocken als "fett". Den fertigen Falter konnte ich dieses Jahr auch schon bewundern:

Hausmutter auf Apfelbaum (Dresden, 11.06.2015)Hausmutter auf Apfelbaum (Dresden, 11.06.2015)

Thursday, May 28, 2015

Der erste Pilzspaziergang

Trotz (oder gerade wegen der) Erkältung habe ich einen kurzen Spaziergang in die Heide unternommen und dabei auch mal nach Pilzen geschaut. Das Ergebnis fiel, wie zu erwarten, sehr mau aus. Man merkt auch in der Heide die Trockenheit. Ein schöner Lichtblick war der unten abgebildete Porling auf Buchentotholz, bei dem es sich um P. tuberaster, den Sklerotien-Stielporling handeln dürfte. Außerdem waren einige alte Glimmer-Tintlinge und (vermutlich) Stockschwämmchen zu sehen.

Sklerotien-Stielporling am 27.05.2015 in der Dresdener HeideSklerotien-Stielporling am 27.05.2015 in der Dresdener Heide (Draufsicht)

Stellenweise war der Waldboden mit bereits blühenden Walderdbeeren bedeckt (auf meiner Terrasse trägt sie schon seit geraumer Zeit Früchte). Am Wegesrand fanden sich zudem eine Skorpionsfliege und zwei schwarze Schnegel.

Walderdbeeren am 27.05.2015 in der Dresdener HeideSkorpionsfliege am 27.05.2015 in der Dresdener HeideSchwarzer Schnegel am 27.05.2015 in der Dresdener Heide

Ich hoffe, die Pilzsituation bessert sich im Juni und bringt wieder viele Pfifferlinge hervor :)

Friday, April 17, 2015

Wildbienen (2)

Mauerbienen sind fleißig :) Hier die Bilder im Vergleich zum letzten Post (5 Tage).

Wildbienen-Nisthilfe von Dobar wenige Tage zuvorWildbienen-Nisthilfe von Dobar heute
Wildbienen-Nisthilfe aus gebohrtem Pappelholz wenige Tage zuvorWildbienen-Nisthilfe aus gebohrtem Pappelholz heute
Wildbienen-Nisthilfe von Florabest (Lidl) wenige Tage zuvorWildbienen-Nisthilfe von Florabest (Lidl) heute

Sunday, April 12, 2015

Nisthilfen und Unterpflanzung für Wildbienen

Erdbeere, Chili, Paprika, Zucchini, Wassermelone, Kirsche oder Apfel müssen bestäubt werden. Neben den Schwebfliegen (Chili und Paprika!) übernehmen das Bienen und Hummeln. Seit wenigen Tagen sind Mauerbienen hier fleißig am Nistbau. Daher möchte ich die Nisthilfen kurz vorstellen.

Nisthilfe von Dobar

Wildbienenhotel (Dobar)

Ich habe zum Ende des letzten Frühjahrs ein Insektenhotel von Dobar mit Schilf und gebohrten Birkenästen als Nisthilfe aufgehängt. Interessanterweise wurden die Birkenäste zwar besucht, aber ich konnte keinen vollständig belegten Eingang finden. Stattdessen wurden schon nach kurzer Zeit die ersten Schilfröhrchen in Beschlag genommen. Wegen des ausgefransten Schnittes braucht man sich nicht unbedingt Gedanken machen - auch wenn das häufig als Qualitätsdefizit wahrgenommen wird - die Bienen schneiden sich den Eingang frei und räumen das Röhrchen aus, wenn sie Interesse haben. Auf dem Bild rechts ist übrigens eine Mauerbiene zu sehen, die gerade einen Eingang verschließt. Die Birkenhölzer werden derzeit durch die Mauerbienen ebenfalls recht gut angenommen, sind aber noch nicht vollständig belegt und verschlossen.

Unter dem Häuschen habe ich eine Blechdose mit selbst geschnittenem Schilf (in Fixzement eingegossen) angebracht. Ich habe die Schilfröhrchen unterschiedlich lang gelassen. Das führt leider dazu, dass neugierige Vögel sich schnell mal dranhängen und die Eingänge beschädigen. Mal schauen, wie das Produkt angenommen wird.

Nisthilfe aus gebohrtem Pappelholz

Stirnholz mit Bohrung

Das Holz war ein Zufallsfund. Eine Zitterpappel war frisch gefällt wurden und der Eigentümer erlaubte mir, ein ca. 40 cm langes und 20 cm breites Stück mitzunehmen. Ich habe dann etwa 15 cm davon abgeschnitten und mit Bohrern von 4..10 mm Durchmesser Löcher in das Stirnholz gebohrt. Da das recht spät im letzten Jahr geschah, konnte ich mit einer Ausnahme kaum Aktivitäten an dem Holz beobachten. Die Ausnahme war eine Solitärwespe, die innerhalb eines Tages gleich 4 Gänge für sich in Anspruch nahm. Einer davon (leicht schräg unten links im Bild) zeigt ein kleines Loch im Verputz. Hier hatte letztes Jahr eine Schlupfwespe das Gelege parasitiert. In den letzten Tagen hinzugekommen sind Gelege von Mauerbienen. Zwei Eingänge sind sogar schon vollständig belegt! Die Mauerbienen nehmen bevorzugt die Röhren mit 8..10 mm Durchmesser, quetschen sich mittlerweile aber auch in die nur 5..6 mm großen, da die erstgenannten schon belegt sind :)

Man kann auf dem Bild auch den Nachteil von Bohrungen im Stirnholz erkennen: durch die unterschiedliche Trocknung im Inneren und Äußeren des Holzblockes entstehen Risse. Durch diese können Parasiten eindringen. Ich werde den Block also irgendwann wechseln müssen. Als günstiger Ersatz schwebt mir entweder ein Nistholz (ca. 10  EUR) oder ein zersägter Ivar-(Eck-)Pfosten (<10 EUR) vor.

Nisthilfe von Florabest (Lidl)

Nisthilfe von Florabest (Lidl)

Lidl bietet dieses Jahr Nisthilfen für Insekten an. Der Preis liegt bei <10 EUR. Da habe ich zugeschlagen. Das Gehäuse selbst besteht aus eher dünnen, genagelten(?) Brettern und das Metallgeflecht ist geklammert. An der Rückseite besitzt das Haus schon einen Riss. An Materialien wurden Strohwolle, Zapfen, gebohrte Äste sowie Bambusröhren eingesetzt. Ob Schmetterlinge, Marienkäfer und Florfliegen das Angebot annehmen, sei mal dahingestellt. Aber die Röhren vom Bambus und im Astholz sind im Durchmesser ausreichend, auch wenn manchmal ein Ausbohren nicht schaden könnte (notfalls hilft die Rundfeile). Die Mauerbienen haben sie sofort gut angenommen. Ob das auch bei den späteren Bienenarten so sein wird und ob die Brut überlebt, muss sich zeigen. Ich bin nicht unzufrieden, gerade bei dem Preis.

Unterpflanzung

Wildbienen benötigen auch Nahrung. Um sie anzuziehen und ihnen gleichzeitig einen interessanten ansprechenden Mix anzubieten (alles in der Hoffnung, dass sie nebenbei auch meine Nutzpflanzen besuchen), bieten sich Bienenweiden an, also Pflanzen, die den Insekten Nektar und Pollen spenden; gerade in der Stadt, wo die schmückende oft wichtiger als die ökologische Funktion einer Pflanze ist. Besonders zeitig im Jahr, wenn nur wenige Arten blühen, sind Weidearten (Salix) als erste Nahrungsquelle vorhanden. Die wunderschön blühenden Sal-Weiden (Salix caprea) sind oft der erste Treffpunkt für Bienen und Hummeln in der freien Natur, jedoch nur selten in der Stadt (Brachflächen, Vorwaldgesellschaft!). Aufmerksame Menschen haben vielleicht auch den zeitig blühenden Löwenzahn bemerkt, der u.a. unter Obstbäumen nicht fehlen sollte! Was für manche Unkraut ist, nutze ich bei meinen Obstbäumen im Kübel als Unterpflanzung, gemeinsam mit Wildkräuter- und Wildblumenmischungen. Außerdem nutze ich leere Pflanzgefäße für Gründüngerarten (Senf, Lein, Ölrettich, Phacelia etc.), die gerne besucht werden. Als echte Bienenweide entpuppt haben sich außerdem Borretsch (Gurkenkraut), der sehr schön und lange blüht, lecker in Quark und Salaten schmeckt und sich als Unterpflanzung bei Erdbeeren eignet, sowie Kapuzinerkresse, die als Unterpflanzung bei Obstbäumen Blattläuse von den Bäumen ablenkt und Hummeln anlockt. Letztere bietet i.d.R. auch Schwebfliegen Lebensraum, deren Larven Blattläuse fressen und die Hauptbestäuber an Chili und Paprika sind!

Apropos ...

Am Projekttheater in der Neustadt gibt es in der Hauswand auf Augenhöhe alte Bohrlöcher; teilweise ist der Dübel schon rausgefallen. Darin nisten derzeit Mauerbienen! Vor kurzem sah ich auch Werbung für einen einen Eltern-Kind-Nachmittag in der Neustadt/Radeberger Vorstadt zum Bau von Insektenhotels, was ich für eine schöne Idee halte. Vielleicht konnte ich ja Interesse an einem eigenen Bienenhotel wecken :)

Ausgewählte Links

Sunday, March 29, 2015

Prevent suspend/hibernate if system is remotely backed up via rdiff-backup

I usually use rdiff-backup to backup several of my systems. One is a workstation which goes to sleep after some time of idling around. Now having a user logged in running rdiff-backup (or rsync, rsnapshot etc for that matter) won't prevent the system from being put to sleep. Naturally this happens before the backup is complete. So some time ago I was looking for a resolution and recieved a suggestion to use a script in /etc/pm/sleep.d/. I had to modify the script a bit, because the query result always was true. So this is my solution in /etc/pm/sleep.d/01_prevent_sleep_on_backup now:

#!/bin/sh

. "${PM_FUNCTIONS}"

command_exists rdiff-backup || exit $NA

case "$1" in
        hibernate|suspend)
                if ps cax | grep -q rdiff-backup
                then
                        exit 1
                fi
        ;;
esac

exit 0

Currently testing ...

Update

The above works with pm-utils; but it fails with systemd. Seems I have to move and modify the script for my system.

Update 2

It doesn't work. In short: exit 1 doesn't prevent systemd from going to suspend. I can see, that the script itself leads to the results I want, so the logic is correct. But I cannot find a way to tell systemd, to stop suspend. Shouldn't it be doing this automtically in a case, where a remote user is logged in and runs a command?

Update 3

There is also a related bug report.

Monday, March 23, 2015

Start ...

Seit einiger Zeit lebe ich nun in der Dresdner Neustadt und kann eine schöne, großzügige Dachterrasse im 4. Obergeschoss eines Mehrfamilienhauses nutzen. Auf diesem Blog möchte ich ein wenig von meinen Erfahrungen beim Gärtnern auf dieser Stadt-Dachterrasse aber auch beim Pflanzen von Bäumen und Sträuchern (vor allem an Gewässern) erzählen.

Wer es bis hierher noch nicht erahnt: in meiner Wohnung und auf meiner Dachterrasse finden sich viele unterschiedliche Pflanzen: u.a. Carnivore, Blumen, "Grünpflanzen", Gemüse, Beerensträucher, Obststämme, Laub- und Nadelhölzer. Auch wenn die Terrasse groß ist, sind den Ambitionen durch die Statik, den Platz- und Wasserbedarf der Pflanzen natürliche Grenzen gesetzt. Wer möchte hier schon einen 6-Meter-Apfelbaum stehen haben? Ich sicher nicht :) Aber auch auf kleinem Raum kann man viel erreichen. Dabei versuche ich, die Grundsätze der Mischkultur anzuwenden, biete Nisthilfen und Bienenweiden an und verarbeite alle pflanzlichen Reste in einer Wurmkiste zu Kompost. Hört sich das spannend an?

Aufgrund meiner Arbeit und der Berufung als Lehrer der DWA-Gewässernachbarschaft "Obere Elbe" liegen mir außerdem unsere strukturell massiv verarmten Gewässer am Herzen. Vielen davon fehlt schon das Notwendigste - nämlich standortgerechte Bäume und Sträucher im Uferbereich und im Gewässerrandstreifen. Dabei kann jeder (das Einverständnis des Besitzers bzw. Bewirtschafters des Grundstückes vorausgesetzt) viel für die Gewässer tun, indem er die richtigen Pflanzen anpflanzt. Das ist in aller Regel nicht schwer und auch in kleinem Kreis schnell getan. Das Ergebnis kann eine abwechslungsreiche Aue mit unterschiedlichen, teils sehr schön blühenden oder samenden Gehölzen sein, die das Gewässer strukturell aufwerten und gleichzeitig die Ufer befestigen, dem Hochwasserschutz dienen und z.B. Vögeln, Schmetterlingen und (Wild-)Bienen Nahrung und Lebensraum bieten. Wer das nicht glaubt, kann sich einfach mal das Europäische Pfaffenhütchen (Spindelstrauch), die Zitterpappel (Espe), die Schwarzerle, die Gewöhnliche Traubenkirsche oder eine der vielen einheimischen Weidenarten anschauen.