# James Asher's .bashrc file # # A post about how to configure your bashrc file can be found here: # http://17thdegree.com/archives/2006/04/28/linux-customization-with-bashrc/ # # This File location: http://17thdegree.com/uploads/2006/04/bashrc.txt # update path location export PATH=$PATH:/sbin:/opt/lampp/bin/ # set the default editor export EDITOR=/usr/bin/emacs # bash history should save 3000 commands export HISTFILESIZE=3000 ########################################## # alias's ########################################## # bash script alias's alias top20='clear; bash /home/jasher/intranet/shortcuts/top20-logs;' alias mountedinfo='df -hT' alias raidinfo='more /proc/mdstat' alias web='cd /opt/lampp/htdocs' alias home='cd ~' alias un='tar -zxvf' alias openports='netstat -nape --inet' # Define a few Color's BLACK='\e[0;30m' BLUE='\e[0;34m' GREEN='\e[0;32m' CYAN='\e[0;36m' RED='\e[0;31m' PURPLE='\e[0;35m' BROWN='\e[0;33m' LIGHTGRAY='\e[0;37m' DARKGRAY='\e[1;30m' LIGHTBLUE='\e[1;34m' LIGHTGREEN='\e[1;32m' LIGHTCYAN='\e[1;36m' LIGHTRED='\e[1;31m' LIGHTPURPLE='\e[1;35m' YELLOW='\e[1;33m' WHITE='\e[1;37m' NC='\e[0m' # No Color # Sample Command using color: echo -e "${CYAN}This is BASH ${RED}${BASH_VERSION%.*}${CYAN} - DISPLAY on ${RED}$DISPLAY${NC}\n" # SPECIAL FUNCTIONS ####################################################### netinfo () { echo "--------------- Network Information ---------------" /sbin/ifconfig | awk /'inet addr/ {print $2}' /sbin/ifconfig | awk /'Bcast/ {print $3}' /sbin/ifconfig | awk /'inet addr/ {print $4}';echo "---------------------------------------------------" } fortune () { echo "--------------------- Fortune ---------------------" /usr/bin/fortune -s echo "---------------------------------------------------" } spin () { echo -ne "${RED}-" echo -ne "${WHITE}\b|" echo -ne "${BLUE}\bx" sleep .02 echo -ne "${RED}\b+${NC}" } # WELCOME SCREEN ####################################################### clear; #remove anything above this welcome screen for i in `seq 1 15` ; do spin; done ;echo -ne "${WHITE} Welcome to Apache01 ${NC}"; for i in `seq 1 15` ; do spin; done ;echo ""; # this will display a header echo -e ${LIGHTBLUE}`cat /etc/SuSE-release` ; # this shows some information about my machine itself echo -e "Kernel Information: " `uname -smr`; echo ""; echo -ne "Hello $USER today is "; date echo -e "${WHITE}"; cal ; echo ""; # some date / calendar info echo -ne "${CYAN}";netinfo; # network info mountedinfo; echo ""; # filesystem info raidinfo; echo ""; # RAID info echo -ne "${LIGHTPURPLE}";fortune; echo ""; # and for a little fun, a fortune echo -ne "${LIGHTBLUE}Uptime for this computer is ";uptime | awk /'up/ {print $3,$4}' # machine uptime for i in `seq 1 15` ; do spin; done ;echo -ne "${WHITE} Welcome to Apache01 ${NC}"; for i in `seq 1 15` ; do spin; done ;echo ""; #ending header echo ""; echo ""