• 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.

  • 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 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.

  • 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 wece 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

  • 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