Setup a nice looking WSL terminal on Win 10

WSL ( Windows Subsystem for Linux ) is a very nice and good practice environment on Windows 10 for people who would like to taste a bit of linux system and bash…etc you could turn on the feature and install the supported Linux you like. currently supported Linux as follow:

Ubuntu 18.04
Ubuntu 18.04 ARM
Ubuntu 16.04
Debian GNU/Linux
Kali Linux
OpenSUSE
SLES

You could download and install them from Windows App store or download them manually from : https://docs.microsoft.com/en-us/windows/wsl/install-manual

1. Turn on Windows Subsystem for Linux feature on Windows 10

2. Download wsl-terminal (https://github.com/goreliu/wsl-terminal), follow up the “Usage” section to install and setup terminal.

3. Install zsh –> sudo apt-get install zsh

4. install Oh-my-zsh

curl -L https://raw.github.com/robbyrussell/oh-my-zsh/master/tools/install.sh | sh

5. change zsh theme ( nano ~/.zshrc )

6. Download and install Fonts (DejaVuSansMono for Powerline )

7. modify wsl-terminal option –> right click title bar on wsl-terminal and click “option”. It will then pop up and option windows for users. you could change the font and theme you like.

I also add some additional information in bashrc to let apt use proxy . My computer is behind proxy server to go outside of networks.

alias weather=’curl wttr.in/burnaby’

Acquire::http::Proxy “http://127.0.0.1:3388”;
Acquire::https::Proxy “http://127.0.0.1.60:3388”;
Acquire::ftp::Proxy “http://127.0.0.1:3388”;
Acquire::socks::Proxy “http://127.0.0.1.60:3388”;

And I also installed lolcat (sudo apt install lolcat). and now the WSL terminal looks something like above. It looks much more pretty now 🙂


Delete Protected system fonts (Win 7, Win10)

After installed required fonts for our newly installed Win10 computer.
I found the command prompt will show some weird chars for back slash.
After done some google search and poke around, I found a solution. One of the windows fonts cause the problem
usually I could just simply delete it from font fonder..however when I was trying to delete that one.
It shows an error msg saying that font is “system protected….etc”
to delete system protected font we could simply delete the key value from Registry.

HKEY_LOCAL_MACHINE → Software → Microsoft → Windows NT → CurrentVersion → Fonts –> “(Font Name)”

in my case font name will be : msgothic.ttc, MS Gothic & MS UI Gothic & MS PGothic (TrueType)

After deleting the reg key and then restart the computer the cmd prompt is back to normal now 🙂

How to get remote computer’s mac address from windows tool – “psexec”

How to get remote computer’s mac address from psexec

PS D:\Admin\User> psexec \\win10-test -u admin -p Pa$$w0rd ipconfig /all

PsExec v2.2 - Execute processes remotely
Copyright (C) 2001-2016 Mark Russinovich
Sysinternals - www.sysinternals.com



Windows IP Configuration

   Host Name . . . . . . . . . . . . : win10-test
   Primary Dns Suffix  . . . . . . . : contoso.com
   Node Type . . . . . . . . . . . . : Hybrid
   IP Routing Enabled. . . . . . . . : No
   WINS Proxy Enabled. . . . . . . . : No
   DNS Suffix Search List. . . . . . : contoso.com

Wireless LAN adapter Wi-Fi:

   Media State . . . . . . . . . . . : Media disconnected
   Connection-specific DNS Suffix  . :
   Description . . . . . . . . . . . : Intel(R) Dual Band Wireless-AC 7265
   Physical Address. . . . . . . . . : F9-A4-C5-FA-0D-AA
   DHCP Enabled. . . . . . . . . . . : Yes
   Autoconfiguration Enabled . . . . : Yes

Wireless LAN adapter Local Area Connection* 9:

   Media State . . . . . . . . . . . : Media disconnected
   Connection-specific DNS Suffix  . :
   Description . . . . . . . . . . . : Microsoft Wi-Fi Direct Virtual Adapter
   Physical Address. . . . . . . . . : FA-A5-2C-A0-E0-AB
   DHCP Enabled. . . . . . . . . . . : Yes
   Autoconfiguration Enabled . . . . : Yes

Ethernet adapter Ethernet:

   Connection-specific DNS Suffix  . : contoso.com
   Description . . . . . . . . . . . : Realtek PCIe GBE Family Controller
   Physical Address. . . . . . . . . : AD-A2-03-6C-CC-AC
   DHCP Enabled. . . . . . . . . . . : Yes
   Autoconfiguration Enabled . . . . : Yes
   Link-local IPv6 Address . . . . . : fe21::3007:f746:5e9b:f2bf%12(Preferred)
   IPv4 Address. . . . . . . . . . . : 10.10.4.10(Preferred)
   Subnet Mask . . . . . . . . . . . : 255.255.254.0
   Lease Obtained. . . . . . . . . . : February 14, 2018 11:16:09 AM
   Lease Expires . . . . . . . . . . : February 21, 2018 11:16:08 AM
   Default Gateway . . . . . . . . . : 10.10.4.254
   DHCP Server . . . . . . . . . . . : 10.10.4.17
   DHCPv6 IAID . . . . . . . . . . . : 61661907
   DHCPv6 Client DUID. . . . . . . . : 00-01-00-01-22-0F-C5-56-AC-E2-D3-63-C3-30
   DNS Servers . . . . . . . . . . . : 10.10.4.99
                                       10.10.4.100
   Primary WINS Server . . . . . . . : 10.10.4.101
   Secondary WINS Server . . . . . . : 10.10.4.102
   NetBIOS over Tcpip. . . . . . . . : Enabled

ipconfig exited on it100092 with error code 0.