2019/08/28

How to open Google Chrome while remote login by SSH session on Windows 10

1.Download Xming X Server for Windows and install
2.Download putty.exe
3.Open XLaunch
4.Set display settings and click Next

How to use MRTG to generate network traffic report

1.Download ActivePerl and install
2.Download mrtg-2.17.7.zip
3.Extract mrtg-2.17.7.zip to E:\
4.Go to E:\mrtg-2.17.7\bin
5.Open cmd.exe
6.Type E: then press Enter to go E partition
7.Type cd mrtg-2.17.7\bin then press Enter to go this path
8.Type perl cfgmaker public@IP --global "WorkDir: E:\mrtg-2.17.7\bin" --output lan.cfg to create lan.cfg
9.Type perl mrtg lan.cfg to generate network traffic logs and pictures
10.Type perl indexmaker --output E:\mrtg-2.17.7\bin\lan.html --title=mrtg lan.cfg to generate summary report

2019/07/31

How to enable SNMP Service on Windows 10 Build 1809

1. Open PowerShell as administrator
2. Type and execute Get-WindowsCapability  -Online -Name "SNMP*" to check SNMP service didn't install
3. Type and execute Add-WindowsCapability  -Online -Name "SNMP.Client~~~~0.0.1.0" to install SNMP service
4. Type and execute  Get-Service -Name snmp* to check SNMP service is running now


2019/07/26

How to find largest files or directories on Linux system

sudo cd /
sudo find . -type f -print0 | xargs -0 du | sort -nr | head -20 | cut -f2 | xargs -I{} du -sh {}
or
sudo find . -type d -print0 | xargs -0 du | sort -nr | head -20 | cut -f2 | xargs -I{} du -sh {}

2019/07/25

How to make VMware ESXi image with NIC driver

1.Download and install VMware PowerCLI
https://my.vmware.com/web/vmware/details?downloadGroup=PCLI650R1&productId=614

2.Download NIC drivers(.vib) for VMware ESXi
https://vibsdepot.v-front.de/wiki/index.php/List_of_currently_available_ESXi_packages

3.Download ESXi-Customizer-PS
https://www.v-front.de/p/esxi-customizer-ps.html#download

4.Set the PowerShell Execution Policy
(a)Select Start > All Programs > Windows PowerShell version > Windows PowerShell   
(b)Type "Set-ExecutionPolicy RemoteSigned" and run for Remote Signed
(c)Type "Set-ExecutionPolicy Unrestricted" and run for Unrestricted

5.Execute ESXi-Customizer-PS-v2.6.0.ps1 to make a VMeware ESXi 6.7 customized iso file
(a)Open VMware PowerCLI
(b)Type .\ESXi-Customizer-PS-v2.6.0.ps1 -v67 -vft -load net-e1000e,net55-r8168 -pkgDir 'E:\VMwareESXi\NIC_Driver_ESXi' -outDir 'E:\VMwareESXi\customized_iso' and run
(c)Go to E:\VMwareESXi\customized_iso path and you'll find the ESXi-6.7.0-20190604001-standard-customized.iso file

2019/06/26

How to generate date and time log in Windows batch script


for /f "skip=1 delims=" %%z in ('wmic os get localdatetime') do if not defined Z set Z=%%z
set DATE=%Z:~0,4%-%Z:~4,2%-%Z:~6,2%
set TIME=%Z:~8,2%-%Z:~10,2%-%Z:~12,2%
set timestamp=%DATE%_%TIME%.log

or

set timestamp=%DATE:/=-%@%TIME::=-%
set timestamp=%timestamp: =%
set timestamp=%timestamp:,=.%.log

or

set timestamp=%date:~0,4%%date:~5,2%%date:~8,2%@%TIME:~0,2%-%TIME:~3,2%-%TIME:~6,2%
set timestamp=%timestamp:,=.%.log

2019/06/17