2023年11月13日 星期一

2023 Promox on Morefine N6000 16GB 512GB

2023 Promox on Morefine N6000 16GB 512GB


Software

Etcher 100MB (not but can be rufus-4.3.exe 1.4MB)
Proxmox VE 7.4 ISO Installer (1st ISO release) 1GB

Console

root
Sky4dots

Web

https://192.168.1.60:8006

Reference

Google "proxmox 安裝教學"

https://post.smzdm.com/p/agqw24zw/

2023年7月24日 星期一

2023 VirtualBox DSM 5.2 Xpenology add entire disk



Google
"virtualbox directly use entire disk"
https://superuser.com/questions/495025/use-physical-harddisk-in-virtual-box

Ubuntu Disk

KINGSTON SA2000M8500G (S5Z42105) 50026B76845ED7E4 /dev/nvme0n1p1 EFI System
WDC WD3200AAJS-08L7A0 (03.03E03) WD-WCAV2V960601 /dev/sda1 Linux RAID auto
WDC WD30PURX-78P6ZY0 (80.00A80) WD-WCC4N1RYA6FU /dev/sdb 
WDC WD30PURX-89P6ZY0 (80.00A80) WD-WCC4N0XAR09S /dev/sdc


Existing vmdk

/home/user/VirtualBox VMs/dsm52/wd3200.vmdk
# Disk DescriptorFile
version=1
CID=d9aeed4d
parentCID=ffffffff
createType="fullDevice"
# Extent description
RW 625142448 FLAT "/dev/sda" 0
# The disk Data Base
#DDB
ddb.virtualHWVersion = "4"
ddb.adapterType="ide"
ddb.geometry.cylinders="16383"
ddb.geometry.heads="16"
ddb.geometry.sectors="63"
ddb.uuid.image="815e3d8a-2015-4612-bfbe-2aa887471d19"
ddb.uuid.parent="00000000-0000-0000-0000-000000000000"
ddb.uuid.modification="ee994653-01a3-46d9-ae65-4ea38ee6df89"
ddb.uuid.parentmodification="00000000-0000-0000-0000-000000000000"
ddb.geometry.biosCylinders="1024"
ddb.geometry.biosHeads="255"
ddb.geometry.biosSectors="2"

Command

sudo VBoxManage internalcommands createrawvmdk -filename /path/to/file.vmdk -rawdisk /dev/sda
mkdir /home/ricky/VirtualBox VMs/vmdks/
cd /home/ricky/VirtualBox VMs/vmdks/
sudo VBoxManage internalcommands createrawvmdk --filename wd3200.vmdk --rawdisk /dev/sda
sudo chown ricky wd3200.vmdk

New Command (correct syntax)
sudo VBoxManage internalcommands createrawvmdk --filename "/home/ricky/VirtualBox VMs/dsm52/wd3t78p.vmdk" --rawdisk /dev/sdb
sudo chown user wd3t78p.vmdk
sudo VBoxManage internalcommands createrawvmdk --filename "/home/ricky/VirtualBox VMs/dsm52/wd3t89p.vmdk" --rawdisk /dev/sdc
sudo chown ricky wd3t89p.vmdk

Virtualbox add amdk

Add SCSI Default LsiLogin controller
(Dont use SCSI BusLogic that cannot be detected)

2023 ASUS VPN AX56U Kwai Hong

2023 AX56U VPN

Kwai Hong 2022 2023
hkmimimall.ddns

AX56U
RT-AX56U V2
固件版本:3.0.0.4.386_51598
虚拟专用网 (VPN) 服务器: PPTP, OpenVPN, IPSec VPN
VPN 客户端: PPTP, L2TP, OpenVPN
Instant Guard

PPTP: Cannot use in China

OpenVPN: Need install OpenVPN app. Seems cannot use in China.
虚拟专用网 (VPN) 详细设置: General
服务器通信端口 55555
RSA 加密 1024 bit
客户端使用 VPN 访问网络 内部网络(LAN)
导出 OpenVPN 设置文件 client.ovpn

IPSec: Can use in China.
Description: ipsec
Server: hkmimimall.ddns.net
Account: leungirc
Password: Sky4dots
Certificate: No
GroupName: empty
Key: 131xxxx6

IPSec accounts (max 8 users):
leungric Sky4dots
ting unknown
ip12 unknown




2023 AC58U

Ching Fu Court 2023
hkwiwimall.asuscomm

RT-AC58U
韌體版本:3.0.0.4.380_8457
VPN 伺服器: PPTP, OpenVPN
VPN 用戶端: PPTP, L2TP, OpenVPN


2023年7月22日 星期六

