Tuesday, October 27, 2009

How to kill remote session via command line

C:\Documents and Settings\datagram>qwinsta /server:10.10.10.x

SESSIONNAME USERNAME ID STATE TYPE DEVICE

console 0 Conn wdcon

rdp-tcp 65536 Listen rdpwd

rdp-tcp#4 datagram 1 Active rdpwd

administrator 2 Disc rdpwd

C:\Documents and Settings\datagram>rwinsta rdp-tcp#4 /server:10.10.10.x


Monday, October 26, 2009

Remotely Start/Stop windows services

Two ways.

1. sc \\"+MachineName+ start+ServiceName

2.
  • To start a service, type:

    net startservice

  • To stop a service, type:

    net stopservice

Sunday, October 25, 2009

Error: Service 'RemoteRegistry' failed to reach status 'Stopped' on this server.

When installing exchange 2007 sp2

In the services manager set Remote Registry to "Disabled" then reboot.
When the workstation has restarted open the services manager and set it to "auto" or "manual" then try the install again.

Saturday, October 24, 2009

attempting to load a 64-bit application however this cpu is not compatible with 64-bit mode

Solution to this problem.

1. Check your server BIOS settings and enable Virtualization.
****** YOU HAVE TO SHUT DOWN YOUR SERVER AND PLUG OUT THE POWER CORD FOR AT LEAST 2 MINUTES TO MAKE THIS SETTING EFFECTIVE.

2.There is no 64bit support for VMI. VMI is not compatible with 64bit guests.
You must disable VMI to power on this 64bit guest operating systems.
To disable VMI:
  1. Choose the virtual machine in VMware Infrastructure Client.
  2. Click Edit Settings > Options > Advanced.
  3. Deselect Paravirtualization.


Tuesday, October 20, 2009

IP/Port Blocking

Q. All machines with IP range 10.10.10.x should have access to Port 80 on
(Machine 10.10.10.xx). and rest all should be blocked.

Ans.
Via IPTABLES

iptables -A INPUT -s 10.10.10.0/24 -p tcp --destination-port 80 -j
ACCEPT
iptables -A INPUT -p tcp --destination-port 80 -j DROP

Via Hosts

in hosts.allow
80: 10.10.10.0/24

in hosts.deny
80: ALL

Wednesday, October 14, 2009

Count Disk Space

To show the size of all sub directories of a specific directory
du -sh /home/*
du /path/to/dir --max-depth=1 | sort -nr
du -sh
df -h /path/to/dir
To show all the 1 level sub directories size
du -sh *
To show the size of specific directory
du -sh /home