Backblaze may cause VMware fail to start

I’ve been using VMware Workstation 16 for a long time. Recently, I realize that sometimes my vmware virtual machines cannot start/resume.

The error message is:

Power on failure messages: The operation was cancelled by the user
Cannot open the disk 'X:\VMS\xxxxx\xxxxx-cl1.vmdk' or one of the snapshot disks it depends on.
Module 'Disk' power on failed.
Failed to start the virtual machine.

Continue reading “Backblaze may cause VMware fail to start”

Upgrade Mysql 5.7 to 8 “The following signatures were invalid” solution

If you are running Mysql 5.7 and would like to upgrade it to Mysql 8, here is a guide that actually WORKS for Ubuntu 18.04

wget https://repo.mysql.com//mysql-apt-config_0.8.10-1_all.deb
sudo dpkg -i mysql-apt-config_0.8.10-1_all.deb

Choose mysql server and select mysql 8.0

sudo apt-get update
sudo apt-get install mysql-server

Continue reading “Upgrade Mysql 5.7 to 8 “The following signatures were invalid” solution”

Invisible reCAPTCHA Update

为了改善用户体验,我站已替换之前的reCAPTCHA v2(验证码v2)为Invisible reCAPTCHA(隐形验证码)。
For improving the general user experience of this site, we have replaced the reCAPTCHA v2 with Invisible reCAPTCHA.

Regex filter visible characters with character class

最近有一个任务就是过滤掉文件中的非法不可读字符,也就是除了大小写字符,数字还有标点符号外其它的所有字符。网上找竟然没有现成的,就自己写了一个:

"[^a-zA-Z0-9 -/:-@\[-`{-~]"

符合这个条件的字符都会被替换为空,虽然可以更精简一点,不过我还是把标点符号那一部分孤立出来了,加强了扩展性,小伙伴们可以直接摘取,标点符号有几段是不连续的。

Recently a task was put on my desk which I needed to write a regex to filter out all non-readable characters from . In other words, only alphabetic, numeric and symbolic characters are allowed in that field. Well, I did not find anyone wrote this kinda of regex on the internet and came up my own one:

"[^a-zA-Z0-9 -/:-@\[-`{-~]"

All characters meets the above regex will be replaced with an empty string. Though it can be more simple, for compatibility, I just isolated the symbolic part from other two parts (alphabetic and numeric). The symbolic part is not continues and has several chunks coz those chunks are not continuous on the ASCII table. Please feel free to use it and leave your comment below.

Recaptcha 2 is now on site

There was a spamming problem on my blog a few months ago. Though I have Akismet to block them, I quickly get bored seeing my spamming box is filled with trashes. It is necessary to include some kinda of verification stuff for the comment module.

