Technical Blog

This is a weblog where I write technical stuff, most of which is about computers.
Creative Commons License
Please notice that all contents within this site are licensed under a Creative Commons Attribution 3.0 Unported License, except for works containing a separate license.

Recent Posts

  • Enable Windows BitLocker on the System Drive in VMware Player with a Virtual Key Storage Drive The VMware Player which is free for non-commercial use does not support the virtual Trusted Platform Module (vTPM), and thus does not officially support BitLocker on the system drive ...
    Posted Oct 15, 2020, 7:58 PM by Jingshan Du
  • Binary PAL Palette (Colormap) Files for OriginLab Origin(Pro) Recent versions of Origin has shipped with a number of palettes that are significantly better than the previous version which essentially uses a default Windows color scheme. However, many "more ...
    Posted May 5, 2020, 9:31 PM by Jingshan Du
  • Error when installing GSAS-II: matplotlib cannot import name cbook GSAS-II is a fantastic crystallography package developed by the ANL written in python: installation, you will find that the package ...
    Posted Oct 23, 2018, 11:47 AM by Jingshan Du
Showing posts 1 - 3 of 23. View more »

Enable Windows BitLocker on the System Drive in VMware Player with a Virtual Key Storage Drive

posted Oct 15, 2020, 7:58 PM by Jingshan Du

The VMware Player which is free for non-commercial use does not support the virtual Trusted Platform Module (vTPM), and thus does not officially support BitLocker on the system drive in a Windows guest OS. Here a workaround is provided to enable BitLocker with minimal disturbance to normal user interaction by creating a virtual USB disk for boot-time authentication. 

1. Add a virtual USB disk to the virtual machine
Although not officially documented, you can add virtual USB devices, such as USB drives, to a virtual machine in VMware Player. This will serve as the key storage drive for BitLocker so you do not have to input an additional password when booting into the virtual machine.

To do this, you need to first create a small virtual disk (vmdk). If you only have VMware Player without other tools, you can add a new hard drive to your virtual machine and use that wizard to create a new vmdk file. It does not have to be large --even a few megabytes is enough. Then, locate the vmx file for your virtual machine (typically in the C:\Users\[username]\Documents\Virtual Machines\[name of the VM]\ or the location where the VM is stored). Open it using a text editor (e.g., notepad), and append the following content to the file:
ehci:0.present = "TRUE"
ehci:0.deviceType = "disk"
ehci:0.fileName = "pathToFile.vmdk"
ehci:0.readonly = "FALSE"
Note that the number "0" after "ehci:" specifies which USB port this virtual drive is inserted into. Make sure to replace "pathToFile.vmdk" with the actual path to the small vmdk file that you just created.

Now launch your virtual machine which already has a working Windows operating system. Go to Disk Management (you can search for it or right-click on the Windows Start button) and you will find a new drive "not initialized". Now initialize this drive in the right-clicking menu on the drive name left to the block diagram. Then, add a volume on this new drive and format it as either NTFS or FAT32 (does not matter).

2. Enable Windows to use BitLocker on the system drive without TPM presence

Briefly, search for "group policy" in the system or launch it directly by doing Win+R -> "gpedit.msc". Navigate to Local Computer Policy > Computer Configuration > Administrative Templates > Windows Components > BitLocker Drive Encryption > Operating System Drives and double-click on "Require additional authentication at startup". Then, enable this policy and check on the option "Allow BitLocker without a compatible TPM (requires a password or a startup key on a USB flash drive)".

Now you can go ahead and enable BitLocker on your system drive. You will be prompted to select either of the two methods for boot-time authentication: insert a  USB drive or enter a password. As entering an additional password at every boot is very annoying, you can now use the virtual USB drive that was just created for key storage. 

Binary PAL Palette (Colormap) Files for OriginLab Origin(Pro)

posted May 5, 2020, 9:31 PM by Jingshan Du

