Collectd is a system statistics collection daemon. It gathers a lot of information about the system it’s running on, and passes it on to a software that can process and visualize that information, e.g. Grafana. Collectd already brings along a lot of built-in plugins to gather information about the system load, the network traffic, available […]
Author: Danilo Bargen
Speeding Up Yaourt Package Installs
If you use the Yaourt package installer on Arch Linux, you’re probably aware of the long install times of certain large packages like android-ndk or chromium. The reason for this is the compression. The install process goes something like this: Download package Build package with makepkg Download sources Build package Compress package into a .pkg.tar.xz […]
Dynamic DNS Updates on FreeDNS from RouterOS
FreeDNS FreeDNS (https://freedns.afraid.org/) offers free DNS hosting for up to 5 subdomains. You can set up a domain like example.mooo.com and point it to any IP you want. I wanted to set up Dynamic DNS updates, so that a certain subdomain would always point to my (potentially changing) home IP. The setup on FreeDNS is […]
Fixing EFI Bootloader after Windows 10 Upgrade
(TLDR: bootctl –path=/path/to/esp-partition install) Besides my Arch Linux installation, I have a partition that runs Windows (primarily to play Age of Empires II). Today I upgraded to Windows 10, which – as expected – overwrote the EFI bootloader. This guide will work if you’re using either Gummiboot or systemd-boot. (Gummiboot was merged into systemd-boot, so […]
Overriding Default Arguments in Python
Sometimes you want to change the behavior of a function call in a Python test. Let’s assume you have the following code: # a.py from b import subfunc def func(): # do something subfunc(1, 2) # do something else # b.py def subfunc(a, b=1): # step1 # step2 # step3 You are testing the func […]
Rustaceans: Please Keep a Changelog!
I’ve been coding Rust during my free time for a few months now (mostly on the spaceapi server, the telegram groups bot and rpsrtsrs). Something I noticed lately is that very rarely projects keep a changelog or provide release notes. Is that perception true? Here is the list of the 10 most downloaded crates on […]
Programming a Perceptron in Rust
Two years ago, I wrote a blogpost about implementing a perceptron in Python that quite a few people liked. Nowadays I’m getting started with the Rust programming language, so after the big Rust 1.0 release today I thought it would be a good moment to do another post about implementing a simple perceptron, this time […]
Opbeat Release Tracking with Ansible
I recently discovered Opbeat. It seems to be a simple (and free/cheap) alternative to Newrelic, at least if you’re using Django. Opbeat supports release tracking (like Newrelic does, too). That means that your deployment setup can log all deployments together with the git revision number via the Opbeat API. That helps you to identify issues […]
Creating Django Oscar Initial Data Migration
I’m working on an online shop for our local hackerspace Coredump. To implement it, we chose django-oscar because I already know how to deal with Django and because it seems to be very customizeable. In the docs it is mentioned that every shop needs a product class and a fulfillment partner. The proper way to […]
Properly Defining SerializerMethodFields in DRF
I’m currently implementing a RESTful API with Django Rest Framework (a fantastic framework by the way). I’m mostly depending on the automatic serialization that a ModelSerializer provides. class ReportSerializer(serializers.ModelSerializer): class Meta: model = models.Report fields = (‘id’, ‘name’) But sometimes you need extra fields. In my case I wanted to add a readonly image_url field […]
Migrating from django-social-auth to python-social-auth
I recently ported an app with Google OAuth2 integration from django-social-auth to python-social-auth. Here are some things I noticed that were not mentioned in the porting docs. (Note: In the following text I will refer to django-social-auth and python-social-auth as DSA and PSA in order to keep my typing sanity.) Migrating Database Last week I […]
Profiling Pytest Tests
If you want to run a profiler over your pytest cases (including underlying code), the easiest way is to run pytest directly using cPython: python -m cProfile -o profile $(which py.test) You can even pass in optional arguments: python -m cProfile -o profile $(which py.test) tests/worker/test_tasks.py -s campaigns This will create a binary file called […]
First Tests with the Micropython Board
Micropython Micropython (https://micropython.org/) is an implementation of the Python 3 language for microcontrollers. While this might sound like a stupid idea at first (why use a high level garbage collected language on low level hardware?), the creator Damien George has put a great amount of effort into this project. And it’s safe to say that […]
Scrolling Text with RPLCD
The RPLCD Library Last year when I started playing around with HD44780 based character LCDs on the Raspberry Pi, I did not find any software library for it that I liked. There were some C++ libraries around and also some Python scripts, but they were a bit messy and not as clean and consistent as […]
Down the Tweet Chain Rabbit Hole
Today I stumbled over an apparently interesting tweet by @aendu: Tweet of aendu/433586683615784960 The link in the tweet points to another tweet: Tweet of madmenna/433585834193715200 And, as you may have guessed, this link points to yet another tweet. After about 20 levels deep I stopped clicking on the links and wrote a Python script instead: […]