2023 DSM 5.2 Xpenology on HyperV Enable Docker with synocommunity GateOne

 



HyperV nested virtualization
https://learn.microsoft.com/en-us/virtualization/hyper-v-on-windows/user-guide/nested-virtualization
Set-VMProcessor -VMName dsm -ExposeVirtualizationExtensions $true

synocommunity
https://xpenology.com/forum/topic/49139-invalid-location/
https://github.com/SynoCommunity/spksrc/issues/4897
# ssh root@192.168.1.41Sky4dots
sudo -i
mv /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/ca-certificates.crt.bak
curl -Lko /etc/ssl/certs/ca-certificates.crt https://curl.se/ca/cacert.pem
https://packages.synocommunity.com/

GateOne


2023年6月27日 星期二

Binance HTTP API

 https://api.binance.com/api/v3/ticker/price?symbol=BTCUSDT

{"symbol":"BTCUSDT","price":"30427.03000000"}

2023年5月15日 星期一

Ubuntu 20.04 Filemanager actions for right click open VSCode

 

https://askubuntu.com/questions/1049111/add-open-with-vscode-to-context-menu-in-ubuntu

sudo apt install filemanager-actions

2023年5月13日 星期六

CPP Dev on Windows on 2023

https://github.com/HO-COOH/CPPDevOnWindows
https://gitlab.com/etoricky/windows-10-clang-with-catch2

Operate on 2023-05-13

1. Install Clang

https://www.msys2.org/
MSYS2 MSYS
pacman -Syu  # Sync download update
pacman -S mingw-w64-x86_64-clang mingw-w64-x86_64-clang-tools-extra
pacman -S mingw-w64-x86_64-make
pacman -S mingw-w64-x86_64-gdb
pacman -S mingw-w64-x86_64-ninja
System Environment > Path > C:\msys64\mingw64\bin
pacman -S mingw-w64-x86_64-libc++

C:\Users\user>clang++ --version
clang version 16.0.2
Target: x86_64-w64-windows-gnu
Thread model: posix
InstalledDir: C:/msys64/mingw64/bin

C:\Users\user>gcc --version
gcc (Rev5, Built by MSYS2 project) 13.1.0
Copyright (C) 2023 Free Software Foundation, Inc.

C:\Users\user>ninja --version
1.11.1

2. Install CMake

cmake-3.26.3-windows-x86_64.msi
choose Add CMake to the system PATH for all users

C:\Users\user>cmake --version
cmake version 3.26.3

3. CLion

CLion-2023.1.2.exe
File > Settings > Build, Execution, Deployment > Toolchains
NameL MinGW
Toolset: C:\msys64\mingw64
CMakeL Bundled v3.25.2
Build Tool: C:\msys64\mingw64\bin\ninja.exe
C Compiler: C:\msys64\mingw64\bin\clang.exe
C++ Compiler: C:\msys64\mingw64\bin\clang++.exe
Debugger: MinGW-w64 GDB

4. VS Code

VSCodeUserSetup-x64-1.78.2.exe

Extension:
Microsoft C/C++ as Microsoft Language Server
dont install clangd
CMake, for cmake scirpts syntax highlight
CMake Tools, for actually running CMake
Settings > Cmake:Generator to MinGW Makefiles
Settings > Palette > CMake: Quick Start > Clang > apple > Executable
now can debug, syntax highlighting, auto complete

C/C++ Extension Pack v1.3.0

C:\Users\user>code --version
1.78.2

5. Git

Git-2.40.1-64-bit.exe

C:\Users\user>git --version
git version 2.40.1.windows.1


Done, can build

but  missing ctest, google test, clang-format, clang-tidy, llvm code coverage






End

2023年5月2日 星期二

Keep a process running after exiting SSH session

 

https://www.halfbit.de/howtos/keep-ssh-process/


ctrl+z
bg
disown
exit
ssh
ps- -ef



Keep a process running after exiting SSH session

  1. In SSH, launch the process you wish to keep in background, for example