Recent versions of Origin has shipped with a number of palettes that are significantly better than the previous version which essentially uses a default Windows color scheme. However, many "more scientific" and visually more pleasant schemes are not available in Origin because the latter uses a binary PAL file format. Thanks to Peter Karpov ( a collection of reasonable colormaps are available in the CSV format, including several improved ones with methods described in his blog post. Here I converted all these colormaps into the binary PAL file format which can be directly imported into Origin and be used. The recommended way is to copy all .pal files into your <User Files Folder>\Palettes\ folder. More information on Origin PAL can be found at

List of colormaps (
Download ZIP file for the PALs below.

Error when installing GSAS-II: matplotlib cannot import name cbook

posted Oct 19, 2018, 10:45 PM by Jingshan Du   [ updated Oct 23, 2018, 11:47 AM ]

GSAS-II is a fantastic crystallography package developed by the ANL written in python:

During installation, you will find that the package itself cannot be set up properly. When running its, you will see the following error:
Sorry, this version of Python cannot be used
for GSAS-II. It is missing the following package(s):
Please install these package(s) and try running this again.
Showing first error:
Traceback (most recent call last):
  File "GSASII\", line 187, in <module>
    exec('import '+pkg)
  File "<string>", line 1, in <module>
  File "C:\Miniconda2\lib\site-packages\matplotlib\", line 124, in <module>
    from . import cbook
ImportError: cannot import name cbook
This is simply the newer matplotlib versions breaks the code (misteriously). I searched on the web for a while and finally found some other people encountering similar problems with some other packages ( The solution is simple: downgrading the matplotlib to 2.0.2 by running:
conda install matplotlib=2.0.2
Note that I tested both 2.2.x and 2.1.x, and neither worked. 2.0.2 is the highest version that will run GSAS-II.

Update (10/23/2018)

I also found that the recent wxpython version 4.0.x has some problems working with GSAS-II. I downgraded to the classic wxpython 3.0 and now it works fine.

Windows: Sound in a web browser not played through the default device

posted Sep 25, 2017, 5:43 PM by Jingshan Du

When you have multiple playback devices, the Windows system lets you to choose which one is the default. Usually, sounds from most programs will be played on that device if there is no specific customized settings in these programs. However, sometimes you may notice that when you tries to listen to streaming music/video from your web browser, the sound is directed to another device other than the default one set by Windows.

Actually, this may not be the problem of the browser, if the streaming content is played by a Adobe Flash-based player. In fact, the Flash player has its own setting for the playback device. To access it, right click on the Flash content in the webpage, and select "Settings...". You will see a small window popping up. Select the Audio Output tab, and choose the audio device you want to use. Now the sounds in the Flash content will be played through the device you just selected.

How to fix the displaced AF boxes in the viewfinder in a Canon EOS DSLR

posted Sep 3, 2017, 10:06 PM by Jingshan Du

In preparation of the total solar eclipse that just happened in August, I bought a EOS 500D from eBay. Everything was in excellent conditions except that I always saw a defocused view from the viewfinder by eyes, although the images were at focus. What is more, the boxes and circles around the AF points are slightly off from where they are supposed to be. The image below shows what I saw through the viewfinder. The centers of all the boxes are slightly above the corresponding AF points. A horizontal line can be also seen at the bottom of the view. 
After some exploration, I found that this issue is because the dummy glass plate that contains these boxes are displaced. Please see the below image. A very thin metal frame holds this dummy plate above the mirror. This metal frame is locked by a small metal tooth (green circles). In my case, the engagement had fallen off. I used a tweezer to firstly pick up the tooth and shake the camera gently. This moves the dummy plate to the right position. Then, place the metal frame back and engage the metal tooth using the tweezer. Now when I look through the viewfinder, everything is correct!

Step-by-step: Upgrading Nokia Lumia 1020 to Windows 10 Mobile Anniversary (build 14393)

posted Aug 20, 2016, 11:08 PM by Jingshan Du

Only limited Windows Phones are eligible to be upgraded to the latest Windows 10 Mobile release. The second generation Lumia (x2x series) are unfortunately no longer supported by M$ to run Windows 10. I recently upgraded my own Lumia 1020 to the latest stable release of Windows 10 Mobile (build 14393) following the posts by ssmb212 ( and Stealing_heart ( I would like to share my experience step by step here.

1. Obtain root access

These steps let us access the system files of the operating system.

1.1 Install Windows Device Recovery Tool. Plug the phone to the PC and do a recovery flash using this tool. Note that in my first attempt I skipped this flashing and I got a boot loop in later steps... so try not to be lazy here.

1.2 Install Windows Phone Internals. The phone will be recognized by this software and let you know the exact model (RM-xxx) and Product Code (a string like 059S9T1).

1.3 Search for the exactly same product in Download the .hex file from Emergency Files section. Also download this file and unpack it.

1.4 In WPinternals, go to Unlock bootloader. Select all required files (FFU, which is available in C:\ProgramData\Microsoft\Packages\... when we used the recovery tool to flash the phone; Emergency flash Loader, the .hex file; SBL3 engineering file, the unpacked Lumia 1020 file). Continue to do the unlock and wait for the software to complete processes.

1.5 In WPinternals, Enable root access. This will also turn the phone to Mass Storage Mode, which makes the phone looks like a USB drive to the PC and thus allowing us to modify system files.

2. Change device targeting information

These steps changes the registry of the phone system to let the system think this is a newer generation of Lumia phone so upgrading to Windows 10 is allowed.

2.1 Open regedit on the PC. Click on HKEY_LOCAL_MACHINE. Select Files - Load Hive. Navigate to the phone drive (MainOS)/Windows/system32/config. Select the file SYSTEM. Type in wp-sys as the name. Actually you can choose any name here but wp-sys will be used in my later steps.

2.2 In regedit, navigate to wp-sys/Platform/DeviceTargetingInfo. Look for the below keys. First save the original values and then change them according to below:
PhoneManufacturer = NOKIA,
PhoneManufacturerModelName = RM-984_1006,
PhoneModelName = Lumia 830,
PhoneHardwareVariant. = RM-984
This will let your phone to pretend to be a Lumia 830 Indian variant temporarily. Click on wp-sys and select File - Unload Hive. This will save the above edits to the phone.

2.3 Go back to WPinternals, Disable root access. On your phone, hold the Power button and the VolumeDown button at the same time until a vibration to let the phone reboot.

2.4 On your phone, you are ready to upgrade! Download the Upgrade Advisor app, or the Windows Insider app to configure the upgrade process. Note your phone may firstly download some updates for wp 8.1 and before finishing updating you cannot enroll in the Insider program. We will first reach the build 10586 of Windows 10 after long long waiting.

2.5 Now only the Windows Insider app can lead us to the Anniversary Update version (1607, build 14393) of Windows 10. Note after comprehensive rolling out of this build in release channel, you may receive this update directly from Windows Update. In case you do not, use the Insider app. Select Insider Production channel does the job.

3. Post-installation clean-ups

We are now running the latest Windows 10 on our Lumia 1020 phone! However we still need some works to make everything working on our phone.

3.1 Use WPinsiders and select Manual mode. Go to Mass Storage Mode. This will reboot the phone and make it a USB drive again.

3.2 Use regedit on PC, Load Hive of the same SYSTEM file, and restore the information that we changed in 2.2 to the original values of Lumia 1020.

3.3 Hard reset the phone by firstly holding the Power button and VolumeDown button. Feel the vibration, and release the Power button while still holding VolumeDown, until an exclamation mark appears on the phone screen. Release VolumeDown and press these buttons IN ORDER:
VolumeUp - VolumeDown - Power - VolumeDown.
Wait and this will reset the phone to an initial stage after clean installation (with the latest operating system we just installed).

3.4 Complete the setting up process. I encountered a very strange setting up with no wifi, no cellular and 0% battery level. I guess the drivers were not loaded successfully in this initial booting-up. I went through the setting-ups without logging in using MS account and reboot the phone. The phone then boot up normally.

3.5 Update all apps in the Store. This will also install/update supporting system apps. Some system apps may not be updated automatically, and you can scan the QR codes from here to install/update them manually. Remember to get a QR scanner app first!

3.6 About the language pack. Downloading keyboards or speech language may not work, with constant "Attention needed" errors. This can be solved by following below:
Go to Settings - Update & security - Windows Insider Program, and enroll the phone as a insider. After rebooting, you will be able to install language files. You can de-activate Insider configuration after that and it seems you can still install language files from then on.

3.7 Fix the glance screen. There are some missing registry keys and system files in the Anniversary build that are necessary for glance screen. Method comes from many posts in this thread.
3.7.1 In WPinternals let the phone enter Mass Storage Mode.
3.7.2 On the PC to Load Hive for SYSTEM (as wp-sys) and also for SOFTWARE (as wp-soft) in the same folder.
3.7.3 Download this attached file. Run this .reg file to combine entries into the phone registry.
3.7.4 Unload Hive for both wp-sys and wp-soft to save everything to the phone.
3.7.5 Then download this file and unpack all included files to phone drive (MainOS)\SharedData\OEM\Public. Power + VolumeDown to reboot the phone.
3.7.6 Go to Settings - Extras - Glance screen to enable this function, and it should be working now.

It took me an afternoon plus evening to finish everything up, but it's absolutely worth the time. :-)

Changing synced library path in EndNote after you moved/renamed your main library

posted Aug 16, 2016, 9:20 AM by Jingshan Du

Sometimes you may need to move your main EndNote library to a different location or just decided to give it a fancier name at some point. However, after doing so, the EndNote software stops syncing that library. If you check with the preferences, you will find that the path to the synced library is still the old one and you can not edit it.

Actually EndNote saves this path in the registry in Windows. If this needs to be edited, run regedit and search for "SyncLibraryPath". You can edit the text stored in that value to the new path of the library you want to sync with EndNote Web. On my computer this value resides in
HKEY_USERS\S-1-5-21-3470660602-2923859688-2853976470-1001\SOFTWARE\ISI ResearchSoft\EndNote\Preferences
, although I do not know whether that long string of number may vary on different computers.

Force updating graphics driver to resolve "driver stopped responding"

posted Mar 4, 2016, 11:11 PM by Jingshan Du

My current ThinkPad laptop is a T440p equipped with a NVidia graphics card. The graphics driver to this system is an OEM-customized one because of the NVidia Optimus technology [1] that enables switching between the integrated intel graphics (inside the CPU) and the dedicated graphics card.
Since I received this machine and upgraded to Windows 10, I found that the graphics driver will crash one or few times everyday. When that happens, everything will freeze for a few seconds and then a message pops saying that "Display driver ...... stopped responding and has successfully recovered". For most time it happens to the Intel driver since it is in charge of screen displaying under the Optimus technology.
The most popular solution I can find on the Internet is to set the delay time of TDR, a tracking mechanism to monitor the computer hardware. [2] However this does not solve my problem.
It then occurred to me that my graphics drivers are not the newest. Since Lenovo distributes the customized driver, I cannot receive or manually install the generic driver package from Intel. The Intel driver included in the Optimus driver from Lenovo is very old, which turned out to be the culprit.
There is one way to force updating the Intel graphics driver.
  1. Download the driver from Intel's website in zip format.
  2. Unpack it to somewhere.
  3. Open your Device Manager, find the Intel HD graphics card under the Display adapters section.
  4. Right click on it and select "Update Driver Software..."
  5. Select "Browser my computer for driver software", Next.
  6. Select "Let me pick from a list of device drivers on my computer". Note that using the "search for driver software in this location" will not work since the system will refuse to install it. Next.
  7. Select "Have Disk..." Navigate to where you unpacked the new drivers, enter the Graphics folder and select the ini file in it. ok and next...
  8. Then the new driver should be installing. It may take a few minutes to finish.
At least after force updating the driver, it has remained stable for a few days. We will see whether the problem is completely solved by time.
References and Further Readings

Virtual Store location for programs saving files without the administrator privilege

posted Feb 1, 2016, 8:43 PM by Jingshan Du

There are many locations that programs without the administrative privilege cannot alter. For example, the "Program Files" folder and its subfolders. Such feature has been introduced as part of the User Account Control (UAC) since Windows Vista to prevent unauthorized changes of critical files. However there are many old programs in the pre-UAC era which save configurations and other stuff in the root path of the program or at the root of the disk (like C:\). If these programs are installed in the "Program Files" folder in newer systems, it can lead to a problem when they are not running with administrator privilege.

Microsoft has introduced a feature called Virtual Store to virtually link these inaccessible locations to somewhere the program can modify. The program itself cannot sense it while they will actually save files in a different location. Sometimes it is confusing for the user trying to find where these saved files are since they do not appear in the root folder of the program,. The alternative path is given as below.

I am writing this small article since it is very hard to find related information via the search engine if you did not know the term "virtual store". This piece should answer your question if you are trying to find where do programs without the administrator privilege save files in the "program files" folders.

References and further readings:

Force upgrade to Office 2016 apps when using Office 365 Education/University/etc

posted Jan 30, 2016, 11:36 AM by Jingshan Du

Now that students and faculty members in major US universities and colleges have got MS Office 365 Education subscription, many of you may found that you are still getting the "out-dated" Office 2013 apps rather than the newest Office 2016 suite. The reason is that by default, the update branch for the educational subscriptions is a slower and more stable one called "Current Branch for Business".

Microsoft maintains three different update branches or channels for Office 365. As explained in the TechNet, features in the Current Branch for Business get updated every four months. This means that if the IT manager in your school did not change the updating settings, you will get office 2016 at the end of the first Quarter in 2016.

However there is a way to bypass the administrative setting and install or upgrade your Office programs to the 2016 version. This is done by the "Office Deployment Tool" offered by Microsoft to IT professionals. Although there is a long TechNet article explaining how to use this little program (, we can do it in a very simplified way.

1. Download the Office 2016 Deployment Tool at
2. Run the downloaded file. It will just unpack two files to the destination you choose.
3. Navigate to the location of these files. Open the configuration.xml file with a text editor.
4. You will see the <Add OfficeClientEdition...> stuff. Modify the OfficeClientEdition to 64 if you wish to install the 64-bit edition. Below that line you will see two <Product ID...> terms. These are the programs that will be installed. Mostly we only have Office 365 ProPlus, so leave the first product intact, and delete the second <Product...> to </Product> contents which indicates Visio, another Office component sold separately. Save the file.
5. Open a command line (cmd) at the location of these files. Run
Setup.exe /configure
.Then wait and start using your new Office apps!

Note: a complete reference for how to edit the configuration.xml file can be found at

Example configuration.xml that installs 64-bit Office 2016 ProPlus:
  <Add OfficeClientEdition="64" Branch="Current">
    <Product ID="O365ProPlusRetail">
      <Language ID="en-us" />

1-10 of 23