6/23/2024

Fedora - VLC cannot play MP4

The symptom is when you play a mp4 video, you can only hear the sound but you cannot see the video. Also, if you are running in a terminal, you will see the error like "main decoder error: buffer deadlock prevented"

I tried to remove and reinstall it from the VLC official site, but I got the same result. 

Here is the solution which works for me. 

https://discussion.fedoraproject.org/t/how-to-fix-vlc-in-fedora-40/118009


sudo dnf install libavcodec-freeworld --allowerasing 

rm -R ~/.config/vlc

5/24/2024

Fedora 40 - Installation

Get Fedora 40  

Create Installation USB 

# dd if=/path/to/image.iso of=/dev/sdX bs=8M status=progress oflag=direct

Nvidia GeForce MX150 Driver install

sudo dnf install https://mirrors.rpmfusion.org/free/fedora/rpmfusion-free-release-$(rpm -E %fedora).noarch.rpm https://mirrors.rpmfusion.org/nonfree/fedora/rpmfusion-nonfree-release-$(rpm -E %fedora).noarch.rpm
sudo dnf install akmod-nvidia-470xx

Install LXDE

su -c 'dnf group install lxde-desktop'

Do all settings in the GNOME user interface, then switch to LXDE. Because there are many settings, you cannot find in LXDE.

I could not find the Language installation, so I just installed the IME, and it worked. Wow~~~

For IME, we need to install "酷音" manually. 

Install Google Chrome

Install VLC

Install gscan2pdf

Install KeePassXC

This is the first time I have used the Boxes VM.  I installed Windows 11 Pro, VS2022 Community, MS SQL Developer and MS SQL Management Studio.  It is working well.

-- update on 07/13/2024

SPICE has a limit on file size. I want to copy a file size of around 500MB, but it shows the file size exceeds the limit. So, install SAMBA instead.

If you want to share a Linux folder and clipboard with Windows, install Spice WebDAV daemon and Windows SPICE Guest Tools in Windows. 

https://www.spice-space.org/download.html

https://www.spice-space.org/download/windows/spice-webdavd/

https://www.spice-space.org/download/windows/spice-guest-tools/spice-guest-tools-latest.exe



Rust - Installation

I am using Fedora as the working environment.  The Rust-related information below is based on my working environment.

Rust installation

Visual Studio Code for Rust

Rust by Example



4/27/2024

VM Player install failed on Ubuntu 24.04

When I tried to install VMWare Player 17.5.1 on Ubuntu 24.04, I got the below error messages. 

Message: 'stderr: [AppLoader] Use shipped Linux kernel AIO access library.
An up-to-date "libaio" or "libaio1" package from your system is preferred.
[AppLoader] GLib does not have GSettings support.
Using kernel build system.
warning: the compiler differs from the one used to build the kernel
  The kernel was built by: x86_64-linux-gnu-gcc-13 (Ubuntu 13.2.0-23ubuntu4) 13.2.0
  You are using:           gcc (Ubuntu 13.2.0-23ubuntu4) 13.2.0
