Streak numbers in apps

I've used habit trackers or apps with streaks and one problem emerged for me between all of them. When a number is visible how many consecutive days I successfully completed a task it quickly became a bad relationship, because I forced myself to do it on days where the energy is low. It's especially bad if the app enforces you to keep the streak going. What is left is an unpleasant feeling connected to the task to only keep the streak going. That emotional baggage builds up to the point where I don't wanna do it at all anymore. The habit tracker was a tool to get me motivated and lower the barrier for me to do the task, in the end the opposite happened. It's okay to have days where the energy is low and I can't do a specific task, the next day will be better.

I still love tracking my habits and tasks and look at how much I finished in the past, which is a motivator for the future. What I found out though, consecutive days numbers are no motivator for me.

Create mobile swipe controles in Godot

For a prototype I wanted to implement mobile swipe controls to move my player on the horizontal axis.

The first thing to make sure is to check the setting under “Project Settings -> General -> Input Devices -> Pointing”. The settings “Emulate Mouse From Touch” needs to be active.

In your node which shall be controlled by the swipe control you need the following code:

extends CharacterBody2D

var swipe_start : Vector2
var processing_swipe : bool = false

func _unhandled_input(event: InputEvent) -> void:
    if event is InputEventScreenTouch:
        if event.is_pressed():
            if not processing_swipe:
                processing_swipe = true
                swipe_start = event.position
        else:
            processing_swipe = false
    elif event is InputEventScreenDrag:
        calculate_swipe(event.position)

func calculate_swipe(position_now : Vector2) -> void:
    var diff = swipe_start - position_now
    global_position.x -= diff.x
    swipe_start = position_now

I created this code with Godot 4.6.

Xemu Mega65 menu does not work

I compiled the Mega65 emulator from Xemu to play Roguecraft DX. The context menu did not show up, although I compiled the emulator with GTK3 support.

The configuration detected GTK3 successfully:

Checking for GTK3 (via pkg-config [--cflags-only-I|--libs] gtk+-3.0) … YES

In the GitHub repository issues I found the problem, it does not work with wayland. To get it to work the x11 backend for GDK needs to be used. Execute this before starting the emulator in the same terminal session:

export GDK_BACKEND=x11

GitLab not starting after upgrade to 17.8 on ArchLinux

GitLab introduced 3 new secrets for ActiveRecord encryption. If the secrets are not available in /etc/webapps/gitlab/secrets.yml the gitlab-puma.service is not able to start.

Due to the security settings in the gitlab-puma.service it can’t generate the secrets, because the process cannot write files.

The secrets need to be generated manually and inserted in the secrets.yml. This command creates eligible keys:

LC_ALL=C < /dev/urandom tr -dc 'a-zA-Z0-9' | head -c 32

These are the 3 secret keys:

active_record_encryption_primary_key
active_record_encryption_deterministic_key
active_record_encryption_key_derivation_salt

Afterwards restart GitLab:

systemctl restart gitlab.target

If a proxy server is in front of GitLab, it should be restarted as well.

Locale setting in zsh

I faced the problem that I was using a zsh with my normal user and changed into root, suddenly all escape sequences didn’t work anymore and tools like mc were unusable.

I found out my locale settings didn’t match, root used en_US.utf8, my normal user did not have anything set and used POSIX.

To set the LANG variable I put it in .zshenv, this way I did not need to edit my .zshrc, which I copy from grml.org.

Put this line into $HOME/.zshenv for it to work:

export LANG=en_US.utf8

systemd with proceeding processes

To be able to keep processes running which were started from a service unit after the service is stopped, you need to configure the following option in the .service file under the [Service] section:

KillMode=process

This keeps started processes from the service unit running after the service is stopped. This is not a recommended behavior, but my use cases involves a timer which calls a python script to run processes if needed, which needs to be running after the script has terminated. In the default behavior systemd kills all child process started from the service unit.

Here is the documentation: https://www.freedesktop.org/software/systemd/man/latest/systemd.kill.html