.vimrc
Monday, March 27th, 2006” Los’ .vimrc
” http://www.carlos-m.net/
set tabstop=4
set shiftwidth=4
set shiftround
set expandtab
set autoindent
set laststatus=4
set ruler
hi Comment ctermfg=Cyan
:autocmd FileType mail :nmap
” Los’ .vimrc
” http://www.carlos-m.net/
set tabstop=4
set shiftwidth=4
set shiftround
set expandtab
set autoindent
set laststatus=4
set ruler
hi Comment ctermfg=Cyan
:autocmd FileType mail :nmap
[code]
#
# Sort mail from bugtraq mailing list
# -Carlos Macasaet
# http://www.carlos-m.net/
#
:0: bugtraq.lock
* ^List-ID:.*bugtraq\.list-id\.securityfocus\.com
| $RCVSTORE +bugtraq
[/code]
[code]
# spam.rc
# -ifile: http://www.nongnu.org/ifile/
# in addition, I use Martin Macok’s scripts for using ifile with procmail
# - http://xtrmntr.org/ORBman/ifile.procmail.html
# directories used
BINDIR=$HOME/usr/bin
# programs used
KSH=$BINDIR/ksh
# Insert ifile header info
# if you don’t want to learn from new messages, use ifile.inject.header
:0 fBw
| $KSH $BINDIR/ifile.inject-learn.header
# and now we can sort the mail with the help of ifile hint
:0: ifile.lock
* ^X-Ifile-Hint:\ spam
| $RCVSTORE +spam
[/code]
[code]
# announcements.rc
# moves all mail from addresses in announcers.lst to the folder “announcements”
# -Carlos Macasaet
# http://www.carlos-m.net/
:0
* ? formail -x”From:” -x”From:” -x”Sender:”\
-x”Reply-To:” -x”Return-Path:”\
| egrep -is -f $PMDIR/announcers.lst
{
:0: announcements.lock
| $RCVSTORE +announcements
}
[/code]
[code]
#
# Carlos Macasaet’s ZSH Configuration
# http://www.carlos-m.net/
#
# some global options
setopt KSH_GLOB
setopt SH_GLOB
setopt NO_BARE_GLOB_QUAL
setopt GLOB_SUBST
setopt NO_HUP
setopt AUTO_CD
setopt CD_ABLE_VARS
# set environment
export EDITOR=/usr/bin/vim
export VISUAL=$EDITOR
export FCEDIT=$EDITOR
export PAGER=/usr/bin/less
export TMPDIR=$HOME/tmp
umask 022
# set path and manpath
path=( $HOME/bin $HOME/usr/bin /usr/local/bin
/bin /usr/bin /usr/X11R6/bin /usr/games /usr/lib/nmh
/sbin /usr/sbin)
manpath=($manpath $HOME/usr/man)
typeset -U path manpath
# set prompt
if [[ $USER == ‘root’ ]]; then
PROMPTSUFFIX=’#’
else
PROMPTSUFFIX=’$’
fi
setopt PROMPT_PERCENT
PS1=”%m$PROMPTSUFFIX ” #prints hostname$ or hostname#
RPS1=’(%*)’ #prints current time on right
# history options
setopt APPEND_HISTORY
setopt INC_APPEND_HISTORY
setopt SHARE_HISTORY
setopt EXTENDED_HISTORY
setopt HIST_EXPIRE_DUPS_FIRST
setopt HIST_REDUCE_BLANKS
setopt HIST_IGNORE_SPACE
HISTSIZE=100
SAVEHIST=100
HISTFILE=$HOME/logs/zsh_history
# Autocomplete for current dir on filetypes
compctl -g ‘*.Z *.gz *.tgz’ + -g ‘*’ zcat gunzip
compctl -g ‘*.tar.Z *.tar.gz *.tgz *.tar.bz2′ + -g ‘*’ tar
compctl -g ‘*.zip *.ZIP’ + -g ‘*’ unzip zip
compctl -g ‘*.(mp3|MP3|ogg|OGG)’ + -g ‘*(-/)’ mpg123 xmms
# Autocomplete hosts
hosts=(sol.galaxy.acm.jhu.edu fomalhaut.galaxy.acm.jhu.edu
castor.galaxy.acm.jhu.edu betelguese.galaxy.acm.jhu.edu
jhuniverse.jhu.edu hops.cs.jhu.edu barley.cs.jhu.edu
ugrad1.cs.jhu.edu ugrad2.cs.jhu.edu ugrad3.cs.jhu.edu
ugrad4.cs.jhu.edu ugrad4.cs.jhu.edu ugrad5.cs.jhu.edu
ugrad6.cs.jhu.edu ugrad7.cs.jhu.edu ugrad8.cs.jhu.edu
ugrad9.cs.jhu.edu ugrad10.cs.jhu.edu ugrad11.cs.jhu.edu
ugrad12.cs.jhu.edu ugrad13.cs.jhu.edu ugrad14.cs.jhu.edu
ugrad15.cs.jhu.edu ugrad16.cs.jhu.edu ugrad17.cs.jhu.edu)
compctl -k hosts ssh scp ping host
# Autocomplete MH folders
mhfolders=(`folders -fast | awk ‘{ print “+”$1 }’`)
compctl -k mhfolders folder scan refile flist show rmm repl forw
# write/talk completion
function whoson { reply=(`users`); }
compctl -K whoson talk ytalk write finger
# Usage: pskill pskill() {
kill -9 $(ps -aux | grep $1 | grep -v grep | awk ‘( print $1 )’)
echo -n “Killed $1 process…”
}
alias logoot=’logout’
alias feline=’cat’
alias ls=’ls –color’
alias ll=’ls –color -l’
alias md=’mkdir’
# watch for friends
watch=( $(<$HOME/etc/watchlist) )
LOGCHECK=60
WATCHFMT=’%n %a’
export PGHOST=localhost
[/code]
[code]
#
# Carlos Macasaet’s .procmailrc
# http://www.carlos-m.net/
#
#
# Common Directories
#
HOME = /home/$USER
MAILDIR = $HOME/Mail # MH… represent
LOGDIR = $HOME/var/log
PMDIR = $HOME/etc/procmail # recipes stored here
NMHDIR = /usr/lib/nmh
#
# Common Programs
#
RCVSTORE = $NMHDIR/rcvstore # stores MH messages
RCVTTY = $NMHDIR/rcvtty # new mail notification
#
# Logging Options
#
LOGFILE=$LOGDIR/procmail
#VERBOSE=yes # enable for debugging
LOGABSTRACT=all
# filter out duplicates
:0 Whc: msgid.lock
| /usr/bin/formail -D 65536 $LOGDIR/msgid.dat
:0 a:
/dev/null
#
# personal sorting files
#
INCLUDERC=$PMDIR/pager.rc # forward certain mail to my pager
INCLUDERC=$PMDIR/ntrs.rc
INCLUDERC=$PMDIR/cron.rc
INCLUDERC=$PMDIR/logwatch.rc
INCLUDERC=$PMDIR/lists/acm-members.rc
INCLUDERC=$PMDIR/lists/acm-officers.rc
INCLUDERC=$PMDIR/lists/acm-acm.rc
INCLUDERC=$PMDIR/lists/acm-linux.rc
INCLUDERC=$PMDIR/lists/bugtraq.rc
INCLUDERC=$PMDIR/lists/cryptogram.rc
INCLUDERC=$PMDIR/lists/Redhat.rc
INCLUDERC=$PMDIR/lists/mailbits.rc
INCLUDERC=$PMDIR/lists/jhu_street_hockey.rc
INCLUDERC=$PMDIR/jhu.rc
INCLUDERC=$PMDIR/jhu_cs.rc
INCLUDERC=$PMDIR/friends.rc
INCLUDERC=$PMDIR/family.rc
# these announcement mailing lists sometimes get sorted as spam
INCLUDERC=$PMDIR/announcements.rc
# filter out spam
INCLUDERC=$PMDIR/spam.rc
# these mailing lists tend to receive spam
INCLUDERC=$PMDIR/lists/acm-admin.rc
INCLUDERC=$PMDIR/lists/OpenBSD.rc
# default folder
:0
{
:0 c: inbox.lock
| $RCVSTORE +inbox
:0
| $RCVTTY -nobell
:0 e # RCVTTY doesn’t always return 0
/dev/null
}
[/code]