Note to self: The last 32 bit version of the libjpeg-turbo DLL compiled with MS Visual Studio (libjpeg-turbo-x.y.z-vc.exe) that supports Windows XP is version 2.0.6. Later versions apparently need a newer Visual C++ runtime that does not work on Windows XP.

A colleague of mine just learned that the hard way.

We haven’t tested the versions compiled with gcc (libjpeg-turbo-x.y.z-gcc.exe).

Note to self:

If a user cannot change his password on a Samba AD Domain from a Windows (10) computer getting the following error message:

Check that the user didn’t already change the password on the same day because the default setting for minimum password age is 1 (day). To change that setting, use samba-tool:

root:/root# samba-tool domain passwordsettings set --min-pwd-age=0
All changes applied successfully!


Note that Samba apparently does not support changing this setting (and other password policy settings) with the Windows Group Policy Editor.

To check these settings, also use the samba-tool:

root:/root# samba-tool domain passwordsettings show

Account lockout duration (mins): 30
Account lockout threshold (attempts): 0
Reset account lockout after (mins): 30


(Note that the above are not my actual password settings in a production environment but rather test settings to find out which settings caused the problem.)

Note to self: If you have anything important running on your Windows 10 computer for a longer time (e.g. over night), make sure to prevent Windows Update to become active. It will force a restart of your computer if it fancies so, regardless of the programs that might still be active.

Guess what happened last night? I not only lost some work but it also aborted a critical maintenance task running for our server infrastructure, which means I have to repeat that task next weekend and endanger company data for another week.

Judging by the results of search for "prevent windows reboot" I am not the first one who got hit by this "feature".

(And to add insult to injury I was now looking for the settings to disable automatic updates for a while and can’t bloody find it. Entering "Windows Update" into the search field of the control panel doesn’t find it.
The search box in the start menu does find it though. WTF?)

Of course as of Windows 10 users can no longer prevent Windows Update to restart their computer (We’re Microsoft, we know best 🙁 ). They have only the following options:

1. Pause Windows Update for 7 days.
2. Pause Windows Update until a fixed date, which can be up to about 1 month into the future.
3. Set the “active hours”, that is the times between which Windows Update will not restart your computer. That period is limited to up to 18 hours.

On Windows 10 professional (home users are out of luck) there are some settings in the Local Group Policy Editor which might help here, but I haven’t yet figured out what to set. One that looks promising is:

Specifies that to complete a scheduled installation, Automatic Updates will wait for the computer to be restarted by any user who is logged on, instead of causing the computer to restart automatically.

If the status is set to Enabled, Automatic Updates will not restart a computer automatically during a scheduled installation if a user is logged in to the computer. Instead, Automatic Updates will notify the user to restart the computer.

Be aware that the computer needs to be restarted for the updates to take effect.

If the status is set to Disabled or Not Configured, Automatic Updates will notify the user that the computer will automatically restart in 5 minutes to complete the installation.

Note: This policy applies only when Automatic Updates is configured to perform scheduled installations of updates. If the “Configure Automatic Updates” policy is disabled, this policy has no effect.

But unfortunately that policy is already enabled and obviously didn’t prevent the restart last night. I guess that’s what the “Note” is about. The Configure Automatic Updates policy is disabled. I guess I’ll have to figure out what to configure there.

But why is there no option like "Don’t restart if a user is logged on and a program is running."? For their own programs (e.g. Explorer or anything MS Office) they could create fancier solutions as "If a program is running but doing nothing, notify it (e.g. an Explorer window or MS Word with an unchanged document) and restart it afterwards.".

If I remember correctly there is some Win32 API option to prevent manual shutdowns or restarts. Maybe that will also prevent a restart caused by Windows Update.

Edit: Within a few minutes after I posted this, several people have made me aware of Ulrich Decker’s Reboot-Blocker tool. Thanks everybody!

Microsoft is trying to force everybody to update from the old NT4 domain system to the “new” (as in “was new >10 years ago”) Active Directory system. While that’s probably a good idea for most people there are some like me stuck with a working Samba installation that for some reason needs to continue to use NT4 domains.

Getting a Windows computer to join such a domain has become more difficult with Windows 10. Here is what needs to be done (I write this mostly so I can look it up myself):

1. Make sure your samba server is configured to enforce the NT4 (SMB1) login. samba.conf must contain the following entry:
[global]
// other entries here
server max protocol = NT1

2. Install the SMB1 protocol on the Windows computer. This is done using the “Turn Windows Features on or off” dialog (just type this into the start menu). You need to set the check marks for two entries under “SMB 1.0/CIFS File share Support”:
• SMB 1.0/CIFS Client
• SMB 1.0/CIFS Server

