Skip to content

April of 2024

Activism

Antifascism

Feminism

Privileges

Life Management

Time management

  • New: Anticapitalist approach to time management.

    Time management is being used to perpetrate the now hegemonic capitalist values. Its a pity because the underlying concepts are pretty useful and interesting but they are oriented towards improving productivity and being able to deal with an increasing amount of work. Basically they're always telling you to be a better cog. It doesn't matter how good you are, there is always room for improvement. I've fallen on this trap for a long time (I'm still getting my head out of the hole) and I'm trying to amend things by applying the concepts on an anticapitalist mindset. The turning point was to read Four thousand weeks: Time management for mortals by Oliver Burkeman, the article will have book extracts mixed with my way of thinking.

    Some (or most) of what's written in this article may not apply if you're not a male, white, young, cis, hetero, European, university graduated, able-bodied, """wealthy""" person. You need to be at a certain level of the social ladder to even start thinking in these terms. And depending on the number of oppressions you're suffering you'll have more or less room to maneuver. That margin is completely outside our control so by no means we should feel guilty of not being able to manage time. What follows are just guidelines to deal with this time anxiety imposed by the capitalist system with whatever air we have to breath.

    Changing the language

    The easiest way to change the underlying meaning is to change the language. Some substitutions are:

    • work -> focus: Nowadays we use work everywhere even if it's not in the laboral environment. For example I work very hard to achieve my goals. Working is the action of selling your time and energies in order to get the resources you need to live. It has an intrinsic meaning of sacrifice, doing something we don't want to do to get another thing in return. That's a tainted way of thinking about your personal time. I find focus is a great substitute as it doesn't have all those connotations. There are similar substitutions based on the same argument, such as: workspace -> space of focus, workflow -> action flow or just flow.
    • task -> action: Similar to work a task is something you kind of feel obliged to do. It uses a negative mindset to set the perfect scenario to feel guilty when you fail to do them. But you're on your personal time, it should be fine not to do an action for whatever reason. Action on the other side fosters a positive way of thinking, it suggests change, movement in a way that helps you move forward. There are also other derived words such as task manager -> action manager.
    • productivity -> efficiency: Productivy is the measurement of how fast or good you create products. And products are something that is made to be sold. Again this introduces a monetary mindset on all aspects of our life. Efficiency on the other side is the quality of achieving the largest amount of change using as little time, energy or effort as possible (Cambridge doesn't agree with me though :P. It may be because universities are also another important vector of spreading the capitalist values :(). So using efficiency we're focusing more on improving the process itself, so it can be applied for example on how to optimize your enjoyment of doing nothing. Which is completely antagonistic to the concept of productivity.

    Changing the mindset

    There is a widespread feeling that we're always short on time. We're obsessed with our overfilled inboxes and lengthening todo lists, haunted by the guilty feeling that we ought to be getting more done, or different things done, or both. At the same time we're deluged with advice on living the fully optimized life to squeeze the most from your time. And it get's worse as you age because time seems to speed up as you get older, steadily accelerating until months begging to flash by in what feels like minutes.

    The real problem isn't our limited time. It's that we've unwittingly inherited, and feel pressured to live by a troublesome set of ideas about how to use our limited time, all of which are pretty much guaranteed to make things worse. What follows are a list of mindset changes from the traditional time management bibliography that can set the bases of a healthier Anticapitalist one.

    Time is not a resource to spend

    Before timetables life rhythms emerged organically from the tasks they needed to do. You milked the cows when they needed milking and harvested the crops when it was harvest time. Anyone who would tried imposing an external schedule on any of that, for example, doing a month's milking in a single day to get it out of the way would rightly have been considered a lunatic.

    There was no need to think of time as something abstract and separate from life. In those days before clocks, when you did need to explain how long something might take, your only option was to compare it with some other concrete activity. They were untroubled by any notion of time "ticking away" thus living a heightened awareness of the vividness of things, the feeling of timelesness. Also known as living in deep time, or being in the flow, when the boundary separating the self from the rest of reality grows blurry and time stands still.

    There's one huge drawback in giving so little thought to the abstract idea of time, though, which is that it severely limits what you can accomplish. As soon as you want to coordinate the actions of more than a handful of people, you need a reliable, agreed-upon method of measuring time. This is why the first mechanical clocks came to be invented.

    Making time standardized and visible in this fashion inevitably encourages people to think of it as an abstract thing with an independent existence, distinct from the specific activities on which one might spend it. "time" is what ticks away as the hands move around the clock face.

    The next step was to start treating time as a resource, something to be bought and sold and used as efficiently as possible. This mindset shift serves as the precondition for all the uniquely modern ways in which we struggle with time today. Once time is a resource to be used, you start to feel pressure, whether from external forces or from yourself, to use it well, ant to berate yourself when you feel you've wasted it. When you're faced with too many demands, it's easy to assume that the only answer must be to make better use of time, by becoming more efficient, driving yourself harder, or working longer instead of asking whether the demands themselves might be unreasonable.

    Soon your sense of self-worth gets completely bound up with how you're using time: it stops being merely the water in which you swim and turns into something you fell you need to dominate or control if you're to avoid feeling guilty, panicked or overwhelmed.

    The fundamental problem is that this attitude towards time sets up a rigged game in which it's impossible ever to feel as though you're doing well enough. Instead of simply living our lives as they unfold in time it becomes difficult not to value each moment primarily according to its usefulness for some future goal, or for some future oasis of relaxation you hope to reach once your tasks are finally "out of the way".

    Ultimately it backfires. It wrenches us out of the present, leading to a life spent leaning into the future, worrying about whether things will work out, experiencing everything in terms of some later, hoped-for benefit, so that peace of mind never quite arrives. And it makes it all but impossible to experience the flow, that sense of timeless time which depends on forgetting the abstract yardstick and plunging back into the vividness of reality instead.

    If you don't disavow capitalism an increase in efficiency will only make things worse

    All this context makes us eager to believe the promises of time management frameworks (like GTD) that if you improve your efficiency you'll get more time to enjoy your life. If you follow the right time management system, build the right habits, and apply sufficient self-discipline, you will win the struggle with time.

    Reality then kicks in you never win the struggle and only feel more stressed and unhappy. You realize that all the time you've saved is automatically filled up by more things to do in a never ending feedback loop. It's true that you get more done, and yet, paradoxically, you only feel busier, more anxious and somehow emptier as a result. Time feels like an unstoppable conveyor belt, bringing us new actions as fast as we can dispatch the old ones; and becoming more efficient just seems to cause the belt to speed up. Or else, eventually, to break down.

    It also has another side-effect. As life accelerates, everyone grows more impatient. It's somehow vastly more aggravating to wait two minutes for the microwave than two hours for the oven, or ten seconds for a slow loading web page versus three days to receive the same information by mail.

    Denying reality never works though. It may provide some immediate relief, because it allows you to go on thinking that at some point in the future you might, at last, feel totally in control. But it can't ever bring the sense that you're doing enough (that you are enough) because it defines enough as a kind of limitless control that no human can attain. Instead, the endless struggle leads to more anxiety and less fulfilling life. For example, the more you believe yo might succeed in "fitting everything in", the more commitments you naturally take on, and the less you feel the need to ask whether each new commitment is truly worth a portion of your time, and so your days inevitably fill with more activities you don't especially value. The more you hurry, the more frustrating it is to encounter tasks that won't be hurried, the more compulsively you plan for the future, the more anxious you feel about any remaining uncertainties, of which there will always be plenty.

    Time management used this way serves as a distraction to numb our minds:

    • It may hide the sense of precariousness inherent to the capitalist world we live in. If you could meet every boss's demand, while launching various side projects on your own, maybe one day You'd finally feel secure in your career and your finances.
    • Divert your energies from fully experiencing the reality in which you find yourself, holding at bay certain scary questions about what you're doing with your life, and whether major changes might not be needed. As long as you're always just on the cusp of mastering time, you can avoid the thought that what life is really demanding from you might involve surrendering the craving for mastery and diving into the unknown instead.

    Embrace the finitude of time

    We recoil from the notion that this is it. That this life, with all its flaws and inescapable vulnerabilities, its extreme brevity, and our limited influence over how it unfolds, is the only one we'll get a shot at. Instead, we mentally fight against the way things are, so that we don't have to consciously participate in what it's like to feel claustrophobic, imprisoned, powerless, and constrained by reality.

    Our troubled relationship with time arises largely from this same effort to avoid the painful constrains of reality. And most of our strategies for becoming more efficient make things worse, because they're really just ways of furthering the avoidance. After all, it's painful to confront how limited your time is, because it means that tough choices are inevitable and that you won't have time for all you once dreamed you might do. It's also painful to accept the limited control over the time you do get: maybe you simply lack the stamina or talent or other resources to perform well in all the roles you feel you should. And so, rather than face our limitations, we engage in avoidance strategies, in an effort to carry on feeling limitless. We push ourselves harder, chasing fantasies of the perfect work-life balance, or we implement time management systems that promise to make time for everything, so that tough choices won't be required. Or we procrastinate, which is another means of maintaining the feeling of omnipotent control over life, because you needn't risk the upsetting experience of failing at an intimidating project if you never even start it. We fill our minds with busyness and distraction to numb ourselves emotionally. Or we plan compulsively, because the alternative is to confront how little control over the future we really have.

    Heal yourself from FOMO

    In practical terms, a limit-embracing attitude to time means organizing your days with the understanding that you definitely won't have time for everything you want to do, or that other people want you to do, and so, at the very least, you can stop beating yourself up for failing. Since hard choices are unavoidable, what matters is learning to make them consciously, deciding what to focus on and what to neglect, rather than letting them get made by default, or deceiving yourself that, with enough hard work and the right time management tricks, you might not have to make them at all. It also means resisting the temptation to "keep your options open" in favour of deliberately making big, daunting, irreversible commitments, which you can't know in advance will turn out for the best, but which reliably prove more fulfilling in the end. And it means standing firm in the face of FOMO (fear of missing out) because you come to realize that missing out on something (indeed on almost everything) is basically guaranteed. Which isn't actually a problem anyway, it turns to, because "missing out" is what makes your choices meaningful in the first place. Every decision to use a portion of time on anything represents the sacrifice of all the other ways in which you could have spent that time, but didn't, and to willingly make that sacrifice is to take a stand, without reservation, on what matters most to you.

    Embrace your control limits

    The more you try to manage your time with the goal of achieving a feeling of total control and freedom from the inevitable constrains of being human, the more stressful, empty, and frustrating life gets. But the more you confront the facts of finitude instead, and work with them, rather than against them, the more efficient, meaningful and joyful life becomes. Anxiety won't ever completely go away, we're even limited, apparently, in our capacity to embrace our limitations. But I'm aware of no other time management technique that's half as effective as just facing the way things truly are.

    Time pressure comes largely from forces outside our control: from a cutthroat economy; from the loss of the social safety networks that used to help ease the burdens of work and childcare; and from the sexist expectation that women must excel in their careers while assuming most of the responsibilities at home. None of that will be solved with time management. Fully facing the reality of it can only help though. So long as you continue to respond to impossible demands on your time by trying to persuade yourself that you might one day find some way to do the impossible, you're implicitly collaboration with those demands. Whereas once you deeply grasp that they are impossible, you'll stop believing the delusion that any of that is ever going to bring satisfaction and will be newly empowered to resist them, letting you focus instead on building the most meaningful life you can, in whatever situation you're in.

    Seeing and accepting our limited powers over our time can prompt us to question the very idea that time is something you use in the first place. There is an alternative: the notion of letting time use you, approaching life not as an opportunity to implement your predetermined plans for success but as a matter of responding to the needs of your place and your moment in history.

    Embrace the community constrains

    Moreover, most of us seek a specifically individualistic kind of mastery over time. Our culture's ideal is that you alone should control your schedule, doing whatever you prefer, whenever you want, because it's scary to confront the truth that almost everything worth doing depends on cooperating with others, and therefore on exposing yourself to the emotional uncertainties of relationships. In the end the more individual sovereignty you achieve over your time, the lonelier you get. The truth then is that freedom sometimes is to be found not in achieving greater sovereignty over your own schedule but in allowing yourself to be constrained by the rhythms of community. Participating in forms of social life where you don't get to decide exactly what you do or when you doi it. And it leads to the insight that meaningful efficiency often comes not from hurrying things up but from letting them take the time they take.

    Live for today not tomorrow

    It doesn't matter what you do, we all sense that there are always more important and fulfilling ways we could be spending our time, even if we can't say exactly what they are, yet we systematically spend our days doing other things instead. This feeling can take many forms: the desire to devote yourself to some larger cause, continuously demanding more from yourself, desiring to spend more time with your loved ones.

    Our attempts to become more efficient may have the effect of pushing the genuinely important stuff even further over the horizon. Our days are spent trying to "get through" tasks, in order to get them "out of the way", with the result that we live mentally in the future, waiting for when we'll finally get around to what really matters, and worrying in the meantime, that we don't measure up, that we might lack the drive or stamina to keep pace with the speed at which life now seems to move. We live in a constant spirit of joyless urgency.

Org Mode

  • New: How to deal with recurring tasks that are not yet ready to be acted upon.

    By default when you mark a recurrent task as DONE it will transition the date (either appointment, SCHEDULED or DEADLINE) to the next date and change the state to TODO. I found it confusing because for me TODO actions are the ones that can be acted upon right now. That's why I'm using the next states instead:

    • INACTIVE: Recurrent task which date is not yet close so you should not take care of it.
    • READY: Recurrent task which date is overdue, we acknowledge the fact and mark the date as inactive (so that it doesn't clobber the agenda).

    The idea is that once an INACTIVE task reaches your agenda, either because the warning days of the DEADLINE make it show up, or because it's the SCHEDULED date you need to decide whether to change it to TODO if it's to be acted upon immediately or to READY and deactivate the date.

    INACTIVE then should be the default state transition for the recurring tasks once you mark it as DONE. To do this, set in your config:

    org_todo_repeat_to_state = "INACTIVE",
    

    If a project gathers a list of recurrent subprojects or subactions it can have the next states:

    • READY: If there is at least one subelement in state READY and the rest are INACTIVE
    • TODO: If there is at least one subelement in state TODO and the rest may have READY or INACTIVE
    • INACTIVE: The project is not planned to be acted upon soon.
    • WAITING: The project is planned to be acted upon but all its subelements are in INACTIVE state.

Roadmap Adjustment

  • Correction: Change the concept of Task for Action.

    To remove the capitalist productive mindset from the concept

  • Correction: Action cleaning.

    Marking steps as done make help you get an idea of the evolution of the action. It can also be useful if you want to do some kind of reporting. On the other hand, having a long list of done steps (specially if you have many levels of step indentation may make the finding of the next actionable step difficult. It's a good idea then to often clean up all done items.

    • For non recurring actions use the LOGBOOK to move the done steps. for example:
      ** DOING Do X
         :LOGBOOK:
         - [x] Done step 1
         - [-] Doing step 2
           - [x] Done substep 1
         :END:
         - [-] Doing step 2
           - [ ] substep 2
      

    This way the LOGBOOK will be automatically folded so you won't see the progress but it's at hand in case you need it.

    • For recurring actions:
    • Mark the steps as done
    • Archive the todo element.
    • Undo the archive.
    • Clean up the done items.

    This way you have a snapshot of the state of the action in your archive.

  • New: Project cleaning.

    Similar to action cleaning we want to keep the state clean. If there are not that many actions under the project we can leave the done elements as DONE, once they start to get clobbered up we can create a Closed section.

    For recurring projects:

    • Mark the actions as done
    • Archive the project element.
    • Undo the archive.
    • Clean up the done items.

Coding

Languages

Bash snippets

  • New: Do relative import of a bash library.

    If you want to import a file lib.sh that lives in the same directory as the file that is importing it you can use the next snippet:

    source "$(dirname "$(realpath "$0")")/lib.sh"
    

    If you use source ./lib.sh you will get an import error if you run the script on any other place that is not the directory where lib.sh lives.

  • New: Check the battery status.

    This article gives many ways to check the status of a battery, for my purposes the next one is enough

    cat /sys/class/power_supply/BAT0/capacity
    
    feat(bash_snippets#Check if file is being sourced): Check if file is being sourced

    Assuming that you are running bash, put the following code near the start of the script that you want to be sourced but not executed:

    if [ "${BASH_SOURCE[0]}" -ef "$0" ]
    then
        echo "Hey, you should source this script, not execute it!"
        exit 1
    fi
    

    Under bash, ${BASH_SOURCE[0]} will contain the name of the current file that the shell is reading regardless of whether it is being sourced or executed.

    By contrast, $0 is the name of the current file being executed.

    -ef tests if these two files are the same file. If they are, we alert the user and exit.

    Neither -ef nor BASH_SOURCE are POSIX. While -ef is supported by ksh, yash, zsh and Dash, BASH_SOURCE requires bash. In zsh, however, ${BASH_SOURCE[0]} could be replaced by ${(%):-%N}.

  • New: Parsing bash arguments.

    Long story short, it's nasty, think of using a python script with typer instead.

    There are some possibilities to do this:

Python Snippets

  • New: Kill a process by it's PID.

    import os
    import signal
    
    os.kill(pid, signal.SIGTERM) #or signal.SIGKILL
    
  • New: Convert the parameter of an API get request to a valid field.

    For example if the argument has /:

    from urllib.parse import quote
    
    quote("value/with/slashes")
    

    Will return value%2Fwith%2Fslashes

  • New: Get the type hints of an object.

    ```python from typing import get_type_hints

    Student(NamedTuple): name: Annotated[str, 'some marker']

    get_type_hints(Student) == {'name': str} get_type_hints(Student, include_extras=False) == {'name': str} get_type_hints(Student, include_extras=True) == { 'name': Annotated[str, 'some marker'] } ````

  • New: Type hints of a python module.

    from types import ModuleType
    import os
    
    assert isinstance(os, ModuleType)
    
  • New: Get all the classes of a python module.

    def _load_classes_from_directory(self, directory):
        classes = []
        for file_name in os.listdir(directory):
            if file_name.endswith(".py") and file_name != "__init__.py":
                module_name = os.path.splitext(file_name)[0]
                module_path = os.path.join(directory, file_name)
    
                # Import the module dynamically
                spec = spec_from_file_location(module_name, module_path)
                if spec is None or spec.loader is None:
                    raise ValueError(
                        f"Error loading the spec of {module_name} from {module_path}"
                    )
                module = module_from_spec(spec)
                spec.loader.exec_module(module)
    
                # Retrieve all classes from the module
                module_classes = inspect.getmembers(module, inspect.isclass)
                classes.extend(module_classes)
    
  • New: Import files from other directories.

    Add the directory where you have your function to sys.path

    import sys
    
    sys.path.append("**Put here the directory where you have the file with your function**")
    
    from file import function
    

IDES

Vim autosave

  • New: Manually toggle the autosave function.

    Besides running auto-save at startup (if you have enabled = true in your config), you may as well:

    • ASToggle: toggle auto-save

Generic Coding Practices

Writing good documentation

DevOps

Infrastructure as Code

Ansible Snippets

  • New: Loop over dict fails when only one element detected.

    If you see the If you passed a list/dict of just one element, try adding wantlist=True to your lookup invocation or use q/query instead of lookup." error in an Ansible log it means that the content of the variable is not the type you expect it to be. This can happen for example for lists that have only one or zero elements, which gets translated into a string thus breaking the loop structure.

    So instead of:

    - name: Create filesystem on device
      community.general.filesystem:
        fstype: ext4
        dev: "/dev/disk/by-id/nvme-Amazon_Elastic_Block_Store_vol{{ item.id | split('-') | last }}"
      loop: "{{ volumes }}"
    

    You can use:

    - name: Create filesystem on device
      community.general.filesystem:
        fstype: ext4
        dev: "/dev/disk/by-id/nvme-Amazon_Elastic_Block_Store_vol{{ item.id | split('-') | last }}"
      loop: "{{ lookup('list', volumes, wantlist=True) }}"
    

    If that gives you issues you can use this other construction instead:

    - name: Save the required volume data
      set_fact:
        volumes: "{{ volume_tags_data | json_query('results[0].volumes[].{id: id, mount_point: tags.mount_point}') }}"
    
    - name: Get result type for the volumes
      set_fact:
        volumes_type: "{{ volumes | type_debug }}"
    
    - name: Display volumes type
      debug:
        msg: "{{ volumes_type }}"
    
    - name: Force list of volumes if it's a string
      set_fact:
        volumes: "{{ [] }}"
      when:
        - volumes_type == 'str'
    
    - name: Force list of volumes if it's a dictionary
      set_fact:
        volumes: "{{ [volumes] }}"
      when:
        - volumes_type == 'dict'
    
    - name: Create filesystem on device
      community.general.filesystem:
        fstype: ext4
        dev: "/dev/disk/by-id/nvme-Amazon_Elastic_Block_Store_vol{{ item.id | split('-') | last }}"
      loop: "{{ volumes }}"
    

Monitoring

Loki

  • New: Alert when query returns no data.

    Sometimes the queries you want to alert happen when the return value is NaN or No Data. For example if you want to monitory the happy path by setting an alert if a string is not found in some logs in a period of time.

    count_over_time({filename="/var/log/mail.log"} |= `Mail is sent` [24h]) < 1
    

    This won't trigger the alert because the count_over_time doesn't return a 0 but a NaN. One way to solve it is to use the vector(0) operator with the operation or on() vector(0)

    (count_over_time({filename="/var/log/mail.log"} |= `Mail is sent` [24h]) or on() vector(0)) < 1
    

  • New: Monitor loki metrics.

    Since Loki reuses the Prometheus code for recording rules and WALs, it also gains all of Prometheus’ observability.

    To scrape loki metrics with prometheus add the next snippet to the prometheus configuration:

      - job_name: loki
        metrics_path: /metrics
        static_configs:
        - targets:
          - loki:3100
    

    This assumes that loki is a docker in the same network as prometheus.

    There are some rules in the awesome prometheus alerts repo

    ---
    groups:
    - name: Awesome Prometheus loki alert rules
      # https://samber.github.io/awesome-prometheus-alerts/rules#loki
      rules:
      - alert: LokiProcessTooManyRestarts
        expr: changes(process_start_time_seconds{job=~".*loki.*"}[15m]) > 2
        for: 0m
        labels:
          severity: warning
        annotations:
          summary: Loki process too many restarts (instance {{ $labels.instance }})
          description: "A loki process had too many restarts (target {{ $labels.instance }})\n  VALUE = {{ $value }}\n  LABELS = {{ $labels }}"
      - alert: LokiRequestErrors
        expr: 100 * sum(rate(loki_request_duration_seconds_count{status_code=~"5.."}[1m])) by (namespace, job, route) / sum(rate(loki_request_duration_seconds_count[1m])) by (namespace, job, route) > 10
        for: 15m
        labels:
          severity: critical
        annotations:
          summary: Loki request errors (instance {{ $labels.instance }})
          description: "The {{ $labels.job }} and {{ $labels.route }} are experiencing errors\n  VALUE = {{ $value }}\n  LABELS = {{ $labels }}"
      - alert: LokiRequestPanic
        expr: sum(increase(loki_panic_total[10m])) by (namespace, job) > 0
        for: 5m
        labels:
          severity: critical
        annotations:
          summary: Loki request panic (instance {{ $labels.instance }})
          description: "The {{ $labels.job }} is experiencing {{ printf \"%.2f\" $value }}% increase of panics\n  VALUE = {{ $value }}\n  LABELS = {{ $labels }}"
      - alert: LokiRequestLatency
        expr: (histogram_quantile(0.99, sum(rate(loki_request_duration_seconds_bucket{route!~"(?i).*tail.*"}[5m])) by (le)))  > 1
        for: 5m
        labels:
          severity: critical
        annotations:
          summary: Loki request latency (instance {{ $labels.instance }})
          description: "The {{ $labels.job }} {{ $labels.route }} is experiencing {{ printf \"%.2f\" $value }}s 99th percentile latency\n  VALUE = {{ $value }}\n  LABELS = {{ $labels }}"
    

    And there are some guidelines on the rest of the metrics in the grafana documentation

    Monitor the ruler

    Prometheus exposes a number of metrics for its WAL implementation, and these have all been prefixed with loki_ruler_wal_.

    For example: prometheus_remote_storage_bytes_totalloki_ruler_wal_prometheus_remote_storage_bytes_total

    Additional metrics are exposed, also with the prefix loki_ruler_wal_. All per-tenant metrics contain a tenant label, so be aware that cardinality could begin to be a concern if the number of tenants grows sufficiently large.

    Some key metrics to note are:

    • loki_ruler_wal_appender_ready: whether a WAL appender is ready to accept samples (1) or not (0)
    • loki_ruler_wal_prometheus_remote_storage_samples_total: number of samples sent per tenant to remote storage
    • loki_ruler_wal_prometheus_remote_storage_samples_pending_total: samples buffered in memory, waiting to be sent to remote storage
    • loki_ruler_wal_prometheus_remote_storage_samples_failed_total: samples that failed when sent to remote storage
    • loki_ruler_wal_prometheus_remote_storage_samples_dropped_total: samples dropped by relabel configurations
    • loki_ruler_wal_prometheus_remote_storage_samples_retried_total: samples re-resent to remote storage
    • loki_ruler_wal_prometheus_remote_storage_highest_timestamp_in_seconds: highest timestamp of sample appended to WAL
    • loki_ruler_wal_prometheus_remote_storage_queue_highest_sent_timestamp_seconds: highest timestamp of sample sent to remote storage.
  • New: Get a useful Source link in the alertmanager.

    This still doesn't work. Currently for the ruler external_url if you use the URL of your Grafana installation: e.g. external_url: "https://grafana.example.com" it creates a Source link in alertmanager similar to https://grafana.example.com/graph?g0.expr=%28sum+by%28thing%29%28count_over_time%28%7Bnamespace%3D%22foo%22%7D+%7C+json+%7C+bar%3D%22maxRetries%22%5B5m%5D%29%29+%3E+0%29&g0.tab=1, which isn't valid.

    This url templating (via /graph?g0.expr=%s&g0.tab=1) appears to be coming from prometheus. There is not a workaround yet

Promtail

  • New: Set the hostname label on all logs.

    There are many ways to do it:

    This won't work if you're using promtail within a docker-compose because you can't use bash expansion in the docker-compose.yaml file - Allowing env expansion and setting it in the promtail conf. You can launch the promtail command with -config.expand-env and then set in each scrape jobs:

    labels:
        host: ${HOSTNAME}
    
    This won't work either if you're using promtail within a docker as it will give you the ID of the docker - Set it in the promtail_config_clients field as external_labels of each promtail config:
    promtail_config_clients:
      - url: "http://{{ loki_url }}:3100/loki/api/v1/push"
        external_labels:
          hostname: "{{ ansible_hostname }}"
    
    - Hardcode it for each promtail config scraping config as static labels. If you're using ansible or any deployment method that supports jinja expansion set it that way
    labels:
        host: {{ ansible_hostname }}
    

AlertManager

  • Correction: Add another source on how to silence alerts.

    If previous guidelines don't work for you, you can use the sleep peacefully guidelines to tackle it at query level.

Hardware

ECC RAM

  • New: Check if system is actually using ECC.

    Another way is to run dmidecode. For ECC support you'll see:

    $: dmidecode -t memory | grep ECC
      Error Correction Type: Single-bit ECC
      # or
      Error Correction Type: Multi-bit ECC
    

    No ECC:

    $: dmidecode -t memory | grep ECC
      Error Correction Type: None
    

    You can also test it with rasdaemon

Operating Systems

Linux

Linux Snippets

aleph

HAProxy

ffmpeg

  • New: Reduce the video size.

    If you don't mind using H.265 replace the libx264 codec with libx265, and push the compression lever further by increasing the CRF value — add, say, 4 or 6, since a reasonable range for H.265 may be 24 to 30. Note that lower CRF values correspond to higher bitrates, and hence produce higher quality videos.

    ffmpeg -i input.mp4 -vcodec libx265 -crf 28 output.mp4
    

    If you want to stick to H.264 reduce the bitrate. You can check the current one with ffprobe input.mkv. Once you've chosen the new rate change it with:

    ffmpeg -i input.mp4 -b 3000k output.mp4
    

    Additional options that might be worth considering is setting the Constant Rate Factor, which lowers the average bit rate, but retains better quality. Vary the CRF between around 18 and 24 — the lower, the higher the bitrate.

    ffmpeg -i input.mp4 -vcodec libx264 -crf 20 output.mp4
    

Android

ICSx5

  • New: Introduce ICSx5.

    ICSx5 is an android app to sync calendars.

    References

Arts

Cooking

  • New: Comer naranja por la noche.

    "Por la mañana oro, al mediodía plata y por la noche mata". Así de tajante se muestra el refranero español con respecto a la naranja y el melón. La naranja es una fruta ácida y por esta razón es recomendable evitar su consumo por la noche. Y es que este alto nivel de acidez puede provocar una digestión lenta y sensación de acidez y ardor en el estómago. Directamente relacionado con estos síntomas puede sobrevenir dolor de estómago y esto conducirnos a un descanso poco placentero durante la noche. Así, lo mejor es evitar su consumo a última hora del día. Si encima le añades unos trocitos de chocolate negro dificultarás el tránsito intestinal (por las grasas) y harás que te cueste más conciliar el sueño ya que es estimulante. Pero qué rico sabe de postre de cena xD.

    Estas consecuencias varían en función de las personas y de su sistema digestivo. Así, este alimento sí puede resultar saludable para ciertas personas sin problemas gástricos y un alto nivel de tolerancia a este alimento.

    Lo más aconsejable es consumirla por la mañana. Tomar una naranja a primera hora del día te aportará una buena dosis de vitamina C y fibra.

    Siempre es recomendable tomar la fruta directamente y evitar los zumos, aunque sean naturales. De esta forma nos sentiremos más saciados y añadiremos más fibra y menos azúcares a nuestra dieta.

    Además, la acidez de las naranjas que podría perjudicarnos por la noche es perfectamente tolerable por la mañana incluso si la tomamos en ayunas. De esta forma, podremos ir asimilando sus propiedades durante todo el día.

    Estas frutas tienen un gran efecto antioxidante. Además, su gran contenido en vitamina C es un refuerzo inigualable para el sistema inmunológico y ayuda a combatir la anemia. También es un remedio ideal para tratar los resfriados y las gripes.

  • New: Por qué no vale con quitar la parte del moho de los alimentos.

    Artículo

Drawing

Other