RSSAmplifier

Blog

Blog

overtag.dkRSS feed ↗30 posts

Latest posts

Running Pre-commit in Docker

Make your "pre-commit" command run in a Docker container and reduce attack surface on your development system! You probably know pre-commit which is a super-popular way to automatically install and run the required linters of a Git repository. It'll fetch all the required software and run it from an isolated environment, such as a virtual environment or a node environment. Only problem: It's not…

A primer on Django project structure

Here's an example recipe for a Django project layout: src/ apps/ users/ project/ settings/ templates/ asgi.py, urls.py etc.. manage.py tests/ pyproject.yaml That's the basic layout we're going to discuss now. But if you want to get started quickly, try running the prototype startproject.sh command that will bootstrap the above, with your project name as the parameter (source: Codeberg repo ). And…

A Venn diagram of Open Source governance

Duplicate form submissions and how to handle them in Django

Let's have a look at duplicate form submissions , understand the problem and fix it with a nice server-side solution. It's a common problem that almost always needs to be addressed - whether you are building HTML-over-the wire or a backend/frontend architecture, you will have the same issues: User clicks the same button twice. User navigates back and re-submits a form that we already processed.…

Code globally, meet locally

I recently shared initial thoughts around Local conferences: Big potential! In this follow-up blog post, I want to share practical information on the specific format that we've been organizing Django Day Copenhagen around -- aaaand finish with some good old motivation 🥕️ With a practical focus, I hope that the blog post can make people consider for real that doing a small local conference is…

A settings pattern for reusable Django apps

Local conferences: Big potential!

Incoming blog posts!

Versioning your Python project for Debian

Version numbers matter! Using a consistent version numbering throughout your project's life matters, too. Changing project name is a high price to pay for cleaning up version errors. So there's some good news! The Python community's PEP-440 specifies how to use versions. Here are some examples of versions that abide PEP-440, they are in order !! 0.1.dev1 - Our first release, just playing around.…

Why I work for Learning Equality

Opinions and motivations of a tech-skeptical software developer @ an NGO working in education Building a future with equal access to learning opportunities (via technology!) is a long and winding road: We need to consider sustainable scenarios for our technology and face up to true challenges — not be tempted by hype or simple fixes. Anecdotes from when things were easier About a decade ago, when…

Blogging in Django: Zinnia or Wagtail-Blog?

Simple answer: If you're already running Wagtail or planning to run it on your site, you'll probably benefit from an integrated blog like wagtail_blog . It may not be full of features in itself, but since Wagtail is, you can easily go where you want. I'm adding support for custom models to wagtail_blog , and after that, the blog system is IMO flexible enough for most subsequent scenarios. I'm also…

Suspend using your own custom timing - unlike screen savers

I fail to use automatic standby because: I often switch off automatic power saving and screen savers and forget to switch them back on In many cases, it's disturbing unattended processes like downloading Often defaults to not being active while in docking station or charger So you might fall asleep in front of a movie. Or you might go out and forget your laptop. Basically, if I for instance don't…

Software development without LLMs: A methodology and a reasoning

As experiences gather up and technology improves, there are more and more evaluations and strategies coming in - all about when and why to use this data-center-driven LLM technology. A lot of decision-makers have already jumped aboard the AI/LLM train. Maybe you're one of them - and I kind of hope so, because this blog post is for you! My departing point for everything here is this: For the sake…

Making decisions in teams

It's easy to feel joy of building and crafting your own software. Seeing the results, knowing that "I did it". Maybe someone else will notice, too, and tell you about the great work that you did. We all have agency and motivation - and we're all equals and equally different. Sure, some are more experienced than others and will say something correct more often. Someone will have more power, and…

A primer on Django app design

In this follow-up to A primer on Django project structure , we're gonna look at the layout of individual Django apps. In the former topic, I went as far as to define a basic, universal project layout and also intended to fuel a discussion about templates, tutorials and the recent django new command. But this blog post is more an introduction to operating your Django project once you start filling…

Deploying Django on a VPS

Containerizing applications comes with its own set of issues, but in a world where application and cloud platforms are pretty much the norm, it feels like we have to argue the case of using a VPS (virtual private server) in terms of its advantages. The tables have turned, so rather than argue why to containerize our applications, it seems like we need a little reminder about the advantages of a…

Why I worked in the Danish public sector and stopped

How to actually install Node-js on Debian/Ubuntu

This post is: A rant and The simple instructions The tl;dr rant In order to install Node.js, you should execute a 330 line shell script directly from their servers. It's done this way such that the end user doesn't have to understand what's going on, and such that strange edge cases from old systems can be automatically fixed. This is part of a larger trend of piping unread/unverified contents…

