Windows: one reboot a month. Linux: 2,601 days of uptime

Top: Microsoft's support page "One restart a month for Windows updates" (KB5121772, shown in French). Bottom: a terminal where the uptime command prints: up 2601 days, 22:04, 12 users, load average: 0.74, 0.64, 0.53

The whole post fits in this one screenshot.

Up top: an official Microsoft support page, KB5121772, titled with a perfectly straight face “One restart a month for Windows updates” (in French here, but the English page says the same thing). Right below it, a Copilot panel kindly offers to help me… restart sooner, pause updates for up to 35 days, or set my “active hours” so Windows Update will graciously refrain from rebooting me mid-afternoon.

At the bottom, my terminal:

$ uptime
 06:49:06 up 2601 days, 22:04, 12 users,  load average: 0.74, 0.64, 0.53

2,601 days, a little over seven years without a reboot. 12 open sessions, load average under 1, and it just keeps going.

Microsoft’s “big news”

In March 2026, Pavan Davuluri, head of Windows + Devices, published a long memo on Windows’ priorities for the rest of the year: performance, reliability, craft. On the list: a taskbar you can finally move, a fixed Start menu, a bit less AI everywhere… and a Windows Update that would only restart your PC once a month.

Promise kept. KB5121772 explains that, starting with updates released on or after July 28, 2026, Windows 11 (24H2, 25H2 and 26H1) holds back driver, .NET and firmware updates that need a restart, then installs them all together with the monthly security update on Patch Tuesday (the second Tuesday of the month). One reboot to rule them all.

The tech press cheered. Read again what they’re cheering for, though: before, each kind of update could ask for its own restart, any time in the month. Now they’re batched. That’s the progress.

Picture a carmaker announcing: “Great news: your engine will only stall once a month from now on, and we’ve moved all the stalls to the second Tuesday.”

Seven years is how many Patch Tuesdays?

Going by that uptime, this machine booted around October 18, 2019. For perspective:

  • Windows 7 was still supported (it had three months left).
  • Windows 11 didn’t exist yet: it shipped in October 2021.
  • Windows 10 reached end of support (October 2025) while this box was still running.
  • Nobody outside epidemiology used the word “lockdown”.

Since that boot, there have been 85 Patch Tuesdays. In Microsoft’s best-case 2026 world, where everything is neatly batched and nothing goes sideways, a Windows PC would have restarted at least 85 times. In the real world, with out-of-band fixes, GPU drivers, annual feature updates and the surprise “Restart required” at 9:02 a.m. right before a meeting, you can easily double that.

Here: zero.

Why Windows needs to reboot (and Linux doesn’t)

The explanation is technical, and it goes back decades.

On Windows: a file in use is locked

On Windows, as long as an executable or DLL is loaded by a process, you can’t overwrite or delete it. So there’s no way to swap out ntdll.dll, a driver or a core system component while it’s running. The installer drops the new files alongside the old ones, records the pending swaps in the registry (the PendingFileRenameOperations value under HKLM\SYSTEM\CurrentControlSet\Control\Session Manager), and the Session Manager does the replacement at the next boot, before anything else gets loaded. Hence the reboot, and the “Don’t turn off your PC” screen while your coffee goes cold.

On Linux: a filename is just a label

On Linux (and Unix in general), a filename is just a directory entry pointing to an inode, the actual file. When apt or dnf updates a library, it writes the new version to a temporary file, then renames it over the old one with an atomic rename(). The name now points to the new file.

And the programs that were using the old version? They keep running with it, none the wiser: the old inode stays alive as long as a process holds it open or mapped in memory. New processes load the new version. Nothing crashes.

Here’s a quick demo in Python:

import os

with open("demo.txt", "w") as f:
    f.write("old version\n")

prog = open("demo.txt")              # a "program" keeps the file open

with open("demo.tmp", "w") as g:
    g.write("new version\n")
os.replace("demo.tmp", "demo.txt")   # atomic rename(), just like apt or dnf

print(prog.read())                   # old version
print(open("demo.txt").read())       # new version

On Linux, it happily prints both versions. On Windows, os.replace() raises a PermissionError: the file is open, hands off.

Once the packages are updated, all that’s left is restarting the affected services, one at a time, whenever you choose:

