2022年3月27日 星期日

How to change the name of a user profile folder in Windows 10


1. Try to create a new account

2. Change the new account to administrator

3. Restart computer and login with new account

4. Rename c:/Users/"Old_Account"

5. Modify registry. In the Run prompt (press Win+ R ), type regedit and hit Enter.

HKEY_LOCAL_MACHINE \ SOFTWARE \ Microsoft \ Windows NT \ CurrentVersion \ ProfileList \

6. Select ProfileList, click on the sub-key to find which ProfileImagePath is match your Old_Account, and then double-click ProfileImagePath string to open it. Rename Old_Account.

7. Modify registry to fix Users Folder error. In the Run prompt (press Win+ R ), type regedit and hit Enter.

Computer\HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders

Double click to open the value data, and enter either of these: 

%USERPROFILE%\Desktop

C:\Users\%USERNAME%\Desktop

PS: multiple items need to be modified.

Click OK, and quit the Registry Editor.



Refer to:

1. https://www.tenforums.com/tutorials/89060-change-name-user-profile-folder-windows-10-a.html

2. https://www.itechguides.com/change-user-name-windows-10-rename-user-folder-windows-10/


Create a local user or administrator account in Windows

 Create a local user account

1. Select Start / Settings / Accounts / Family & other users

2. Select Add someone else to this PC

3. Select I don't have this person's sign-in information, and then select Add a user without a Microsoft account

4. Enter username, password, or password hint3. 


Modify account type to Administrator

1. Select Start / Settings / Accounts / Family & other users

2. Select the account name that you want to change, Select Change account type

3. Select Administrator, and then select OK

4. Sign in with the new administrator account


2022年3月25日 星期五

Computer hardware information tools

1. CPU-Z

    https://www.cpuid.com/softwares/cpu-z.html

2. Speccy

    https://www.ccleaner.com/speccy

Command Line to get Win 7 / Win 10 / Win 11 system related information

1. Open cmd Terminal

2. Windows version 
    # winver

3.  local computer system information 

    # systeminfo

    # systeminfo | @find "開機時間"

4. Remote computer system information (limitation: Windows PC)

    # systeminfo / s {Remote IP}

5. Get MAC address

    # getmac

6. Get Remote PC MAC address (limitation: Windows PC)

    #getmac /s {Remote IP}

7. 查詢主機板廠商、主機板型號。

    #wmic baseboard get product,Manufacturer

8. 查詢主機板廠商、主機板型號、序號、版本號。

    # wmic baseboard get product,Manufacturer,version,serialnumber

9. 顯示作業系統Windows 10 序號

    # wmic path softwarelicensingservice get OA3xOriginalProductKey

10. 

    # ipconfig | find /i "IPv4"

11. use regedit to get Win10 product key

    「HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\SoftwareProtectionPlatform」

   to find BackupProductKeyDefault, it contains ProductKey


特別注意:

「BackupProductKeyDefault」內所含的金鑰序號是「第一次」寫入的序號,有非常大的機率是不含正版啟用功能,目的只是為了可以識別或是正常安裝。

例如各大廠商如 HP、Acer 等,在電腦產品出貨前必須先寫入一組 BackupProductKeyDefault 來順利安裝系統與識別產品,這組序號僅供版本識別使用,沒有任何意義,隨後再把正式的序號寫入主機板中(OA3xOriginalProductKey),所以我們才可以用 CMD 來查詢。

另外一種狀況是,當自己重灌電腦或升級時,輸入一組通用序號來讓流程順利進行,這組序號也會寫入 BackupProductKeyDefault 值中。



12.  Microsoft Store,search「ShowKeyPlus」and install it.

     It may update window if your system is too old to install ShowKeyPlus. 


13. Windows system file check, administrator cmd 

     # sfc / scannow



Refer to:

1. https://adersaytech.com/kb-article/how-to-check-windows-product-key.html

2022年3月24日 星期四

What will happen if your windows do not activate ?

having limited access to some basic feature:

1. customize your display

2. crucial security updates, bug fixes, or patches

3. can't lock screen

4. you’ll be limited to the default wallpapers that come with Windows.

5. You can’t remove the default theme

6. You’ll have default fonts only

7. Your Start Menu settings can’t be configured

