Sunday, April 9, 2023

Force remove old drivers in Windows 11 for enabling Memory Integrity

 In Command Prompt with Administrator privilege, do the following:

pnputil /delete-driver oemXX.inf /uninstall /force


Saturday, April 8, 2023

A solution for Intel ProSet Adapter Configuration Utility no longer supported in Windows 11 for managing VLANs

So I finally bit the bullet yesterday and upgraded one of my Windows 10 machine to Windows 11. I figured a lot of Win11 bugs have been ironed out by now, so I decided to get on with it before Win10 support expires in 2025.

I am pretty impressed with the overall upgrade process; all my software and documents were left intact... except for one very big issue. My Hyper-V VMs were no longer working due to the VLAN configuration being hosed.

As it turns out, Intel pulled support for the ProSet utility for Windows 11, which is what I used to configure multiple VLANs on my NIC. So, the solution is to now use Windows PowerShell commands to manually establish VLAN interfaces you need, via the Hyper-V stack. Go ahead and install the Hyper-V host components.

What you are essentially doing is to create a Hyper-V VLAN switch and attach multiple VLAN adapters to it. In the example below, we'll name your VLAN switch "VLAN-vSwitch" and I will assume your NIC is named "Ethernet" (usually by default, or find it out with "Get-NetAdapter" command). And we'll create three VLANs with ID 101, 102, and 103.

In a Windows PowerShell running as Administrator, do the following:

New-VMSwitch -name VLAN-vSwitch -NetAdapterName Ethernet -AllowManagementOS $true

Remove-VMNetworkAdapter -ManagementOS -Name VLAN-vSwitch

Add-VMNetworkAdapter -ManagementOS -Name "VLAN101" -SwitchName "VLAN-vSwitch" -Passthru | Set-VMNetworkAdapterVlan -Access -VlanId 101

Add-VMNetworkAdapter -ManagementOS -Name "VLAN102" -SwitchName "VLAN-vSwitch" -Passthru | Set-VMNetworkAdapterVlan -Access -VlanId 102

Add-VMNetworkAdapter -ManagementOS -Name "VLAN103" -SwitchName "VLAN-vSwitch" -Passthru | Set-VMNetworkAdapterVlan -Access -VlanId 103

Running the Get-NetAdapter command again will now show you the VLAN adapters you created. Let me know if you have any questions!


Tuesday, December 28, 2021

Fix pi-hole disk keep getting full

Unfortunately, the default setting of pi-hole allows small pi-hole installations to fail due to disk getting full. The FTL database file /etc/pihole/pihole-FTL.db captures logging for 365 days by default, and it can grow to multi-gigabytes within that period.

First, stop the service:

sudo service pihole-FTL stop

If your disk is already full, first delete the pihole-FTL.db file by doing:

sudo rm /etc/pihole-FTL.db

Then edit maxDBdays configuration in your /etc/pihole/pihole.toml file as follows:

  1. sudo vi /etc/pihole/pihole.toml
  2. Fine the line maxDBdays = xxx and change xxx to 30 (or something smaller from the default 91)
  3. :wq command to save and quit vi
And start the service:

sudo service pihole-FTL start

That should allow your pi-hole installation to operate for a long time. FYI I see about 300MB pihole-FTL.db size after 30 days in my home network.

Tuesday, February 11, 2020

Windows batch processing of file names in a text file

The following script loops through copy.txt file's content (1 file name per line), then copies each file to D:\tmp\:

@echo off
for /F %%a in (copy.txt) do copy "%%a" D:\tmp\


Windows FFMPEG Script to transcode video files from H.264/MPEG-4 to H.265/HEVC, using NVENC hardware acceleration on NVIDIA GPU


I  recently put some effort into converting all my H.264 video files into H.265 format, and this is the best setting I found. On a RTX 2070 Super, I get about 250+ fps, on average; a feature length film in 1080p takes about 6 minutes to convert.

@echo off
for %%a in ("*.mkv") do ffmpeg.exe -vsync 0 -hwaccel cuda -i "%%a" -c:v hevc_nvenc -preset llhq -rc vbr_hq -cq 21 -c:s copy -acodec copy "D:\tmp\H.265\%%~na.mkv"
for %%a in ("*.m4v") do ffmpeg.exe -vsync 0 -hwaccel cuda -i "%%a" -c:v hevc_nvenc -preset llhq -rc vbr_hq -cq 21 -c:s copy -acodec copy "D:\tmp\H.265\%%~na.mp4"
for %%a in ("*.mp4") do ffmpeg.exe -vsync 0 -hwaccel cuda -i "%%a" -c:v hevc_nvenc -preset llhq -rc vbr_hq -cq 21 -c:s copy -acodec copy "D:\tmp\H.265\%%~na.mp4"
for %%a in ("*.avi") do ffmpeg.exe -vsync 0 -hwaccel cuda -i "%%a" -c:v hevc_nvenc -preset llhq -rc vbr_hq -cq 21 -c:s copy -acodec copy "D:\tmp\H.265\%%~na.mp4"

The key is using the "-hwaccel cuda" option, which keeps the output of NVDEC decoder output on the GPU's framebuffer for NVENC encoder to work on. This way your CPU utilization is kept low and keep GPU's encoder at 100%.

Sunday, April 8, 2018

Plex playback error

Recently I started experiencing Plex playback issues on my XBox One. As it turned out, I inadvertently (ignorantly) changed the Plex App’s Video => Maximum H.264 Level setting to 5.1.

FYI, the Plex app on XBox One only supports H.264 Level 4.0 and below, as documented here:

https://support.plex.tv/articles/203810286-what-media-formats-are-supported/

After I changed the setting to 4.0, all my videos encoded at >4.0 started playing again, my Plex server transcoding them in real time!

Monday, June 12, 2017

Random thought of the day

It occurred to me today, that being (financially) rich means having assets that generate income to sustain your livelihood. Being poor is having to perform other activities in lieu of having those assets. So, one’s financial goal in life shouldn’t be simply making more money every year, but rather acquiring income generating assets over time to become self-sustaining. In other words, don’t buy things unless they are going to generate income!