Taking back Firefox from the Internet

Firefox wants to connect to quite a lot of services. And it's highly recommended to read the article How to stop Firefox from making automatic connections , in which Mozilla explains and discloses a lot of these. The article gives an impression of how contemporary software developers perceive their authority or privilege to access the user's Internet connection and whatever environmental footprint…

Debricking OpenWRT on TP Link AC1750 Archer C7 v2.0 via TFTP

This is a little guide for people using Ubuntu who've bricked a router like mine. References: OpenWRT wiki: TP-Link Archer C5 AC1200 / TP-Link Archer C7 AC1750 / TP-Link TL-WDR7500 Installing a TFTP server for OpenWRT on Ubuntu Prerequisites: A workstation running Ubuntu Trusty+ (the tftp server is ancient, so no worries about the Ubuntu version) A router Wireshark for debugging Flashing the…

Debating Internet.org

[also brought on FAIR Denmark ] Facebook has launched Internet.org, maybe a solution that will provide internet access to lots of people who need it? In this post, I'll explain what I think about it, because certainly it doesn't seem like a project we can just ignore. Others are also discussing the issue , and already a group of 65 international organizations have signed a letter with lots of…

Regenerating Shotwell thumbnails

When reinstalling, upgrading or moving settings, thumbnails may be missing in Shotwell. The problem can look like this: Each time you import photos, Shotwell will generate thumbnails in two different sizes. If you loose them, you have the problem that they are regenerated on-demand, everytime you scroll by an image. That stinks. Requirements You need to do apt-get install sqlite3 imagemagick to…

Nokia 301 on Wammu / Gammu

I had an older Nokia and got a new one which I needed to upload my phone book to. In order to connect to Nokia 301 from Gammu, plug the phone in with a USB cable and select the "Modem" option on the phone. The others won't work. Wammu is a GTK frontend to Gammu. You can use for various tasks, but I found that restoring my backup through Wammu failed (even though the file was created with Wammu),…

Ubuntu 14.04 Trusty with DNS server and NetworkManager (disabling dnsmasq)

I've badly been looking for a way to both run an internal network server on eth0 and connecting to any kind of internet device, be it on wlan0 or a USB dongle. That way, I can be online and browsing documentation, downloading new stuff etc. on the server but not depend on a static configuration but still use Network Manager for its intended purpose. In /etc/NetworkManager/NetworkManager.conf ,…

Ubuntu, Kickstart, preseeding, and Wireless (WLAN)

I have been trying to get an automated network install running. The starting point is a Kickstart (Kickseed) setup that works fine on LAN. Problem is: Computers do not do PXE netbooting from WLAN, and secondly that the debian installer was not configuring the network correctly. But the steps are very simple. Get mini.iso , basically the same kernel and initrd that the netbooter is running Put it…

Limiting choices in a ModelAdmin list_filter

So, you need to limit choices, because the list of related choices is too long? Then do NOT use limit_choices_to parameter on the ForeignKey! Why? Because you risk having options missing in your forms, deleting relations unknowingly. For instance, consider that you have the following case, expressed in pseudo code: ModelClass.related_instance = models.ForeignKey(MyRelatedModel, limit_choices_to =…

Testing and tracking down Warnings in Django

Warnings are often suppressed through many layers of control mechanisms in Python and Django. However, you should really be aware of these and clean them up once in a while! In other cases, the Warnings reflect an inconsistent state, such as if you are mixing naive and timezone-aware variables. It can be a real pain to track down RuntimeWarning because it doesn't leave a nice stack trace. The…

Django: Log and block brute force attempts

Here is a very simple mechanism for wrapping a decorator around your views to protect them against brute force attempts. For instance, if you have a secret file download available only with the right secret (/view/id/secret-hash/), you expose your view to simple brute force attempts. Simply put, this decorator will log a 404 response object or Http404 exception, count pr. IP and return status=400…

Share an internet connection: A nice little script for quickly getting the task done.

This script uses iptable forwarding and dnsmasq to share an internet connection with full relay of remote DNS servers and a local DHCP server. Before trying the script, here is the over all steps: You connect to the internet in your normal fashion. For instance with a 3G dongle and your network manager applet. Make sure that nothing is running on port 53, run netstat -tlnp to debug READ THE SCRIPT…

To Save Everything, Click Here: The Folly of Technological Solutionism

There is a new book coming up with a very remarkable abstract, to be released on March 5, 2013: In the very near future, “smart” technologies and “big data” will allow us to make large-scale and sophisticated interventions in politics, culture, and everyday life. Technology will allow us to solve problems in highly original ways and create new incentives to get more people to do the right…