Setup keys for xxx to login yyy without password
[xxx-sync@xxx ~]$ ssh-keygen -t dsa
cp id_dsa.pub to xxx /home/xxx-sync/.ssh
Monthly Archives: May 2009
Find
To delete empty directory
for d in `find /www/xxxx/oldfiles/* -type d -mtime +1| sort -r`;do echo $d;rmdir $d;done
requiretty
Some cron didn’t work well after move to CentOS5
New to disable requiretty
May 19 10:40:01 xxx sudo: root : sorry, you must have a tty to run sudo ; TTY=unknown ; PWD=/www/xxx/bin ; USER=xxx ; COMMAND=/bin/sh moviepagechmod.sh
vi /etc/sudoers
#Defaults requiretty
Linux Command rpm
delete rpm packages ignoring dependent error
#rpm -e –nodeps openssl-0.9.7a-33.17
list all files installed by a package
rpm -ql package_name
LVM
Setup lvm
combine /dev/sdb and /dev/sdc
if there’s partition on /dev/sdb, /dev/sdc, need to clear them first using fdisk
fdisk /dev/sdb -> d (delete partition) ->w
fdisk /dev/sdc
pvcreate /dev/sdb
pvcreate /dev/sdc
vgcreate vgrp /dev/sdb /dev/sdc
vgchange -a y vg
vgdisplay vg|grep ‘Total PE
‘lvcreate -i2 -I8 -l 70006 vg -n lv
mkfs.ext3 /dev/vg/lv
tune2fs -r 128000 /dev/vg/lv
mount /dev/vg/lv /backup
Remove lvm
#lvremove /dev/vg/lv
#vgremove vg
#fdisk /dev/sdb
#mkfs.ext3 /dev/sdb1
#tune2fs -r 128000 /dev/sdb1
(do same to /dev/sdc)
#mount /dev/sdb1 /www