You may get logs similar to the following:
Sep 17 16:15:07 nsserver named[21089]: network unreachable resolving
'ns2.vistaprint.com/A/IN': 2001:503:a83e::2:30#53
You can specify OPTIONS=’-4′ in /etc/sysconfig/named to tell named not to use IPv6 or disable IPv6 completely on your machine. You can disable IPv6 this way:
Add
“options ipv6 disable=1” to /etc/modprobe.conf
and
“NETWORKING_IPV6=no” to /etc/sysconfig/network
Identifying which domain controller a computer is using
From command prompt:
echo %logonserver%
Useful PowerCLI scripts
—Find VMs with snapshots
Connect-VIServer vcenter Get-VM | Get-Snapshot | Select Created, VM
—Find VMs with mounted ISO
Get-VM | FT Name, @{Label="ISO file"; Expression = { ($_ | Get-CDDrive).ISOPath }}
—Get Datastores and Used Storage for VMs within Cluster
Get-Cluster "Cluster_name" | Get-VM | Select Name, @{N="Datastore";E={Get-Datastore -vm $_}}, UsedSpaceGB, ProvisionedSpaceGB | sort Name | Export-Csv C:\datastores-acceptance.csv
Disconnect all VM CD-ROM Drives
get-cddrive -VM * |where {$_.ISOPATH -ne $null}|set-cddrive -nomedia
Useful Linux Commands
In order to add additional repositories on your Centos you have to run:
rpm -Uvh http://dl.fedoraproject.org/pub/epel/6/i386/epel-release-6-8.noarch.rpm
This command for example will add the EPEL repository. You can find additional repositories on http://wiki.centos.org/AdditionalResources/Repositories
——————————————————————————————-
Searching for packages with yum:
yum list samba
Display list of updated software:
yum list updates
Apply all updates:
yum update
Update specified package
yum update bind
Check if there is an update for a specified package:
yum list updates bind
Install network setup tool
yum install system-config-network-tui
Find which package contains a specific command
yum provides OR whatprovides ifconfig
——————————————————————————————-
Using tcpdump to capture packets
tcpdump -n -i eth0 port 25
——————————————————————————————-
List The Open Ports And The Process That Owns Them
netstat -tulpn
Killing a Windows service that’s stuck on stopping or starting
If you ever have trouble with a service being stuck in a ‘starting’ or ‘stopping’ state, you can run a couple of simple commands to kill the service.
–First query the process to find it’s PID:
sc queryex |more
–Kill the process:
taskkill /f /pid 3386
Install VMware Tools on Centos
Firstly we have to install some prerequisites:
yum install make gcc kernel-devel kernel-headers glibc-headers perl
Mount the VMware Tools CD
mkdir /mnt/cdrom mount /dev/cdrom /mnt/cdrom
Copy the install bundle from the CD and extract it
cp /mnt/cdrom/VMware-Tools*.tar.gz /tmp/ cd /tmp/ tar xvfz VMwareTools*.tar.gz
Run The installer
cd /tmp/vmware-tools-distrib ./vmware-install.pl
Copy Share permissions from one folder to another
To copy share permissions from one shared folder to another you have to use the permcopy command which is included in Windows Resource Kit Tools:
permcopy \\SourceServer Sharename \\Destinationserver Sharename
This command will copy the share permissions but not the security permissions of a folder. In order to copy the security permissions (and the files and folders included within it) I personally use the robocopy command which is also included in Windows Resource Kit Tools:
robocopy \\Source \\Destination /MIR /SEC /r:3 /w:5
Useful Excel formulas
In this article I will post some excel formulas that I have used and might need again sometime. From time to time I might edit this post and add additional formulas.
- Find duplicate entries in a range of cells
Select the range of cells you want to check –>Format –>Conditional Formating –>Formula is – add the formula
=IF(COUNTIF($A1:$A$1;$A1)-1>0;TRUE;FALSE)
Press Format and change the formating for these cells
- Find cells that do not have exactly 12 digits
Select the range of cells you want to check –>Format –>Conditional Formating –>Formula is – add the formula =LEN(B1)<>12
Press Format and change the formating for these cells
Esxi – Virtual NIC to Physical NIC mapping
In order to determine which physical NIC a virtual NIC of a VM is using, we have to login to the Host and use the esxtop utility. In the default esxtop screen we have to press “n” in order to get the network “view”. The results will have the following fields:
Virtual machine —– Physical NIC —- vSwitch —- various metrics
Multiple RDP Sessions in Windows Server 2008 R2
In order to allow multiple concurrent sessions on Windows Server 2008 R2 you have to perform the following steps:
– Start -> Administrator Tools -> Remote Desktop Services -> Remote Desktop Services Host Configuration
– Double click the “Remote Desktop Licensing Mode” under the “Licensing” Title
– Uncheck the default behaviour of “Restrict each user to a single session”.
Now you can connect with 2 clients to the same machine without loosing your session.