John Liu Blog

Every drop counts

Wi-fi connection issue

When playing with Hyper-v, I somehow managed to break my local Wi-fi connection. The issue was that download speed is normal whereas upload speed is very slow (~0.6Mpbs) which caused web browser very slow and sometime error out. I initially thought might be firewall rules (I setup some new firewall rules). After using a physical cable connection, download/upload speed are as normal. Played with update/reinstall Wi-fi NIC driver with no luck.

Change NIC category

A network card (NIC) can be classified as in Private network, Public network or Domain network. One can setup different firewall policies for different network category. If need, you can use Powershell script to change NIC netowrk category. #to list NIC network connection profile info Get-NetConnectionProfile #to change NIC network connection profile Set-NetConnectionProfile -Name "Unidentified network" -InterfaceIndex 56 -NetworkCategory Private

HttpWebRequest SSL/TLS error

If you are using HttpWebRequest in your application, you may receive “The request was aborted: Could not create SSL/TLS secure channel” error. This error might be caused by the mismatch SSL/TLS protocol between the server and client. The solution is to make sure that both client and server have a common protocol version supported. Add following line in your code to let the client be able to connect to as many servers as possible (rather than to be as secure as possible).

Regex

Some Regex syntax Find quoted text "(.*?)" Lookahead: matches “x” only if “x” is followed by “y” x(?=y) Negative lookahead: matches “x” only if “x” is NOT followed by “y” x(?!y) Lookbehind: matches “x” only if “x” is preceded by “y” (?=y)x Negative lookbehind: matches “x” only if “x” is NOT preceded by “y” (?!y)x CSV file line columns counts Using comma as delimiter. ,|(".*?"(,(?!$))?) break above down as: , a standard comma | or ( start of group ".

SQL error

1. “Cannot load Counter Name data because an invalid index” When trying to install SQL2019 PolyBase (and possibly other programs as well), you may receive error “Cannot load Counter Name data because an invalid index” exception To fix this error, start CMD as administrator and run C:\WINDOWS\System32> lodctr /r then run C:\WINDOWS\SysWOW64> lodctr /r If all success, you should receive message: “Info: Successfully rebuilt performance counter setting from system backup store”