8. You can’t customize your taskbar

9. Activate Windows watermark

10. You’ll get persistent notifications to activate Windows 10

VirtualBox Keyboard Not Working on Windows 10


VirtualBox Keyboard Not Working on Windows 10

1. Open Windows Setting Manager

2. Search "Add or Remove"

3. Removed touch pad driver "SynTP"

4. Restart Windows 10

5. Open Device Manager to check Keyboard and Mouse driver

6. Open a Text File or cmd terminal to check keyboard function 

Refer to :

1. https://www.technipages.com/fix-vmware-keyboard-not-working-on-windows#:~:text=Quick%20Fixes&text=Click%20on%20the%20virtual%20machine's,can%20use%20it%20within%20VMWare.


Ubuntu VirtualBox cannot create the machine folder ___MF___ in the parent folder ___PF___.

1. Please check ___MF___ is existed.

2. Check your privilege 

2022年3月23日 星期三

Copy large file cause system hangs up on ubuntu

1. Edit /etc/sysctl.conf

2. Added

    vm.dirty_background_ratio = 2

    vm.dirty_ratio = 4

    vm.dirty_bytes = 15000000

3. # sudo sysctl -p 

It seems OK on my Ubuntu 20.04.4, 62GB RAM, AMD Ryzen 7 3700 8-core


Debug a large file copy caused system hangs up (for ubuntu)

 use iotop to debug I/O issue

1. # sudo apt-get install iotop

2. # sudo iotop

3. start another terminal

4. # sync

5. to monitor the process to see if it's hanging.

    # top

6. start another terminal, print free memory every 2 seconds

    # free -ms 2

7. Start another terminal, 

# sudo nohup free -ms 2 &> ~/Documents/log/free.log &

# sudo nohup top -b -d 5 &> ~/Documents/log/top.log &

# sudo nohup iotop -b -d 2 -o -t &> ~/Documents/log/iotop.log &




# iostat -x 1           or              collectl -sD

# atop




2022年3月19日 星期六

Win 7 / 10 查詢變更授權

Refer: https://read01.com/zh-tw/Le32AL.html#.YjUy9H9BxEY   

           (2016/05/13 來源:紅黑聯盟)

1. 以管理員身份執行 cmd

2. "slmgr.vbs -upk"  ---- 卸載證書

    "slmgr.vbs -rearm"則為重置電腦的許可證書狀態

3. 重新導入相關的OEM證書及Key

    slmgr.vbs -upkpb61
4. ex. 以管理員身份運行cmd,導入密鑰的命令(這裡以聯想的Ultimate為例):

slmgr.vbs -ipk 6K2KY-BFH24-PJW6W-9GK29-TMPWP


5. 導入證書的命令:

slmgr.vbs -ilc 證書路徑

其他命令及其作用:

slmgr.vbs -dli   (顯示許可證信息)

slmgr.vbs -xpr   (當前許可證狀態的截止日期)

slmgr.vbs -dlv   (顯示詳細的許可證信息)

slmgr.vbs -xpr

slmgr.vbs -ilc lenovo.oemcert.100036.xrm-ms


其它查看授權的方法:上網下載 slic toolkit 查看看 BIOS 有沒有windows 授權






2022年1月11日 星期二

Windows 10 彩盒版 (完整版 Full Version) (Retail) 與 隨機版 (OEM) 的使用限制

 Windows 10 彩盒版(完整版 Full Version) (Retail) 與 隨機版(OEM) 的使用

1. 隨機版(OEM): 輸入金鑰之後會綁定主機板,Win 10 build 1607 之後,若有用微軟帳號綁定轉成數位授權,則可以移機到新的主機

2. 數位版啟用授權之轉移同隨機版

(也就是免費更新上WIN10跟從M$商城買的授權隨機版規則)

(例如:原本是彩盒版 Win7 免費更新上 Win10,就會變成隨機版)

3. 彩盒版(完整版 Full Version) (Retail):理論上可以任意的移機,限制是同時只能有一台是合法使用。但實際上,微軟的伺服器好像會偵測安裝次數,可能被限制安裝次數,若有問題時,還是可打電話到微軟要求解決。最好保留購買的發票與彩盒金鑰


建議:

