Deblog

Get current host's local IP

June 24, 2023 | Tags: python networking TIL

Sometimes, when working in a private network, it can be useful to know the current host IP address. If you are in the Linux shell, it can be as easy as using ifconfig and get it from there. However, if you need it in your application or in a script or in a programatic way, it's better to use the socket module from the standard library.

[Read more]

Django SQLite Backup

May 29, 2023 | Tags: Django python sqlite AWS

SQLite is a great database. It is embeddable, very portable and great for read-only applications. However, since it is stored in a single file, it can be hard to manage it in production environments with ephemeral file systems as you will need another process to back it up for you. Sometimes, you do not have access to the file system directly, see Heroku or Render, for example.

[Read more]

Django Simple Analytics

Aug. 29, 2022 | Tags: python django open source

Few months ago, on this very website, I implemented a very simple analytics tool to check how many people went into my website. A few days ago, I decided to move this out of my website and into its own separate package.

[Read more]

Send UDP packets in python

Aug. 18, 2022 | Tags: python networking udp TIL

Not that it's terribly hard to do, but is one of these useful things to know anb be able to source. Using the sockets library is triivally easy if you know the parameters you need to use (and it's very well documented).

[Read more]
1 2