When WSL1 first appeared I was pretty excited, a lot of people claim today that because WSL, Windows is the best platform for developers, personally these days I think any OS from the big three can act as a perfect developing platform since many of us use docker anyway.
But back to WSL1, what I really liked was the WSL1 was Cygwin on steroids a kind of “Linux Wine”, and that meant a lot from the perspective of OS development, because it really was a step in the direction of merging OSes rather than have yet another virtual machine.
I mostly switched to WSL2 because I grew tired of my applications crashing because WSL1 was missing some implementations, and I thought I wasted enough time on workarounds like setting Nginx buffering to off, replacing libc libraries, replace system binaries with custom scripts, replacing apt repos with custom ones, adding custom apt repos, changing network IP version preference, avoid using Unix sockets and so on and on(but even TCP wasn’t fully implemented, constantly you could bumble into TCP_INFO error), so basically WSL1 is not extremely stable. View full article
As you probably know running PHP on Windows is a bad idea as you can get into a plethora of problems even for a simple development setup but, when you want to test a quick script or you just want to write maybe a solution to an algorithmic problem found on some type of programmer improvement site that accepts solutions in PHP you can use of course some prebuild windows binaries from windows.php.net.
Anyway, the main gist of this mini-post is that I found a recurring bug with the CURL library, the bug has been reported before and it consists in the fact that the library will not load(even if you set up correctly php.ini) View full article
As the title suggest this is a Windows-only example, you may notice that I used it in QT environment from qDebug() helper function, honestly, the only small project that I can think of for this function is one where you would like to change the bootloader, but as I said this is a trivial example.
A few remarks:
- 1 CreateFile needs to be called from a process that was run as admin in order to work ( require admin in manifest )
- 2 On MBR Fist sector/boot sector is always writeable
- 3 L”\\\\.\\PHYSICALDRIVE0″ means the first Volume but the user might have multiple volumes and you should make additional checks
View full article
HANDLE h = CreateFile ( L"\\\\.\\PHYSICALDRIVE0",
I had to make a new user on a Windows 7 workstation machine, and the simple create user procedure failed miserably, I thought maybe there are some permission problems.
The user created with GUI ( either control panel or MMC) or from the console with the “net user command”, spawned multiple ‘profile’ and ‘temp’ folders in the USERS folder, didn’t create the necessary registry entries.
And if you logged in with any of the created users you got a perpetual “preparing desktop” and when logged in you got an information notice that announced you: “you have been logged on with the default system profile”.
One thing that I didn’t bother to look at is the logs, and that should be the first thing obvious, I did a lot of futile things like recreating the default user folder, reset the default permissions, and other tricks that usually repair any problem with creating a new user. View full article