Change grub2 default startup item in Fedora

Confirm our OS is in BIOS or EFI,

1
2
3
4
# in BIOS system
GRUB_CFG=/boot/grub2/grub.cfg
# in EFI system
GRUB_CFG=/boot/efi/EFI/fedora/grub.cfg

Then lookup the booting item id we want to set as default.

If we only want to switch default between Linux kernels,

1
grubby --info ALL

Else if we want to change default booting item to Windows,

1
cat $GRUB_CFG | grep Windows

Read the output, we will find the item, e.g. corresponding to the name, the id is "e528434f2b3e4d7c97d97aa4aabb976e-5.16.7", write it in /etc/default/grub

1
2
#GRUB_DEFAULT=saved
GRUB_DEFAULT=e528434f2b3e4d7c97d97aa4aabb976e-5.16.7

Finally update grub,

1
2
grub2-mkconfig -o $GRUB_CFG
#.

Reboot to see the change.

And in Ubuntu, how to make grub2 remember last choice?

sudo vi /etc/default/grub
	GRUB_DEFAULT=saved
	GRUB_SAVEDEFAULT=true
sudo update-grub

refer to:
https://docs.fedoraproject.org/en-US/fedora/f35/system-administrators-guide/kernel-module-driver-configuration/Working_with_the_GRUB_2_Boot_Loader/

Fedora 21 改变启动顺序以及grub2 配置技巧


https://askubuntu.com/questions/148662/how-to-get-grub2-to-remember-last-choice

Directories in Win10

Not only one Startup directory,

C:\ProgramData\Microsoft\Windows\Start Menu\Programs\StartUp
C:\Users\euhat\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Startup

Themes downloaded from Windows Store,

C:\Users\euhat\AppData\Local\Microsoft\Windows\Themes

Linux subsystem Ubuntu,

C:\Users\euhat\AppData\Local\Packages\CanonicalGroupLimited.UbuntuonWindows_xxxx\LocalState\rootfs

Need to clean,

C:\ProgramData\Package Cache
Control Panel\All Control Panel Items\Administrative Tools\Task Scheduler\Task Scheduler Library\Microsoft\Windows\Application Experience\Microsoft Compatibility Appraiser

refer to:
https://blog.csdn.net/weixin_48160438/article/details/113413048

CreateTexture2D E_INVALIDARG

  1. Ensure "Graphics Tools" installed.

    Go to the Settings panel, under System, Apps & features, Manage optional Features, Add a feature, and then look for "Graphics Tools".

  2. Enable the debug layer by code,

    1
    2
    3
    4
    5
    6
    
    D3D11CreateDevice(
    	nullptr,
    	D3D_DRIVER_TYPE_HARDWARE,
    	nullptr,
    	XXX | D3D11_CREATE_DEVICE_DEBUG, // add here!
    	...);

    or in Visual Studio, on the main menu, choose Debug, Graphics, setup in DirectX Control Panel.

  3. Restart debug session. And after CreateTexture2D returns E_INVALIDARG, there will be debug informations in VS IDE Output Panel, each one of which begins with like "D3D11 ERROR".

refer to:
https://docs.microsoft.com/en-us/visualstudio/debugger/graphics/getting-started-with-visual-studio-graphics-diagnostics
https://docs.microsoft.com/en-us/windows/win32/direct3d11/overviews-direct3d-11-devices-layers
https://stackoverflow.com/questions/53569263/directx-11-id3ddevicecreatetexture2d-with-initial-data-fail
https://blog.rthand.com/capture-directx-10-11-debug-output-to-visual-studio/
https://article.itxueyuan.com/dwlpL
https://walbourn.github.io/

Dramas and movies memo

英剧

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
1816-1855	Charlotte Bronte
			Jane Eyre 简·爱
1818-1848	Emily Jane Bronte
			Wuthering Heights 呼啸山庄
1820-1849	Anne Bronte
			Agnes Grey
			The Tenant of Wildfell Hall
		约翰·高尔斯华绥
			The Forsyte Saga
1775-1817	Jane Austen
			Emma 艾玛
			傲慢与偏见
1971		安东万叔叔
		漫长的婚约
 
		待查
			大卫科波菲尔
			唐顿庄园
			远乡
			丹尼尔的半生缘
			绛红雪白的花瓣
			指匠情挑
			南方与北方
			锦绣佳人
			海蒂和爷爷
			包法利夫人

美剧

