Skip to main content

Posts

Showing posts with the label Ubuntu

Running OPC UA .Net Standard PubSub reference server on Ubuntu 22.04 using dotnet-sdk-6.0

Running OPC UA .Net Standard PubSub reference server on Ubuntu 22.04 using dotnet-sdk-6.0 System info: OS: Ubuntu 22.04 OPC UA .Net Standard under test: 1.4.371.96 Install MQTT broker $: sudo apt install mosquitto Install dotnet-sdk-6.0 $: sudo apt install dotnet-sdk-6.0 Install git as needed $: sudo apt install git Clone OPC UA .Net Standard git repo $: mkdir ~/prj $: cd ~/prj $: git clone https://github.com/OPCFoundation/UA-.NETStandard.git $: cd UA-.NETStandard $: git checkout refs/tags/1.4.371.96 Run publisher $: dotnet run --project Applications/ConsoleReferencePublisher/ConsoleReferencePublisher.csproj --framework net6.0 Run subscriber (on another terminal) $: cd ~/prj/UA-.NETStandard $: dotnet run --project Applications/ConsoleReferenceSubscriber/ConsoleReferenceSubscriber.csproj --framework net6.0

Unable to install updates (null): cannot refresh "snap-store": snap "snap-store" has running apps (snap-store)

Unable to install updates (null): cannot refresh "snap-store": snap "snap-store" has running apps (snap-store), pids:##### Using Ubuntu Software to update Snap packages failed on Ubuntu 22.04. To fix it run the following: $: killall snap-store $: snap refresh

Running OPC UA .Net Standard PubSub reference server on Ubuntu 20.04 using dotnet-sdk-3.1

Running OPC UA .Net Standard PubSub reference server on Ubuntu 20.04 using dotnet-sdk-3.1 High Level Info: OPC UA .Net Standard under test: 1.4.371.96 OS: Ubuntu 20.04 (>20.04 not working due to dotnet-sdk-3.1 is not supported) Install dotnet-sdk-3.1 $: wget https://packages.microsoft.com/config/ubuntu/20.04/packages-microsoft-prod.deb -O packages-microsoft-prod.deb $: sudo dpkg -i packages-microsoft-prod.deb $: rm packages-microsoft-prod.deb $: sudo apt update $: sudo apt install dotnet-sdk-3.1 Clone OPC UA .Net Standard git repo $: mkdir -p ~/prj $: git clone -b 1.4.371.96 https://github.com/OPCFoundation/UA-.NETStandard.git Install MQTT broker Mosquitto and supporting tools $: sudo apt install mosquitto $: sudo apt install mosquitto-clients Run mqtt sub client to see traffic $: mosquitto_sub -h localhost -v -t '#' Run reference PubSub publisher $: cd ~/prj/UA-.NETStandard/Applications/ConsoleReferencePublisher $: dotnet run --project ConsoleReferen

Add hard drive into Linux Mint 21.1 Vera/Ubuntu/Debian

Add hard drive into Linux Mint 21.1 Vera/Ubuntu/Debian This is a condensed version on how to add hard disk into Linux Mint/Ubuntu/Debian. First check hard drives in the system, like so: $: sudo lshw -C disk It should show (partial data only) like this: *-disk:1 description: ATA Disk product: WDC WD3200AAKX-0 vendor: Western Digital physical id: 1 bus info: scsi@1:0.0.0 logical name: /dev/sdb version: 1H15 serial: WD-WMC2E0871450 size: 298GiB (320GB) capabilities: partitioned partitioned:dos configuration: ansiversion=5 logicalsectorsize=512 sectorsize=512 signature=e32ff1f9 Using parted , let's now configure the harddisk/partition $: sudo parted /dev/sdb In parted prompt, create a new GPT partition table (parted) mklabel gpt Change the default unit to GB (parted) unit GB Create one partition occupying all the space on the drive (parted) mkpart primary ext4 0 100% Check to verify the layout (parted) print It should show somethi

How to expand Ubuntu VM root partition

How to expand Ubuntu VM root partition In this post I have expanded the virtual disk of a Ubuntu VM via VirtualBox Media Manager. The OS inside the VM will not automatically use the additional space. In this post I will show how to expand the root partition to make use of the additional space. There are multiple ways to expand a partition in Linux, in this post I will document how to do it using GParted.  Change the VM configuration to boot using Ubuntu installer.  Boot the VM using the Ubuntu ISO installer Run GParted - in the warning dialog that says not all space is used, hit on the Fix button Select the partition to resize and click Resize/Move partition button Expand the partition to the desired size The hit on Apply All Operations Shutdown the VM, remove/detach ISO, then reboot the computer   .end.

How to expand virtual hard disk in VirtualBox

How to expand virtual hard disk in VirtualBox To expand a virtual disk in VirtualBox open Oracle VM Virtual Manager then do File | Virtual Media Manager... (Ctrl+D) menu option. Then select the disk you wanted to expand. Note that VirtualBox does not support expanding a snapshot - you can expand but it will not work. You either have to delete all the snapshots or create a full clone of the snapshot. In the screen capture below I have created a full clone of Ubu2110 to Ubu2110-C1 and adjusted the size from 10GB to 12GB. In the next post , we will explore how to expand storage of a Ubuntu VM to make use of the additional space. Keywords: VirtualBox Ubuntu Expand

