Skip to content

June of 2021

Projects

Coding

Python

  • Improvement: Add textual as interesting library to explore.

    textual: Textual is a TUI (Text User Interface) framework for Python using Rich as a renderer.

Click

  • Improvement: Explain how to change the command line help description.

Configure Docker to host the application

  • New: Explain how to use watchtower to keep docker containers updated.

    With watchtower you can update the running version of your containerized app simply by pushing a new image to the Docker Hub or your own image registry. Watchtower will pull down your new image, gracefully shut down your existing container and restart it with the same options that were used when it was deployed initially.

  • Correction: Explain how to run the watchtower checks immediately.

    With the --run-once flag

FastAPI

Pytest

  • New: Explain how to set a timeout for your tests.

    Using pytest-timeout.

  • New: Explain how to rerun tests that fail sometimes.

    With pytest-rerunfailures that is a plugin for pytest that re-runs tests to eliminate intermittent failures. Using this plugin is generally a bad idea, it would be best to solve the reason why your code is not reliable. It's useful when you rely on non robust third party software in a way that you can't solve, or if the error is not in your code but in the testing code, and again you are not able to fix it.

    feat(python_snippets#Create combination of elements in groups of two): Explain how to create combination of elements in groups of two

    >>> list(itertools.combinations('ABC', 2))
    [('A', 'B'), ('A', 'C'), ('B', 'C')]
    

Python Snippets

Python Mysql

  • New: Explain how to interact with MySQL databases with Python.
  • Correction: Correct the syntax of the left joins.

    Instead of using ON users.id == addresses.user_id, use ON users.id = addresses.user_id

Selenium

DevOps

Infrastructure Solutions

Jobs

  • New: Explain how to rerun failed cronjobs.

    If you have a job that has failed after the 6 default retries, it will show up in your monitorization forever, to fix it, you can manually trigger the job.

    kubectl get job "your-job" -o json \
        | jq 'del(.spec.selector)' \
        | jq 'del(.spec.template.metadata.labels)' \
        | kubectl replace --force -f -
    

Continuous Integration

  • New: Explain how to troubleshoot the error: pathspec master did not match any file.

    Remove all git hooks with rm -r .git/hooks.

Monitoring

Elasticsearch Exporter

  • New: Introduce the prometheus elasticsearch exporter.

    The elasticsearch exporter allows monitoring Elasticsearch clusters with Prometheus.

    Explain how to install it, configure the grafana dashboards and the alerts.

  • Improvement: Add more elasticsearch alerts.

    Measure the search latency, search rate and create alerts on the garbage collector, json parser and circuit breaker errors

  • New: Add alert on low number of healthy master nodes.

Software Architecture

Domain Driven Design

  • Improvement: Add warning when migrating old code.

    You may be tempted to migrate all your old code to this architecture once you fall in love with it. Truth being told, it's the best way to learn how to use it, but it's time expensive too! The last refactor I did required a change of 60% of the code. The upside is that I reduced the total lines of code a 25%.

Operative Systems

Linux

Linux Snippets

dunst

  • New: Introduce dunst.

    Dunst is a lightweight replacement for the notification daemons provided by most desktop environments. It’s very customizable, isn’t dependent on any toolkits, and therefore fits into those window manager centric setups we all love to customize to perfection.

elasticsearch

  • Correction: Explain how to restore only some indices.

    curl -X POST "{{ url }}/_snapshot/{{ backup_path }}/{{ snapshot_name }}/_restore?pretty" -H 'Content-Type: application/json' -d'
    {
      "indices": "{{ index_to_restore }}",
    }'
    
  • New: Explain how to fix Circuit breakers triggers.

Arts

Writing

Grammar and Orthography

  • New: Explain what collocations are and how to avoid the word very.

    Collocation refers to a natural combination of words that are closely affiliated with each other. They make it easier to avoid overused or ambiguous words like "very", "nice", or "beautiful", by using a pair of words that fit the context better and that have a more precise meaning.

  • New: Explain what can you use instead of I know.

    Using "I know" may not be the best way to show the other person that you've got the information. You can take the chance to use other words that additionally gives more context on how you stand with the information you've received, thus improving the communication and creating a bond.

Cooking

  • New: Introduce the cooking art.

Cooking Basics