/tmp/modconfig-i3MEkp/vmmon-only/common/crosspage.o: warning: objtool: CrossPage_CodePage+0x207: \'naked\' return found in RETHUNK build
make[3]: *** [scripts/Makefile.build:243: /tmp/modconfig-i3MEkp/vmmon-only/common/crosspage.o] Error 255
make[3]: *** Deleting file \'/tmp/modconfig-i3MEkp/vmmon-only/common/crosspage.o\'
make[3]: *** Waiting for unfinished jobs....
/tmp/modconfig-i3MEkp/vmmon-only/linux/hostif.c:2926:1: warning: no previous prototype for \u2018HostIFCheckTrackedMPN\u2019 [-Wmissing-prototypes]
 2926 | HostIFCheckTrackedMPN(VMDriver *vm, // IN: The VM instance
      | ^~~~~~~~~~~~~~~~~~~~~
/tmp/modconfig-i3MEkp/vmmon-only/linux/hostif.c:3046:1: warning: no previous prototype for \u2018HostIFWritePhysicalWork\u2019 [-Wmissing-prototypes]
 3046 | HostIFWritePhysicalWork(MA ma,             // MA to be written to
      | ^~~~~~~~~~~~~~~~~~~~~~~
/tmp/modconfig-i3MEkp/vmmon-only/linux/hostif.c:3205:1: warning: no previous prototype for \u2018HostIFStartTimer\u2019 [-Wmissing-prototypes]
 3205 | HostIFStartTimer(Bool rateChanged,  //IN: Did rate change?
      | ^~~~~~~~~~~~~~~~
/tmp/modconfig-i3MEkp/vmmon-only/linux/driver.c:271:1: warning: no previous prototype for \u2018LinuxDriverInit\u2019 [-Wmissing-prototypes]
  271 | LinuxDriverInit(void)
      | ^~~~~~~~~~~~~~~
/tmp/modconfig-i3MEkp/vmmon-only/linux/driver.c:339:1: warning: no previous prototype for \u2018LinuxDriverExit\u2019 [-Wmissing-prototypes]
  339 | LinuxDriverExit(void)
      | ^~~~~~~~~~~~~~~
make[2]: *** [/usr/src/linux-headers-6.8.0-31-generic/Makefile:1926: /tmp/modconfig-i3MEkp/vmmon-only] Error 2
make[1]: *** [Makefile:240: __sub-make] Error 2
make: *** [Makefile:117: vmmon.ko] Error 2
Using kernel build system.
warning: the compiler differs from the one used to build the kernel
  The kernel was built by: x86_64-linux-gnu-gcc-13 (Ubuntu 13.2.0-23ubuntu4) 13.2.0
  You are using:           gcc (Ubuntu 13.2.0-23ubuntu4) 13.2.0
/tmp/modconfig-i3MEkp/vmnet-only/userif.c:1091:1: warning: no previous prototype for \u2018VNetUserIf_Create\u2019 [-Wmissing-prototypes]
 1091 | VNetUserIf_Create(VNetPort **ret) // OUT
      | ^~~~~~~~~~~~~~~~~
/tmp/modconfig-i3MEkp/vmnet-only/netif.c:173:1: warning: no previous prototype for \u2018VNetNetIf_Create\u2019 [-Wmissing-prototypes]
  173 | VNetNetIf_Create(char *devName,  // IN:
      | ^~~~~~~~~~~~~~~~
/tmp/modconfig-i3MEkp/vmnet-only/bridge.c:258:1: warning: no previous prototype for \u2018VNetBridge_Create\u2019 [-Wmissing-prototypes]
  258 | VNetBridge_Create(const char *devName, // IN:  name of device (e.g., "eth0")
      | ^~~~~~~~~~~~~~~~~
/tmp/modconfig-i3MEkp/vmnet-only/bridge.c:1411:1: warning: no previous prototype for \u2018VNetBridgeSendLargePacket\u2019 [-Wmissing-prototypes]
 1411 | VNetBridgeSendLargePacket(struct sk_buff *skb,        // IN: packet to split
      | ^~~~~~~~~~~~~~~~~~~~~~~~~
/tmp/modconfig-i3MEkp/vmnet-only/userif.o: warning: objtool: VNetCsumAndCopyToUser+0x2d: call to csum_partial_copy_nocheck() with UACCESS enabled
/tmp/modconfig-i3MEkp/vmnet-only/vnetUserListener.c:87:1: warning: no previous prototype for \u2018VNetUserListener_Create\u2019 [-Wmissing-prototypes]
   87 | VNetUserListener_Create(uint32 classMask,  // IN: the listener\'s class mask
      | ^~~~~~~~~~~~~~~~~~~~~~~
Skipping BTF generation for /tmp/modconfig-i3MEkp/vmnet-only/vmnet.ko due to unavailability of vmlinux
Unable to install all modules.  See log for details.

But the VMWare Player icon shows up in the menu. When I launch it, it will try to compile VMWare Tools and then fail.

I'm not sure from which version of Ubuntu onwards, there have been build issues with the vmmon and vmnet modules. 

The solution is to build the vmmon and vmnet modules by yourself. 

Go to here download the source code
https://github.com/mkubecek/vmware-host-modules/tree/workstation-17.5.1

Then, check the INSTALL instructions for building these two modules. 

I follow the below instructions to resolve the problem. 

2b. Build and install modules - replacing the original source tarballs

----------------------------------------------------------------------

Manual build and installation of host modules may be natural for developers
and power users but those who prefer to "just use" would appreciate if they
could rely on standard VMware tools. To this goal, we need to replace the
module source tarballs with patched versions.

In local checked out repository, the replacement tarballs can be created
with

  make tarballs

This command creates files vmmon.tar and vmnet.tar which can be used to
replace the original tarballs provided with the VMware product. Note that
this command creates the tarball from current HEAD (in git language), i.e.
they do not contain any uncommited local changes (e.g. files created by
test build).

When using a downloaded tarball, simply run

  tar -cf vmmon.tar vmmon-only
  tar -cf vmnet.tar vmnet-only

to create the tarballs. In this case, there is no protection against
unwanted local changes.

Whatever way you used to create the tarballs, replace the original ones
provided by VMware

  /usr/lib/vmware/modules/source/vmmon.tar
  /usr/lib/vmware/modules/source/vmnet.tar

by patched versions. It is highly recommended to backup the original
tarballs before replacing them.

Once patched tarballs are installed, you can rebuild the modules as usual:

  vmware-modconfig --console --install-all

or let the GUI run the command for you.

Replacing the original tarballs prevents having to rebuild and install the
modules manually with every new kernel version. However, once the VMware
product is upgraded or reinstalled, tarballs are replaced so that if the
new VMware version doesn't build/work with a recent kernel, you still need
to repeat the process. The same also holds if there is a new kernel which
requires updated version of the patches.]

4/14/2024

Dotnet, VS Code development environment setup on Ubuntu 23.04

Dotnet Runtime or Dotnet SDK installation 

https://learn.microsoft.com/en-us/dotnet/core/install/linux-ubuntu#register-the-microsoft-package-repository

https://learn.microsoft.com/en-us/dotnet/core/install/linux-ubuntu-install?pivots=os-linux-ubuntu-2404&tabs=dotnet8

VS Code and C#

https://code.visualstudio.com/docs/languages/csharp


1/02/2022

Docker MSSQL on Ubuntu 21.04

Install Docker Engine on Ubuntu

Quickstart: Run SQL Server container images with Docker

Docker Hub - Microsoft SQL Server

Install sqlcmd and bcp the SQL Server command-line tools on Linux

Current Docker Images from Docker Hub do not support Diagram Design Visual Tools.  That means you can not use SQL Management Studio to design the table. 

You can use Azure Data Studio to connect to MSSQL, but there is no fancy tool for table design. 

I just found Visual Studio Server Explorer can do the table design in VS.

Running SQL Server Developer in a Windows-based Docker Container


12/23/2021

MSSQL UNPIVOT and PIVOT example


MSSQL UNPIVOT and PIVOT example

drop table #tmp_1;

SELECT UB92_Exp1Id, row_number() over (order by DxCode) as DxIdx, DxCode, DxCodes
into	#tmp_1
FROM   
   (SELECT	UB92_Exp1Id
		,UB_67 as DiagA
		,UB_68 as DiagB
		,UB_69 as DiagC
		,UB_70 as DiagD
		,UB_71 as DiagE
		,UB_72 as DiagF
		,UB_73 as DiagG
		,UB_74 as DiagH
		,UB_75 as DiagI
		,UB_67_I as DiagJ
		,UB_67_J as DiagK
		,UB_67_K as DiagL
	FROM Rey.UB92_Exp1
	where FileNo='xxxxxx') p  
UNPIVOT  
   (DxCodes FOR DxCode IN   
      (DiagA, DiagB, DiagC, DiagD, DiagE, DiagF, DiagG, DiagH, DiagI, DiagJ, DiagK, DiagL)  

) AS unpvt;  
  

select * from #tmp_1

SELECT	*
FROM
(
	select	a.UB92_Exp1Id, 'Diag'+Char(64+a.DxIdx) as Dx, a.DxCodes
	from	#tmp_1 a

) AS src 
PIVOT(
	max(DxCodes) FOR [Dx] IN ([DiagA],[DiagB],[DiagC],[DiagD],[DiagE],[DiagF],[DiagG],[DiagH],[DiagI],[DiagJ],[DiagK],[DiagL])
) AS DiagRow;