Resolve Windows NetBIOS name in Ubuntu 20.04

Resolve Windows NetBIOS name in Ubuntu 20.04 It is very common to have a mix of Windows and Ubuntu/Linux in an enterprise environment. There are scenarios where Ubuntu can get IP via DHCP but not enroll the machine to DNS. To resolve Windows NetBIOS machine name in Ubuntu in a workgroup environment do the following. Install nss-winbind like below $: sudo apt install libnss-winbind Then update /etc/nsswitch.conf . On Ubuntu 20.04, this will be line 12, which should look like below: hosts: files wins dns Refs: https://8thstring.blogspot.com/2010/05/resolve-netbios-name-in-ubuntu.html

WSL2: Ubuntu fails to start ssh server

WSL2: Ubuntu fails to start ssh server Running sudo service ssh start fails with error message like below: * Starting OpenBSD Secure Shell server sshd sshd: no hostkeys available -- exiting. It is failing because there are no keys generated in the system, to fix it do: $: sudo ssh-keygen -A You should now able to able to start it, like: $: sudo service ssh start

Installing WSL2 on Windows Server 20H2

Installing WSL2 on Windows Server 20H2 Environment info  Host: Windows 10 Release 1909 Pro Virtualization: VMware Professional 14 Pro  Prerequisite  Windows Server 20H2 VMware Tools installed - mount the installer ( Menu | Install VMware Tools... ) PS C:\>setup.exe /S /v "/qn REBOOT=R ADDLOCAL=ALL" PS C:\>shutdown /t 0 /f /r Enable nested virtulization on the VM Install WSL2 Ubuntu 20.04 PS C:\>dism.exe /online /enable-feature /featurename:Microsoft-Windows-Subsystem-Linux /all /norestart PS C:\>dism.exe /online /enable-feature /featurename:VirtualMachinePlatform /all /norestart PS C:\>shutdown /t 0 /f /r PS C:\>#Wait for the reboot to complete PS C:\>Invoke-WebRequest https://wslstorestorage.blob.core.windows.net/wslblob/wsl_update_x64.msi -OutFile $HOME\Downloads\wsl_update_x64.msi PS C:\>cd $HOME\Downloads PS C:\>msiexec.exe /i wsl_update_x64.msi /quiet /qn PS C:\>wsl --set-default-version 2 PS C:\>curl.exe -L -o ubuntu-2004.zip

iftop shows qqqq under tmux

 Running iftop in tmux shows qqqq for the border, like below. To fix this do: $: sudo TERM=xterm iftop

Adding existing user to a group in Ubuntu

Example below adds user timus to the group www-authors $: sudo usermod -a -G www-authors timus To add user timus to sudoers group, do: $: sudo usermod -a -G sudo timus Note: That for the sudo to take effect you have to logout and log back in. In Debian Buster (10.3), need to reboot for it to take effect Tested on: - Lubuntu (13.04) - Ubuntu (12.04 - 13.04) - Debian Buster (10.3) References: http://www.cyberciti.biz/faq/howto-linux-add-user-to-group/ http://askubuntu.com/questions/7477/how-can-i-add-a-new-user-as-sudoer-using-the-command-line

How to get GNOME version from the command line

Get Gnome version from terminal $: gnome-shell --version Alternative ways to get version, works on older versions of Gnome. $: gnome-about --version This will show something like: GNOME gnome-about 2.32.0 This can also be done using the command below. $: gnome-session --version Above command does not work on Fedora 22 Workstation. Tags: GNOME version command line cli

Creating Ubuntu 19.04 using Quick Create mode in Hyper-V with Enhanced Session Mode

Hyper-V that is shipped with Windows 10 1903 is supposed to have Enhanced Session Mode support for Ubuntu 19.04 when the VM was created using Quick Create option. As of December 1, 2019 Enhanced Session Mode is not working, as a workaround, do the following steps. Assuming a Ubuntu 19.04 VM was created using "Quick Create" option, do: 1. From the host machine, run PowerShell as administrator PS c:\> Set-VM -VMName __Ubuntu_VM_Name_here__ -EnhancedSessionTransportType HvSocket Replace  __Ubuntu_VM_Name_here__ with the Hyper-V VM name. You have to ensure that the VM is not running at this point. 2. Power-up the VM, and then install linux-azure kernel, like: $: sudo apt install linux-azure 3. Shutdown the VM. This is very important, restarting the VM does not work. You can do, like: $: sudo shutdown -h now Once the VM is turned off, turn it back on. It should now have Enhanced Session Mode. For example, the screen dimension can be changed on connection, co

Helpful Midnight Commander escape key sequences when function keys are not working

Running Midnight Commander on a Linux machine remotely that does not have function key support or not easy to access like mobile phones can be challenging. Generally, Linux console supports escape sequences, for example to simulate F1, press ESC+1 (press escape key, then press 1). Below shows convenient list of escape sequences for Midnight Commander Action Shortcut Escape Sequence (⎋ symbol) Close application F10 ⎋+0 User Menu F2 ⎋+2 Application Menu F9 ⎋+9