Using Postfix instead of Sendmail in Freebsd
Freebsd distros, usually installs sendmail as its mail server. To replace Sendmail with Postfix, here are the steps.
First, make sure that you have an active internet connections and you have setup your dns properly and do the following:
# cd /usr/ports/mail/postfix-current
# make install clean
During installation, just say Y to all the questions.
After the installation, we want to run postfix and not sendmail during startup.
# vi /etc/rc.conf
Add the following lines:
sendmail_enable="NO"
sendmail_submit_enable="NO"
sendmail_outbound_enable="NO"
sendmail_msp_queue_enable="NO"
postfix_enable="YES"
Reboot and your good to go!
Got this from ScriptInstallation.In
Friday, September 05, 2008
Sunday, June 29, 2008
Just got back from Saint Clair's Sports Center Cafe.... After finishing a pitcher of beer, the fight wasn't over, so I ordered for another glass! After I ordered my glass of beer, then the fight was over! Watch my Filipino boxing idol, beating the hell out of his opponent (Diaz) on the ninth round. I'm not really a boxing fan, but since I have nothing to do here and just feeling a little apart from home, I opted to try to watch Pacquiao's fight since they are usually exciting.
Rollback:
Decided to go to the bar instead of paying for pay per view and got a pitcher plus a glass and french fries to watch the game. I would say that it was worth it, since my wife somehow sponsored it to give her more time to do her digi-scrapping hobby. Well, I guess I need to watch more fights of Pacquiao.
actually, didn't cheer that much inside the bar since I notice that most of the people in the bar are cheering for Diaz. Just do not want to be in a bad situation. But, by the time the winner announced, I just started to cheer and clap for the winner, and noticed they were turning to me and acknowledges the victory.
That's IT! forgive me if I'm unorganized! Hope you understand, after a pitcher and a glass of beer. Once again, congratulations to Manny "PACMAN" Pacquiao.
Rollback:
Decided to go to the bar instead of paying for pay per view and got a pitcher plus a glass and french fries to watch the game. I would say that it was worth it, since my wife somehow sponsored it to give her more time to do her digi-scrapping hobby. Well, I guess I need to watch more fights of Pacquiao.
actually, didn't cheer that much inside the bar since I notice that most of the people in the bar are cheering for Diaz. Just do not want to be in a bad situation. But, by the time the winner announced, I just started to cheer and clap for the winner, and noticed they were turning to me and acknowledges the victory.
That's IT! forgive me if I'm unorganized! Hope you understand, after a pitcher and a glass of beer. Once again, congratulations to Manny "PACMAN" Pacquiao.
Wednesday, June 25, 2008
Case Insensitive search in vi/vim
Just got a tip for turning on/off case insensitive search in vi/vim:
To search in case insensitive mode, in command mode:
:set ignorecase
OR
:set ic
To go back to case sensitive search, which is the default:
:set noignorcase
Got this tip from:
http://www.tech-recipes.com/unix_tips406.html
Just got a tip for turning on/off case insensitive search in vi/vim:
To search in case insensitive mode, in command mode:
:set ignorecase
OR
:set ic
To go back to case sensitive search, which is the default:
:set noignorcase
Got this tip from:
http://www.tech-recipes.com/unix_tips406.html
Friday, May 30, 2008
Creating Page File in Linux
When you installed your linux previously without a swap partition and later you decided to add one, here is what you can do.
# dd if=/dev/zero of=/swap1 bs=1024 count 8192 Create 8MB file
# mkswap /swap1 8192 Make file a swap device
# sync; sync
# swapon /swap1 Activate page file
From:
Oreilly's Essential System Administration, 3rd Edition
When you installed your linux previously without a swap partition and later you decided to add one, here is what you can do.
# dd if=/dev/zero of=/swap1 bs=1024 count 8192 Create 8MB file
# mkswap /swap1 8192 Make file a swap device
# sync; sync
# swapon /swap1 Activate page file
From:
Oreilly's Essential System Administration, 3rd Edition
Wednesday, May 28, 2008
Using find to delete old junk files on a system
#find / \( -name a.out -o -name core -o -name '*~'\
-o -name '#*#' \) -type f -atime +14 \
-exec rm -f {} \; -o -fstype nfs -prune
Command explanation:
This command searches the entire filesystem and removes various editor backup files, core dump files, and random executables (a.out) that haven't been accessed in two weeks and that don't reside on a remotely mounted filesystem. The logic is messy: the final -o option ORs all the options that preceded it with those that followed it, each of which is computed separately. Thus, the final operation finds files that match either of two criteria:
*The filename matches, it's a plain file, and it hasn't been accessed for 14 days.
*The filesystem type is nfs (meaning a remote disk).
If the first criteria set is true, the file gets removed; if the second set is true, a "prune" action takes place, which says "don't descend any lower into the directory tree." Thus, every time find comes across an NFS-mounted filesystem, it will move on, rather than searching its entire contents as well.
Got it from OReilly's Essential System Administration 3rd Edition
#find / \( -name a.out -o -name core -o -name '*~'\
-o -name '#*#' \) -type f -atime +14 \
-exec rm -f {} \; -o -fstype nfs -prune
Command explanation:
This command searches the entire filesystem and removes various editor backup files, core dump files, and random executables (a.out) that haven't been accessed in two weeks and that don't reside on a remotely mounted filesystem. The logic is messy: the final -o option ORs all the options that preceded it with those that followed it, each of which is computed separately. Thus, the final operation finds files that match either of two criteria:
*The filename matches, it's a plain file, and it hasn't been accessed for 14 days.
*The filesystem type is nfs (meaning a remote disk).
If the first criteria set is true, the file gets removed; if the second set is true, a "prune" action takes place, which says "don't descend any lower into the directory tree." Thus, every time find comes across an NFS-mounted filesystem, it will move on, rather than searching its entire contents as well.
Got it from OReilly's Essential System Administration 3rd Edition
Tuesday, April 15, 2008
Thursday, December 20, 2007
Rotating log files
If in case you need to write a script to rotate log files that you have.
#!/bin/sh
# Usage: rotate
PATH=/sbin:/usr/sbin:/bin:/usr/bin:/usr/local/bin ; export PATH
logfile=$1 # name of the logfile without any extensions
to_num=$2 # extension that the rotated file will have
while [ $to_num -gt 1 ] ; do
from_num=`expr $to_num - 1` # extension of the file to be rotated
if [ -f $logfile.$from_num ] ; then # if the logfile already exists
mv $logfile.$from_num $logfile.$to_num
elif [ -f $logfile.$from_num.gz ] ; then # in case they are compressed
mv $logfile.$from_num.gz $logfile.$to_num.gz
fi
to_num=$from_num
done
if [ -f $logfile ] ; then # sanity check
cp $logfile $logfile.1
cp /dev/null $logfile # truncates the file
gzip --quiet $logfile.1 # compress it to save space
fi
Got it from http://www.aoc.nrao.edu/~krowe/TCC/sysadmin/topics/tools.html
If in case you need to write a script to rotate log files that you have.
#!/bin/sh
# Usage: rotate
PATH=/sbin:/usr/sbin:/bin:/usr/bin:/usr/local/bin ; export PATH
logfile=$1 # name of the logfile without any extensions
to_num=$2 # extension that the rotated file will have
while [ $to_num -gt 1 ] ; do
from_num=`expr $to_num - 1` # extension of the file to be rotated
if [ -f $logfile.$from_num ] ; then # if the logfile already exists
mv $logfile.$from_num $logfile.$to_num
elif [ -f $logfile.$from_num.gz ] ; then # in case they are compressed
mv $logfile.$from_num.gz $logfile.$to_num.gz
fi
to_num=$from_num
done
if [ -f $logfile ] ; then # sanity check
cp $logfile $logfile.1
cp /dev/null $logfile # truncates the file
gzip --quiet $logfile.1 # compress it to save space
fi
Got it from http://www.aoc.nrao.edu/~krowe/TCC/sysadmin/topics/tools.html
Subscribe to:
Comments (Atom)