Advertisement
glavmonter

.bashrc

Oct 7th, 2013
149
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 7.10 KB | None | 0 0
  1. #######################################################
  2. # Dave Crouse's .bashrc file
  3. # www.bashscripts.org
  4. # www.usalug.org
  5. #
  6. # Last Modified 04-08-2006
  7. # Running on OpenSuSE 10
  8. #######################################################
  9.  
  10.  
  11. # EXPORTS
  12. #######################################################
  13.  
  14. #PATH=$PATH:/usr/lib/festival/ ;export PATH
  15. #export PS1="[\[\033[1;34m\w\[\033[0m]\n[\t \u]$ "
  16. export PS1="[\[\033[1;34m\w\033[0m] \n[\[\e[1;32m\\]\u\[\e[0m\]@\h]$ "
  17.  
  18. #export PS1='[\u@\h \W]\$ '
  19.  
  20. export EDITOR=/usr/bin/vim
  21. export HISTFILESIZE=3000 # the bash history should save 3000 commands
  22. export HISTCONTROL=ignoredups #don't put duplicate lines in the history.
  23. alias hist='history | grep $1' #Requires one input
  24.  
  25. # Define a few Color's
  26. BLACK='\e[0;30m'
  27. BLUE='\e[0;34m'
  28. GREEN='\e[0;32m'
  29. CYAN='\e[0;36m'
  30. RED='\e[0;31m'
  31. PURPLE='\e[0;35m'
  32. BROWN='\e[0;33m'
  33. LIGHTGRAY='\e[0;37m'
  34. DARKGRAY='\e[1;30m'
  35. LIGHTBLUE='\e[1;34m'
  36. LIGHTGREEN='\e[1;32m'
  37. LIGHTCYAN='\e[1;36m'
  38. LIGHTRED='\e[1;31m'
  39. LIGHTPURPLE='\e[1;35m'
  40. YELLOW='\e[1;33m'
  41. WHITE='\e[1;37m'
  42. NC='\e[0m'              # No Color
  43. # Sample Command using color: echo -e "${CYAN}This is BASH ${RED}${BASH_VERSION%.*}${CYAN} - DISPLAY on ${RED}$DISPLAY${NC}\n"
  44.  
  45.  
  46. # SOURCED ALIAS'S AND SCRIPTS
  47. #######################################################
  48.  
  49. ### Begin insertion of bbips alias's ###
  50. source ~/.bbips/commandline/bbipsbashrc
  51. ### END bbips alias's ###
  52.  
  53. # Source global definitions
  54. if [ -f /etc/bashrc ]; then
  55.     . /etc/bashrc
  56. fi
  57.  
  58. # enable programmable completion features
  59. if [ -f /etc/bash_completion ]; then
  60.     . /etc/bash_completion
  61. fi
  62.  
  63.  
  64. # ALIAS'S OF ALL TYPES SHAPES AND FORMS ;)
  65. #######################################################
  66.  
  67. # Alias's to local workstations
  68. alias tom='ssh 192.168.2.102 -l root'
  69. alias jason='ssh 192.168.2.103 -l root'
  70. alias randy='ssh 192.168.2.104 -l root'
  71. alias bob='ssh 192.168.2.105 -l root'
  72. alias don='ssh 192.168.2.106 -l root'
  73. alias counter='ssh 192.168.2.107 -l root'
  74.  
  75. # ALIAS TO REMOTE SERVERS
  76. alias ANYNAMEHERE='ssh YOURWEBSITE.com -l USERNAME -p PORTNUMBERHERE'  
  77. # My server info removed from above for obvious reasons ;)
  78.  
  79. # Alias's to TN5250 programs. AS400 access commands.
  80. alias d1='xt5250 env.TERM = IBM-3477-FC env.DEVNAME=D1 192.168.2.5 &'
  81. alias d2='xt5250 env.TERM = IBM-3477-FC env.DEVNAME=D2 192.168.2.5 &'
  82. alias tn5250j='nohup java -jar /home/crouse/tn5250j/lib/tn5250j.jar 2>>error.log &'
  83.  
  84. # Alias's to some of my BashScripts
  85. alias bics='sh /home/crouse/scripts/bics/bics.sh'
  86. alias backup='sh /home/crouse/scripts/usalugbackup.sh'
  87. alias calc='sh /home/crouse/scripts/bashcalc.sh'
  88. alias makepdf='sh /home/crouse/scripts/makepdf.sh'
  89. alias phonebook='sh /home/crouse/scripts/PHONEBOOK/baps.sh'
  90. alias pb='sh /home/crouse/scripts/PHONEBOOK/baps.sh'
  91. alias ppe='/home/crouse/scripts/passphraseencryption.sh'
  92. alias scripts='cd /home/crouse/scripts'
  93.  
  94. # Alias's to control hardware
  95. alias cdo='eject /dev/cdrecorder'
  96. alias cdc='eject -t /dev/cdrecorder'
  97. alias dvdo='eject /dev/dvd'
  98. alias dvdc='eject -t /dev/dvd'
  99. alias scan='scanimage -L'
  100. alias playw='for i in *.wav; do play $i; done'
  101. alias playo='for i in *.ogg; do play $i; done'
  102. alias playm='for i in *.mp3; do play $i; done'
  103. alias copydisk='dd if=/dev/dvd of=/dev/cdrecorder' # Copies bit by bit from dvd to cdrecorder drives.
  104. alias dvdrip='vobcopy -i /dev/dvd/ -o ~/DVDs/ -l'
  105.  
  106. # Alias's to modified commands
  107. alias ps='ps auxf'
  108. alias home='cd ~'
  109. alias pg='ps aux | grep'  #requires an argument
  110. alias un='tar -zxvf'
  111. alias mountedinfo='df -hT'
  112. alias ping='ping -c 10'
  113. alias openports='netstat -nape --inet'
  114. alias ns='netstat -alnp --protocol=inet | grep -v CLOSE_WAIT | cut -c-6,21-94 | tail +2'
  115. alias du1='du -h --max-depth=1'
  116. alias da='date "+%Y-%m-%d %A    %T %Z"'
  117. alias ebrc='pico ~/.bashrc'
  118.  
  119. # Alias to multiple ls commands
  120. alias la='ls -Al'               # show hidden files
  121. alias ls='ls -aF --color=always' # add colors and file type extensions
  122. alias lx='ls -lXB'              # sort by extension
  123. alias lk='ls -lSr'              # sort by size
  124. alias lc='ls -lcr'      # sort by change time  
  125. alias lu='ls -lur'      # sort by access time  
  126. alias lr='ls -lR'               # recursive ls
  127. alias lt='ls -ltr'              # sort by date
  128. alias lm='ls -al |more'         # pipe through 'more'
  129. alias ll='ls -l'
  130.  
  131. # Alias chmod commands
  132. alias mx='chmod a+x'
  133. alias 000='chmod 000'
  134. alias 644='chmod 644'
  135. alias 755='chmod 755'
  136.  
  137. # Alias Shortcuts to graphical programs.
  138. alias kwrite='kwrite 2>/dev/null &'
  139. alias firefox='firefox 2>/dev/null &'
  140. alias gaim='gaim 2>/dev/null &'
  141. alias kate='kate 2>/dev/null &'
  142. alias suk='kdesu konqueror 2>/dev/null &'
  143. alias eclipse='~/bin/eclipse/eclipse >/dev/null 2>&1 &'
  144.  
  145. # Alias xterm and aterm
  146. alias term='xterm -bg AntiqueWhite -fg Black &'
  147. alias termb='xterm -bg AntiqueWhite -fg NavyBlue &'
  148. alias termg='xterm -bg AntiqueWhite -fg OliveDrab &'
  149. alias termr='xterm -bg AntiqueWhite -fg DarkRed &'
  150. alias aterm='aterm -ls -fg gray -bg black'
  151. alias xtop='xterm -fn 6x13 -bg LightSlateGray -fg black -e top &'
  152. alias xsu='xterm -fn 7x14 -bg DarkOrange4 -fg white -e su &'
  153.  
  154. # Alias for lynx web browser
  155. alias bbc='lynx -term=vt100 http://news.bbc.co.uk/text_only.stm'
  156. alias nytimes='lynx -term=vt100 http://nytimes.com'
  157. alias dmregister='lynx -term=vt100 http://desmoinesregister.com'
  158.  
  159.  
  160. # SOME OF MY UNUSED ALIAS's
  161. #######################################################
  162.  
  163. # alias d=`echo "Good Morning Dave. today's date is" | festival --tts; date +'%A %B %e' | festival --tts`
  164. # alias shrink84='/home/crouse/shrink84/shrink84.sh'
  165. # alias tl='tail -f /var/log/apache/access.log'
  166. # alias te='tail -f /var/log/apache/error.log'
  167.  
  168.  
  169. # SPECIAL FUNCTIONS
  170. #######################################################
  171.  
  172. netinfo ()
  173. {
  174. echo "--------------- Network Information ---------------"
  175. /sbin/ifconfig | awk /'inet addr/ {print $2}'
  176. echo ""
  177. /sbin/ifconfig | awk /'Bcast/ {print $3}'
  178. echo ""
  179. /sbin/ifconfig | awk /'inet addr/ {print $4}'
  180.  
  181. # /sbin/ifconfig | awk /'HWaddr/ {print $4,$5}'
  182. echo "---------------------------------------------------"
  183. }
  184.  
  185. spin ()
  186. {
  187. echo -ne "${RED}-"
  188. echo -ne "${WHITE}\b|"    
  189. echo -ne "${BLUE}\bx"
  190. sleep .01
  191. echo -ne "${RED}\b+${NC}"
  192. }
  193.  
  194. scpsend ()
  195. {
  196. scp -P PORTNUMBERHERE "$@" USERNAME@YOURWEBSITE.com:/var/www/html/pathtodirectoryonremoteserver/;
  197. }
  198.  
  199.  
  200. # NOTES
  201. #######################################################
  202.  
  203. # To temporarily bypass an alias, we preceed the command with a \  
  204. # EG:  the ls command is aliased, but to use the normal ls command you would
  205. # type \ls
  206.  
  207. # mount -o loop /home/crouse/NAMEOFISO.iso /home/crouse/ISOMOUNTDIR/
  208. # umount /home/crouse/NAMEOFISO.iso
  209. # Both commands done as root only.
  210.  
  211.  
  212. # WELCOME SCREEN
  213. #######################################################
  214.  
  215. clear
  216. echo -e ${LIGHTBLUE}`cat /etc/SuSE-release` ;
  217. echo -e "Kernel Information: " `uname -smr`;
  218. echo -e ${LIGHTBLUE}`bash --version`;echo ""
  219. echo -ne "Hello $USER today is "; date
  220. echo -e "${WHITE}"; cal ; echo "";
  221. echo -ne "${CYAN}";netinfo;
  222. mountedinfo ; echo ""
  223. echo -ne "${LIGHTBLUE}Uptime for this computer is ";uptime | awk /'up/ {print $3,$4}'
  224. echo ""; echo ""
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement