# $UNIX: profile,v 1.0 1994/08/16 06:07:39 sinuspl Exp $
# basically all for bash, (*) means: need to be changed

# do not save dupes in the bash history file
export HISTCONTROL=ignoredups

# big history
export HISTSIZE=10000

# aliases
alias ll='ls -l'
alias la='ls -la'
alias l='ls -alF'
alias ls-l='ls -l'
alias ls-a='ls -a'
alias ls-al='ls -al'
alias ls-la='ls -la'
alias o='less'
alias cd..='cd ..'
alias cd...='cd ../..'
alias ..='cd ..'
alias ...='cd ../..'
alias psauxw='ps auxw'
alias rd=rmdir
alias md='mkdir -p'
alias which='type -p'
alias rehash='hash -r'
alias beep='echo -en "\x07"'
alias back='cd $OLDPWD'
alias dir='echo "Stupid..."; sleep 1; logout'

# exports
# needs 'most' to be installed (*)
export PAGER=most

# tmpdir in home, needs ~/tmp
export SCREENDIR=~/.screen
if test "$UID" >= 1000 ; then
	export TMPDIR=~/tmp
	export DIRTEMP=~/tmp
	export TEMP=~/tmp
	export TEMPDIR=~/tmp
	export DIRTMP=~/tmp
	export TMP=~/tmp
fi

# proxy (*)
#export HTTP_PROXY=http://squid.proxy.com:3128/

# news (*)
export NNTPSERVER=news.newsfeed.com

# aslookups, for traceroute-as
export AS_SERVER_HOST=whois.ra.net

# Midnight Commander needs this to run in color mode
export COLORTERM=1

# unknown term
if [ "$TERM" = "" -o "$TERM" = "unknown" ]; then
	TERM=linux
fi

# title
if [ "$TERM" = "xterm" ]; then
	export PROMPT_COMMAND='echo -ne "\033]0;${USER}@${HOSTNAME}:${PWD/$HOME/~}\007"'
fi

# set bash prompt
set -p
if test "$UID" = 0 ; then
	export PS1="\h:\w# \[\033[0m\]"
else
	# color (*)
#	PS1="\[\033[32m\]\u\[\033[34m\]@\[\033[33m\]\h:\w\[\033[32m\]> \[\033[0m\]"
	# or black-white (*)
	export PS1="\u@\h:\w> \[\033[0m\]"
fi
export PS2='> '

#
export ignoreeof=0

# some more aliases for root
if test "$UID" = 0 ; then
	# check your log files!
	alias maillog='tail -f /var/log/maillog'
	alias messages='tail -f /var/log/messages'
	alias syslog='tail -f /var/log/syslog'
	alias dnslog='tail -f /var/log/named.log'
	alias warnlog='tail -f /var/log/warn'
	alias netlog='tail -f /var/log/iplog'
	alias ripe='whois -h whois.ripe.net'
	# needs /root/bin/ to be there (*)
	PATH=~/bin:$PATH
	echo
	echo -n "Status:" ; uptime
	echo
	echo "Privileged user, limits not used."
	echo
else

# admin
if test "$UID" = 1000 ; then
	PATH=~/bin:$PATH
	# we don't like anything from users on out tty
	if test "$SSH_TTY" != ""; then
		chmod 600 $SSH_TTY
	fi
else

# colored ls, needs 'gnuls' to be installed, only for freebsd (*)
#export LS_COLORS="no=00:fi=00:di=01;34:ln=01;36:pi=40;33:so=01;35:bd=40;33;01:cd=40;33;01:or=01;05;37;41:mi=01;05;37;41:ex=01;32:*.cmd=01;32:*.exe=01;32:*.com=01;32:*.btm=01;32:*.bat=01;32:*.sh=01;32:*.csh=01;32:*.tar=01;31:*.tgz=01;31:*.arj=01;31:*.taz=01;31:*.lzh=01;31:*.zip=01;31:*.z=01;31:*.Z=01;31:*.gz=01;31:*.bz2=01;31:*.bz=01;31:*.tz=01;31:*.rpm=01;31:*.cpio=01;31:*.jpg=01;35:*.gif=01;35:*.bmp=01;35:*.xbm=01;35:*.xpm=01;35:*.png=01;35:*.tif=01;35:"
#alias ls='gnuls --color'

	ulimit -v 131072                # max amount of virtual memory is 128MB
	echo
	echo "System: `uname -s` `uname -n` `uname -r`"
	echo -n "Status: `uptime`"
	echo
	# only if you users can see only own processes
	echo "Processes:" ; ps auxw | grep -v "ps auxw"
	echo
	quota -v
	echo
# try to run fortune
#    [ -x /usr/games/fortune ] && /usr/games/fortune -o ; echo
fi
fi
