RSSAmplifier

Blog

Mats Lindh

Where desperate is just another word for a regular day.

e-mats.orgRSS feed ↗10 posts

Latest posts

Only applying WTForms validations if another field has a specific value

When you have a WTForms field that have a radio button that can change between different field types, you might want to only apply certain validators if the field has a specific value (for example to swap between types of users, types of cars, etc.). This is a custom validator that stops validation if a Continue reading Only applying WTForms validations if another field has a specific value

Checking out a private submodule in a GitHub Action pipeline with a limited deploy key

I prefer to have any authentication identifiers be as narrow as possible when they re defined in a pipeline or similar, and this proved to be a challenge when it comes to private git submodules inside a GitHub Action pipeline. A common way to solve this is by defining a personal access token (a PAT), but Continue reading Checking out a private submodule in a GitHub Action pipeline with a limited…

django: initial or submitted values in manual Form rendering

After defining a form with initial values, we want the values to be shown to the user but we don t want to use Django s built-in form rendering (.. for various reasons) when using django templates. So if no data has been submitted, we want to get the initial value defined for the form Continue reading django: initial or submitted values in manual Form rendering

Regenerate session ids in a flask server side session

To avoid an attack known as a session fixation attack , where the attacker is able to force your web application to use a specific session id, you re supposed to be the good guy and regenerate the session id when a user logs in or register (or if you really want to, on every request to Continue reading Regenerate session ids in a flask server side session

Imagemagick / MagickWand under alpine linux / python-alpine

The python implemention of MagickWand, aptly named Wand, requires ImageMagick and MagickWand installed. While building docker images using the python:alpine base images, these dependencies can be installed through: ENV MAGICK_HOME=/usr RUN apk add --no-cache imagemagick & \ apk add --no-cache imagemagick-dev The first one is required for Wand to find the installed MagickWand libraries, while…

cmd.exe – program has stopped working – but it works in Windows Explorer?

After digging through this issue for _at least_ four hours today, I ve revisited an issue that crept up 1,5 years ago. This time I found out that it actually happened to most 32-bit programs launched under cmd. Since the Android SDK s utilities are compiled in 32-bit mode by default, this time I had to actually Continue reading cmd.exe program has stopped working but it works in Windows Explorer?

bkool pro trainer fails firmware update

After trying to get my bkool pro smart trainer to update to the most recent version for almost two weeks, I finally solved the issue tonight. The official FAQ just states that you should stop anything related to bluetooth and that the ANT+ dongle should be right at the base of the trainer. I had Continue reading bkool pro trainer fails firmware update

Facebook Graph API: (#324) Missing or invalid image file

If you keep getting errors when trying to set a custom page tab icon when adding an app to a page make sure that the application is actually published. You can add it and the icon will change, but will still generate an error if the application isn t published yet. No idea Continue reading Facebook Graph API: (#324) Missing or invalid image file

Old Ubuntu-releases in APT / etc.

We have an old VM (Ubuntu 14.10) that we just have running it does a very specific job, isn t connected to anything important and just shugs along. But because of a dependency issue with external software, we needed to install a new library to it and because of dependencies when we first set Continue reading Old Ubuntu-releases in APT / etc.

“python.exe has stopped working” suddenly appeared under Windows 10

When attempting to start python tonight, Windows 10 suddenly produced the python.exe has stopped working error. Examining the event in the Event Viewer didn t provide any more useful information, but surprisingly everything worked if I launched python.exe directly from Explorer or through bash (cygwin), but not if I launched it through the regular command Continue reading python.exe has stopped…