Skip to main content

WSL Hello Sudo

This blog post might be outdated!
This blog post was published more than one year ago and might be outdated!
· One min read
Stephan Hochdörfer
Head of IT Business Operations

According to Microsoft Windows Hello is a "more personal, more secure way to get instant access to your Windows 10 devices using a PIN, facial recognition, or fingerprint". Wouldn't it be cool to use it to authenticate sudo via face recognition, fingerprint authentication, or a machine-local PIN? Luckily there's a PAM module that does exactly that and it is working perfectly for me so far.

Fixing the .html.html url problem in Magento

This blog post might be outdated!
This blog post was published more than one year ago and might be outdated!
· 2 min read
Stephan Hochdörfer
Head of IT Business Operations

A while ago we took over a Magento 1 shop that was migrated over to Magento 2. Some products and categories has a “.html.html” url postfix and the merchant wanted to have this fixed. When data was migrated from Magento 1 shop, the url keys came with ".html" suffix. On Magento 2, you have url_key and url_path attributes that help creating the urls for products and categories. Since the url_key attribute contained the “.html” postfix and url_path appended an additional “.html” postfix, the source of the problem was found.

MySQL ERROR 1062 - Duplicate entry for key PRIMARY

This blog post might be outdated!
This blog post was published more than one year ago and might be outdated!
· One min read
Stephan Hochdörfer
Head of IT Business Operations

Simply put, error 1062 is caused when MySQL finds a DUPLICATE of a row you are trying to insert. I sometimes hit this error when importing database dumps of applications that have been in production for a long time. The “fix” is easy: Find the duplicate data and delete it. Depending on your database structure it might not be that easy though. I that case, I configure MySQL to ignore those errors, for local development I find that approach acceptable. For dockerized setups, you can pass a “sql_mode” flag to the container which then will be interpreted by the MySQL server during startup. The docker-compose configuration that works for me looks like this:

WSL 2 date incorrect

This blog post might be outdated!
This blog post was published more than one year ago and might be outdated!
· One min read
Stephan Hochdörfer
Head of IT Business Operations

There is an issue with WSL 2 where the clock in a WSL 2 instance isn't updated when the host resumes from sleep/hibernate. This can lead to problems when you want to install Linux packages or when creating or modifying files in general.

How to Test Gitlab CI Pipelines locally

This blog post might be outdated!
This blog post was published more than one year ago and might be outdated!
· 2 min read
Stephan Hochdörfer
Head of IT Business Operations

Testing GitLab CI build pipelines can be a bit annoying. You must make your changes, commit and push them to kick off the CI pipeline. Then you have to wait a while for the result to show up and start over again if something went wrong. If your CI runners are busy, you keep waiting and waiting for the next free slot. Luckily, it is possible to run GitLab CI jobs completely locally. After installing the gitlab-runner package locally, you can execute a job like this:

How to find serialized values in your MySQL database

This blog post might be outdated!
This blog post was published more than one year ago and might be outdated!
· 2 min read
Stephan Hochdörfer
Head of IT Business Operations

As outlined in the last blog post, we needed to convert serialized data into JSON format to make Magento happy. Since Magento’s Magento\Framework\DB\AggregatedFieldDataConverter implementation needs to know which database fields to convert, we had to find them. The easiest way seems to be to go through the whole database and figure out which fields contain serialized data. Doing this by hand is no fun, so I wrote a little script that helped me with that task:

Magento 2.2 serialization issues

This blog post might be outdated!
This blog post was published more than one year ago and might be outdated!
· 2 min read
Stephan Hochdörfer
Head of IT Business Operations

After upgrading a Magento 2.1 instance to Magento 2.4, I realized some problems with serialized data. In Magento 2.1 PHPs serialize() and unserialize() functions have been used whilst in Magento 2.2 the default serialization uses json_encode() and json_decode().