Saturday, June 20, 2020

Problem: Baseboard management controller cannot get IP address?

I have a computer system whose motherboard has ASRock Rack baseboard management controller (BMC) that allows me to interact with the system via the Intelligent Platform Management Interface (PMI). One day, I noticed that the BMC ceases to have an IP address assigned. This is obviously a problem since the system does not have a monitor directly connect to it, and the management console was at the time the only means for me to administrate the system fully.

Neither of the following I attempted resolved the issue,
  1. I unplug and re-plug the Ethernet cable to the Ethernet port of the BMC.
  2. I reboot the network gateway that runs the DHCP server to allocate the IP address to it.
  3. I shutdown the system, and reboot the system.  
Finally, I realized that the BMC is a little computer of its own, and I had never rebooted it at all despite the above attempts. With this in mind, I attempted the following solution and it worked!

  • Unplug the power cable from the system and plug the power cable back to the system
This in retrospect is the means to reboot the BMC system. Having attempted this, I also wonder, what if I switch off the power switch of the power supply, would it also work? I guess it should be, it reboots the BMC system itself to cut off the power. So simple, after some frustration!


Friday, June 19, 2020

"git status" shows modifications, but "git diff" shows nothing

I encountered a strange problem about a git repository today, that is, when I do a git status, git reports there are modifications. However, when I do a git diff, git reports no difference, like the following,

$ git status .
On branch master
Your branch is up to date with 'origin/master'.

Changes not staged for commit:
  (use "git add ..." to update what will be committed)
  (use "git checkout -- ..." to discard changes in working directory)

        modified:   .gitignore

$ git diff
$

After a little bit digging, apparently a few others encountered the same problem as a Stack Overflow discussion indicates.

The cause of my case are two,
  1. Some files have different line endings from the version in the repository as a result that I was working on a Windows Subsystem for Linux and had the git's configuration property core.autocrlf set as input. I revealed the Windows line ending using vim, as in the following,
    
    $ vim -b .gitignore
    # Compiled class file^M
    *.class^M
    ^M
    # Log file^M
    *.log^M
    ^M
    # BlueJ files^M
    *.ctxt^M
    

    where the ^M characters are the Windows line endings, i.e., CR LF. I got rid of the line endings using sed, as in,
    
     sed -i -e s/^M// .gitignore
    

    Note that we enter the line ending by pressing CRTL-V CRTRL-M
  2. The second issue is that some files have different permissions from those in the repository. Since I was using a Windows Subsystem for Linux on a Windows host, it is difficult for me to set the permissions identical to those in the repository. However, we can let git to ignore permission difference, i.e.,
    
    git config --local core.filemode false
    

    where I only did this for the repository. If we wish to do this for globally for all repositories, just issue the command without the --local option.


Monday, June 1, 2020

Problem: Application Icon on Windows Taskbar Becomes White Square

I was using a Windows 10 system. I noticed somehow the icon of application on the taskbar became a white square, like this picture shows,


I figured out a solution to resolve this. That is to delete the thumbnail icon cache that we can find at %LOCALAPPDATA%\Microsoft\Windows\Explorer, i.e.,

  1. Open a Windows Command Prompt window
  2. Do the following from the command line on the Windows Command Prompt window
    1. taskkill /F /IM explorer.exe
    2. del %LOCALAPPDATA%\Microsoft\Windows\Explorer\thumbcache_*.db
    3. explorer.exe
Sometimes, it is also necessary to remove all the thumbnails themselves, i.e., run the Disk Cleanup application. From the command line, that is,
  1. Run the Disk Cleanup application, i.e., cleanmgr.exe
  2. Uncheck everything using the user interface, and check "Thumbnails" (See the screen shot). 
  3. Click OK to confirm
  4. Exit the Disk Cleanup application

The system will rebuild the thumbnail cache and the thumbnails.