Monday, November 20, 2023

Get Network Interface Card GUID in Windows

Get Network Interface Card GUID in Windows

Method 1 - using netsh
PS C:\> netsh lan show interfaces
Below shows sample output
There is 1 interface on the system:

    Name             : Ethernet
    Description      : Microsoft Hyper-V Network Adapter
    GUID             : 17ab0088-6ca5-4aac-82bb-c533700cda21
    Physical Address : 00-15-5D-1C-45-00
    State            : Connected. Network does not support authentication.
Method 2 - using PowerShell WMI
PS C:\> Get-CimInstance -ClassName Win32_NetworkAdapter | Select-Object -Property DeviceID, GUID, Name
Below shows sample output
DeviceID GUID                                   Name
-------- ----                                   ----
0                                               Microsoft Kernel Debug Network Adapter
1        {17AB0088-6CA5-4AAC-82BB-C533700CDA21} Microsoft Hyper-V Network Adapter
2                                               WAN Miniport (SSTP)
3                                               WAN Miniport (IKEv2)
4                                               WAN Miniport (L2TP)
5                                               WAN Miniport (PPTP)
6                                               WAN Miniport (PPPOE)
7                                               WAN Miniport (IP)
8                                               WAN Miniport (IPv6)
9                                               WAN Miniport (Network Monitor)

Saturday, November 18, 2023

Control Panel console command equivalent

There are cases where you might need to run some of the Control Panel applets to perform quick configuration like add user accounts under different user credentials(say administrator account). Anyway below lists the files and equivalent Control Panel applet.
Command Description
access.cpl Accessibility Options
appwiz.cpl Add or REmove Programs
bthprops.cpl Bluetooth configuration
desk.cpl Display Properties
firewall.cpl Windows Firewall
hdwwiz.cpl Add Hardware Wizard
inetcpl.cpl Internet Properties
intl.cpl Regional and Laguage Options
irprops.cpl Infrared Properties
joy.cpl Game Controllers
jpicpl32.cpl Java Control Panel
main.cpl Mouse Properties
mmsys.cpl Sounds and Audio Devices Properties
ncpa.cpl Network Connections
powercfg.cpl Power Options Properties
sysdm.cpl System Properties
telephon.cpl Phone and Modem Properties
timedate.cpl Date and Time Properties
wscui.cpl Security and Maintenance

Wednesday, October 25, 2023

Enable SSH server on QNX 6.5

This is quick start guide how to run ssh server on QNX. Tested on QNX 6.5 (650SP1-VM.tar).

# ssh-keygen -t dsa -b 1024 -f /etc/ssh/ssh_host_dsa_key -N ''
# ssh-keygen -t rsa -b 1024 -f /etc/ssh/ssh_host_rsa_key -N ''

This is not security best practice but this is only a test machine. Enable direct root ssh login to the machine.
# sed -i 's/#PermitRootLogin no/PermitRootLogin yes/g' /etc/ssh/sshd_config

To start ssh service interactively, do:
# /usr/sbin/sshd

Use /usr/sbin/sshd -ddd to view debug output

To run sshd on start, add the following to /etc/rc.d/rc.local:
/usr/sbin/sshd &
Reference:
http://www.qnx.com/developers/docs/660/index.jsp?topic=%2Fcom.qnx.doc.neutrino.utilities%2Ftopic%2Fs%2Fsshd.html

Using INTEL PRO/1000 Gigabit driver in QNX 6.6 running on VMware ESXi

Using INTEL PRO/1000 Gigabit driver in QNX 6.6 running on VMware ESXi

When installing QNX 6.6 using VM-QNXSDP660-201402230339.iso on VMware ESXi (8.0 update 2) the default network apapter used is AMD Lance PCNet 32. The PCNet 32 driver reports to only support 10Mbps, for cases where higher network bandwidth is needed Intel PRO/1000 Gigabit is a good choice. To load Intel PRO/1000 Gigabit, edit /etc/rc.d/startup_aps.sh and comment out pcnet.so driver and add dirver for e1000, like:
#io-pkt-v4-hc -d /lib/dll/devn-pcnet.so &
io-pkt-v4-hc -d /lib/dll/devnp-e1000.so &

Saturday, October 14, 2023

Installing Vim 7.2 in QNX 6.5 using pkgsrc

Installing Vim 7.2 in QNX 6.5 using pkgsrc