# Debian / Ubuntu: which services are still using old libraries?
sudo needrestart

# Fedora / RHEL: is a full reboot actually needed?
sudo dnf needs-restarting -r

# List deleted files that are still open
sudo lsof +L1

# Restart only what needs restarting
sudo systemctl restart nginx

What about the kernel?

The kernel is another story (someone will bring it up in the comments anyway): it can’t be swapped out like a library. To run a new kernel, you have to reboot… or use live patching (kpatch from Red Hat, Livepatch from Canonical, kGraft from SUSE, all of which now build on the livepatch infrastructure that has been in the mainline kernel since 4.0) to fix critical vulnerabilities directly in memory. And when you really do want to reboot, kexec lets you skip the whole BIOS/UEFI stage.

And yes, 2,601 days of uptime also means the kernel in memory dates from October 2019. On an internet-facing box without live patching, that wouldn’t be smart, and I’m not suggesting you make it a contest. But here’s the real difference:

On Linux, the admin decides when to reboot. On Windows, Redmond does.

I update when I want, restart services when it suits me, and reboot on the day I pick. No countdown, no “active hours” to negotiate with my own computer.

“But Windows has hotpatch!”

Yes, Microsoft offers hotpatch: security updates applied without a restart. Good. Except it’s limited to Enterprise and Server editions, with the matching licenses and management tooling. And even then, every quarter starts with a “baseline” month that requires… a restart. So, at best, four reboots a year. Over seven years: 28. Still 28 more than zero.

Conclusion

Well done, Microsoft: in 2026, Windows has learned to bother you only once a month. That’s better than before, I’ll give you that. But selling “one reboot a month” as progress mostly shows how low the bar was.

Meanwhile, right below it on the same screenshot, my Linux box shows up 2601 days and never asked anyone’s permission.

What’s your record? Paste your uptime in the comments.

Anthropic Quietly Slashes Claude Allowances Without Warning: User Backlash Grows

Anthropic has stealthily adjusted usage caps for Claude subscribers, mechanically throttling service capacity during peak hours to balance demand against available resources. The announcement, though significant, was slipped out on March 26, 2026, by Thariq Shihipar, an engineer on the technical team, via a casual post on X — far from official channels, which sharpened the irritation of many customers.
What Actually Changes
During peak hours (5 AM to 11 AM Pacific Time, or 1 PM to 7 PM GMT, weekdays), the token cost per session climbs, meaning the five-hour allowance burns through faster than real activity time. Conversely, weekly caps remain untouched — only the distribution across the seven-day window shifts.
Who Takes the Hit
Roughly 7% of users will now bump into limits they wouldn’t have previously reached. Pro subscribers bear the brunt. Max 20x plan holders largely escape unscathed, with only about 2% of that tier affected. The impacted tiers are: Free, Pro ($20/month), Max 5x ($100/month), and Max 20x ($200/month). API customers, billed per token, are exempt from this measure.
The Weight of Context
Claude has racked up millions of users after OpenAI’s Pentagon contract triggered a mass boycott — 295% spike in ChatGPT uninstalls in a single day, 2.5 million participants in the QuitGPT movement. Meanwhile, the rise of agentic features (vibe-coding, “computer use”) means flat-rate subscribers now consume far more tokens than before, while AI providers struggle to keep pace.
Legitimate Grievances
The opacity has drawn sharp criticism. Numerous users condemn the lack of advance notice, arguing that substantial service limit changes deserved early, formal announcement. The news was quietly posted by an engineer on social media rather than through an institutional account or Anthropic’s website.
The facts reported here are corroborated by The Register, PCWorld, TechRadar, gHacks Tech News, and several other specialized sources.

How to Use Hyperfine. Example: Compare the Performance of rg and ag

How to Use Hyperfine to Compare the Performance of rg and ag

What is Hyperfine?

Hyperfine is a command-line tool that allows you to measure and compare the performance of other commands. It is particularly useful for evaluating the execution speed of different commands or scripts, providing detailed statistics such as average time, standard deviation, and execution time range.

Introduction to rg (ripgrep)

Ripgrep, often abbreviated as rg, is an ultra-fast text search tool. It is designed to quickly scan files and directories for specific patterns. Ripgrep is known for its speed and its ability to ignore irrelevant files, such as those in .git or node_modules directories.

