Whether you're developer, DevOps engineer, SysAdmin, QA or in any other technical role, you're surely familiar with
cURL - _the command line tool and library for transferring data with URLs_ (as described in docs).
...
Chances are that you never touched and maybe haven't even heard about Python's `weakref` module. While it might not
be commonly used in your code, it's fundamental to inner workings of many libraries, frameworks and even...
Learn how to use BuildKit - the improved builder backend for Docker - that adds many new features to Docker,
including new Dockerfile syntax, built-in debugger and more...
If you work in shell/terminal often enough, then over time the history will become your personal knowledge vault,
documentation and command reference. Being able to use this personal documentation efficiently can hugely boost your
...
All of us - software engineers - use git every day, however most people only ever touch the most basic of commands,
such as "add", "commit", "push" or "pull", like it's still 2005. Git however,...
Python has many options for formatting strings and text, including f-strings, `format()` function, templates and
more. There's however one module that few people know about and it's called `textwrap`. This module is...
Low indoor air quality - or high CO2 - negatively impacts cognitive performance, causes headaches, drowsiness and
more. It's easy to fix though, just use a CO2 sensor and open a window from time-to-time. But why stop there, when...
While Python's `bisect` module is very simple - containing really just 2 functions - there's a lot one can do with
it, including searching data efficiently, keeping any data sorted, and much more - and in this article we will...
Whenever I troubleshoot anything container-related, I look for a good container image that contains all the right
tools to troubleshoot and/or solve the problem. However, finding such an image, or assembling my own is time-consuming...
From time to time, when coding, we all run into weird behaviours of the programming language. Sometimes it's a
"feature" we weren't aware of, sometimes it's just quirky behaviour of the language, and sometimes...
Couple days ago, I published my 100th article, so I feel like it’s time for reflections — looking at how I got
there, what I learned along the way and whether it was actually worth the time and effort. As well as some thoughts on
...
There are certain bugs and issues that are very hard to troubleshoot. Just ask yourself, _"How would I debug
deadlock, segmentation fault, crashing application, or a hanging process?"
_ Now there's a tool to...
etcd is the brain of every Kubernetes cluster, the key-value storage keeping track of all the objects in a cluster.
It's intertwined and tightly coupled with Kubernetes, and it might seem like an inseparable part of a cluster, or...
Let's imagine a situation - you have multiple Python applications running on Kubernetes that interact with each
other. There's bug that you can't reproduce locally, but it surfaces everytime you hit a particular API...
Python is a popular choice for automating anything and everything, that includes automating system administration
tasks or tasks that require running other programs or interacting with operating system. There are however, many ways to
...
Python is 32 years old language, yet it still doesn't have proper, true parallelism/concurrency. This is going to
change soon, thanks to introduction of a "Per-Interpreter GIL" (Global Interpreter Lock) which will land in...
Python is known to come with "batteries included", thanks to its very extensive standard library, which includes
many modules and functions that you would not expect to be there. However, there are many more "essential"...
When it comes to synthetic testing, engineers often rely on 3rd party platforms such as Datadog or New Relic that
provide this type of monitoring. If you're running your applications and services on Kubernetes though, you can spin...
Running live demos can be stressful. You know what you want to say and show. You prepare the CLI commands you want
to run to best showcase what you've built, but then you waste time typing long commands; you make typos; the...
While Python is not a pure functional programming language, you still can do a lot of functional programming in it.
In fact, just one function - `reduce` - can do most of it and in this article I will show you all the things one can do...
Nowadays, Alpine Linux is one of the most popular options for container base images. Many people (maybe including
you) use it for anything and everything. Some people use it because of its small size, some because of habit and some,...
There's a lot of "magic" that happens behind the scenes to make whole Kubernetes work. One of those is resource
management and resource allocation done by Linux cgroups.
In this article we will take a deep...
Have you ever written a long chain of if/else statements or a huge match/case block, with all statements just
matching against a list of values, and wondered how could you make it more concise and readable?
If so, then...
Continuous profiling is a great tool for optimizing the performance of applications. It allows us to continuously
monitor and analyze application's resource usage, identify bottlenecks, and use resources more efficiently. In this...
We all are familiar with Python's generators and all their benefits. But, what if I told you that we can make them
even better by combining them with recursion? So, let's see how we can use them to implement _"lazy...
Python's magic methods - also known as _dunder_ (double underscore) methods - can be used to implement a lot of
cool things. Most of the time we use them for simple stuff, such as constructors (`__init__`), string representation
...
With what's happening at Twitter, many people are considering moving to Mastodon. Like Twitter, Mastodon also
offers an API that can be used to create many useful application, bots, to analyze data, respond to notification or...
Kubernetes v1.25 introduced Container Checkpointing API as an alpha feature. This provides a way to
backup-and-restore containers running in Pods, without ever stopping them.
This feature is primarily aimed at forensic...
Google has literally hundreds of APIs, including ones for Gmail, Drive, Maps, Translation, Analytics and more. All
of these share the same concepts like authorization, pagination or media uploads/downloads. In this article we will...
Out-of-the-box, Python standard library ships with many great libraries some of which provide commandline interface
(CLI), allowing us to do many cool things directly from terminal without needing to even open a `.py` file.
...
Python provides a lot of ways to ask questions about your code. Whether it's basic things like `help()` function,
builtin functions like `dir()` or more advanced methods in `inspect` module - the tools are there to help you find...
Every Python developer is familiar with the `self` argument, which is present in every* method signature of every
class. We all know how to use it, but do you _really_ know what it is, why it's there and how it works under the hood?
Python's list comprehensions (and generators) are an awesome feature that can greatly simplify your code. Most of
the time however, we only use them to write a single `for` loop, maybe with addition of one `if` conditional and...
The assignment operator - or "walrus operator" as we all know it - is a feature that's been in Python for a while
now (since 3.8), yet it's still somewhat controversial and many people have unfounded hate for it.
...
The `match`/`case` syntax that got introduced to Python in 3.10 looks like basic `switch` statement which we all
know from other languages - in Python however - it's much more than just an alternative `if` syntax. So, let's...
With every Python release, there are new modules being added and new and better ways of doing things get
introduced. We all get used to using the good old Python libraries, but it's time say goodbye to `os.path`, `random`,
...
Scaling application on Kubernetes using _Horizontal Pod Autoscaler (HPA)_ based on their CPU or memory usage is
pretty simple. There are however many more features of HPA that you can use to customize scaling behaviour of your
...
As files, datasets and configurations grow, it gets increasingly difficult to navigate them. There are however many
tools out there, that can help you to be more productive when dealing with large JSON and YAML files, complicated...
We've all been there - it's frustrating seeing deletion of Kubernetes resource getting stuck, hang or take a very
long time. You might have _"solved"_ this using the terrible advice of removing finalizers or running...
In this article we take look at how you can leverage Kubernetes Python Client library to automate whatever annoying
Kubernetes task you might be dealing with, whether it's creating/patching resources, watching events, accessing...
Monitoring is usually at the end of a checklist when building an application, yet it's crucial for making sure that
it's running smoothly and that any problems are found and resolved quickly.
Building complete...
With the recent events relating to _Google Analytics_ platform, it's becoming very clear that the time has come for
many of us to migrate from Google Analytics to different platforms.
In this article we will go over...
Formatted string literals - also called _f-strings_ - have been around since Python 3.6, so we all know what they
are and how to use them. There are however some facts and handy features of f-string that you might not know about. So,
...
Every project can benefit from a robust continuous integration pipeline that builds your application, runs tests,
lints code, verifies code quality, runs vulnerability analysis and more. However, building such pipeline takes a...
When it comes to performance optimization, people usually focus only on speed and CPU usage. Rarely is anyone
concerned with memory consumption, well, until they run out of RAM. There are many reasons to try to limit memory usage, not
...
Before any new feature, change or improvement makes it into Python, there needs to be a _Python Enhancement
Proposal_, also knows as PEP, outlining the proposed change. These PEPs are a great way of getting the freshest info about
...
We all spend a good chuck of our time debugging, sifting through logs or reading tracebacks. Each of these can be
difficult and time-consuming and in this article we will focus on making the last one - dealing with tracebacks and
...
If you're using GitHub as your version control system of choice then GitHub Apps can be incredibly useful for many
tasks including building CI/CD, managing repositories, querying statistical data and much more. In this article we...
Profiling is integral to any code and performance optimization. Any experience and skill in performance
optimization that you might already have will not be very useful if you don't know where to apply it. So, in this article we
...
Making sure your application running in Kubernetes is available and ready to serve traffic can be very easy with
_Pod_ liveness and readiness probes. However, not all application are built to be able to use probes or in some cases
...
Google Analytics can provide a lot of insight into traffic and about users visiting your website. A lot of this
data is available in nice format in web console, but what if you wanted to build your own diagrams and visualizations,
...
Building images in CI/CD pipeline can be quite different from builds on local machine. One major difference is
availability of cache. In the local environment you most likely have all the resources, dependencies and image layers...
As your cluster grows, so does the number of resources, volumes or other API objects and sooner or later you will
reach the limits somewhere. Whether its `etcd`, volumes, memory or CPU. Why subject yourself to unnecessary pain and...
Almost every application requires some form of authentication, password handling or use of secure credentials such
as API keys. You might not be security expert, but you should know how to deal with all of these securely to keep your
...
kubectl is powerful tool that allows you to perform literally any and all Kubernetes-related tasks. Some of these
common tasks however, can be quite clunky or might include many steps that might take considerable time to perform. In...
Whether it's basics like `tar` and `zip`, specific tools or formats such as `gzip` and `bz2` or even more exotic
formats like `lzma`, Python standard library has it all. With all these modules and options, deciding what might be...
Docker containers are not inherently secure as many people think. So, it's crucial use tools and scanners like
Anchore or Clair to rid your containers of vulnerabilities.
Whether you are working on some machine learning/AI stuff, building web apps in Flask or just writing some quick
Python script, it's always useful to have some template for your project that satisfies all your needs, namely:...