Change MySql Data Path

sudo su
 
cp -R /var/lib/mysql /home/work/
chown -R mysql:mysql /home/work/mysql
 
vi /etc/mysql/mysql.conf.d/mysqld.cnf
	socket  = /home/work/mysql/mysqld.sock
	datadir = /home/work/mysql
 
systemctl start mysql
cat /var/log/mysql/error.log
	mysqld: File './binlog.index' not found (OS errno 13 - Permission denied)
 
vi /etc/apparmor.d/usr.sbin.mysqld
	/usr/sbin/mysqld {
		/home/work/mysql/ r,
		/home/work/mysql/** rwk,
		...
 
systemctl restart apparmor
systemctl start mysql

refer to:
https://askubuntu.com/questions/1089045/mysql8-wont-start

Scramble Web Site Images using TamperMonkey Script

// ==UserScript==
// @name         Euhat Web Site Images Download
// @namespace    http://tampermonkey.net/
// @version      0.1
// @description  try to take over the world!
// @author       euhat
// @match        https://www.sample.com/*
// @icon         https://www.google.com/s2/favicons?sz=64&domain=toutiao.com
// @grant           GM_xmlhttpRequest
// @grant           GM_setValue
// @grant           GM_getValue
// @grant           GM_addStyle
// @grant           GM_setClipboard
// @grant           GM_download
// @require         https://unpkg.com/vue@2
// ==/UserScript==
 
(function() {
	'use strict';
 
	var euForm = document.createElement("div");
	euForm.innerHTML = `
		<div id="euForm">
			<b>Here:</b>
			<button @click="euDownAll">Download All Image</button>
		</div>
	`;
 
 
 
	document.querySelector("html").appendChild(euForm);
 
	GM_addStyle(`
#euForm{
font-size : 15px;
position: fixed;
background-color: rgba(88, 88, 88, 0.9);
color : #FF0000;
text-align : center;
padding: 10px;
z-index : 9999;
border:2px solid black;
}
    `);
 
	document.getElementById("euForm").style.left = (200 || 20) + "px";
	document.getElementById("euForm").style.top = (200 || 100) + "px";
 
	function findAllLinks() {
		const allNodes = document.querySelectorAll('div.pgc-img > img');
		var objList = [];
		var i = 0;
		allNodes.forEach((item) => {
			const obj = {
				id: i++,
				url: item.src
			};
			objList.push(obj);
		});
		return objList;
	}
 
	var vm = new Vue({
		el: '#euForm',
		data: {
			version: "1.0.0",
		},
		methods: {
			async euDownAll() {
				var objList = findAllLinks();
				objList.forEach((item) => {
					const obj = {
						url: item.url,
						name: item.id + ".jpg",
						onload: function(e) {
 
						},
						onerror: function(e) {
							console.log(e)
						},
						onprogress: function(d) {
 
						}
					}
					GM_download(obj)
				});
			},
		}
	});
 
})();

refer to:
https://developer.mozilla.org/zh-CN/docs/Web/API/Document/querySelectorAll

Change Font Size in Win32 Rich Edit Control

	char* strFont = "Open Sans";
	int nFontSize = 70;
 
	CHARFORMAT cfFormat;
	memset(&cfFormat, 0, sizeof(cfFormat));
	cfFormat.cbSize = sizeof(cfFormat);
	cfFormat.dwMask = CFM_CHARSET | CFM_FACE | CFM_SIZE;
	cfFormat.bCharSet = ANSI_CHARSET;
	cfFormat.bPitchAndFamily = FIXED_PITCH | FF_DONTCARE;
	cfFormat.yHeight = (nFontSize * 1440) / 72;
	strcpy(cfFormat.szFaceName, strFont);
 
	CHARRANGE cr;
	cr.cpMin = INT_MAX;
	cr.cpMax = INT_MAX;
	SendDlgItemMessage(m_hWnd, IDE_EDITBOX, EM_SETCHARFORMAT, SCF_ALL, (LPARAM)&cfFormat);
	SendDlgItemMessage(m_hWnd, IDE_EDITBOX, EM_EXSETSEL, 0, (LPARAM)&cr);

refer to:
https://gamedev.net/forums/topic/457546-rich-edit-controls-change-the-font-size-win32-c/457546/

Portable QGis

qgis-bin.env.sh

sed -e 's/\%CUR_DIR\%/E\:\\tool\\QGIS/g' \
	-e 's/\%CUR_DIR_LINUX\%/E\:\/tool\/QGIS/g' qgis-bin.env.scheme > qgis-bin.env

qgis-bin.env.scheme

PATH=%CUR_DIR%\bin;%CUR_DIR%\apps\grass\grass82\lib;%CUR_DIR%\apps\grass\grass82\bin;%CUR_DIR%\apps\qt5\bin;%CUR_DIR%\apps\Python39\Scripts;%CUR_DIR%\bin;%CUR_DIR%\apps\qgis\bin;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\system32\WBem
GDAL_DATA=%CUR_DIR%\apps\gdal\share\gdal
GDAL_DRIVER_PATH=%CUR_DIR%\apps\gdal\lib\gdalplugins
GDAL_FILENAME_IS_UTF8=YES
PDAL_DRIVER_PATH=%CUR_DIR%\apps\pdal\plugins
GISBASE=%CUR_DIR%\apps\grass\grass82
GRASS_PROJSHARE=%CUR_DIR%\share\proj
GRASS_PYTHON=%CUR_DIR%\bin\python3.exe
OSGEO4W_ROOT=%CUR_DIR%
PROJ_LIB=%CUR_DIR%\share\proj
PYTHONHOME=%CUR_DIR%\apps\Python39
PYTHONPATH=%CUR_DIR%\apps\grass\grass82\etc\python;
PYTHONUTF8=1
QGIS_PREFIX_PATH=%CUR_DIR_LINUX%/apps/qgis
QT_PLUGIN_PATH=%CUR_DIR%\apps\qgis\qtplugins;%CUR_DIR%\apps\qt5\plugins
VSI_CACHE=TRUE
VSI_CACHE_SIZE=1000000
O4W_QT_PREFIX=%CUR_DIR_LINUX%/apps/Qt5
O4W_QT_BINARIES=%CUR_DIR_LINUX%/apps/Qt5/bin
O4W_QT_PLUGINS=%CUR_DIR_LINUX%/apps/Qt5/plugins
O4W_QT_LIBRARIES=%CUR_DIR_LINUX%/apps/Qt5/lib
O4W_QT_TRANSLATIONS=%CUR_DIR_LINUX%/apps/Qt5/translations
O4W_QT_HEADERS=%CUR_DIR_LINUX%/apps/Qt5/include
QGIS_WIN_APP_NAME=QGIS_3.30\QGIS Desktop 3.30.2
SSL_CERT_DIR=%CUR_DIR%\apps\openssl\certs
SSL_CERT_FILE=%CUR_DIR%\bin\curl-ca-bundle.crt

Plugins,

QuickOSM
Search Layers

refer to:
https://github.com/sourcepole/qgis-openlayers-plugin
http://www.uwenku.com/question/p-gajlmliq-bag.html
https://www.naturalearthdata.com
https://www.qgistutorials.com/en/docs/3/making_a_map.html

西班牙葡萄牙历史年表

1
2
3
4
5
6
7
410
	西哥特人
711
	阿拉伯人 / dhimmis
		Tariq
1492
	Alhambra Decree

España

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
Aragón 阿拉贡
	1452/3-1516/1	Fernando II 费迪南二世
 
Católica 卡斯提尔
	1425-1468	Juana Enriquez 胡安娜·恩里克斯
	1451/4-1504/11	Isabel I 伊莎贝尔一世 / 资助哥伦布 / 宗教审判所
			Catherine of Aragon / 英王亨利八世的第一任王后,英格兰女王玛丽一世(血腥玛丽)的母亲
	1478/7-1506/9	FelipeIel Hermoso 腓力一世 / 父亲是神圣罗马帝国皇帝马克西米连一世,母亲是勃艮第女公爵玛丽
	1479/11-1555/4	Juana / 疯女
	1500/2-1558/9	Carlos I / Charles V / 神圣罗马帝国哈布斯堡王朝皇帝 / 尼德兰君主 / 德意志国王
				老师是教皇哈德良六世
				皇后是葡萄牙国王曼努埃尔一世的女儿伊莎贝拉
				资助麦哲伦 / 传唤马丁·路德
			Fernando II / 神圣罗马帝国皇帝
	1527/5-1598/9	Felipe II / Philip II / Philippines
 
 
1451/10-1506/5	Cristóbal Colón / Genova

Portugal

1
1480-1521/4		Fernão de Magalhães 麦哲伦 / Seville

refer to:
https://baike.sogou.com/v29706756.htm?fromTitle=%E8%A5%BF%E7%8F%AD%E7%89%99%E5%8E%86%E5%8F%B2

Taskbar Disappeared, Unresponsible in Win11

Global.iris service of Windows 11, which is related to the wallpaper of the day feature, cannot be turned off from the services menu.

reg delete HKCU\SOFTWARE\Microsoft\Windows\CurrentVersion\IrisService

then reboot the pc.

refer to:
https://windowsreport.com/global-iris-service-windows-11
http://www.ulaojiu.com/xitong/xtjc/20210903/224262.html

Debian Memo

Intel non-free wifi firmware,

lspci -nnk
lshw -c
modinfo iwlwifi
dmesg | grep microcode
 
apt install intel-microcode
sudo apt-get install--reinstall linux-firmware

https://www.intel.com/content/www/us/en/support/articles/000005511/wireless.html
https://wiki.debian.org/iwlwifi
https://forums.debian.net/viewtopic.php?t=152523
https://wiki.debian.org/Microcode

Install PVE in Metal Partition not Whole Disk

Learnt from referred link, we first install Xubuntu along with Win11 in the same metal disk,

then we reboot into Xubuntu, update it to PVE kernel,

# sudo vi /etc/apt/sources.list.d/pve-install-repo.list
	deb [arch=amd64] http://download.proxmox.com/debian/pve bullseye pve-no-subscription
 
sudo wget https://enterprise.proxmox.com/debian/proxmox-release-bullseye.gpg -O /etc/apt/trusted.gpg.d/proxmox-release-bullseye.gpg
 
sudo apt update
sudo apt full-upgrade
 
sudo apt install pve-kernel-5.15
 
reboot
 
sudo apt install proxmox-ve postfix open-iscsi

To be continued ...

p.s. dependency failed while installing pve in ubuntu, which means we must play it under debian os.

refer to:
https://post.smzdm.com/p/awzzqlep
https://pve.proxmox.com/wiki/Install_Proxmox_VE_on_Debian_Buster