---
navigation: true
title: Python Scripts
main:
  fluid: false
---
:ellipsis{left=0px width=40rem top=10rem blur=140px}
# Python Scripts

My messy Python creations

## 🤖 Nvidia Stock Bot
---

For the past four years, the electronics hardware shortage has been relentless. Graphics cards are no exception. In 2020, I had to wait two months to get my RTX 3080. To manage it, I joined [JV Hardware](https://discord.gg/gxffg3GA96), where a small group of geeks had set up a bot that pinged users when GPUs became available.

Four years later and with 5,000 members on the server, the RTX 5000 series is being released. Yet, no working stock bot seems to exist. Not to mention a certain “influencer” who charges users for access to a bot that doesn’t even work. He manually copies alerts from other servers like ours, which have already solved the issue.

Anyway, eager to get an RTX 5090 for my AI-dedicated machine, I decided it was time to dive into Python—with a little help from ChatGPT. Along with another member, KevOut, who helped guide me through the APIs and initial architecture, I ended up building a clean and functional bot that sends different kinds of Discord alerts—all deployable in a simple Docker container.

After many setbacks, I went from this:

![Nvidia Stock Bot Old](/img/nonsense/nvidia-stock-bot-old-en.svg)

To this:

![Nvidia Stock bot](/img/nonsense/nvidia-stock-bot-en.svg)

And more recently :

![Nvidia Stock bot](/img/nonsense/nvidia-stock-bot-en-v4.svg)

And I was also lucky enough to be referenced in the famous [selfhost newsletter](https://selfh.st/weekly/2025-07-11/) !

More info directly on the repo:

::card
#title
  🐋 __Nvidia Stock Bot__
#description
  [Nvidia GPU stock alert bot](https://git.djeex.fr/Djeex/nvidia-stock-bot)
::

## 🤖 Adguard CIDRE Sync
---

Adguard Home is a fantastic solution for DNS-level ad blocking and rewriting requests—perfect for removing ISP DNS trackers or intrusive ads.

It works great locally, but if you want all your devices (even on the go) to benefit, you’ll need to expose Adguard to the internet. Unfortunately, that means anyone can use it, potentially overloading your €1/month remote VPS.

Adguard allows whitelisting or blacklisting clients. The problem? To whitelist a client, you need their IP—but for mobile phones, that IP changes often. Instead of trying to whitelist ever-changing IPs, the better approach is to block broader IP ranges by region.

CIDRE is a tool that syncs geo-targeted IP ranges with firewalls. Instead of running CIDRE with a full firewall stack on the remote server, I figured I could just import those regularly updated IP ranges into Adguard’s blocklist.

Thus, Adguard CIDRE Sync was born: a container that syncs Adguard’s blocklist with CIDRE’s updated IP ranges on a schedule of your choosing.

The idea is to:
- Backup Adguard’s config file on first run (original untouched version saved)
- Download selected country IP ranges via an environment variable
- Let you manually add custom IPs via a file
- Concatenate, backup the config again (as the updated version), and inject the list into the correct blocklist section
- Reload Adguard by restarting the container (using Docker socket proxy for limited permissions)

All fully autonomous, with frequency set via environment variable in the `docker-compose` config.

More info directly on the repo:

::card
#title
  🐋 __Adguard CIDRE Sync__
#description
  [Adguard blocklist sync bot](https://git.djeex.fr/Djeex/adguard-cidre)
::