? Earlier 3 items total Later ?

On this page:?

Measure the daily number of E-mail messages in a mailbox

This snippet written in bash with calls to perl from the command line measures the number of E-mail messages sent to a mailbox per calendrical day.

#!/bin/bash
grep -h '^Date:' * |
    perl -pe 's!^Date: !!' |
    perl -pe 's!^\w\w\w, !!' |
    perl -pe 's{\d{2}:\d{2}:\d{2}.*$}{}' |
    perl -pe 's!^\s+!!' |
    perl -pae '$_=sprintf("%.2d-%s-%s\n", @F)' |
    sort | uniq -c | sort -n


I used perl for some places where sed would have been more suitable because I find the sed regexp syntax confusing. :-)

Local time/date

$time_now on $date_today in $timezone.";
?>

How to setup NTP on BSD

echo xntpd_enable=\"YES\" >> /etc/rc.conf
echo xntpd_program=\"/usr/sbin/ntpd\" >> /etc/rc.conf
echo xntpd_flags=\"-p /var/run/ntpd.pid\" >> /etc/rc.conf
ntpdate time.nist.gov
ntpdate time.nist.gov
mkdir /etc/ntp
touch /etc/ntp/drift

touch /etc/ntp.conf
echo server time.nist.gov >> /etc/ntp.conf
echo driftfile /etc/ntp/drift  >> /etc/ntp.conf
/etc/rc.d/ntpd start

? Earlier 3 items total Later ?