1
2
3
4
5
6
7
	血海兄弟
 
	爱在春天来
	Kramer Versus Kramer 克莱默夫妇
	阿丽塔 :战斗天使
Mads Mikkelsen
	The Salvation 救世

日剧

1
2
3
4
	望乡
		女王的教室
	大正三部曲
		流浪者之歌

refer to:
大林讲电影
越哥说电影
野人电影
鲸落电影

Spi protocol memo

drivers/spi/spi.c

1
2
3
4
5
6
7
8
9
spi_write_then_read
 __spi_sync
 
spi_transfer_one_message
 spi_set_cs
 stm32_spi_transfer_one
 
 rspi_dma_transfer
 rspi_pio_transfer

SPI: Serial Peripheral Interface
CS(SS): Chip Select
SCLK: Serial Clock
PTP: Precise Time Protocol

refer to:
https://blog.csdn.net/faihung/article/details/81839825

Minimize memory usage in win10

Remove all apps,

1
#Get-AppxPackage -AllUsers | Remove-AppxPackage

To restore,

dism.exe /online /cleanup-image /scanhealth
dism.exe /online /cleanup-image /restorehealth
dism.exe /online /cleanup-image /startcomponentcleanup
sfc /scannow
 
Get-AppXPackage WindowsStore -AllUsers | Foreach {Add-AppxPackage -DisableDevelopmentMode -Register “$($_.InstallLocation)\AppXManifest.xml”}

Strip off HyperV,

bcdedit /set hypervisorlaunchtype off

Disable realtime protection of Windows Defender, or completely shut it down,

gpedit.msc
	Computer Configuration
		Administrative Templates
			Windows Components
				Microsoft Defender Antivirus
					Turn off Microsoft Defender Antivirus
						Enabled

Turn off Windows Update, from https://blog.csdn.net/milaoshu1020/article/details/115062811

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
' switch_win_update_v3.vbs
Const usosvc_reg = "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\usosvc"
Set fso = createobject("scripting.filesystemobject")
Set shell = createobject("wscript.shell")
curdir = fso.getparentfoldername(wscript.scriptfullname)
 
If wscript.arguments.count = 0 Then
	Set sh = createobject("shell.application")
	sh.shellexecute wscript.fullname,"""" & wscript.scriptfullname & """ -admin",,"runas"
ElseIf wscript.arguments.count = 1 And wscript.arguments(0) = "-admin" Then
	run
Else
	msgbox "Argument error!"
End If
 
Sub Run()
	Do
		ret = inputbox("0: Turn off Win10 Update;" & vbcrlf & _
						"1: Turn on Win10 Update;" & vbcrlf & _
						vbcrlf & _
						"Input:", "Switch Win10 Update v3","0")
		Select Case ret
		Case "0"
			retnum = shell.run("sc.exe stop usosvc",0,True)
			shell.regwrite usosvc_reg & "\WOW64",&H14c,"REG_DWORD"
			msgbox "Turned Win10 Update off!",vbexclamation
			Exit Do
		Case "1"
			shell.regdelete usosvc_reg & "\WOW64"
			retnum = shell.run("sc.exe start usosvc",0,True)
			msgbox "Turned Win10 Update on!",vbexclamation
			Exit Do
		Case ""
			Exit Do
		Case Else
			msgbox "Input mismatch!",vbcritical
		End Select
	Loop
End Sub

After doing those things, in a machine with 8G memory and an SSD, we can play a 4G memory allocated Win10 LTSC 2019 vmware guest and a 2G ubuntu20 one in a silky manner.

refer to:
http://www.xitongcheng.com/jiaocheng/win10_article_42055.html
https://www.bilibili.com/read/cv4183745

Awtk memo

Download node-v16.14.0-x64.msi from
https://nodejs.org/en/
or for win7 is
https://nodejs.org/download/release/v13.6.0
install it in Adminstrator cmd console.

Official repository:
https://github.com/zlgopen/awtk

1
2
3
4
5
6
python -m pip install pywin32
python -m pip install scons
 
cd awtk-master
scons
bin\demoui

Debug after attach demoui.exe,

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
awtk-master\demos\demo_ui_app.c
 application_init
  WIDGET_FOR_EACH_CHILD_BEGIN(window_manager(), root, i)
   init_children_widget(root, (void*)win)
    widget_foreach(widget, init_widget, ctx)
     widget_on(widget, EVT_CLICK, on_menu_bar_open, win)
      on_menu_bar_open
       open_menu_bar
 