I’m not 100% sure whether the latter is required. I haven’t tried it without.

3. Add the following entries to the registry:
Windows Registry Editor Version 5.00

[HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\LanManWorkstation\Parameters]
"DomainCompatibilityMode"=dword:00000001
"DNSNameResolutionRequired"=dword:00000000


You can either add them manually or copy the above to the .reg file and import that into the registry.

4. Reboot the computer to activate these changes.

Now it should be possible to join the Windows 10 computer to the Samba Domain.

Source: Required Settings for Samba NT4 Domains on the Samba Wiki.

Starting with Windows Vista Microsoft has started to take security really serious. That’s a good thing. Unfortunately in typically Microsoft attitude they think they always know best and that the user is an idiot, so it’s best to keep anything dangerous from him.

Fast forward to Windows 10 and the issue at hand:

Windows 10 tries to identify networks and based on that classifies them as private or public. The Windows firewall then changes some settings based on this classification.

Now imagine a computer installed in a special setting that is connected via LAN to some other computers in the same place. Network wise this is an isolated island, there is no connection to any company LAN or the Internet. All computers have fixed IP addresses, so there is no DHCP server involved, and provide network shares to each other.

Unfortunately Windows sees this setup as an unidentified network and classifies it as a public network. This means that many things – in particular network shares – do not work.

And since Microsoft doesn’t trust users to know what they are doing, there is no easy (GUI) way to change this. It used to be possible in Windows 7 but no longer.

So, what can be done? Google turned up lots of different suggestions but the only one that worked for me was this answer on SuperUser.com.

It gives a PowerShell script which I have adjusted to my needs:

Write-Host "current settings:"
Get-NetConnectionProfile |
Where{ $_.InterfaceAlias -eq 'NetworkCardName'} | ForEach {$_
$_|Set-NetConnectionProfile -NetWorkCategory Private } Write-Host "new settings:" Get-NetConnectionProfile | Where{$_.InterfaceAlias -eq 'NetworkCardName'}

Write-Host "Beliebige Taste um fortzufahren..."


It reads all connection profiles, filters for the one that apply to a network adapter with a given name (which I renamed to make it unique) and changes this profile to be private. It then displays the new settings and waits for the user to press a key.

In order to work, this script must be started with administrator privileges. Of course, that would have been too simple: Microsoft also by default prevents the execution of PowerShell scripts. Again, that might be a valid security measure but in this situation it’s merely a pain in the lower back. So in order to allow scripts, we need to change this setting as suggested in yet another answer on SuperUser.com:

Start PowerShell as administrator and run the following command:

set-executionpolicy remotesigned


This allows the execution of local scripts, which is what we want. It also allows remote scripts if those are signed, which isn’t particularly what I want but apparently you can’t get one without the other.

Diesmal funktioniert alles [music video]

Even after Microsoft abandoned the stupid idea of the Windows 8 start screen and gave us back the start menu in Windows 10 there is still a lot to desire. Of course you can replace the the start menu with a tool like Open Shell (formerly known as Classic Shell) which improves it quite a lot. Or you use a separate launcher like the Portable Apps Launcher.

I have switched to Open Shell but I also use JumpFolder to create my own, multiple “Start Menus” using the jump list that every icon on the taskbar has had since Windows 7.

Basic usage means that you put the JumpFolder.exe into any directory on your disk, add subdirectories containing shortcuts to the programs you want to start, pin JumpFolder.exe to the Windows taskbar and start it once. After that the jump list of this icon will show you all those shortcuts:

(In case you are curious: These shortcuts start Civilization, the original DOs game from 1991, 7 Kingdoms, a Windows game from 1997) and Todolist by Abstract Spoon. I can definitely recommend the games but the todo list is not my favourite, but hey, it’s free.)

Note that even though the JumpFolder homepage states that it requires Windows 7, it also works for later Windows versions, including Windows 10.

But the number of entries in the jump list is limited (by default to 10 entries which can be increased, but even then, vertical space on a monitor is limited) and it would be nice to have more than one. But there can only be one JumpFolder.exe icon on the taskbar. So, what can be done? Simple: Create a shortcut to JumpFolder.exe itself and pin that shortcut to the taskbar.

OK, here are the steps:

