Miscellaneous Notes

This is dynamic post and I will keep on adding points in here. I generally add small but useful things here which is not worthy to create long post.

 


How to Explanation
transfer the tech-support bundle to FTP on Arista Router copy flash:/EOS-4.18.2F.swi ftp:/user:password@192.168.10.15/EOS-4.18.2F.swi
user = username of ftp server account
password = password of ftp server account
192.168.10.15 = IP address of ftp server
EOS-4.18.2F.swi = tech-support bundle file name
Encrypt a PowerShell script https://drive.google.com/open?id=19Bvik1FcSTC57eJ0CZPE4D-8hnQfyCi-
Reboot Windows with PowerShell command powershell.exe -encodedCommand cwBoAHUAdABkAG8AdwBuACAALQByACAALwB0ACAAMAAxACAA
To create a digital clock Download and run these PS script to create the clock on your PC.
EST Clock | CST Clock | IST Clock
Do few things in Linux 1. Check Kernal Version in Linux - Rpm -qa | grep -I kernel
2. Change IP on an interface - ifconfig eth1 192.168.2.2 netmask 255.255.255.0
3. To set or change DG of any VM - route add default gw 192.168.2.1
4. File location to change the IP - vi /etc/sysconfig/network-scripts/ifcfg-eth0
5. To Search specific text in linux server -
grep -rnw '/path/to/somewhere/' -e 'pattern'
How to ping with the MTU value ping www.yahoo.com -f -l 1492
Add Network Components in vRNI Check this article
How to encode and decode Base64 script Check this here
Ping an entire subnet in Windows I have documented it here
Some Useful ESXi Commands Check speed and other info of HBA card - esxcli storage san fc list
vCloud API Guide for NSX Here is the vendor page for pdf
To create static routes in multiple esxi hosts $esx = Get-VMHost -Name esxihost_Name
$esxcli = Get-EsxCli -VMHost $esx -V2
$parms = @{
network = '192.168.102.0/24'
gateway = '192.168.3.1'
}
$esxcli.network.ip.route.ipv4.add.Invoke($parms)
$esxcli.network.ip.route.ipv4.list.Invoke()
Send mail to any mail account using PS Download the powershell script from Google Drive. Click here
How to delete any iso file in all datastores which is older than 15 days foreach($ds in Get-datastore){
New-PSDrive -Name GJ -PSProvider VimDatastore -Root '/' -Datastore $ds > $null
Get-Childitem -Path GJ:\ -Recurse -Include *.iso | Remove-Item -Confirm:$true | Where ((Get-date).AddDays(-15))
#This will search each and every folder in your datastore and show you the file to delete it.
Remove-PSDrive -Name GJ -Confirm:$false}
Replace false to true in command (Remove-Item -Confirm:$false to Remove-Item -Confirm:$true)if you want to check and delete each file one by one
How to edit Login Banner in Vmware Cloud Director Appliance 1. Create or edit a file in /etc/login.warn and put your message in here.
2. Edit /etc/sshd/sshd_config file and change the line from #Banner none to #Banner /etc/login.warn
How to search largest files in Linux sudo du -a /dir/ | sort -n -r | head -n 20
This command will search top 20 largest files in any directory
How to search particular word or string in file in Linux tr ‘[:space]’ ‘[/n*] < /var/log/apache2/access.log | grep -I -c 172.18.101.16
172.18.101.16 is to search in access.log file

0 Comments:

Post a Comment