Friday, December 14, 2012

Force shutdown hang vm on XenServer 6.1



1. xe vm-list

Look carefully at uuid and check name-label of the hang vm

2. list_domains

Get the id of of the hang vm by checking the uuid

3. /opt/xensource/debug/destroy_domain -domid xx(ID)

Kill the hang vm. Refer to image if you dont understand.


Thursday, September 6, 2012

Using echo command on linux


To empty file 

 echo -n > filename

To insert text into file

 echo "hello" > filename 


Bind multiple ip address to NIC in Debian



First, back up your working interface to somewhere.
# cp /etc/network/interfaces /root/bak.interface
Then edit file
# vi /etc/network/interfaces

## This is how to bind multiple ip to NIC

auto eth0
auto eth0:0
auto eth0:1

iface eth0 inet static
address 192.168.20.31
netmask 255.255.255.0
gateway 192.168.20.1

iface eth0:0 inet static
address 192.168.20.32
netmask 255.255.255.0
gateway 192.168.20.1

iface eth0:1 inet static
address 192.168.20.33
netmask 255.255.255.0
gateway 192.168.20.1

##save and quit
##restart network service

How to add mysql user


To create a super user to local host

mysql> create user 'dunhill'@'localhost' identified by 'password';
mysql>grant all privileges on *.* to 'dunhill'@'localhost' with grant option;

To create a super user to any host

mysql> create user 'dunhill'@'%' identified by 'password';
mysql> grant all privileges on *.* to 'dunhill'@'%' with grant option;

To create a normal user with limited access

mysql> create user 'admin'@'localhost';
mysql> grant reload,process on *.* to 'admin'@'localhost';