November 5, 2021

Migrate a Repository From Bazaar to Git

Bazaar is a distributed version control system (VCS), developed by Canonical. For a long time, Bazaar was the only supported VCS on Launchpad. Launchpad is a code hosting platform, similar to the now prevalent GitHub, and while open to the public, nowadays it is mostly used by Canonical itself and many other individuals and companies to manage the whole lifecycle of creating packages for Ubuntu and its distributions. Since quite some time also git is a supported VCS on Launchpad....

July 22, 2021

GPG - All I Need to Know

While I need to use GPG pretty regularly, I always have to look up the commands - they just don’t stick :-) Over the last couple of months I collected every command I had to use. Enjoy! create a key gpg --quick-generate-key user-id # or gpg --generate-key # or gpg --full-generate-key delete a private key gpg --delete-secret-keys key-id delete a public key gpg --delete-key key-id encrypt a file gpg --encrypt --recipient someone@example....

May 20, 2021

Enrich Test Coverage With Contexts

Hold on tight, now I expect a lot of us: We all test our code use coverage strive for 100% test coverage So, what’s missing? I miss some context 100% test coverage is great, but sometimes we need more information. e.g. which test covers line XXX? In sufficiently complex code bases, with mixed unit and integration tests, this is no longer easy to find out. Sure, you can set a breakpoint and run your tests and wait until the breakpoint has been hit....

May 12, 2021

Hugo and GitHub Pages - Welcome in the Land of Confusion

Yesterday, I migrated my blog to Hugo. GitHub Pages While the migration was straight forward, I was a bit puzzled with the deployment process to GitHub. For those who don’t know yet, GitHub enables all users to have an own website, called GitHub Pages, with a URL like https://your-user-name.github.io. Previously I used Lektor. The source code for my site lived in https://github.com/jugmac00/jugmac00.github.io.source, and was deployed by Lektor to https://github.com/jugmac00/jugmac00.github.io. Easy enough....

May 9, 2021

Bite My Shiny Type Annotated Library

How do you make type annotations available to the users of your library? Well, you just type annotate your library, right? No! But let’s step back for a moment. Flask 2.0 goes full type annotations This morning I read David Lord’s announcement that Flask, Jinja, Click, Werkzeug, MarkupSafe, and ItsDangerous are now fully type annotated, and new releases will be available next week. Ok, as I typed Flask-Reuploaded almost a year ago, I certainly noticed that Flask was not typed back then, but external type information was provided via typeshed, which I remember lively, as I had to add a missing type annotation for Werkzeug....

March 1, 2021

Testing the tox 4 Pre-Release at Scale

Every once in a while, you may read that one of your favorite used packages announces a new version. Sometimes even a so-called alpha version is announced. The maintainers then politely ask you, the user, to test the package, and give feedback if anything is broken. When the upcoming pytest version 6 had been announced, I wrote a short instruction on how to install pre-releases. This time, tox, the virtualenv management and test tool, announced a new version 4, but it is not just a new version, it is a complete rewrite by Bernát Gábor!...

October 30, 2020

Convincing an Enterprisy App to Work Behind nginx as Reverse Proxy

For simplicity, let’s the call the app Dated HR, a tool to “Simplify your HR work”, which offers support for time tracking, holiday, payroll… So far so good, and even better, as it is an enterprisy Windows software, which needs to be configured with IIS and a MSSQL database, a colleague of mine installed it on an internal Windows server. The app makes a web GUI available under http://nemesis.company.local, which would work like a charm - for our colleagues at site, but not for the colleagues from the other sites....

October 29, 2020

How to Run a Dockerized Service via systemd

Until recently, I saw no good reason to use Docker, as my deployment tool of choice produces approximately identical builds, locally on my Ubuntu laptop, on staging and on production. But time does not stand still and especially as I have to deploy a Java application, it was time to rethink my strategy, as I do not want to play the which Java runtime environment plays nicely together with which app version game....

October 28, 2020

How to Create Hundreds of Pull Requests With a Single Command

.. or “How to win #hacktoberfest”? Seriously… #hacktoberfest is no longer cool ( Hacktoberfest is Hurting Open Source ) you cannot win it anyway the mass pull requests I created (see below) went all to repositories, which do not take part at #hacktoberfest note If you are not interested in the story behind, I also created a concise “today-I-learned” post. prologue The company I work for has been using Zope, the grand-daddy of Python web application servers, for more than 15 years....

June 28, 2020

Flask Reuploaded

It all started with this error message: File "/Projects/xxx/venv/lib/python3.7/site-packages/flask_uploads.py", line 26, in <module> from werkzeug import secure_filename, FileStorage ImportError: cannot import name 'secure_filename' from 'werkzeug'' Trying to build my Flask application, the above error message was generated, as Werkzeug, a very important library in the Flask ecosystem, changed its API in version 1.0, back in February 2020. This broke a lot of plugins. Twitter thread As my app relies on Flask-Uploads, I had a look at the problem and finally provided a pull request to the Flask-Uploads repository on GitHub....