label_paint_text
 widget_draw_text_in_rect
 
window_create
 edit_create
 button_create
 label_create
  widget_set_text
window_close
dialog_create_simple
 dialog_set_title

Ui and style,

1
2
3
4
5
6
7
8
9
#doc/theme.md
bin/themegen input.xml output.bin -
 
#doc/ui_desc.md
bin/preview_ui demos/assets/raw/ui/main.xml
bin/xml_to_ui window1.xml window1.data
#include "res/ui/window1.data"
assets_manager_add((const asset_info_t*)ui_window1);
widget_t* win = window_open(name);

Message box,

Read more

Musicians memo

古典

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
1770-1827	贝多芬/乔安娜/卡尔
1810-1849	肖邦
 
		肖斯塔科维奇
			第二圆舞曲
 
		德沃夏克
			From the new world 第九交响曲,第四章
			幽默曲
 
		勃拉姆斯
			作品44号 第四首
 
		柴可夫斯基
			六月船歌
		维托里奥_蒙蒂
			查尔达什舞曲
 
		李斯特
			Six Consolations, S.172 安慰曲 No.3
 
		Erik Satie 萨蒂
			3 Gymnopedies, No.1
		维瓦尔第
			四季-冬

中文

1
2
		田一名
			给我一首歌的时间

欧美

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
		ABBA
			I have a dream
			Gimme Gimme Gimme
		Richard Marx
			Right here waiting
		Bryan Adams
			Here I am
			Everything I do
		Billy Joel
		David Bowie
			Moonage Daydream
			Heros
			Ashes to Ashes
			Cat People
			Fashion
			Let's Dance
			I'm Afraid Americans
			Valentine's Day
		Lady Gaga, Bradley Cooper
			Shallow
			Always Remember Us This Way
		Taylor Swift
			Clean
		P!nk
			Try
		Kelly Clarkson
			Because of You
		The Police
			Every Breath You Take
		Dan Fogelberg
			Sutter's Mill
		Joel Hanson & Sara Groves
			Traveling light
		Mariah Carey
			We Belong Together
		Eric Clapton
			Tears In Heaven
			Wonderful Tonight
		Yoni Schlesinger - Pink Floyd
			Shine On You Crazy Diamond
		Alan Walker
			Fade
			The Spectre
			All Falls Down
		Bruno Mars
			Talking to the moon
		Ava Max
			Salt
		PBH & Jack
			Funk You
		SIA
			Move Your Body
		梦龙乐队
			Believer
		萌德&卡妹
			Señorita
			Havana
		Alice Merton
			No Roots
		Darin Zanyar
			Be What You Wanna Be
		Groove Coverage
			Far Away From Home
		雷纳德·席尔瓦
			The Way I Still Love You
		Joel Hanson & Sara Groves
			Traveling Light
		Austin Mahone & Rich Homie Quan
			Send It
		Glenn Frey
			The One You Love
		Haley Reinhart
			I Put A Spell On You
		Patrice Rushen
			Forget Me Nots
		Post Malone
			Circles
		Hayd
			Head in the clouds
		Christina Aguilera
			Fighter
		待查
			summer train

日本

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
		石川小百合
		伍代夏子
			舟
		坂本冬美 / 猪俣公章
		冰川清志
		多岐川舞子
		酒井法子
			微笑みを見つけた
 
		原广志
			摘星的晚上
		S.E.N.S
			風のように
		来生孝夫
			Goodbye Day
		谷村新司
			浪漫铁道
		德永英明
			Rainy Blue (25th Anniversary Track)
		当山ひとみ
			Cathy
		THE虎舞竜
			ロード

西语

1
2
3
4
		皮亚佐拉
			遗忘
		待查
			Despacito

Piano

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
		Bryan Adams
			Everything I Do
		Richard Clayderman
			星空
			秋日私语
		张信哲
			爱如潮水
		周传雄
			黄昏
		Audio Machine
			Breath and Life
		Peter Roe
			Last Reunion
		地狱咫尺
			star sky
		shirfine
			幻昼
		羽肿
			windy hill
		三亩地
			城南花已开
		高至豪
			you离开的事实
		文武贝
			繁华的寂静
		CMJ
			所念皆星河
		赵海洋
			夜空的寂静
			瞬间的永恒
		欧阳朵
			失去才懂
 
		待查
			穿越时空的思念
			夜的钢琴曲五
			Collapsing World
			Nevada

手风琴

1
2
		Venturi Carlo - 帕萨瑞尼
			怀念_华尔兹

