Monday, January 28, 2008

how to enable quota quickly

vi /etc/fstab

/dev/VolGroup00/LogVol00 /                       ext3    defaults,usrquota,grpquota        1 1
:wq

touch /aquota.user /aquota.group
chmod 600 /aquota.*
mount -o remount /
quotacheck -avugm
quotaon -avug

Sunday, January 27, 2008

awk - select the specified column

db2 list tables for schema test | awk '$3 == "V" {print $0}'

Wednesday, January 16, 2008

enable ntpd for freebsd 6.1

1. put the following to /etc/rc.conf
ntpd_enable="YES"
ntpdate_enable="YES"
ntpd_flags="-p /var/run/ntpd.pid"

2. put the following to /etc/ntp.conf
server server1
server server2
driftfile /var/db/ntp.drift
restrict default ignore
restrict 10.0.201.0 mask 255.255.255.0 nomodify notrap

3. run 'ntpdate server1' to update time once
4. if you don't want to reboot, just run 'ntpd -p /var/run/ntpd.pid'

Thursday, January 10, 2008

bigbrother: Filesystem of /home/bbuser/bb/tmp is FULL

  1. go to /home/bbuser/bb
  2. change SORT \"+${DFSORT} to SORT \" -k${DFSORT+1}\" like below ( 2 places to change)
  3. [bbuser@jephe bin]$ grep DFCMD bb-disk.sh
    eval "$DFCMD | $EGREP \"$DFUSE\" | $EGREP -v \"$DFEXCLUDE\" | $SORT \"-k${DFSORT+1}\" > $BBTMP/DFOUT.$$"
    wclen1=`eval "$DFCMD | $EGREP \"$DFUSE\" | $EGREP -v \"$DFEXCLUDE\" | $SORT \"-k${DFSORT+1}\" | $WC"`
    [bbuser@jephe bin]$ pwd
    /home/bbuser/bb/bin
  4. starting up bb again by running : cd /home/bbuser/bb; sh runbb.sh
  5. check BBOUT output to see if you still encounter errors.
Conclution : sort +4 is the old obsolte syntax, use sort -k5 instead.

Sunday, January 6, 2008

openssh login issue

1.server: openssh 3.9p1 + fedora core 3
2.error from server authpriv: openpty: No such file or directory
session_pty_req: session 0 alloc failed
error from putty: server refused to allocate pty
3. symptom from Linux ssh client by command 'ssh servername -v':
no error, hanging to wait for command prompt coming out

4. solution:
go to /dev/pts/, check any file is there, e.g. 0 is there
fuser 0
kill -9 the process number
try again.

Saturday, November 17, 2007

centos 4.4 snapshot create error

1. error message:
snapshot: Required device-mapper target(s) not detected in your kernel

solution:
manually load dm_snapshot module as this:

modprobe dm-snapshot

Thursday, November 8, 2007

Configure Linux or Windows connection to remote cups printer

Linux:

use IPP
format: ipp://ip or hostname/printers/PRINTERNAME

Windows/MacOS
add printer, use url http://ip or hostname:631/printers/PRINTERNAME

server side configuration for http printing
First, edit file /etc/cups/mime.types to enable printing via http, remove the hash mark # at the beginning of the following line:
#application/octet-stream

Next, edit the file /etc/cups/mime.convs to remove the hash mark the the beginning of the following line:
#application/octet-stream application/vnd.cups-raw 0

Troubleshooting Windows printing to cups server
access_log
error_log
page_log