Skip to content

May of 2022

Life Management

Food Management

  • New: Introduce my food management workflow.

    As humans diet is an important factor in our health, we need to eat daily around three times a day, as such, each week we need to invest time into managing how to get food in front of us. Tasks like thinking what do you want to eat, buying the ingredients and cooking them make use a non negligible amount of time. Also something to keep in mind, is that eating is one of the great pleasures in our lives, so doing it poorly is a waste. The last part of the equation is that to eat good you either need time or money.

    This article explores my thoughts and findings on how to optimize the use of time, money and mental load in food management while keeping the desired level of quality to enjoy each meal, being healthy and following the principles of ecology and sustainability. I'm no expert at all on either of these topics. I'm learning and making my mind while writing these lines.

Grocy Management

  • New: Introduce my grocy management workflow.

    Buying stuff is an unpleasant activity that drains your energy and time, it's the main perpetrator of the broken capitalist system, but sadly we have to yield to survive.

    This article explores my thoughts and findings on how to optimize the use of time, money and mental load in grocy management to have enough stuff stored to live, while following the principles of ecology and sustainability. I'm no expert at all on either of these topics. I'm learning and making my mind while writing these lines.

    grocy is a web-based self-hosted groceries & household management solution for your home.

    My chosen way to deploy grocy has been using Docker. The hard part comes when you do the initial load, as you have to add all the:

    • User attributes.
    • Product locations.
    • Product groups.
    • Quantity conversions.
    • Products.


  • New: Get assets url.

    If you're using Vite, you can save the assets such as images or audios in the src/assets directory, and you can get the url with:

    getImage() {
      return new URL(`../assets/pictures/${this.active_id}.jpg`, import.meta.url).href

    This way it will give you the correct url whether you're in the development environment or in production.

  • New: Play audio files.

    You can get the file and save it into a data element with:

    getAudio() { = new Audio(new URL(`../assets/audio/${this.active_id}.mp3`, import.meta.url).href)

    You can start playing with, and stop with

  • New: Vue Router.

    Creating a Single-page Application with Vue + Vue Router feels natural, all we need to do is map our components to the routes and let Vue Router know where to render them.

  • New: Deploy static site on github pages.

Software Architecture



  • New: Introduce BeautifulSoup and how to use it.

    BeautifulSoup is a Python library for pulling data out of HTML and XML files. It works with your favorite parser to provide idiomatic ways of navigating, searching, and modifying the parse tree.


  • New: Add endpoints only on testing environment.

    Sometimes you want to have some API endpoints to populate the database for end to end testing the frontend. If your app config has the environment attribute, you could try to do:

    app = FastAPI()
    def get_config() -> Config:
        """Configure the program settings."""
        # no cover: the dependency are injected in the tests"Loading the config")
        return Config()  # pragma: no cover
    if get_config().environment == "testing":
        @app.get("/seed", status_code=201)
        def seed_data(
            repo: Repository = Depends(get_repo),
            empty: bool = True,
            num_articles: int = 3,
            num_sources: int = 2,
        ) -> None:
            """Add seed data for the end to end tests.
                repo: Repository to store the data.
                repo=repo, empty=empty, num_articles=num_articles, num_sources=num_sources

    But the injection of the dependencies is only done inside the functions, so get_config().environment will always be the default value. I ended up doing that check inside the endpoint, which is not ideal.

    @app.get("/seed", status_code=201)
    def seed_data(
        config: Config = Depends(get_config),
        repo: Repository = Depends(get_repo),
        empty: bool = True,
        num_articles: int = 3,
        num_sources: int = 2,
    ) -> None:
        """Add seed data for the end to end tests.
            repo: Repository to store the data.
        if config.environment != "testing":
            raise HTTPException(status_code=404)


  • New: Enforce serial execution of related tests.

    Implement a serial fixture with a session-scoped file lock fixture using the filelock package. You can add this to your

    import contextlib
    import os
    import filelock
    def lock(tmp_path_factory):
        base_temp = tmp_path_factory.getbasetemp()
        lock_file = base_temp.parent / 'serial.lock'
        yield filelock.FileLock(lock_file=str(lock_file))
        with contextlib.suppress(OSError):
    def serial(lock):
        with lock.acquire(poll_intervall=0.1):

    Then inject the serial fixture in any test that requires serial execution. All tests that use the serial fixture are executed serially while any tests that do not use the fixture are executed in parallel.

  • New: Using fixtures at class level.

    Sometimes test functions do not directly need access to a fixture object. For example, tests may require to operate with an empty directory as the current working directory but otherwise do not care for the concrete directory.

    class TestDirectoryInit:
    Due to the usefixtures marker, the cleandir fixture will be required for the execution of each test method, just as if you specified a cleandir function argument to each of them.

    You can specify multiple fixtures like this:

    @pytest.mark.usefixtures("cleandir", "anotherfixture")
  • Correction: Improve the snippet to run some tests in serial instead of parallel.


  • New: Introduce gettext.

    Gettext is the defacto universal solution for internationalization (I18N) and localization (L10N), offering a set of tools that provides a framework to help other packages produce multi-lingual messages. It gives an opinionated way of how programs should be written to support translated message strings and a directory and file naming organisation for the messages that need to be translated.

  • New: Introduce Python Internationalization.

    To make your code accessible to more people, you may want to support more than one language. It's not as easy as it looks as it's not enough to translate it but also it must look and feel local. The answer is internationalization.

    Internationalization (numeronymed as i18n) can be defined as the design process that ensures a program can be adapted to various languages and regions without requiring engineering changes to the source code.

    Common internationalization tasks include:

    • Facilitating compliance with Unicode.
    • Minimizing the use of concatenated strings.
    • Accommodating support for double-byte languages (e.g. Japanese) and right-to-left languages (for example, Hebrew).
    • Avoiding hard-coded text.
    • Designing for independence from cultural conventions (e. g., date and time displays), limiting language, and character sets.

    Localization (l10n) refers to the adaptation of your program, once internationalized, to the local language and cultural habits. In theory it looks simple to implement. In practice though, it takes time and effort to provide the best Internationalization and Localization experience for your global audience.

    In Python, there is a specific bundled module for that and it’s called gettext, which consists of a public API and a set of tools that help extract and generate message catalogs from the source code.

Python Snippets

Python VLC

  • New: Introduce python's vlc library.

    Python VLC is a library to control vlc from python.

    There is not usable online documentation, you'll have to go through the help(<component>) inside the python console.


  • New: Get a list of the tables.

    sql_query = """SELECT name FROM sqlite_master
      WHERE type='table';"""
    cursor = sqliteConnection.cursor()



  • New: Introduce JWT.

    JWT (JSON Web Token) is a proposed Internet standard for creating data with optional signature and/or optional encryption whose payload holds JSON that asserts some number of claims. The tokens are signed either using a private secret or a public/private key.


Infrastructure Solutions


  • New: Pod limit per node.

    AWS EKS supports native VPC networking with the Amazon VPC Container Network Interface (CNI) plugin for Kubernetes. Using this plugin allows Kubernetes Pods to have the same IP address inside the pod as they do on the VPC network.

    This is a great feature but it introduces a limitation in the number of Pods per EC2 Node instance. Whenever you deploy a Pod in the EKS worker Node, EKS creates a new IP address from VPC subnet and attach to the instance.

    The formula for defining the maximum number of pods per instance is as follows:

    N * (M-1) + 2


    • N is the number of Elastic Network Interfaces (ENI) of the instance type.
    • M is the number of IP addresses of a single ENI.

    So, for t3.small, this calculation is 3 * (4-1) + 2 = 11. For a list of all the instance types and their limits see this document

Operating Systems


Linux Snippets


  • New: Introduce Anki.

    Anki is a program which makes remembering things easy. Because it's a lot more efficient than traditional study methods, you can either greatly decrease your time spent studying, or greatly increase the amount you learn.

    Anyone who needs to remember things in their daily life can benefit from Anki. Since it is content-agnostic and supports images, audio, videos and scientific markup (via LaTeX), the possibilities are endless.

  • New: Interacting with python.

    Although there are some python libraries:

    I think the best way is to use AnkiConnect

    The installation process is similar to other Anki plugins and can be accomplished in three steps:

    • Open the Install Add-on dialog by selecting Tools | Add-ons | Get Add-ons... in Anki.
    • Input 2055492159 into the text box labeled Code and press the OK button to proceed.
    • Restart Anki when prompted to do so in order to complete the installation of Anki-Connect.

    Anki must be kept running in the background in order for other applications to be able to use Anki-Connect. You can verify that Anki-Connect is running at any time by accessing localhost:8765 in your browser. If the server is running, you will see the message Anki-Connect displayed in your browser window.

  • New: Use anki connect with python.


  • New: Introduce LibreElec.

    LibreElec is the lightweight distribution to run Kodi


Video Gaming

King Arthur Gold

  • New: Introduce King Arthur Gold.

    King Arthur Gold, also known as KAG, is a free Medieval Build n'Kill Multiplayer Game with Destructible Environments.

    Construct freeform forts as a medieval Builder, fight in sword duels as a Knight or snipe with your bow as an Archer. KAG blends the cooperative aspects of Lost Vikings, mashes them with the full destructibility of Worms and the visual style and action of Metal Slug, brought to you by the creators of Soldat.


  • New: Introduce the sudoku game.

    Sudoku is a logic-based, combinatorial number-placement puzzle. In classic Sudoku, the objective is to fill a 9 × 9 grid with digits so that each column, each row, and each of the nine 3 × 3 subgrids that compose the grid (also called "boxes", "blocks", or "regions") contain all of the digits from 1 to 9. The puzzle setter provides a partially completed grid, which for a well-posed puzzle has a single solution.