1. 若是使用隨機版(OEM),可考慮用微軟帳號綁定轉成數位授權,以後可以自由移機到新的主機,舊的會自動失效,不須事先取消綁定。先到微軟網站,登入你的帳號,查看帳戶有沒有連結授權。

2. 隨機版(OEM)不綁定微軟帳號轉成數位授權,要先取消綁定主機板授權,然後,才可以移動授權到新的主機板


按照MS的規則

彩盒版 = 可單機序號啟動+轉移、可綁定MS帳號啟動+轉移

隨機版 = 可單機序號啟動(不可轉移)、可綁定MS帳號啟動(不可轉移),
後來被發現微軟啟動規則BUG,才出現 [隨機版綁定MS帳號啟動+轉移] 的方法

至於隨機版用主機板維修的理由做電話序號啟動+轉移,這是微軟在放水(或是說相信客戶的誠實),按照規則是可以拒絕轉移的


上網下載 slic toolkit 查看看 BIOS 有沒有windows 授權

可用 DOS Prompt 的 slmgr 查看是 Retail, OEM or Volume

slmgr /dli

refer to :

1. https://www.lifewire.com/slmgr-command-4684499

2. https://www.windowscentral.com/how-determine-if-license-oem-retail-volume-windows-10

3. https://softwarekeep.com/help-center/how-to-plug-in-your-product-key-with-slmgr-and-slui

4. https://www.mobile01.com/topicdetail.php?f=300&t=5484013&p=2

5. https://www.mobile01.com/topicdetail.php?f=300&t=6394804





2021年12月30日 星期四

How to set up USB for Virtualbox?

How to set up USB for Virtualbox?


1. Install Extension Pack

  For USB 2.0 and USB 3.0 we need to install the free (but closed source) VirtualBox Extension Pack from the VirtualBox download page

  

2. Become a "vboxuser" in Host machine (local machine)

To be able to get access to an attached USB device, the Ubuntu host user needs to be in the vboxusers group. Add your user to this group by running the following command


sudo usermod -aG vboxusers <username> 


and reboot or logout/login.


3. Activate USB support in VirtualBox Manager


Shut down your virtual machine and open USB settings in the VirtualBox Manager. Tick Enable USB Controllerand USB 2.0 (EHCI) Controller or USB 3.0 (xHCI) Controller.


Suggestion: using USB 2.0 (EHCI) Controller


4. Select host USB device for access from the guest

To grant access to USB devices we need to select a device to disable in the host and to enable in the guest (this is a precaution to avoid simultaneous access from host and guest). This can be done from the panel Devices menu or by right mouse click in the bottom panel of the VirtualBox Manager on the USB icon:


Tick the device you need in the guest, untick it if you need it in the host. If you can't see your USB device in that list, it means that VirtualBox cannot access your host USB devices. Make sure your user is added to the vboxusers group and that you restarted your host.


The selected device will immediately be accessible from the guest.


Refer to : https://askubuntu.com/questions/25596/how-to-set-up-usb-for-virtualbox


2021年11月11日 星期四

How to make 'python' program command execute Python 3?

/usr/bin/env: ‘python’: No such file or directory

 

Method 1: (This method is failed to "#! /usr/bin/env")

   putting alias in the user's ~/.bashrc

   example:

   alias python=python3


Method 2: (This method is OK to "#! /usr/bin/env")

  $ whereis python3

  $ ls -lisa /usr/bin/python*

  $ sudo ln -s /usr/bin/python3 /usr/bin/python


Method 3:

  $ sudo apt install python-is-python3

2021年10月22日 星期五

Install Chinese Input on Ubuntu 20.04

1. Settings / Region & Language / Input Sources / Manage Installed Language

    Add Chinese

2. Settings / Region & Language / Input Sources / + 

    Select ... , 

    then Other, 

    then select Chinese, Press Add

3. Settings / Region & Language / Input Sources / Chinese

    Press Chinese, Select Chinese (Chewing)


2021年10月8日 星期五

VirtualBox Copy & Paste don't work between host and guest OS (for Ubuntu)

Refer to https://askubuntu.com/questions/63420/how-to-fix-virtualboxs-copy-and-paste-to-host-machine



1) VirtualBox / Machine / General / Advanced
    Shared Clipboard: Bidirectional
            Drag'n' Drop: Bidirectional
