2019年4月23日 星期二

Esxi "Relocating modules and starting up the kernel"

http://dq.tieba.com/p/6099253984

安装esxi时出现以下,解决方案
Shutting down firmware services...
Relocating modules and starting up the kernel...
第一种方法
问题的原因是Headless模式不能设定. 解决办法是添加 ignoreHeadless=TRUE 参数
1. 在ESXi安装开始前有一个倒计时, 这时按下 Shift + O, 在显示的命令后添加 ignoreHeadless=TRUE, 回车, 安装就能正常进行
2. 以下的步骤是把这个参数值写入配置, 不会随重启丢失
3. 当ESXi启动后, 点击F2, 登录
4. 在System Customization下, 进入Troubleshooting Options
5. 启用ESXi Shell, 然后一路按ESC返回
6. 在主界面下, 按Alt + F1 访问控制台
7. 登录, 输入并执行以下命令
esxcfg-advcfg --set-kernel "TRUE" ignoreHeadless
8. 输入exit, 退出控制台登录
9. 点击 Alt+F2 返回 ESXi 主界面
10. 最后别忘了禁用 ESXi Shell.
第二种方法
在WEB界面中,打开管理-服务 中启用 esxi shell 各SSH 用shell软件连接进入以下命令

esxcfg-advcfg --set-kernel "TRUE" ignoreHeadless

再输入以下命令

esxcfg-advcfg --get-kernel ignoreHeadless

若出现以下

ignoreHeadless=TRUE

证明已写 入,重启esxi 正常进入


我是直接装在16g msata 中的,正常启动了

2019年4月16日 星期二

Making MFC Ribbon bitmap file with Pixelformer



In short, use Pixelformer instead of mspaint.exe for Windows C++ Ribbon bmp file



http://programmingnode.blogspot.com/2016/04/making-mfc-ribbon-bitmap-file.html

___________________________________________________________________________



Tuesday, April 5, 2016

Making MFC Ribbon bitmap file.

Despite there are lots of programming framework these days, it seems MFC never improve its capability regarding UI components since Visual Studio 6.0.
But I was wrong, Microsoft provided nice new UI features since Visual Studio 2010 release.
One of them is the Ribbon feature.
I am satisfied with usability of Ribbon and easy to use, actually easy to program.

When I tried to change default bitmap image for Ribbon, soon I found there was not enough description about it. Ribbon couldn't display my modified bmp file or show background black.
Here I wrote down simple recipe how to make bitmap file for MFC Ribbon.

The bitmap file format used in Ribbon is 32-bit ARGB format.
The ARGB means that each pixel consists of 4 bytes of color values, Alpha, Red, Green, Blue. The Alpha value affects transparency of a pixel.
The ARGB bitmap isn't popular format because this format doesn't support compression unlike PNG or GIF format. Only few editors can produce 32-bit ARGB format that the Ribbon can recognize.

After minutes of googling, I found very good graphic editor called Pixelformer.
I want to set setting icon beside of button in Panel within a Category contained in a MFCRibbonBar. So I need to draw setting icon in default bitmap file, called writesmall.bmp.

The first step is to open writesmall.bmp file in res folder of my project.


The Ribbon uses alpha value for transparency instead of mask RGB value.
So I needed to change colors of pixel and alpha values of pixel accordingly.

Surprisingly Pixelformer supply a way of that. There were menu for  Normal, Color Only, Alpha Only in View menu. User can change alpha value manually.

The second step is to get 16x16 setting image.
I got a free PNG image file for setting icon from https://www.iconfinder.com/.

The third step is to place setting image on to writesmall.bmp.
To copy the image it need to import the file into the writesmall.bmp editing through the menu, Image/Import.


And copy whole image and then paste it on the writesmall.bmp.
I think pasting should be done in the Normal view mode. I deleted area of pixels in the place where I put new image before pasting.

The forth step is to save as ARGB bitmap.
After image edit done, I exported it back to ARGB bitmap file.
It can be done through Image/Export menu. I show 32-bit ARGB option.

Windows C++ MFC Tiles-View List Control

http://codexpert.ro/blog/2013/10/05/tiles-view-list-control/

Introduction


In Visual Studio Community 2017, create a new project of Visual C++ > MFC/ATL > MFC Application > MFCApplication1.

Choose "Single Document", Advanced features: uncheck all except "Common Control Manifest", uncheck all "Advnaced frame panes", choose Generated Classes's Be class: CListView.










