Monday, March 13, 2023

tmux with git-bash

 Install tmux with git-bash (mingw64)

Download 2 pre-built packages from: https://repo.msys2.org/msys/x86_64/

tmux-<version>-x86_64.pkg.tar.zst 

libevent-devel-<version>-x86_64.pkg.tar.zst 

Download Zstd for windows (used for decompressing ZST files):  https://sourceforge.net/projects/zstd-for-windows/files/

Unzip Zstd tool then use it to extract .tar.zst files to get tar files:

zstd.exe -d <path-to-file>.tar.zst

Use 7z to unzip tmux-<version>-x86_64.pkg.tar and libevent-devel-<version>-x86_64.pkg.tar, then copy all tmux.exe and libevent related dll files to C:\Git\mingw64\bin

Done.


Wednesday, February 15, 2023

Dbus error after running Eclipse Oxygen

Error when running Eclipse Oxygen (with CDT) on lubuntu 20.04:

GLib-GIO-CRITICAL **: 16:15:43.425: g_dbus_proxy_new: assertion 'G_IS_DBUS_CONNECTION (connection)' failed

Fixed the sympthon by following command (see: here):

sudo apt purge fcitx-module-dbus


Monday, February 13, 2023

Import OVA which is created by VMWare to VirtualBox

Notes about the problem I had when trying to import OVA created by VMWare to VirtualBox...

My environment: 
  • Windows 10 pro + VirtualBox v7.0 
    • VirtualBox downgraded to 6.1.26 due to this issue with Wayland
      • Still not fixed with Wayland on old linux guest machine (kernel 2.x)
Failed to import OVA file, error when trying import OVA file (exported by VMWare) to VirtualBox:  
  • VBOX_E_INVALID_OBJECT_STATE (0x80bb0007)
OVA file is just a tar file, so extracted it using 7z, we can see these 3 files:
  • vm-disk1.vmdk: Virtual Disk file
  • vm.mf: checksum data
  • vm.ovf: OVF file, VM definition file
Use "qemu-img" to check "vm-disk1.vmdk" (need to install qemu tool to Windows ):
> qemu-img info vm-disk1.vmdk
image: vm-disk1.vmdk
file format: vmdk
virtual size: 22 GiB (23667847168 bytes)
disk size: 316 MiB
cluster_size: 65536
Format specific information:
    cid: 1377153543
    parent cid: 4294967295
    create type: streamOptimized
    extents:
        [0]:
            compressed: true
            virtual size: 23667847168
            filename: vm-disk1.vmdk
            cluster size: 65536
            format:
Probably  VirtualBox could not handle the "streamOptimized" type or compressed vmdk disk image format. 

Tried  use "qemu-img" to convert it to non-compressed disk image:
> qemu-img convert -f vmdk vm-disk1.vmdk -O vmdk vm-disk1-decompressed.vmdk
    
> qemu-img info vm-disk1-decompressed.vmdk
image: vm-disk1-decompressed.vmdk
file format: vmdk
virtual size: 22 GiB (23667847168 bytes)
disk size: 709 MiB
cluster_size: 65536
Format specific information:
    cid: 3421777080
    parent cid: 4294967295
    create type: monolithicSparse
    extents:
        [0]:
            virtual size: 23667847168
            filename: vm-disk1-decompressed.vmdk
            cluster size: 65536
            format:
Ok, now it is "monolithicSparse" and not-compressed disk image type.

Because we just created a new disk, old checksum in file "vm.mf" cannot be used so just delete this file before trying to import again

Replace the  original "vm-disk1.vmdk" with "vm-disk1-decompressed.vmdk"(or edit the "vm.ovf" to make it point to "vm-disk1-decompressed.vmdk", no need to correct the disk size information in this case)

Now try to import again "vm.ovf" and we should be able to import it to VirtualBox. After this step, we can modify the config of the imported VM (cpu numer, memory size, etc., just check the "vm.ovf" and try to set the same config)

After this step, we can run the imported virtual machine, but if you see the error No bootable medium found! System halted , you should enable the "Enable EFI" config:


Done.

Saturday, January 14, 2023

'cmake'と'ccache'を一緒に使用する方法

CmakeではCMAKE__COMPILER_LAUNCHERがあり,これを使用するとコンパイラーを呼び出す時に一緒に呼び出される 使用例: 下記のようにtoolchainファイルに書き加えて使用するか,Cmakeを呼び出す時に-DCMAKE__COMPILER_LAUNCHERで定義して実行する
set(CMAKE_C_COMPILER_LAUNCHER ccache CACHE INTERNAL "")
set(CMAKE_CXX_COMPILER_LAUNCHER ccache CACHE INTERNAL "")
この設定は,cmake 3.4から使用できる

Monday, August 15, 2022

.NET Framework and .NET Core

・「.NET」は「.NET Framework」と考えていい - .NET Frameworkはアプリケーションフレームワークで,下記のものから構成されている - CLR (Common Language Runtime,共通言語ラインタイム) - BCL(Base Class Library,基本クラスライブラリ) - 各種ライブラリ、フレームワーク - Ex: ASP.NET, WPF ... - .NET Core: 新しい.NET実装で,オープンソース,クロスプラットフォームコンソールアプリケーション,ASP.NET Core Web Appとクラウン度サービスをビルドできる - .NET Standard: すべての .NET 実装が実装する必要のある基本 API のセット,この API を基本クラス ライブラリ (BCL) と呼びます。.NET Standard をターゲットにすることで、どの .NET 実装やどの OS で実行されても、すべての .NET アプリケーションが共有できるライブラリをビルドできます