Play NFSHP2 on Linux
Problem
You want to play Need For Speed Hot Pursuit 2 on Linux.
Solution
You cannot buy this game on Steam. However, you can add the game to Steam (as a Non-Steam Game) and play it with the Proton compatibility layer.
It would also be possible to install the game on Linux, but I suggest a simpler way. First, install the game on Windows and test it there. If all patches are applied and it works well, then copy the installed folder over to Linux.
Thus, the steps are the following:
1) Install the game under Windows. I have a detailed blog post about the necessary steps, see here: https://ubuntuincident.wordpress.com/2024/12/29/make-nfshp2-run-under-windows-10/ . Apply the patches: noCD patch, widescreen patch (in my case: 1920×1080). But it’s all explained in the linked blog post.
Summary: make sure that it runs well on Windows.
2) Zip up the folder “Need For Speed Hot Pursuit 2” that contains the installed game and copy it over to Linux.
3) Extract the zip file somewhere under Linux. I chose this folder: /opt/games/Need For Speed Hot Pursuit 2
4) Add the game to Steam as a Non-Steam Game. Launch Steam, and in the bottom left corner there’s a button called “Add a game”. Click on it and select “Add a Non-Steam Game…”. Click on the button Browse… and locate NFSHP2.exe (/opt/games/Need For Speed Hot Pursuit 2/NFSHP2.exe). Then add it (click the button “Add selected programs”).
NFSHP2.exe will appear in your game library. Find it and click on it. The game has its own page. Right click on NFSHP2.exe and select Properties. Under the Compatibility tab, check “Force the use of a specific Steam Play compatibility tool”. From the list below, select “Proton Experimental”. If another element gets selected, then click on the dropdown list again and select “Proton Experimental” again. This time “Proton Experimental” will be accepted. Close this window (your settings will be saved).
And we are basically done. Click on the Play button. Steam will download some stuff and the game will be launched in a few minutes.
5) When the game is started for the first time, it creates its configuration file called rendercaps.ini . Quit the game since we will have to edit this file to set the resolution.
6) This file is nicely hidden. It’ll be somewhere here: ~/.steam/steam/steamapps/compatdata/2448634011/pfx/drive_c/users/steamuser/Documents/EA Games/Need For Speed Hot Pursuit 2/rendercaps.ini . The ID “2448634011” is a random number, so it’ll be different in your case. Use the Linux command find to locate it easily:
$ cd$ cd .steam/steam$ find . | grep "rendercaps\.ini"
Edit the file. In the first section ([Graphics]), change the resolution:
Width=1920Height=1080
But, you can also find a complete rendercaps.ini file in my previous blog post (see here).
7) Start the game and enjoy :)
8) Optional step: you can customize the game’s page inside Steam. From https://www.steamgriddb.com/ you can download cover and background images for the game.
In Steam, right click on the game on the left side, Properties… -> Customization, and add cover and background images.
Links
- Make NFSHP2 run under Windows 10 (my previous blog post about this game)
- Play NFSHP2 on Linux (my YouTube video in which I show all the steps presented in this post)
- shorter notes (that served as the basis for this post)
- NFSHP2 on Old Games Download
The modulo operation is not that trivial
Surprise
In Python, -1977 % 100 = 23. In JavaScript, -1977 % 100 = -77. WTF?
Explanation
Modulo in different languages has different meaning! It’s not like the plus (+) operator which means the same thing in every language when applied for two integers, for instance.
In Python:
a % b = a - (b * floor(a / b))
In JavaScript:
a % b = a - (b * truncate(a / b))
For example, if a = -1977 and b = 100, then a / b is -19.77. But! floor(-19.77) is -20, while truncate(-19.77) is -19. Hence the difference!
I tested some languages and got the following result:
Group 1 (languages using floor()): Python, Lua
Group 2 (languages using truncate()): C, C++, D, Java, JavaScript, C#, Go, Rust, Nim, Kotlin, Pascal, Swift
Some more examples in Python and in JavaScript
Python:
>>> 1977 % 100
77
>>> -1977 % 100
23
>>> 1977 % -100
-23
>>> -1977 % -100
-77
JavaScript:
> 1977 % 100
77
> -1977 % 100
-77
> 1977 % -100
77
> -1977 % -100
-77
How to imitate Python?
How to have a Python-like modulo in other languages? Here is a C function:
int modulo(const int a, const int b)
{
return ((a % b) + b) % b;
}
Giving away my Dell Latitude D410
Today I decided to give away my Dell Latitude D410 laptop. I bought it second-hand when I was in Montréal, Canada. It was 200 CAD at that time. I liked this laptop but it hasn’t been switched on for many many years. I took some photos of it: https://imgur.com/a/dell-latitude-d410-UkcFPzQ
Specs: 32-bit Pentium M processor, 2 GB RAM, 40 GB HDD.
I gave it to a friend who is not a tech guru. I installed LMDE 6 on it. “LMDE is a Linux Mint project which stands for ‘Linux Mint Debian Edition’. Its goal is to ensure Linux Mint can continue to deliver the same user experience if Ubuntu was ever to disappear.” (source) LMDE 6 supports 32-bit systems and it’s suitable for old computers, that’s why I chose it. It’s very similar to the normal Linux Mint (Cinnamon). The only difference I noticed was the GUI software updater. It didn’t have the option to select and install the kernel version you want. Otherwise, it had the same look & feel. And it worked relatively well on this old laptop.
Lesson learned: if you want Debian with the goodies of Linux Mint, try LMDE, which combines the best of both worlds.
I only had one issue: the wifi card in the laptop was not recognized. However, after installing the package firmware-b43-installer , the wifi started to work :)
Goodbye, old little laptop. You served me well!
Notes / Links
- LMDE 6 “Faye” released! (blog post announcement)
- LMDE 6 will reach its end-of-life around October 2026. You can verify it here.
- LMDE 7 is newer but it dropped 32-bit support.
How to compact VirtualBox’s VDI file size?
Problem
I had a Windows 10 in VirtualBox. I gave it a dynamic VDI file of size 100 GB. The file was about 50 GB large. When I upgraded it to Windows 11, the installer downloaded about 30 GB stuff, thus the VDI grew to 80 GB. After the upgrade, I cleaned the system and managed to go back to 50 GB inside Windows. However, the VDI file doesn’t shrink, it remained 80 GB. So I lost 30 GB free space. How to get it back?
Solution
I found the solution here. In short: fill up the empty space with zeroes and then ask VirtualBox to compact the VDI file. During this process, empty space filled with zeroes can be removed. This way I could reduce the size of my VDI file from 80 GB to 50 GB.
Steps:
- I didn’t defrag my Windows. As I know, NTFS defrags itself regularly. I skipped this step.
- Fill free space with zeroes. Download the tool sdelete and run it inside Windows. Open a terminal in admin mode and issue this command:
sdelete64 -z C: - Shut down the Windows system (the guest).
- In the host (I have Linux), issue this command:
VBoxManage --compact Windows10.vdi
It’ll reduce the size of the VDI file. After that, start your Windows box.
Before starting this process, I made a backup of my virtualboxed Windows, but there was no problem.
Upgrade to Windows 11
This is October 2025. Since Windows 10 reached its EOL, I’ve decided to upgrade my machines to Windows 11. I started with a laptop and I summarize here my experiences.
- I want to have both Windows and Linux on my machines. Windows is Windows 11 25H2, and Linux is Manjaro Linux.
- My laptop didn’t meet the official requirements for Windows 11 but there’s a solution for that: create the bootable USB with Rufus. Upon creation, Rufus will come up with a list to personalize your Windows stick. You can select to disable secure boot, disable TPM 2.0 check, etc.
- First I installed Windows 11. There was no problem during the installation. My laptop has an Intel Core i7-4500 processor @ 1.8 GHz (4 virtual cores) and 8 GB RAM with 250 GB SSD. Windows 11 runs fine on it. I installed the Enterprise edition. I gave it a 150 GB partition. It seems to be enough. I also have an external HDD attached to it.
- I installed with a local account, as shown in this video.
- After Windows, I installed Manjaro Linux in a separate partition. With btrfs I had some problems, so I chose the ext4 file system.
- To Enter the boot menu, I had to keep pressing the ESC key. First, the USB option didn’t appear. Then, when I moved the stick to another USB slot, it appeared in the menu and I could boot from it.
- Under Windows, I installed the updates.
- I installed Total Commander.
- With ninite.com, I installed lots of useful programs.
- To make screenshots, I installed ShareX (available in ninite.com).
- Some other useful softwares: qbittorrent (version 4.5.5), WinCDEmu (to mount ISO images), and Winaero Tweaker (to tweak Windows).
- I activated my Windows and then used Winaero Tweaker to customize it.
- I also installed Avast Antivirus (available in ninite.com).
- I have some tools written in Go and they launched very slowly. It took about 15 seconds for an EXE to start. Avast was the culprit. Here is how to put a directory to an exception list: start Avast, then Menü -> Beállítások. Under Általános, select Kivételek. Then add your exceptions. (Sorry, I have Hungarian Windows).
- When you install Go programs with “
go install“, they are put here:C:\Users\<user>\go\bin - Startup applications are here:
C:\Users\<user>\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Startup. I created here some symbolic links. - How to create a symbolic link:
mklink link original - If mklink is not found in PowerShell, use this:
cmd /c mklink link original - When you put cmd on the Desktop, then actually it’ll be the Terminal with PowerShell. However, in its Settings, you can select Command Prompt to be your default profile. You can also set to center the terminal on the screen.
- I also enabled auto login, as described in this post of mine.
Linux
- I installed Manjaro Linux with ext4 (I had some problems with btrfs). I gave it about 100 GB. The installer told me to create another partition that must be mounted as
/boot/efi. But the installer provided every detail about it. (I made it 500 MB, FAT32, and gave it the boot flag). - Grub starts the operating system that was started the last time. It’s good for me, so I didn’t change it.
- I’ll customize Linux later.
Updates
- On another laptop of mine, Windows 10 offered to upgrade my system to Windows 11. I accepted it and it did a great job. All my installed programs remained functional. It was a painless experience.
- If Windows 10 doesn’t offer the upgrade, you can try the Windows 11 Installation Assistant. If it’s stuck at downloading updates, then just wait. Mine was stuck at 46% for about 1.5 hours but then it continued. (This upgrade failed at the end, but it didn’t ruin my system.)
- I figured out just later that you can try to upgrade your system by keeping everything. That is, you keep all the programs and settings. Prepare your USB stick with Rufus, launch Windows 10 or Windows 11, and start
setup.exefrom the USB. It’ll start the upgrade process and you can select to keep everything (programs and settings). This way I could upgrade a Windows 11 23H2 system to Windows 11 25H2. Just make sure that you have around 50 GB free space before starting the upgrade. - I could also upgrade a virtual machine of mine that had a Windows 11 23H2. I copied the content of the USB stick to drive C: to a temporary folder and launched
setup.exe. The upgrade went flawlessly.
VLC shows some codec error
Problem
After upgrading my Manjaro box, VLC started to show some error message about a codec error. The video and audio played correctly, but there was an error message.
Solution
sudo pacman -S vlc-plugins-all
Links
- VLC and firefox broken after latest updates.
- https://forum.manjaro.org/tag/stable (always check it before an upgrade)
Master thesis of Linus Torvalds
Linux: a Portable Operating System by Linus Torvalds
Written in 1997. 60 pages long.
screenlocker
Question
What app. to use use for locking the screen?
Answer
slock . I put it on Ctrl + Alt + L . A very nice, zero bullshit software.
Read the man page of slock. It gives a tip how to make it more secure.
asciinema: record your terminal session easily
Problem
You want to record your terminal session and you want to make a GIF of it. Why? For instance you want to make a short demo for a command-line application.
Solution
Use asciinema and agg for this purpose.
Usage:
$ asciinema rec demo.cast
# Press "Ctrl+d" when ready
$ agg demo.cast demo.gif
Installation (under Manjaro):
$ yay -S asciinema
$ yay -S asciinema-agg
Links
You must be logged in to post a comment.