Mocking static methods and built-in functions in PHP
Testing code that relies on static methods or built-in functions can be challenging in PHP. Traditionally, you’d have to refactor your code to inject dependencies or wrap functions in testable interfaces. To allow you to write clean, maintainable tests without invasive refactors, I created MintyPHP Mocking. It allows you to write things like: $mock = new StaticMethodMock(Adder::class, $this); $mock->expect('add', [1, 2], 3); $result = Adder::add(1, 2); $mock->assertExpectationsMet(); For mocking static methods, and: $mock = new BuiltInFunctionMock('App\Service', $this); $mock->expect('microtime', [true], 1763333612.602); $service = new Service(); $timestamp = $service->getCurrentTime(); $mock->assertExpectationsMet(); For mocking PHP’s built-in functions. ...
Sipeed NanoKVM USB: a security friendly KVM
Openterface, Cytrence and Sipeed make a KVM over USB product. I have bought the cheapest one: the Sipeed NanoKVM-USB at about EUR 60 (available on Amazon) which includes all nessecary cables. I love the product as it allows me to do repairs and upgrades on any laptop or desktop PC I put on my desk, without having to connect a second monitor keyboard and mouse. Data-center usage This device may not be ideal in the data-center as a permanently installed KVM, as it has no network connection. If you would have one management node, you could install a bunch of these in that node to control the other rack-servers (without opening a new attack surface). It may also be of great help when visiting a (private) data-center. I would always want to have this KVM (and a HDMI to VGA adapter) in my laptop bag as it takes barely any space and may avoid the need of a crash cart in the cold aisle. ...
Cannot copy Windows 11 "install.wim"?
When you buy a Windows PC it often comes bundled with a lot of software that you do NOT want. To remove this unwanted software it is recommended to do a “clean install” of Windows 11. When copying the install disk (Windows 11 ISO) to a bootable USB drive you may run into the problem that you can’t copy the “install.wim” file. This post has a solution to that problem. ...
Microsoft's digital licenses are way too cheap
Windows 11 has poor privacy and features like Recall show how bad things have gotten. Microsoft Office is pushing OneDrive a little too hard and has poor compatibility between different Office versions. This would drive people to Linux and LibreOffice if it weren’t for the ridiculous low prices of Microsoft’s digital licenses. This is what I am talking about: Microsoft Office 2024 Professional Plus (for less than 2 euro) Windows 11 Pro (for less than 2 euro) Source: On Allkeyshop.com you can search the product and find a discount code. Then, on Wincdkey.com you can buy the license with the discount code. The license key will be instantly delivered. ...
Install Windows 11 24H2 without TPM
Windows 10 will be EOL (End-Of-Life) in exactly one month on October 14th. Microsoft says you need a modern PC with TPM chip to run Windows 11, but this is not true. In this post I’ll explain how to upgrade to Windows 11 without a TPM chip (or any other hardware requirement) using Rufus. As a bonus I’ll help you setup Windows 11 in a more privacy friendly way using the “O&O ShutUp10++” software package. ...
Install LibreWolf, a better version of Firefox
LibreWolf is a custom and independent version of Firefox, with the primary goals of privacy, security and user freedom. LibreWolf is designed to increase protection against tracking and fingerprinting techniques, while also including a few security improvements. This is achieved through our privacy and security oriented settings and patches. LibreWolf also aims to remove all the telemetry, data collection and annoyances, as well as disabling anti-freedom features like DRM. Installation LibreWolf has a repository for Debian-based distributions (Debian, Ubuntu, Mint, etc.), with which you can easily install and update LibreWolf. To add it to your system and install LibreWolf, run the following commands one by one: ...
Install Debian 13 with the Mint XFCE theme
I often choose Linux Mint XFCE when I need a good looking and comfortable system quick. But sometimes I’d rather have a more stable system and match what I have on the server, which is Debian 13. Unfortunately Debian with XFCE doesn’t look as good as Linux Mint with XFCE. In this post I’ll explain what you can do to make Debian with XFCE look like Linux Mint XFCE. ...
Celebrating 9 years TQdev.com
Today I am celebrating the 9 years that the TQdev.com blog exists. In this period I have written 237 blog posts on various software development related topics. Best visited post is now “LUKS with USB unlock” with more than 42 thousand visitors. Below you find the visitors of the blog per month. Visitors graph The graph below is a (copy of) a server side generated SVG document from the backend of this blog. As you can see the number of visitors has roughly doubled in the last 2 years! ...
Check your NMVe drive I/O latency, disable APST
I’ve got a ADATA SX8200PNP (XPG SX8200 Pro PCIe Gen3x4 M.2 2280 2TB NMVe) and it is not as performant as I would like. I’ve found this out by running a simple I/O ping test (using the “ioping” tool). In this post I’ll explain how you can do this test to see whether or not you are affected as well and what you can do to make your SSD 5-10x more responsive. ...
Installing encrypted Linux Mint on an external SSD
Linux Mint can be installed on an external SSD. Simply boot from this SSD on any other machine and it just works! You can easily buy a fast, large and durable external SSD nowadays. Unfortunately installing Linux Mint on a an external SSD is not so straightforward due to a bug in the installer. In this post I’ll explain you how to work around this bug in the installer of Linux Mint, my favorite desktop distribution. ...