Introduction to ag (The Silver Searcher)

The Silver Searcher, or ag, is another text search tool, similar to ack, but faster. It is optimized for searching within code projects, automatically ignoring irrelevant files and directories. Although it is fast, it is often outperformed by rg in terms of performance.

Performance Comparison with Hyperfine

To compare the performance of rg and ag, we can use Hyperfine with the following command:

hyperfine --warmup 3 'rg -i "Olivier" -g "*php*" .' 'ag -i "Olivier" -G "php"'

The results show that rg is significantly faster than ag:

  • rg has an average execution time of 256.6 ms.
  • ag has an average execution time of 910.3 ms.

In summary, rg is approximately 3.55 times faster than ag in this scenario.

Why Use rg Instead of ag?

The comparison conducted with Hyperfine clearly demonstrates that rg outperforms ag for text searching. If speed is an important criterion for you, rg is therefore an obvious choice. Additionally, rg offers better handling of ignored files and smoother integration with modern development tools.

In conclusion, if you are looking for a fast and efficient text search tool, rg is an excellent option, especially when working on large-scale projects where every millisecond counts.

Automating Git Branch Cleanup with an Alias: A Practical Guide

Automating Git Branch Cleanup with an Alias: A Practical Guide

Working with Git often involves managing multiple local and remote branches. Over time, remote branches may be deleted, leaving behind obsolete local branches. To simplify the cleanup process, you can create a Git alias that automates this task. In this article, we’ll show you how to set up this alias and discuss its pros and cons.

Creating a Git Alias to Clean Up Local Branches

Here’s the command to create a Git alias named prune-all that automatically cleans up obsolete local branches:

git config --global alias.prune-all '!git fetch --prune && git branch -vv | grep ": gone]" | sed "s/^[[:space:]]*\([^[:space:]]*\).*/\1/" | xargs -r git branch -d'

Once this alias is set up, you can simply run:

git prune-all

This command will:

  1. Update local references and remove deleted remote branches (git fetch --prune).
  2. Identify local branches that no longer have a corresponding remote branch (git branch -vv | grep ": gone]").
  3. Extract the names of these branches (sed).
  4. Delete the local branches (xargs -r git branch -d).

Why Use This Alias?

This alias offers several advantages:

  • Time-saving: No need to manually run multiple commands to clean up local branches.
  • Automation: The process is fully automated, reducing human error.
  • Repository Cleanliness: Keeps your local repository clean and in sync with the remote repository.

Precautions to Take

While this alias is very useful, it’s important to understand its limitations and potential risks:

  • Using git branch -d: The alias uses git branch -d to delete local branches. This means Git will refuse to delete a branch if it contains unmerged commits. This is a safety measure to prevent losing work.
  • Risk of Accidental Deletion: If you use git branch -D (with an uppercase D) instead of -d, branches will be force-deleted, even if they contain unmerged commits. Be cautious if you modify the alias to use -D.
  • Manual Verification: Before running the alias, it may be helpful to check which branches will be deleted by running:
git fetch --prune && git branch -vv | grep ": gone]"

When to Use This Alias?

This alias is particularly useful in the following scenarios:

  • You’re working on a project with many branches and want to keep your local repository clean.
  • You’re collaborating with a team, and remote branches are frequently deleted after merging.
  • You want to automate a repetitive task to save time.

Conclusion

Creating a Git alias to clean up local branches is an excellent way to automate a tedious task and keep your repository tidy. By using git branch -d, you add a layer of safety to avoid losing unmerged work. However, be aware of the risks if you decide to use git branch -D instead.

Feel free to try out this alias and adapt it to your needs. Happy branch management!

Have questions or suggestions? Leave a comment below!

Black Screen – A Simple Yet Useful Tool

Black Screen – A Simple Yet Useful Tool

I recently added a simple but practical feature to my website: a “Black Screen” page accessible at olivierpons.fr/black-screen.

What is it?

It’s simply a completely black web page with no interface elements or visible content. It’s designed to display a pure black screen that occupies your entire browser window.

What is it for?