F


Core Code:



private:
CImageList m_imageList;
CImageList m_imageListSmall;
BOOL _SetTilesViewLinesCount(int nCount) {
CListCtrl& listCtrl = GetListCtrl();

LVTILEVIEWINFO lvtvwi = { 0 };
lvtvwi.cbSize = sizeof(LVTILEVIEWINFO);
lvtvwi.dwMask = LVTVIM_COLUMNS;
lvtvwi.cLines = nCount;

return listCtrl.SetTileViewInfo(&lvtvwi);
}
BOOL _SetTilesViewTileFixedWidth(int nWidth) {
CListCtrl& listCtrl = GetListCtrl();

LVTILEVIEWINFO lvtvwi = { 0 };
lvtvwi.cbSize = sizeof(LVTILEVIEWINFO);
lvtvwi.dwMask = LVTVIM_TILESIZE;

lvtvwi.dwFlags = LVTVIF_FIXEDWIDTH;
lvtvwi.sizeTile.cx = nWidth;
lvtvwi.sizeTile.cy = 0;

return listCtrl.SetTileViewInfo(&lvtvwi);
}
BOOL _SetItemTileLines(int iItem, UINT* parrColumns, UINT nCount) {
CListCtrl& listCtrl = GetListCtrl();

LVTILEINFO lvti = { 0 };
lvti.cbSize = sizeof(LVTILEINFO);
lvti.cColumns = nCount;
lvti.iItem = iItem;
lvti.puColumns = parrColumns;

return listCtrl.SetTileInfo(&lvti);
}

void CMFCApplication1View::OnInitialUpdate()
{
CListView::OnInitialUpdate();

CListCtrl& listCtrl = GetListCtrl();
listCtrl.SetExtendedStyle(LVS_EX_GRIDLINES);

ASSERT(NULL == m_imageList.m_hImageList);      // init only once
ASSERT(NULL == m_imageListSmall.m_hImageList); // init only once

CWinApp* pApp = AfxGetApp();
VERIFY(m_imageList.Create(128, 128, ILC_COLOR32, 0, 0));
VERIFY(m_imageListSmall.Create(48, 48, ILC_COLOR32, 0, 0));

m_imageList.Add(pApp->LoadIcon(IDR_MAINFRAME));
m_imageList.Add(pApp->LoadIcon(IDR_MAINFRAME));
m_imageList.Add(pApp->LoadIcon(IDR_MAINFRAME));

m_imageListSmall.Add(pApp->LoadIcon(IDR_MAINFRAME));
m_imageListSmall.Add(pApp->LoadIcon(IDR_MAINFRAME));
m_imageListSmall.Add(pApp->LoadIcon(IDR_MAINFRAME));

listCtrl.SetImageList(&m_imageList, LVSIL_NORMAL);
listCtrl.SetImageList(&m_imageListSmall, LVSIL_SMALL);
listCtrl.SetExtendedStyle(LVS_EX_GRIDLINES);

listCtrl.InsertColumn(0, _T("Name"), LVCFMT_LEFT, 100, 0);
listCtrl.InsertColumn(1, _T("Age"), LVCFMT_RIGHT, 100, 1);
listCtrl.InsertColumn(2, _T("Owner"), LVCFMT_LEFT, 150, 2);
listCtrl.InsertColumn(3, _T("City, Country"), LVCFMT_LEFT, 200, 3);

listCtrl.InsertItem(0, _T("Martafoi"), 0);
listCtrl.InsertItem(1, _T("Zdreanta"), 1);
listCtrl.InsertItem(2, _T("Jumbo"), 2);

listCtrl.SetItemText(0, 1, _T("8 months"));
listCtrl.SetItemText(1, 1, _T("7 years"));
listCtrl.SetItemText(2, 1, _T("35 years"));

listCtrl.SetItemText(0, 2, _T("John Doe"));
listCtrl.SetItemText(1, 2, _T("Brigitte Bardot"));
listCtrl.SetItemText(2, 2, _T("Hannibal Barcas"));

listCtrl.SetItemText(0, 3, _T("New York, USA"));
listCtrl.SetItemText(1, 3, _T("Paris, France"));
listCtrl.SetItemText(2, 3, _T("Barcelona, Spain"));

VERIFY(_SetTilesViewLinesCount(3));
VERIFY(_SetTilesViewTileFixedWidth(250));

UINT arrColumns[3] = { 1, 2, 3 };
VERIFY(_SetItemTileLines(0, arrColumns, 3));
VERIFY(_SetItemTileLines(1, arrColumns, 3));
VERIFY(_SetItemTileLines(2, arrColumns, 3));

listCtrl.SetView(LV_VIEW_TILE);
}