2) The guest's Ubuntun terminal commands:
sudo apt install virtualbox-guest-x11 --reinstall
VBoxClient-all --clipboard
I used --reinstall option because of I had virtualbox-guest-x11 package installed and before reinstalling it I had:
$ VBoxClient-all --clipboard
VBoxClient: error: No service specified. Quitting because nothing to do!
3) After reboot screen resolution jumps to its minimal value, so
Run Guest OS (Ubuntu) / Settings / Displays / Resolution 

2020年12月4日 星期五

The default way to take screenshot in Linux #print screen #prtscr

The default way to take screenshot in Linux


Almost all Linux distributions and desktop environments support these keyboard shortcuts.

Let’s take a look at the list of keyboard shortcuts you can utilize:

PrtSc – Save a screenshot of the entire screen to the “Pictures” directory.
Shift + PrtSc – Save a screenshot of a specific region to Pictures.
Alt + PrtSc  – Save a screenshot of the current window to Pictures.


Ctrl + PrtSc – Copy the screenshot of the entire screen to the clipboard.
Ctrl + Shift + PrtSc – Copy the screenshot of a specific region to the clipboard.

Ctrl + Alt + PrtSc – Copy the screenshot of the current window to the clipboard.

Big5 txt files became unreadable under Linux

command line (convert big5 encoding text.txt to utf8 encoding test-utf8.txt)

iconv -f big5 -t utf8 test.txt > test-utf8.txt

Refer to:  

https://www.itread01.com/p/160400.html

2020年11月5日 星期四

My Favorite Git Setting (for Ubunut)


1. Add the following in ~/.bash_profile


#! /bin/bash
#-----------------------------------------------------------------
# Bash autocompletion for Git

if [ -f ~/.git-completion.sh ]; then
   source ~/.git-completion.sh
fi

if [ -f ~/.git-prompt.sh ]; then
   source ~/.git-prompt.sh
fi

# PS1 may be replaced
 PS1='${debian_chroot:+($debian_chroot)}\[\033[01;32m\][\w]\[\033[0m\]\[\033[1;36m\]$(__git_ps1)\[\033[0;33m\]\[\033[0m\]$ '
#PS1='\[\033[01;32m\]\u@\h\[\033[00m\]: \[\033[01;34m\]\w \[\033[0m\]\[\033[1;36m\] $(__git_ps1)\[\033[0;33m\]\[\033[0m\]$ '
#PS1='[\u@\h \W$(__git_ps1 " (%s)")]\$ '
#PS1="[\[\033[1;32m\]\w\[\033[0m\]] \[\033[0m\]\[\033[1;36m\]\$(git_branch)\[\033[0;33m\]\$(git_since_last_commit)\[\033[0m\]$ "
#PS1="[\[\033[1;32m\]\w\[\033[0m\]] \[\033[0m\]\[\033[1;33m\]\$(__git_ps1)\[\033[0;33m\]\[\033[0m\]$ "


2. Download  https://github.com/git/git/blob/master/contrib/completion/git-completion.bash 

and rename by git-completion.sh

3. download https://github.com/git/git/blob/master/contrib/completion/git-prompt.sh

$ mv git-completion.sh ~/.git-completion.sh
$ mv git-prompt.sh ~/.git-prompt.sh
$ chmod 775 .git-completion.sh
$ chmod 775 .git-prompt.sh


4. 

$ source ~/.bashrc

or


$ source ~/.bash_profile

Reference result




2019年11月13日 星期三

DEBUGGING ARDUINO SKETCHES WITH ATMEL STUDIO 7 (How to install hardware debug tool for ATMEL Studion 7)









Refer to :
1. http://www.solutions-cubed.com/electronic-design-blog/debugging-arduino-sketches-with-atmel-studio-7/

Arduino IDE (Windows app version vs conventional version)

1. The Arduino IDE from Windows app store do not have conventional directory. It's directory is on
   Windows hides windows store apps in c:/users/YourUserName/AppData(hidden folder)/Local/Packages
2. App version of Arduino IDE is not good to translate Arduino sketch file(*.ino) to ATMEL Studio 7 (*.cpp).
3. Suggestion: Removed app version of Arduino IDE and install conventional Arduino IDE from https://www.arduino.cc/en/main/software