This page can be used in several practical situations:

  1. Presentations and conferences: To pause between slides or temporarily hide your screen.
  2. Energy saving: A black screen consumes less energy on OLED/AMOLED displays.
  3. Brightness reduction: In a dark environment, when you need a minimal light source.
  4. Display testing: To check for light leaks or black quality on your screen.
  5. Meditation or focus: Eliminate visual distractions during a focus session.

How does it work?

Technically, it’s a simple static HTML page with a black background that occupies 100% of the screen and disables scrolling. It’s served directly by Nginx without going through WordPress.

This solution was implemented with the help of Claude, Anthropic’s AI assistant, who guided me through the Nginx configuration and the creation of the appropriate HTML file.

Feel free to use it whenever you need it—it’s a modest tool but one that can prove surprisingly useful!

Delete the oldest files from a folder as long as it exceeds a certain size


Samples

Note that you have to launch using “source“

  • Delete the oldest files in the current folder (./) as long as it takes up more than 96MB:
    source ./clean_custom.sh --path ./ -l 9600000
  • Delete older files from temporary folder (/tmp/) as long as it takes more than 2GB:
    source ./clean_custom.sh --path /tmp/ -l 2000000000

Script source code

#!/usr/bin/env bash                                                              
PATH_TO_CLEAN=                                                                   
NUMBER_FILES_TO_DELETE_EACH_LOOP=1                                               
SIZE_LIMIT=2000000000                                                            
                                                                                 
# ----------------------------------------------------------------------------   
# usage:                                                                         
usage()                                                                          
{                                                                                
    echo "Clean directory: while size of a dir > limit, oldest files first."
    echo "Usage: ${filename} [-p|--path path] [-s|--max-size size] | [-h]"
    echo "    -p|--path: path to clean"            
    echo "    -l|--limit: max size for the folder (must be > 0)"
    echo "    -h|--help this help"                 
}                                                                                
                                                                                 
# ----------------------------------------------------------------------------   
# handling arguments:                                                            
args=("$@")                                                            
filename=$(basename -- "$0" | sed 's/\(.*\)\..*/\1/')        
while [ "$1" != "" ]; do                                     
    case $1 in                                               
        -p | --path ) shift              
                      # stop if path doesn't exist:
                      if [ ! -d "$1" ]; then
                          echo "Path not found: '$1'"
                          usage
                          return 1
                      fi
                      PATH_TO_CLEAN=$1
                      ;;
        -l | --limit ) shift             
                       SIZE_LIMIT=$(echo $1 | bc)
                       if [ $SIZE_LIMIT -le 0 ]
                       then
                           usage
                           return 1
                       fi
                       ;;
        -h | --help ) usage              
                      return
                      ;;
        * ) usage                        
            return 1 
    esac                                                     
    shift                                                    
done                                                                             
[ -z "$PATH_TO_CLEAN" ] && echo "Path empty" && usage && return 1
echo "Cleanin dir: '$PATH_TO_CLEAN', size limit=$SIZE_LIMIT" 
# ----------------------------------------------------------------------------   
# handling arguments:                                                            
while [ 1 ]                                                                      
do                                                                               
    s=$(du -sb $PATH_TO_CLEAN | cut -f1 | bc)                
    if [ $s -gt $SIZE_LIMIT ]                                
    then                                                     
        find $PATH_TO_CLEAN -type f -printf '%T+ %p\n' | \
            sort -nr | \
            tail -$NUMBER_FILES_TO_DELETE_EACH_LOOP | \
            cut -d' ' -f 2- | \
            xargs -I {} rm -f {}
    else                                                     
        break                            
    fi                                                                                                                                                                                                                                                      
done                                                                             
return 0

Django scripting: “AppRegistryNotReady: Apps aren’t loaded yet” solution!

If you want to make a simple script that wants to import your application built on top of the Django framework, you would probably do this code:

import django
from app.models import MyModel

You will probably get this error:

django.core.exceptions.AppRegistryNotReady: Apps aren't loaded yet

.

Don’t panic!
The solution is to run your application’s setup() before imports, as follows:

import django

if __name__ == '__main__':
    django.setup()
    # import AFTER setup
    from app.models import MyModel
    # from now I can access MyModel!!

Python: compile and run multiple versions without collisions