QNX 6.5 self-hosted Neutrino host ships with vi but Vim 7.2 is a big imporovement over the default application. Below are the steps to install Vim 7.2 using pkgsrc.
  • Download the bootstrap package
    http://archive.netbsd.org/pub/pkgsrc-archive/packages/QNX/i386/6.5.0_head_20110826/bootstrap.tar.gz
  • Download Vim package and dependencies from the link below
    http://archive.netbsd.org/pub/pkgsrc-archive/packages/QNX/i386/6.5.0_head_20110826/All
    vim-share-7.2.446.tgz
    libiconv-1.14.tgz
    gettext-lib-0.18.1.1.tgz
    vim-7.2.446nb1.tgz
        
  • Copy the files into /tmp using ftp, Momentics IDE, sftp, etc
    #: ls /tmp
    bootstrap.tar.gz
    vim-share-7.2.446.tgz
    libiconv-1.14.tgz
    gettext-lib-0.18.1.1.tgz
    vim-7.2.446nb1.tgz
    
  • Install bootstrap package into the root folder
    #: tar -xvzf bootstrap.tar.gz -C /
    
  • Add pkgsrc utilities into the path
    #: echo 'export PATH=${PATH}:/usr/pkg/bin:/usr/pkg/sbin' >> ~/.profile
    
  • Modify /etc/rc.d/rc.local to update CS_LIBPATH system variable
    setconf CS_LIBPATH $(getconf CS_LIBPATH):/usr/pkg/lib
    
  • Logout and then log back in
  • Install dependencies and Vim
    #: pkg_add -v /tmp/libiconv-1.14.tgz
    #: pkg_add -v /tmp/gettext-lib-0.18.1.1.tgz
    #: pkg_add -v /tmp/vim-share-7.2.446.tgz
    #: pkg_add -v /tmp/vim-7.2.446nb1.tgz
    
  • Fix backspace not deleting the character by adding the following to ~/.vimrc
    set backspace=indent,eol,start
    
  • Run Vim!
    #: export TERM=ansi
    #: vim
    
Refs:
https://community.qnx.com/sf/wiki/do/viewPage/projects.pkgsrc/wiki/BinaryPackages

How to apply QNX 6.5 SP1 into an existing QNX self hosted installation

How to apply QNX 6.5 SP1 into an existing QNX self hosted installation

This was tested on VirtualBox with QNX 6.5.0 self-hosted Neutrino host.
Below are the quick steps
  • Mount the QNX 6.5 SP1 iso (qnxsdp-6.5.0SP1.iso)
  • Run the following command in QNX terminal
    Load CD/DVD-ROM driver
    devb-eide cdrom
    
    Mount the cd/dvd-rom
    mount -t cd /dev/cd0 /cd
    
    Install the update
    cd /cd
    sh ./qnxsdp-6.5.0SP1-201206270843-nto.sh
    

Building in QNX Momentics 6.5 SP1 throws "Couldn't reserve space for cygwin's heap, Win32 error 0"

Building in QNX Momentics 6.5 SP1 throws "Couldn't reserve space for cygwin's heap, Win32 error 0"

Buiding barebones QNX C++ program throws "Couldn't reserve space for cygwin's heap, Win32 error 0". See sample output below
C:\QNX650\host\win32\x86\usr\bin\make.exe -k CPULIST=x86 all --file=C:/Users/u1/AppData/Local/Temp/QMakefile169726255947317724.tmp 
      0 [main] us 0 init_cheap: VirtualAlloc pointer is null, Win32 error 487
AllocationBase 0x0, BaseAddress 0x71690000, RegionSize 0x330000, State 0x10000
C:\QNX650\host\win32\x86\usr\bin\sh.exe: *** Couldn't reserve space for cygwin's heap, Win32 error 0
C:/QNX650/host/win32/x86/usr/bin/make.exe -j 1 -Cx86 -fMakefile all
make.exe[1]: Entering directory `C:/ide-4.7-workspace/test1/x86'
C:/QNX650/host/win32/x86/usr/bin/make.exe -j 1 -Co -fMakefile all 
make.exe[2]: Entering directory `C:/ide-4.7-workspace/test1/x86/o'
make.exe[2]: Nothing to be done for `all'.
make.exe[2]: Leaving directory `C:/ide-4.7-workspace/test1/x86/o'
C:/QNX650/host/win32/x86/usr/bin/make.exe -j 1 -Co-g -fMakefile all
make.exe[2]: Entering directory `C:/ide-4.7-workspace/test1/x86/o-g'
make.exe[2]: Nothing to be done for `all'.
make.exe[2]: Leaving directory `C:/ide-4.7-workspace/test1/x86/o-g'
make.exe[1]: Leaving directory `C:/ide-4.7-workspace/test1/x86'
It seems like "C:\QNX650\host\win32\x86\usr\bin\msys-1.0.dll" needs to be loaded at specific address, to fix do the following: 
  • Install 32-bit version of Git for Windows - it ships with rebase.exe
  • Then run the following commands:

    Create a backup, just incase we need to revert back.
    cp "C:\QNX650\host\win32\x86\usr\bin\msys-1.0.dll" "C:\QNX650\host\win32\x86\usr\bin\msys-1.0.dll.bak"
    

    Change directory to the rebase.exe executable
    cd "C:\Program Files (x86)\Git\bin"
    

    Perform rebase
    rebase.exe -b 0x50000000 C:\QNX650\host\win32\x86\usr\bin\msys-1.0.dll
    

Refs:
https://www.qnx.com/support/knowledgebase.html?id=5011O000001OLXD

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...