Thursday, September 28, 2023

InstallScript: How to use Kernel32 MoveFile

InstallScript: How to use Kernel32 MoveFile

MoveFile Kernel32 API function moves an existing file or a directory, including its children.
Below shows an example code how to use it in InstallScript

Sunday, September 10, 2023

Eclipse shortcut keys

This are some of the shortcut keys that I find useful while working with Eclipse.

Key Action
Ctrl+/ Comment out the current line
Ctrl+\ Uncomment the current line
Ctrl+D Delete the current line
Ctrl+M Maximize editor view
Ctrl+Alt+Arrow Up Duplicate current line, maintain caret location
Ctrl+Alt+Arrow Down Duplicate current line, move caret location down
Ctrl+Shift+p Find matching bracket
Window Navigation
Ctrl+F7 Move to different views.
Ctrl+F6 Move to different editor windows
Alt+Shift+Q+C Focus Console View
Alt+F7 Switch between different consoles
Misc
Ctrl+O Quick Outline

Wednesday, August 16, 2023

Doing winget install fails with a message "Failed when searching source: msstore An unexpected error occurred while executing the command: 0x8a15005e : The server certificate did not match any of the expected values."

Doing winget install fails with a message "Failed when searching source: msstore An unexpected error occurred while executing the command: 0x8a15005e : The server certificate did not match any of the expected values."

I tried to install Windows Terminal using the command below -
C:\>winget install Microsoft.WindowsTerminal
But got the following error message instead.
Failed when searching source: msstore An unexpected error occurred while executing the command: 0x8a15005e : The server certificate did not match any of the expected values.
The following packages were found among the working sources.
Please specify one of them using the --source option to proceed.
Name             Id                        Source
-------------------------------------------------
Windows Terminal Microsoft.WindowsTerminal winget
Reason:
This is normally caused by SSL inspection used in enterprise environments.
Workaround:
C:\>winget settings --enable BypassCertificatePinningForMicrosoftStore

See below for details:
https://github.com/microsoft/winget-cli/issues/2879

Monday, August 14, 2023

Minimal OPC UA client that auto generates self signed certificate on startup in C#

Minimal OPC UA client that auto generates self signed certificate on startup in C#

This is minimal OPC UA client in C# that demonstrates self signed certificate auto generation on startup.
Pre-Req

Steps
Full working code can be found here.

Saturday, August 12, 2023

OPC UA Read service using C#

OPC UA Read service using C#

This is a sample bare bones OPC UA C# application performing a Read service.
Pre-Req

Steps
Full working code can be found here.

Batch convert file line ending from Windows to Linux using Notepad++

Batch convert file line ending from Windows to Linux using Notepad++

Working on cross-platform project means you have to be careful with file line endings. If for some reason the files were not using the correct line endings Notepad++ can be used to do batch conversion of the files. To do so, open Find in Files (Ctrl+Shift+F) and use the following options:
Find what: (\r\n)
Replace with : \n
Filters : *.*
Directory : C:\Temp
Search Mode: (o) Regular expression

Installing QNX 6.4.1 on Ubuntu 20.04

Installing QNX 6.4.1 on Ubuntu 20.04 Install pre-requisites $: sudo dpkg --add-architecture i386 $: sudo apt update $: sudo apt install li...