You have to go find the source code for the Python version that you want.

Example, run an “old” Python 3.6, go here and take the one that we want.

Then get the source code and compile it:

mkdir ~/source ; cd ~/source
wget https://www.python.org/ftp/python/3.6.13/Python-3.6.13.tar.xz
tar xvf Python-3.6.13.tar.xz
cd ~/source/Python-3.6.13
./configure && make
sudo make altinstall

“Et voilà”!

~/source/Python-3.6.13$ python3.6
Python 3.6.13 (default, May 21 2021, 17:12:12) 
[GCC 9.3.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>>

Asynchronous Python TCP server. And its C# Unity client!

Two very short examples to get you started, which send and receive “pure” binary = very little bandwidth, with a persistent connection.

Here are two send-receive samples which should allow you to do all your binary sendings:

  1. C#: the client sends a byte, which corresponds to a boolean, to say if it is in big or little endian;
  2. C#: the client sends a message encoded in UTF-8 (yes I found the solution that works!);
  3. Python: the server reads this boolean;
  4. Python: the server reads the message and says it (under Windows only, remove the code if you’re under Linux);
  5. Python: the server sends an unsigned integer, then two floats;
  6. C#: the client reads the unsigned integer then two floats.

With that, you have enough to understand and make all the streams you want!

Asynchronous TCP Python server

import asyncio
import struct
from asyncio import StreamWriter, StreamReader
import pythoncom
import win32com.client as win32_client
HOST = '192.168.1.31'
PORT = 9696
async def handle(reader: StreamReader, writer: StreamWriter):
    is_little_endian = False
    buffer = bytearray(100)
    addr = writer.get_extra_info('peername')
    print(f"Connected with {addr!r}")
    is_little_endian, = struct.unpack_from(
        '?', await reader.read(struct.calcsize('c'))
    )
    print(f'{is_little_endian=}')
    data = await reader.read(4096)
    message = data.decode('utf8')
    pythoncom.CoInitialize()
    speak = win32_client.Dispatch('SAPI.SpVoice')
    speak.Speak(message)
    print(f"Received {message!r} from {addr!r}")
    print(f"Send: {message!r}")
    float1 = 1.1
    float2 = 2.2
    struct.pack_into(
        # =: native order, std. size & alignment
        # H: unsigned short
        # f: float
        "=Hff",
        buffer, 0, 1, float1, float2)
    writer.write(buffer)
    await writer.drain()
    print("Close the connection")
    writer.close()
async def main():
    server = await asyncio.start_server(handle, HOST, PORT)
    print(f'Serving on {server.sockets[0].getsockname()}')
    async with server:
        await server.serve_forever()
asyncio.run(main())

C# Unity Client

using System;
using System.IO;
using System.Net.Sockets;
using UnityEngine;
public class Connexion : MonoBehaviour
{
    public string server;
    public string message;
    public ushort port;
    private void Start()
    {
        // working sample to send text:
        byte[] data = System.Text.Encoding.UTF8.GetBytes(message);
        byte isLittleEndian = BitConverter.IsLittleEndian ? (byte)1 : (byte)0;
        TcpClient client = new TcpClient(server, port);
        NetworkStream stream = client.GetStream();
        // Send the message to the connected TcpServer.
        stream.WriteByte(isLittleEndian);
        stream.Write(data, 0, data.Length);
        Debug.Log($"Sent: {message}");
        // read sample
        BinaryReader reader = new BinaryReader(stream);
        uint len = reader.ReadUInt16();
        var x = reader.ReadSingle();
        var y = reader.ReadSingle();
        Debug.Log("len=" + len);
        Debug.Log($"x={x}, y={y}");
    }
}

For the record, these two examples seem simple, but they took me a long time, and I had no answer after 3 weeks on stackoverflow…

Django: how to check if we are in debug mode in the template

You will find the information easily, and it seems very simple: in your template, just do:

{% if not debug%}I'm in debug mode!{% endif%}

This won’t work, this is not enough!

In your settings.py file, you must configure the IP’s correctly, which specify that you are / or not / in “development” mode:

INTERNAL_IPS = ['127.0.0.1',]

(Note that this code can be optimized in a way that depends on the environment, for example I made a settings.py which takes this into account).