Unfortunately, due to my laziness I left an unfinished verification system for months. :(

Well, the comment function here is no longer disabled. I just implemented Recaptcha 2. K, now please get busy commenting! XD

=======================Translation===========================

之前我一直深受垃圾邮件的困扰。即使我有Akismet插件可是我很不喜欢看到我的垃圾邮件箱充满了无用的广告。我想我需要给评论模块加一个验证机制。

可惜我灰常懒,我一直留着一个未完工的验证马系统在那里好几个月。

不过现在就好了。我刚刚引入了Recaptcha2。现在小伙伴们可以尽情评论啦!O(∩_∩)O哈哈~

Windows Server 2012 on ESXi 4.1

From: http://jgiffard.wordpress.com/2013/06/25/windows-server-2012-on-esxi-4-1/

My I.T infrastructure at home has 4 ESXi 4.1 servers which host a number of VMs that are used for home and work purposes.  However, my organically grown infrastructure has now reached the point where it needs re-organising.  As part of that I’m installing new A/D controllers and decided to use Server 2012.

And then found that ESXi 4.1 doesn’t support it.  Try it and you’ll get the Server 2012 sad face appearing.  I don’t have time just now to update to ESX5.X on my servers, so I hunted around the Internet to see if there was a workaround.

I found these set of instructions ( really don’t do this for a production environment )

    • Create a  new VM over the vSphere Client.
    • As “Guest Operating System” use Microsoft Windows Server 2008 R2 (64-bit)
    • After VM has been created but before first power on, download the following  bios file and upload it to your ESXi datastore into the folder of the VM
    • Now open the .vmx file of the new VM and add the follwing lines
bios440.filename = "bios.440.rom"
mce.enable = TRUE
cpuid.hypervisor.v0 = FALSE
vmGenCounter.enable = FALSE
    • Power on VM and Server 2012 will install and run

数据库问题修复

之前一段时间里我的附属服务器,也就是这个博客所在服务器,的数据库总是会定期挂掉。通常会显示Error establishing database connection.

这个问题目前已经解决,并且我专门用Go写了一个守护进程来保证数据库的正常运行。

KOFAX驱动KER_UNDERRUN错误和解决方案

最近使用TWAIN协议调用使用KOFAX驱动的扫描仪,主线程内同步调用完全没有问题,在异步扫描的时候很诡异得报错KER_UNDERRUN。在谷歌上搜索只能搜索到这个问题的前半部分KER_可是后面的UNDERRUN却没有任何结果。由于我封装好了一个与扫描仪通信的类,对于这个问题一开始完全没有头绪,可是经过替换排除法我发现了问题的所在。首先说一些结论,这个问题我至今无法在那个扫描程序中解决。

问题出现在我扫描程序提供的一个小功能。在扫描之前,我的扫描程序支持读取数据(扫描仪支持纸张类型和颜色等等)然后展示给用户。只要是进行了这个操作,之后在另一个线程扫描就有几乎90%的可能性出现KER_UNDERRUN错误。即使我在卸载了DLL再重新载入也无法修复这个问题。最后就是取消了在该程序主线程中执行OpenSource这个行为,完全在另一个线程做所有的事情。

不过我还是不想取消这个功能,跨线程读取扫描仪配置然后和主线程通信又很麻烦,于是在我们架构师的建议下找到了一个解决方案:写了另外一个小程序,在用户选择完扫描仪后会被调用,它会读取扫描仪信息然后存在本地,然后主程序等待它执行完后读取那个文件就可以获得全套信息了。因为是在另外一个程序中调用OpenSource,而且执行后另外一个程序会销毁,所以不会影响主程序的行动。这个问题就完美解决了。

[C++]Doubly Linked List with Iterator

During the study week I tried to implement an integer list using Visual C++. My goal is to be as similar to as the list and iterator in the standard library. My goal is to simulate the implementation of the standard library list and iterator.

There are many people having issues with insertion and deletion of the iterator. In order to delete the boundaries of the list, the iterator need to have the access of the front and back of the list. According to the standard iterator, it does not have such a function:

A sample source main is:

#include "DoublyLinkedList.h"
#include
using namespace std;
int main(){
	DoublyLinkedList dll;
	dll.pushFront(12);
	dll.pushFront(11);
	dll.pushFront(10);
	dll.pushBack(13);
	dll.pushBack(14);
	dll.pushFront(9);
	while (!dll.isEmpty()){
		cout << "[DLL]Element:" << dll.getBack() << endl;
		dll.popBack();
	}
	int a[] = {55,66,77,88,99};
	DoublyLinkedList dll2(a, a + 5);
	for (DoublyLinkedList::iterator it = dll2.begin(); it != dll2.end(); ++it){
		cout << "[DLL2]Element:" << *it << endl;
	}
	return 0;
}

Output:

[DLL]Element:14
[DLL]Element:13
[DLL]Element:12
[DLL]Element:11
[DLL]Element:10
[DLL]Element:9
[DLL2]Element:55
[DLL2]Element:66
[DLL2]Element:77
[DLL2]Element:88
[DLL2]Element:99

Source Code(Please feel free to fork & contribute): https://github.com/Parthas-Menethil/DoubleLinkedList