Detecting when head phones are plugged in

In Windows Vista and beyond, you can use the device arrival and removal notifications and retrieve the endpoint formfactor to determine if the manufacturer of your audio solution considers a particular endpoint a “headphone”. Before Vista there was no way of determining this information.

How to add a new device in QEMU source code?

edu in-tree educational PCI device https://github.com/qemu/qemu/blob/v2.7.0/hw/misc/edu.c https://github.com/qemu/qemu/blob/v2.7.0/docs/specs/edu.txt It is very easy to understand and well documented, so I recommend that you study it. It exposes a minimal PCI device, with basic IO, interrupt generation, and DMA. I’ve written a minimal Linux kernel module + userland tests to play with it at: https://github.com/cirosantilli/linux-kernel-module-cheat/blob/6788a577c394a2fc512d8f3df0806d84dc09f355/rootfs_overlay/pci.sh https://github.com/cirosantilli/linux-kernel-module-cheat/blob/6788a577c394a2fc512d8f3df0806d84dc09f355/kernel_module/pci.c Out-of-tree devices … Read more

How to fast get Hardware-ID in C#?

For more details refer to this link The following code will give you CPU ID: namespace required System.Management var mbs = new ManagementObjectSearcher(“Select ProcessorId From Win32_processor”); ManagementObjectCollection mbsList = mbs.Get(); string id = “”; foreach (ManagementObject mo in mbsList) { id = mo[“ProcessorId”].ToString(); break; } For Hard disk ID and motherboard id details refer this-link … Read more

C# little endian or big endian?

C# itself doesn’t define the endianness. Whenever you convert to bytes, however, you’re making a choice. The BitConverter class has an IsLittleEndian field to tell you how it will behave, but it doesn’t give the choice. The same goes for BinaryReader/BinaryWriter. My MiscUtil library has an EndianBitConverter class which allows you to define the endianness; … Read more

Accessing ePass2003 Auto token through browser

Disclosure: I work for CISPL To access ePass2003 or any Smartcard or Cryptographic USB Token, you need to use Browser Extension. As far as I know, browsers may use the keys from crypto device for TLS handshake. My company provides such extension Signer.Digital Browser Extension. Chrome and Firefox Windows Host may be downloaded from https://signer.digital/downloads/Signer.Digital.Browser.Extension.Setup.msi … Read more

Programmable router

If you only want to monitor your network then investigate and learn how to use WireShark. If you want to take the long and much harder route of making a proxy server, use a squid proxy. It runs on a Linux server and you can get a lot of user friendly GUI’s. Plus there are … Read more