Pierre Couy's tech corner

Posts

  • Mitosis in the Gray-Scott model : writing shader-based chemical simulations

    08 Sep 2024 in Simulations . Tags : shader , simulation , emergence , scientific programming

    The Gray Scott Model of Reaction Diffusion is an interesting instance of emergence. By simulating a small chemical system that involves only a few components and reactions, complex and mesmerizing patterns appear.

    You can interact with the simulation above by clicking on it to drop some green and you can reset it by pressing the previous (⏮️) button.

    Although the local rules and the underlying math are quite simple, there is some heavy computations involved. For each time step in the simulation, we must apply these rules to compute the concentrations of every involved component at every possible location. Running such a simulation on a CPU would be extremely slow. GPUs, however, are specifically built to handle large volumes of a single small computation in parallel.

    This post is an introduction to writing such simulations using GLSL ES, with a basic implementation of the Gray Scott model that runs in the browser on Shadertoy that is less than 100 lines of code.

    Read more...
  • Increase privacy by using nginx as a caching proxy in front of a map tile server

    30 Aug 2024 in Server admin . Tags : linux , nginx , tutorial , privacy , selfhosting

    If you are self-hosting any service, chances are that you care about increasing your privacy by minimizing your reliance on third-party services. If this is the case, you may be bothered when an application you are hosting relies on such third-parties. This can be the case when some features are too resource intensive for personal servers.

    One example of this is map tile servers, which are relied upon for map features in a variety of software, such as Immich (awesome Google Photos replacement !). Such tile servers host a whole world map at several zoom levels, and provide clients with map fragments (tiles) for the requested coordinates and zoom level. Unfortunately, it is not easy to host such a tile server : the easiest solution I could find still requires more than 100GB of disk space to serve a full world map. On the other hand, using a third party for this makes clients send a bunch of requests to them. These requests will give the third-party details about any location viewed on the map. It will also generally include other informations, such as the URL you’re viewing the map from and clients IP addresses.

    This article will show how to build a caching reverse proxy in order to mitigate these privacy concerns while avoiding the need to host more than 100GB of map data. As a concrete application, the caching proxy will then be used as a tile provider for an Immich instance.

    Read more...
  • Using a Raspberry Pi to add a second HDMI port to a laptop

    11 Mar 2023 in Tinkering . Tags : raspberry-pi , ffmpeg , tutorial , linux

    Recently, I purchased a new laptop. I was really focused on spending the least amount of money and had not noticed that the laptop I chose was missing an essential feature : it did not have Display Port over USB C. Not being able to use my second external monitor on this new laptop felt like a huge downgrade from my previous one (which was able to output to both its HDMI and VGA ports simultaneously).

    This is the story of how I managed to overcome this limitation by rolling my own virtual screen streaming solution using a Raspberry Pi. I tried to write it in a way you can follow along if you want to reproduce it. If you are just looking to get it up and running as quick as possible, you can check out the GitHub repository containing configuration files and installation scripts (Work In Progress)

    You will find a short video showcasing the result at the end of this article.

    Read more...