Optional Code


// Message mandlers
protected:
DECLARE_MESSAGE_MAP()
    afx_msg void OnViewLargeicon() {
GetListCtrl().SetView(LV_VIEW_ICON);
}
    afx_msg void OnViewSmallicon() {
GetListCtrl().SetView(LV_VIEW_SMALLICON);
}
    afx_msg void OnViewList() {
GetListCtrl().SetView(LV_VIEW_LIST);
}
    afx_msg void OnViewDetails() {
GetListCtrl().SetView(LV_VIEW_DETAILS);
}
    afx_msg void OnViewTile() {
GetListCtrl().SetView(LV_VIEW_TILE);
}
    afx_msg void OnUpdateViewLargeicon(CCmdUI *pCmdUI) {
pCmdUI->SetCheck(LV_VIEW_ICON == GetListCtrl().GetView());
}
    afx_msg void OnUpdateViewSmallicon(CCmdUI *pCmdUI) {
pCmdUI->SetCheck(LV_VIEW_SMALLICON == GetListCtrl().GetView());
}
    afx_msg void OnUpdateViewList(CCmdUI *pCmdUI) {
pCmdUI->SetCheck(LV_VIEW_LIST == GetListCtrl().GetView());
}
    afx_msg void OnUpdateViewDetails(CCmdUI *pCmdUI) {
pCmdUI->SetCheck(LV_VIEW_DETAILS == GetListCtrl().GetView());
}
    afx_msg void OnUpdateViewTile(CCmdUI *pCmdUI) {
pCmdUI->SetCheck(LV_VIEW_TILE == GetListCtrl().GetView());
}

BEGIN_MESSAGE_MAP(CMFCApplication1View, CListView)
ON_WM_CONTEXTMENU()
ON_WM_RBUTTONUP()
ON_COMMAND(ID_VIEW_LARGEICON, &CDemoListView::OnViewLargeicon)
ON_COMMAND(ID_VIEW_SMALLICON, &CDemoListView::OnViewSmallicon)
ON_COMMAND(ID_VIEW_LIST, &CDemoListView::OnViewList)
ON_COMMAND(ID_VIEW_DETAILS, &CDemoListView::OnViewDetails)
ON_COMMAND(ID_VIEW_TILE, &CDemoListView::OnViewTile)
ON_UPDATE_COMMAND_UI(ID_VIEW_LARGEICON, &CDemoListView::OnUpdateViewLargeicon)
ON_UPDATE_COMMAND_UI(ID_VIEW_SMALLICON, &CDemoListView::OnUpdateViewSmallicon)
ON_UPDATE_COMMAND_UI(ID_VIEW_LIST, &CDemoListView::OnUpdateViewList)
ON_UPDATE_COMMAND_UI(ID_VIEW_DETAILS, &CDemoListView::OnUpdateViewDetails)
ON_UPDATE_COMMAND_UI(ID_VIEW_TILE, &CDemoListView::OnUpdateViewTile)
END_MESSAGE_MAP()


MFCApplication1.rc


ID_VIEW_LARGEICON
ID_VIEW_SMALLICON
ID_VIEW_LIST
ID_VIEW_DETAILS
ID_VIEW_TILE









Result




FAQ


Question: What happens when below function calls return FALSE to indicate failure?

CListCtrl::SetTileViewInfo()
CListCtrl::SetTileInfo()

Answer: Using "Common Control Manifest" is a must for successful function calls above.

2019年3月22日 星期五

Windows 10 7 2008 R2 Multiple Remote Desktop Client with RDPWrap



使用Firefox允許從https://github.com/stascorp/rdpwrap/releases下載RDPWrap-v1.6.2.zip,解壓後使用Admin cmd.exe運行install.bat,安裝成功後運行RDPConf.exe確認綠色[fully supported]

2019年3月21日 星期四

Raspberry Pi 3B RDP Client remote desktop to Windows 10

sudo apt-get install rdesktop
rdesktop 192.168.1.10
rdesktop 127.0.0.1 # also possible but crazy

Python Selenium Auto Refresh Webpage


This a.py code uses "geckodriver.exe" in same directory to auto refresh a webpage until specified string is found.


