Monday, September 21, 2015

Mount ISCSI in Linux Server

Mount ISCSI in Linux Server


Server CentOS   Open E Storage 
IP: 124.124.124.144 IP: 124.124.124.150

* Linux Server: CentOS 6.5 64bits
* Storage: Open E, Enterprise Storage OS and Software for Every Business

- Server CentOS IP: 124.124.124.144
- Open E Storage IP: 124.124.124.150

1. Prepare Open E

Download ISO image of Open E , Installed and assign IP

Create Volume Group
Select Disk and create Volume group name: vg200GB
Create ISCSI Volume
Our ISCSI volume

2. Prepare Server 

Install ISCSI Initiator

Discover ISCSI on Server storage

Start ISCSI Service

Check if our server detect any storage
We found sdb
Create partition /dev/sdb

Format /dev/sdb1 to ext4
Create Folder and mount ISCSI drive to mount point and check the result.

Done,

#CentOS #Mount #ISCSI #OpenE #Storage #Vannakk

Friday, September 18, 2015

Share Internet From Windows 8 to other Devices

Share Internet From Windows 8 to other Devices

1. Run Run as Administrator

netsh wlan show drivers
Check your wireless card support this

Hosted network supported  : Yes

2. create a network named “vannakk” with password “vannakk1123” by this command

netsh wlan set hostednetwork mode=allow ssid=vannakk key=vannakk123

3. After that, you network now has been created. What you have to do next is turn it on by enter this command.
netsh wlan start hostednetwork


4. Check the SSID we created
Open Network and Sharing Center
5. Allow wifi to use that SSID
Property on our existing SSID (Vimul In this case) ==> Sharing ==> Allow Other network ....


Done,

Enjoy


Thursday, September 3, 2015

VMware Workstation V. 11, 12 Pro Serial Key

VMware Workstation V. 11, 12 Pro Serial Key



VMware Workstation Pro Serial Key

VMWARE 11 ----->  ZU3R2-6ZD4M-M88VP-P5XGX-NA0WA

VMWARE 12 ----->  5A02H-AU243-TZJ49-GTC7K-3C61N


Hope this can help someone else...! ;)

Sunday, August 30, 2015

Add user to sudoers

Add user to sudoers

Create user: username
useradd username

Add to sudoers

vi /etc/sudoers
With content
username      ALL=(ALL)       NOPASSWD: ALL


SSH Log in with user: username and switch to user: root
sudo su


It will not ask for the password.

Thursday, August 27, 2015

Scripts - Add - DNS Record

Scripts - Add - DNS Record


What : This script is going to add the CNAME record map to srv001, and add under the record srv001
HowTo : ./add-cname-record.sh recordname

Create a file name: add-cname-record.sh and the following content:

#!/bin/bash
USAGE="Usage: $0 recordname"
if (! test $1)
then
 echo $USAGE
 exit 1
fi

echo "Checking is the domain: $1.vannakk.net existed or not yet."
FILE=/etc/bind/forward.vannakk.net.zone
grep -w "$1" $FILE >/dev/null
if [ $? -eq 0 ]
then
   echo "Domain: $1.vannakk.net already existed "
        exit 1
else
   echo "Domain: $1.vannakk.net not yet existed. So this domain will be add."
sed -i '/^srv001/a \'$1'         IN      CNAME   srv001.vannakk.net.' $FILE
fi

echo "Updating Serial..."
SERIAL=$(awk '/serial/{print $1}' $FILE)
sed -i "/serial/s/$SERIAL/$(expr $SERIAL + 1)/" $FILE

echo "Reloading service named"
service bind9 reload
echo "Domain: $1.vannakk.net is added."

Sunday, July 19, 2015

Special command DATE

Special With Command date, find,cp, grep and loop


#!/bin/bash
DATE=`date +%Y-%m-%d`
YEAR=`date +%Y`
THISMONTH=`date +%m`
LASTMONTH=`date +'%m' -d 'last month'`
DAYTH=`date +%d`


1 #. I want to restore all my email last 7 days by the following command:
Go to backup directory and type:

cd /opt/all-email-backup/

find . -mtime -7 -exec cp -p {} /home/vannak/email-restored/ \;

2 #. I want to restore all my email on April by the following command:

for i in `ls -lrt | grep "Apr" | awk '{print $9}' `; do cp -p $i* /home/vannak/april-email/April/; done

Wednesday, June 3, 2015

Route Command On Linux

Route Command On Linux

Here we go,

eth0 = Interface need to go through
gw   = Gateway

route add -net 192.168.0.0/16 dev eth0
route del -net 192.168.0.0/16 dev eth0

route add -net 192.168.0.0/16 gw 192.168.10.1
route del -net 192.168.0.0/16 gw 192.168.10.1


#LINUX #linux #Route #Command #Vannakk #vannakk