cp -Rv /mnt/red/*.* /mnt/black
  1. Suspend the process by pressing Ctrl-Z.
  2. Resume suspended process in background by typing bg.
  3. Detach the process from SSH session by typing disown.
  4. Exit the SSH by typing exit.

The process will continue running in background.

🍭 Typing fg at step (3) will bring the process back to foreground.

2023年4月6日 星期四

Clang recompile with -fPIE PIC Position Independent Code 2023


Problemm:

/usr/bin/ld: _deps/ev-build/libev.a(ev.c.o): relocation R_X86_64_32 against `.rodata.str1.1' can not be used when making a PIE object; recompile with -fPIE

clang: error: linker command failed with exit code 1 (use -v to see invocation)

 

Way 1

Solution:

Add

-DCMAKE_POSITION_INDEPENDENT_CODE=ON

So that 

/usr/bin/cmake -GNinja -DCMAKE_BUILD_TYPE=Debug -DENABLE_CXX_CLANG_TIDY=TRUE -DENABLE_CODE_COVERAGE=TRUE -DCMAKE_C_COMPILER=/usr/bin/clang-15 -DCMAKE_CXX_COMPILER=/usr/bin/clang++-15 -DCMAKE_POSITION_INDEPENDENT_CODE=ON ..


Reference:

https://stackoverflow.com/questions/38296756/what-is-the-idiomatic-way-in-cmake-to-add-the-fpic-compiler-option





readme.md

sudo docker build . -t gfo/cpp-build
sudo docker rm -f cpp-build
sudo docker run --net=host --cap-add sys_ptrace -d --name cpp-build --memory=12g -v "${PWD}/../../../../:/work" gfo/cpp-build tail -F /dev/null
sudo docker exec -it cpp-build bash
mkdir build
cd build
cmake ../ -GNinja -DCMAKE_C_COMPILER=clang-9 -DCMAKE_CXX_COMPILER=clang++-9
ninja -j12
ninja test



Way 2:

Interpolated

/usr/bin/cmake -GNinja -DCMAKE_BUILD_TYPE=Debug -DCMAKE_C_COMPILER=/usr/bin/clang-15 -DCMAKE_CXX_COMPILER=/usr/bin/clang++-15 -DTEST_REPORTER=junit ..

/usr/bin/cmake --build . --target all
/usr/bin/cmake --build . --target test


Raw:

CMAKE_BUILD_DIR=cmake-build-dir
CMAKE_EXEC=/usr/bin/cmake
CXX_BUILD_SYSTEM=Ninja
CXX_BUILD_TYPE=Debug
CLANG_TIDY_FLAG=
CODE_COVERAGE_FLAG=-DENABLE_CODE_COVERAGE=TRUE
EXTRA_CMAKE_FLAGS=-DCMAKE_C_COMPILER=/usr/bin/clang-15 -DCMAKE_CXX_COMPILER=/usr/bin/clang++-15 -DTEST_REPORTER=junit

$ date -R
$ pwd
/builds/subdir/app
$ env | sort
$ mkdir -p ${CMAKE_BUILD_DIR}
$ cd ${CMAKE_BUILD_DIR}
${CMAKE_EXEC} -G"${CXX_BUILD_SYSTEM}" -DCMAKE_BUILD_TYPE=${CXX_BUILD_TYPE} ${CLANG_TIDY_FLAG} ${CODE_COVERAGE_FLAG} ${EXTRA_CMAKE_FLAGS[@]} ..
${CMAKE_EXEC} --build . --target all

${CMAKE_EXEC} --build ${CMAKE_BUILD_DIR} --target test



CoreDump

docker run --privileged <the docker image ID>

setup

sudo sysctl kernel.core_pattern=/var/crash/core.%c.%d.%p.%t.%s.%E
cat /proc/sys/kernel/core_pattern
/var/crash/%E.%p.%t.%s


test

ctest -R "test_name"


repeat test

until ! ctest -R "test_possible_fail"; do     echo ...;     sleep 1; done

2023年2月2日 星期四

How to Enable the Missing Manual Login Option By Editing the Registry 2023 Windows 11

 How to Restore a Missing "Users Must Enter a User Name and Password" Option in Windows 11 (makeuseof.com)




How to Enable the Missing Manual Login Option By Editing the Registry

Alternatively, you can manually edit the registry to restore the missing login option. However, it’s recommended users try the method above first. If that doesn’t do the trick, edit the registry as follows.

  1. Bring up the Power User menu (you can access it with its special Win + X hotkey).
  2. Select Run from the menu.
  3. Open the Registry Editor by entering its regedit Run command and clicking OK.
  4. Navigate to a HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\PasswordLess\Device key within the Registry Editor.
  5. Select the Device key within the left navigation pane.
  6. Double-click the Device key’s DevicePasswordLessBuildVersion DWORD.
  7. Erase the number in the Value data box. Then input 0 there to replace the deleted value.
  8. Click OK to save the new value.

Finally run netplwiz

2023 Promox on Morefine N6000 16GB 512GB

2023 Promox on Morefine N6000 16GB 512GB Software Etcher 100MB (not but can be rufus-4.3.exe 1.4MB) Proxmox VE 7.4 ISO Installer (1st ISO re...