from selenium import webdriver
from selenium.webdriver.common.keys import Keys
import time

driver = webdriver.Firefox()
while True:
    driver.get("http://www.aegpromotion.com/mayday2019")
    if "The system is currently processing ticketing purchase by a large number of customers" not in driver.page_source:
        break
    print('waiting 6 seconds')
    time.sleep(6)
input("Great!")
driver.close()

2019年3月16日 星期六

ESXi 6.7 on ASRock J4105-ITX with Realtek 8111H Network Card

ESXi 6.7 on ASRock J4105-ITX with Realtek 8111H Network Card


Unzip ESXi-Customizer-v2.7.2.exe
then edit ESXi-Customizer.cmd
to remove below lines

   if "!WinVer!"=="5.0" call :logCons --- INFO: Running on Windows 2000. What?!
   if "!WinVer!"=="5.1" call :logCons --- INFO: Running on Windows XP.
   if "!WinVer!"=="5.2" call :logCons --- INFO: Running on Windows Server 2003.
   if "!WinVer!"=="6.0" call :logCons --- INFO: Running on Windows Vista or Server 2008.
   if "!WinVer!"=="6.1" call :logCons --- INFO: Running on Windows 7 or Server 2008 R2.
   if "!WinVer!"=="6.2" call :logCons --- INFO: Running on Windows 8 or Server 2012.
   if "!WinVer!"=="6.3" call :logCons --- INFO: Running on Windows 8.1 or Server 2012 R2.
   if "!WinVer!" GTR "6.3" call :logCons --- WARNING: Running on a Windows newer than 8.1 / 2012 R2. Don't know if this will work ...
   if "!WinVer!" LSS "5.1" call :earlyFatal Unsupported Windows Version: !WinVer!. At least Windows XP is required & exit /b 1
   if "!WinVer!" NEQ "6.1" call :logCons --- WARNING: Your Windows version is supported for customizing ESXi 5.x, but not ESXi 4.1.

then select VMware-VMvisor-Installer-6.7.0-8169922.x86_64.iso
and net55-r8168-8.045a-napi.x86_64.vib
to generate a new .iso file and finally refuse it to a 16GB USB 2.0 flash drive
and boot and install it on a Sandisk 32GB USB 3.0 flash drive.

End


DSM 6.2 on ESXi

https://gugucomputing.wordpress.com/2018/10/09/%E5%9C%A8esxi%E4%B8%AD%E5%AE%89%E8%A3%9Ddsm6-2-%E6%BA%96%E5%82%99dsm%E7%92%B0%E5%A2%83/

1. Prepare .img


OFSMount the file Synoboot.img from synoboot_3615.zip with NO Read-only.
Notepad++ opens grub.cfg
set sn=1230LWN001915
set mac1=001132001915
Add a leading # to the sections of
#menuentry "DS3615xs 6.2 Baremetal $VERSION" --class os {
#menuentry "DS3615xs 6.2 Baremetal $VERSION Reinstall" --class os {
#menuentry "DS3615xs 6.2 Baremetal AMD $VERSION" --class os {
but need to keep the section
menuentry "DS3615xs 6.2 VMWare/ESXI $VERSION" --class os {
Dismount all disks and Exit

On ESXi, create "dsm62" directory and uploads synoboot.vmdk and synoboot.img
ESXi creates new VM called dsm62 Ubuntu Linux 64 bits
Allocate 2CPU 2GB
Removes default disk, SCSI controller, CD/DVD drives
Set MAC address to 001132001915
Add "Existing disk" with synoboot.vmdk
Add new SATA1 controller and new disk at SATA(1:0)

Browse find.synology.com with DSM_DS3615xs_23739.pat below
https://archive.synology.com/download/DSM/release/6.2/23739/DSM_DS3615xs_23739.pat


SN Generator


http://liuhangcheng.coding.me/synology-serial-generator/

DSM 6.1.5


https://xpenology.com/forum/topic/12216-tutorial-install-dsm-615-on-esxi-65/

https://archive.synology.com/download/DSM/release/6.1.5/15254/
DS3615xs 6.1 Jun's Mod V1.02-alpha.zip
DSM_DS3615xs_15254.pat





End

2007 to 2023 HP and Dell Servers Comparison

  HP Gen5 to Gen11  using ChatGPT HP ProLiant Gen Active Years CPU Socket Popular HP CPUs Cores Base Clock Max RAM Capacity Comparable Dell ...