Skip to content

October of 2021

Activism

Antifascism

Antifascist Actions

  • New: A fake company and five million recycled flyers.

    A group of artists belonging to the Center for political beauty created a fake company Flyerservice Hahn and convinced more than 80 regional sections of the far right party AfD to hire them to deliver their electoral propaganda.

    They gathered five million flyers, with a total weight of 72 tons. They justify that they wouldn't be able to lie to the people, so they did nothing in the broader sense of the word. They declared that they are the "world wide leader in the non-delivery of nazi propaganda". At the start of the electoral campaign, they went to the AfD stands, and they let their members to give them flyers the throw them to the closest bin. "It's something that any citizen can freely do, we have only industrialized the process".

    They've done a crowdfunding to fund the legal process that may result.

Feminism

Privileges

  • New: Feminist analysis of privileges and rights.

    Privileges are a group of special structural benefits, social advantages, that a group holds over another. So they are elements that should be removed from our lives.

    Some of the topics included are:

Life Management

Book Management

  • New: Introduce the book management concept.

    Book management is the set of systems and processes to get and categorize books so it's easy to browse and discover new content. It involves the next actions:

    • Automatically index and download metadata of new books.
    • Notify the user when a new book is added.
    • Monitor the books of an author, and get them once they are released.
    • Send books to the e-reader.
    • A nice interface to browse the existent library, with the possibility of filtering by author, genre, years, tags or series.
    • An interface to preview or read the items.
    • An interface to rate and review library items.
    • An interface to discover new content based on the ratings and item metadata.

    I haven't yet found a single piece of software that fulfills all these needs, in the article I tell you about Readarr, Calibre-web, [calibre]((https://manual.calibre-ebook.com/), Polar bookself, GCStar, and how they interact with each other.

  • Improvement: Add link to the calibre-web kobo integration project.

Coding

Python

Full screen applications

Click

  • New: Invoke other commands from a command.

    This is a pattern that is generally discouraged with Click, but possible nonetheless. For this, you can use the Context.invoke() or Context.forward() methods.

Optimization

Flask Restplus

  • New: Introduce the Flask-RESTPlus library.

    Flask-RESTPlus is an extension for Flask that adds support for quickly building REST APIs, but I'd use FastAPI instead.

Pytest

Python Snippets

  • New: Check if a dictionary is a subset of another.

    If you have two dictionaries big = {'a': 1, 'b': 2, 'c':3} and small = {'c': 3, 'a': 1}, and want to check whether small is a subset of big, use the next snippet:

    >>> small.items() <= big.items()
    True
    
  • Correction: Group or sort a list of dictionaries or objects by a specific key.

    Improve previous method with the concepts learned from the official docs

    Particularly improve the sorting by multiple keys with the next function:

    >>> def multisort(xs, specs):
        for key, reverse in reversed(specs):
            xs.sort(key=attrgetter(key), reverse=reverse)
        return xs
    
    >>> multisort(list(student_objects), (('grade', True), ('age', False)))
    [('dave', 'B', 10), ('jane', 'B', 12), ('john', 'A', 15)]
    
  • Correction: Install default directories and files for a command line program.

    I've been trying for a long time to configure setup.py to run the required steps to configure the required directories and files when doing pip install without success.

    Finally, I decided that the program itself should create the data once the FileNotFoundError exception is found. That way, you don't penalize the load time because if the file or directory exists, that code is not run.

  • New: Locate element in list.

    a = ['a', 'b']
    
    index = a.index('b')
    
  • New: Transpose a list of lists.

    >>> l=[[1,2,3],[4,5,6],[7,8,9]]
    >>> [list(i) for i in zip(*l)]
    ... [[1, 4, 7], [2, 5, 8], [3, 6, 9]]
    
  • New: Check the type of a list of strings.

    def _is_list_of_lists(data: Any) -> bool:
        """Check if data is a list of strings."""
        if data and isinstance(data, list):
            return all(isinstance(elem, list) for elem in data)
        else:
            return False
    

Prompt Toolkit

Pydantic

  • New: Copy produces copy that modifies the original.

    When copying a model, changing the value of an attribute on the copy updates the value of the attribute on the original. This only happens if deep != True. To fix it use: model.copy(deep=True).

Promql

DevOps

Infrastructure as Code

Helmfile

  • Correction: Use environment name instead of get values.

    Instead of .Environment.Name, in theory you could have used .Vars | get "environment", which could have prevented the variables and secrets of the default environment will need to be called default_values.yaml, and default_secrets.yaml, which is misleading. But you can't use .Values in the helmfile.yaml as it's not loaded when the file is parsed, and you get an error. A solution would be to layer the helmfile state files but I wasn't able to make it work.

  • New: How to install a chart only in one environment.

    environments:
      default:
      production:
    
    ---
    
    releases:
    - name: newrelic-agent
      installed: {{ eq .Environment.Name "production" | toYaml }}
      # snip
    
  • New: Add note that templates can't be used inside the secrets.

    See this issue

Terraform

Helm Secrets

  • Correction: Update the repository url.

    The last fork is dead, long live the fork

  • New: How to install the plugin.

Continuous Integration

Flakehell

Dependency managers

  • New: Sync the virtualenv libraries with the requirements files.

    python -m piptools sync requirements.txt requirements-dev.txt
    
  • Correction: Use -c instead of -r in the nested requirement files.

    To avoid duplication of version pins.

Operative Systems

Linux

Dynamic DNS

  • New: Introduce the Dynamic DNS concept.

    Dynamic DNS (DDNS) is a method of automatically updating a name server in the Domain Name Server (DNS), often in real time, with the active DDNS configuration of its configured hostnames, addresses or other information.

Hard drive health

  • New: Taking care of your hard drives.

    Hard drives die, so we must be ready for that to happen. There are several solutions, such as using RAID to minimize the impact of a disk loss, but even then, we should monitor the bad sectors to see when are our disks dying.

    In the article we talk about S.M.A.R.T and how to solve some hard drive problems.

Kitty

  • New: Introduce kitty the terminal emulator.

    kitty is a fast, feature-rich, GPU based terminal emulator written in C and Python with nice features for the keyboard driven humans like me.

  • New: Scrollback when ssh into a machine doesn't work.

    This happens because the kitty terminfo files are not available on the server. You can ssh in using the following command which will automatically copy the terminfo files to the server:

    kitty +kitten ssh myserver
    
  • New: Enable infinite scrollback history.

    To make the history scrollback infinite add the next lines:

    scrollback_lines -1
    scrollback_pager_history_size 0
    
  • New: Reasons to migrate from urxvt to kitty.

    • It doesn't fuck up your terminal colors.
    • You can use peek to record your screen.
    • Easier to extend.

Peek

  • Correction: Add note that it works with kitty.

Arts

Drawing

  • New: How to draw Ellipses.

    Ellipses are the next basic shape we're going to study (after the lines). They are extremely important and notoriously annoying to draw. Important because we're going to be using ellipses in 2D space to represent circles that exist in 3D space.

    In this section we:

Exercise Pool

  • New: Add the Tables of ellipses drawing exercise.

    This exercise is meant to get you used to drawing ellipses, in a variety of sizes, orientations and degrees. It also sets out a clear space each ellipse is meant to occupy, giving us a means to assess whether or not an ellipse was successful, or if there were visible mistakes (where it went outside of its allotted space, or ended up falling short). Practicing against set criteria, with a way to judge success/failure is an important element of learning. There's nothing wrong with failure - it's an opportunity to learn. Having a clearly defined task allows us to analyze those failures and make the most of them.