Skip to content

Instantly share code, notes, and snippets.

View valinet's full-sized avatar

Valentin Radu valinet

View GitHub Profile
// ==WindhawkMod==
// @id all-resource-redirect-experimental
// @name All Resource Redirect - Experimental
// @description Define alternative files for loading resources (e.g. instead of imageres.dll) for simple theming without having to modify system files
// @version 1.0
// @author m417z
// @github https://github.com/m417z
// @twitter https://twitter.com/m417z
// @homepage https://m417z.com/
// @include *
@Justinzobel
Justinzobel / thunderbird-115-fix.md
Last active February 18, 2025 04:54
Fix Thunderbird 115's title bar and remove search bar

Thunderbird 115 introduced a new look. I hate it. Not only does it no longer fit in with KDE Plasma, it lost functionality due to it's new integrated search bar in the title bar.

So I went on a mission to fix it.

To restore the regular title bar:

Go into Settings > General > Language & Appereance and uncheck the Hide system window titlebar

To remove search bar:

@krzys-h
krzys-h / Hyper-V GPU-PV with Linux guest.md
Last active April 28, 2025 03:55
Ubuntu 21.04 VM with GPU acceleration under Hyper-V...?

Ubuntu 21.04 VM with GPU acceleration under Hyper-V...?

Modern versions of Windows support GPU paravirtualization in Hyper-V with normal consumer graphics cards. This is used e.g. for graphics acceleration in Windows Sandbox, as well as WSLg. In some cases, it may be useful to create a normal VM with GPU acceleration using this feature, but this is not officially supported. People already figured out how to do it with Windows guests though, so why not do the same with Linux? It should be easy given that WSLg is open source and reasonably well documented, right?

Well... not quite. I managed to get it to run... but not well.

How to do it?

  1. Verify driver support
@ADeltaX
ADeltaX / main.cpp
Created March 22, 2021 15:38
DWM Thumbnail/VirtualDesktop IDCompositionVisual example
#include <Unknwn.h>
#include <Windows.h>
#include <ntstatus.h>
#include <winternl.h>
#include <wrl\implements.h>
#include <comutil.h>
#include <dcomp.h>
#include <dwmapi.h>
#include <dxgi1_3.h>
#include <d3d11_2.h>
@m417z
m417z / ShowAppId.cpp
Created July 29, 2020 16:33
Get an Application User Model ID (AUMID) from a window handle
#include <windows.h>
#include <initguid.h>
// {c8900b66-a973-584b-8cae-355b7f55341b}
DEFINE_GUID(CLSID_StartMenuCacheAndAppResolver, 0x660b90c8, 0x73a9, 0x4b58, 0x8c, 0xae, 0x35, 0x5b, 0x7f, 0x55, 0x34, 0x1b);
// {46a6eeff-908e-4dc6-92a6-64be9177b41c}
DEFINE_GUID(IID_IAppResolver_7, 0x46a6eeff, 0x908e, 0x4dc6, 0x92, 0xa6, 0x64, 0xbe, 0x91, 0x77, 0xb4, 0x1c);
// {de25675a-72de-44b4-9373-05170450c140}
@ADeltaX
ADeltaX / main.cpp
Last active February 5, 2025 10:42
Example of creating a window using a private api on a dll-injected immersive process
#include "pch.h"
#pragma comment(lib, "gdi32.lib")
enum ZBID
{
ZBID_DEFAULT = 0,
ZBID_DESKTOP = 1,
ZBID_UIACCESS = 2,
ZBID_IMMERSIVE_IHM = 3,
ZBID_IMMERSIVE_NOTIFICATION = 4,
@rikka0w0
rikka0w0 / NoImmersiveWin10.md
Last active March 14, 2025 11:39
Get rid of the immersive menu in Win10 1809 and above
  1. Download tools: ResourceHacker and mssstyleEditor, then unpack them
  2. Download resources: Win8 theme for Win10, and then uppack it, we will need 'Windows 8 RP Themes for Windows 10\Theme\Themes For 10 Build 14393 Anniversary Update\Windows 8 RP\aero 8 RP.msstyle'.
  3. Open it with ResourceHacker, export IMAGE 1055:0 and IMERSIVE 1:0.
  4. Make a backup of the original aerolite.msstyles and make a copy of it to your working folder (arbitary)
  5. Open it with ResourceHacker, Go to 'Action -> Add an Image or Other Binary Resource' or hit Ctrl+M to open the "Add Binary Resource" Dialog. Choose the menu image resource file that is going to be used, then change the "Resource Type" to IMAGE and resource name to be what ever available, in my case, 993.
  6. Change the value of IMERSIVE 1:0, by importing the data from "aero 8 RP.msstyle"
@define-private-public
define-private-public / HttpServer.cs
Last active April 22, 2025 09:49
A Simple HTTP server in C#
// Filename: HttpServer.cs
// Author: Benjamin N. Summerton <define-private-public>
// License: Unlicense (http://unlicense.org/)
using System;
using System.IO;
using System.Text;
using System.Net;
using System.Threading.Tasks;
@shamil
shamil / mount_qcow2.md
Last active April 24, 2025 04:34
How to mount a qcow2 disk image

How to mount a qcow2 disk image

This is a quick guide to mounting a qcow2 disk images on your host server. This is useful to reset passwords, edit files, or recover something without the virtual machine running.

Step 1 - Enable NBD on the Host

modprobe nbd max_part=8
@t-mat
t-mat / win32-capture-stack-back-trace.cpp
Created December 15, 2013 22:38
Win32: CaptureStackBackTrace
// CaptureStackBackTrace
// http://msdn.microsoft.com/en-us/library/windows/desktop/bb204633(v=vs.85).aspx
#define WIN32_LEAN_AND_MEAN
#include <windows.h>
#include <stdio.h>
//////////////////////////////////////////////////////////////
void capture() {
const ULONG framesToSkip = 0;
const ULONG framesToCapture = 64;