1. Create a new directory.
2. Put the JumpFolder.exe file into it
3. Create a shortcut to that executable in the same folder and give it a unique name, e.g. “MyJumpFolder1”
4. Optionally, assign an icon to this shortcut.
5. Pin this shortcut to the taskbar
6. Create subdirectories for categories (e.g. “games” and “tools” and put shortcuts into these subdirectories.
7. Start the shortcut on the taskbar. It will now parse the subdirectories and create a jump list from them.
8. Voila: You have a unique “start menu”. Now rinse and repeat for each additional “start menu” you want.

Of course the shortcuts can be for anything, e.g. open a folder or start a program passing it parameters. This way you can create a “start menu” for your music, by putting several shortcuts to your music player into the subdirectories passing it e.g. the directory containing the music files it should play. Eg. for VLC it would look like this:

c:\path\to\VLC.exe "c:\path\to\Peter Fox"

(The parameter is the directory containing mp3s with music from Peter Fox’ album Stadtaffe“.)

My current music “start menu” looks like this:

The same principle can also be used to create entries with jump lists in the start menu, but personally I find that a lot less useful.

I stumbled upon JumpFolder a few years ago when I was considering writing such a program myself. I’ve even got the source code from back then. But it didn’t keep my interest after I discovered that such a program already exists.

Due the the COVID19 pandemic I am currently working from home, using Putty + ssh + Remote Desktop to log into and work on my office PC. For this to work, the office PC must be turned on and booted. So far I have let it running 24h which is really a waste of energy but since sometimes nobody is in the office at all, that was the most fool proof way.

Today I have had some time at my hands waiting for an Ubuntu server to finish installing, so I thought about alternatives.

• One would have been Wake on LAN (WOL), if the BIOS of my computer supported it, but unfortunately it doesn’t (see edit below).
• Waking up using the RTC (real time clock) is actually an option in the BIOS, but that would have woken it up every day rather than just on weekdays.

Finally I stumbled upon an article on How-To Geek about “How to Make Your PC Wake From Sleep Automatically“.

The Windows Scheduler has an option to wake up the computer to run a task. Note that it works only if the computer wasn’t turned off but rather sent into hibernation. So I set up a task that runs “cmd.exe” with the parameter “/c exit” weekly on Monday to Friday at 7:30. Of course I tested it first with a on time schedule and it worked fine.

So now I have sent my office PC into hibernation. We’ll see whether it is available on Monday when I want to log into it.

EDIT:
It turns out that my office PC supports WOL even though it’s not visible in the BIOS. But the network card properties under Windows have a setting for it:

So when I read the hint from Vandrovnik on the international Delphi Praxis forum, I ssh’d into the company intranet and was able to simply wake up my office PC using the wakeonlan tool installed on the remote logon computer:

Great, this is much more flexible than I thought.

I just had one of these dreaded occurrences where the hosts file did not work on a Windows XP installation. (Yes, you read that correctly: “Windows XP”. I still have got a few installations of that to maintain.)

I could not figure out what the problem was, so I turned to Google which found “hosts file ignored, how to troubleshoot?” on ServerFault. The accepted answer lists several steps to trouble shoot. The one that helped me was:

5. Permissions
Sometimes there are issues with permissions on the file, the file
attributes, and similar things. To recreate the file with default
permissions:

1. Create a new text file on your desktop.
2. Copy and paste the contents of your current hosts file into
3. Save the new text file and rename it to hosts.
4. Copy (do not move) the file to your
%SystemRoot%\System32\drivers\etc
directory, and overwrite the old file.

Last point is important: Copying works, moving doesn't.


Unfortunately the described steps did not work for me because I already had moved the hosts file from the desktop to c:\Windows\System32\drivers\etc so the original file and its permissions was already overwritten. What I did to solve this was:

1. Follow the steps 1 to 3 above.
2. Delete the original hosts file in the %SystemRoot%\System32\drivers\etc directory
3. Copy one of the other files in that folder (I used “services”) and rename the copy to “hosts”

Now ping works as expected and connecting to the Embarcadero License Server also does.

Since Microsoft will end the free support for Windows 7 in January 2020, we are updating all our computers to Windows 10 (I would really have liked to avoid that. Windows 7 is definitely not the best Windows ever but its annoyances are known. Windows 10 started to annoy me with new so called “features” immediately after the installation finished. But hey, that’s what you get when you make a living developing software for this stinking pile of sh*t. sorry excuse for an operating system.)

Anyway: As before, when I updated from Windows 8 to Windows 8.1, the Windows 10 update broke my Delphi 6 and 2007 installations. Fortunately my workarounds / fixes for Windows 8.1 also work for Windows 10. Also fortunately I blogged about them

so I could look them up.

Today I got one of these dreaded update reminders for software that I don’t really want to have on my computer (no, not Flash this time). So after procrastinating the inevitable for a few days I just now started the update. I got an interesting surprise:

What???!!!! Oracle doesn’t want me to keep Java on my computer, just because I haven’t used it for half a year? Is this the same company that boasts how many gazillion devices run Java?

Ok, guys, I’ll go for it and remove Java, but I am sure I will shortly find out which of the programs on my PC requires it and will no longer run because I uninstalled it.