2013年11月28日 星期四

yum repository setup for yum

After invoking system-config-kickstart, system will try to pull available package information from repository.
If your machine does not have internet capability, it will hang all the time.
Simply create a local repository to /etc/yum.yum.repos.d/folder for system-config-kickstart to build package list.
Please note, repository id must be named as [base] and all system default repository config file need to be moved out of /etc/yum.repo.d to speed up package load process.
[base]
name=CentOS 5.8 x86_64
baseurl=file:///nfs/centos-5.10-x86_64
enabled=1
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-5

copy repodata from cdrom to local drive
#cp -dpR /mnt/cdrom/repodata /nfs/centos-5.10-x86_64/

use following command to clear cache data
#yum clean all 

use following command to read package information from repository
#yum repolist

Please note, repodata folder need to placed underneath baseurl folder. 
And then you are good to go with system-config-kickstart.

2013年11月24日 星期日

non-interactive fdisk

#!/bin/sh
hdd="/dev/hda /dev/hdb /dev/hdc"
for i in $hdd;do
echo "n
p
1


w
"|fdisk $i;mkfs.ext3 $i;done 
http://xmodulo.com/2012/11/how-to-run-fdisk-in-non-interactive-batch-mode.html

speed up SSH login

1: disable UseDNS from /etc/ssh/sshd_config from remote server
2: specify authentication method when connecting --> -o PreferredAuthentications=password