Violin

1
2
3
4
5
6
7
8
9
10
11
		巴赫
			G弦上的咏叹调
		待查
			告白之夜
			五夜雨
			Experience
			下雨的时候
		Michel Colombier
			Emmanuel
		Era
			The mass

Guitar

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
		Albeniz
		Granados
		Falla
		Turina
		Joaquin Rodrigo
			Concierto De Aranjuez
		Nicolas de Angelis
			悲伤的西班牙
		Yves Montand
			Bella ciao 啊,朋友再见
		Paul Mauriat
			El Bimbo - 橄榄项链
		泰雷加
			鸽子
		周杰伦
			龙巻风
		Beyond
			喜欢you
		周传雄
			黄昏
		赵雷
			成都
		彭佳慧
			相见恨晚

Electric guitar

1
2
3
4
5
6
7
8
9
		Igor Paspalj
			Improvisation
			Away from You
		Paul Gilbert
 
		John Mayer
			Slow Dancing in a Burning Room
		MJ
			You Are Not Alone

Saxophone

1
2
3
4
5
6
7
8
9
		矢野立美
			Love Theme From Tiga
		待查
			Time
			Champagne Ocean
			Careless Whisper
			Dance Monkey
			New Thang
			Epic Sax Guy

未知

1
2
3
4
5
6
		ViceTone
			TuoZhao
		Mix Music
			Don't Cha
		糖爷
			Le Le Le Le La

网络

1
2
3
4
5
6
7
8
9
trouble im in - twinbed
love is gone - slander
past lives - b rns
melancholy - white cherry
numb - xxxtentacion
lullaby - rauf & faik
rather be - feat.jess glynne
Just to be in love
move your body - 希雅

refer to:
https://zhuanlan.zhihu.com/p/43272461
典藏音乐 x99700
罗兰之音4949
全球音乐榜单

Disable features in cmake command line

Identical to "./configure --help", when a project uses cmake, we get building instructions like below,

1
2
3
4
mkdir bld
cd bld
cmake ..
cmake . -L

wait a while we will see all the variables cmake defined in cache.

Or directly look into CMakeCache.txt.

If we want to modify a variable to off, or say, disable some functionality,

1
FEATURE_test_name:BOOL=ON

we run cmake once again like this,

1
cmake -DFEATURE_test_name:BOOL=OFF ..

refer to:
https://www.oschina.net/question/231677_45266

Build qt source in Fedora35

Extract qt-everywhere-src-6.2.2.zip to directory named qt,

sudo dnf install libxcb libxcb-devel xcb-util xcb-util-devel xcb-util-*-devel libX11-devel libXrender-devel libxkbcommon-devel libxkbcommon-x11-devel libXi-devel libdrm-devel libXcursor-devel libXcomposite-devel

cd qt
mkdir bld
cd bld
cmake -G Ninja -DCMAKE_INSTALL_PREFIX:PATH=`pwd`/installed -DCMAKE_BUILD_TYPE="Debug" ..
cmake --build . --parallel
cmake --install . --prefix=`pwd`/installed

Can't locate English.pm in @INC

sudo dnf install perl-English

This application failed to start because no Qt platform plugin could be init...

If "xcb" things missing, we should "dnf install libxcb..." like above, and an annoying step we can't image is after we install required packages, we must delete CMakeCache.txt first and then to invoke cmake, if not, some modules like xcb-sm are always displayed not to be built.

Feature accessibility_atspi_bridge is already defined to be "OFF" and should now be set to "ON" when importing features from Qt6::Gui.

We only need to not let the message interrupt building progress,

/mnt/SDC2/qt/bld/installed/lib/cmake/Qt6/QtFeature.cmake:1136

	message(STATUS "Feature ${feature} is already defined to be \"${QT_FEATURE_${feature}}\" and should now be set to \"${value}\" when importing features from ${target}.")

refer to:
https://download.qt.io/official_releases/qtcreator/6.0/6.0.1/qt-creator-opensource-linux-x86_64-6.0.1.run
https://wiki.qt.io/Building_Qt_5_from_Git#Linux.2FX11
https://forum.qt.io/topic/121386/built-qt6-from-sources-problem-with-xcb-plugin/15
https://forum.qt.io/topic/128887/build-qt6-from-source-xcb-issue/3
https://forum.qt.io/topic/92834/configure-errors-disabling-x11-accessibility-bridge-d-bus-or-at-spi-is-missing/7