The lazy programmer scripts
scripts that work

Overview for windows

Lazy build qemu-img.exe statically from source

qemu-img is a great tool to convert and create disk images on the fly on Windows or Linux. On Windows, I use it to convert VHD(X) to qcow2 or any disk formats you can imagine.

If you want the qemu binaries prebuilt for Windows, you can easily download them from https://qemu.weilnetz.de/. The installer contains the qemu-img.exe binary too.

The documentation to build it on *nix systems is pretty good, but it is lacking parts of it on how to build it on Windows, especially how to build the static version of it. The official documentation can be found at https://wiki.qemu.org/Hosts/W32.

Static build means that I only want a qemu-img.exe binary which works without any open source dependency .dll. Just a small binary, preferably as small as possible (less than 5MB), which works on any Windows version > Windows Vista. The only requirement for the box where you run it is the MSVC (Microsoft Visual C++) runtime.

So, let's get the party started! The scripts below should be run in the mingw64 console after you install msys64.

Written by kami on Friday September 27, 2019
Permalink - Tags: windows, qemu, gnu, linux, c, static



Lazy remove cached favicons in Chrome

It is very cumbersome sometimes to find that you cannot update the favicons on your favorite website when using Chrome.

This script removes the file where Chrome caches the favicons on Windows. It needs to be run in PowerShell as a normal user.

Tested on Window 10 PRO x64.

Written by kami on Tuesday March 5, 2019
Permalink - Tags: powershell, windows, chrome, favicon


Lazy remove pesky files on Windows

There are some files on Windows which cannot be trivially removed, even if you are a full Administrator.

This PowerShell script makes sure that you remove them nonetheless.

Tested on Windows 10 x64.

Note: this script does not remove the files that are opened by a Windows process or if the file paths are more than 255 characters.

Written by kami on Thursday August 9, 2018
Permalink - Tags: powershell, windows, cmd