Advertisement
martadinata

bashrc

Feb 26th, 2012
93
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.18 KB | None | 0 0
  1. #!/bin/bash
  2. #------------------------------------------////
  3. # Lapbox ~/.bashrc file
  4. # Last Modified 20 January 2009
  5. # Running on Debian GNU/Linux - Lenny
  6. #------------------------------------------////
  7. #------------------------------------------////
  8. # Colors:
  9. #------------------------------------------////
  10. black='\e[0;30m'
  11. blue='\e[0;34m'
  12. green='\e[0;32m'
  13. cyan='\e[0;36m'
  14. red='\e[0;31m'
  15. purple='\e[0;35m'
  16. brown='\e[0;33m'
  17. lightgray='\e[0;37m'
  18. darkgray='\e[1;30m'
  19. lightblue='\e[1;34m'
  20. lightgreen='\e[1;32m'
  21. lightcyan='\e[1;36m'
  22. lightred='\e[1;31m'
  23. lightpurple='\e[1;35m'
  24. yellow='\e[1;33m'
  25. white='\e[1;37m'
  26. nc='\e[0m'
  27.  
  28. #------------------------------------------////
  29. # Proxy:
  30. #------------------------------------------////
  31. #http_proxy=http://127.0.0.1:8118/
  32. #HTTP_PROXY=$http_proxy
  33. #export http_proxy HTTP_PROXY
  34.  
  35. #------------------------------------------////
  36. # Aliases:
  37. #------------------------------------------////
  38. ## make ls list by size
  39. ##alias ls='du -s */* | sort -n'
  40. alias findbig='find . -type f -exec ls -s {} \; | sort -n -r | head -5'
  41. alias ls='ls -aF --color=always'
  42. alias la='ls -Al'
  43. alias lx='ls -lXB'
  44. alias lk='ls -lSr'
  45. alias lc='ls -lcr'
  46. alias lu='ls -lur'
  47. alias lr='ls -lR'
  48. alias lt='ls -ltr'
  49. alias lm='ls -al |more'
  50. #alias rm='rm -i'
  51. #------------------------------------------////
  52. # Functions and Scripts:
  53. #------------------------------------------////
  54. localnet ()
  55. {
  56. /sbin/ifconfig | awk /'inet addr/ {print $2}'
  57. echo ""
  58. /sbin/ifconfig | awk /'Bcast/ {print $3}'
  59. echo ""
  60. }
  61. myip ()
  62. {
  63. lynx -dump -hiddenlinks=ignore -nolist [url]http://checkip.dyndns.org:8245/[/url] | grep "Current IP Address" | cut -d":" -f2 | cut -d" " -f2
  64. }
  65. upinfo ()
  66. {
  67. echo -ne "${green}$HOSTNAME ${red}uptime is ${cyan} \t ";uptime | awk /'up/ {print $3,$4,$5,$6,$7,$8,$9,$10}'
  68. }
  69. cd()
  70. {
  71. if [ -n "$1" ]; then
  72. builtin cd "$@" && ls
  73. else
  74. builtin cd ~ && ls
  75. fi
  76. }
  77. weather ()
  78. {
  79. declare -a WEATHERARRAY
  80. WEATHERARRAY=( `lynx -dump "[url]http://www.google.com/search?hl=en&lr&client=firefox-a&rls=org.mozilla_en-US_official&q=weather+%24%7B1%7D&btnG=Search%5B%2Furl%5D" | grep -A 5 -m 1 "Weather for" | sed 's;\[26\]Add to iGoogle\[27\]IMG;;g'`)
  81. echo ${WEATHERARRAY[@]}
  82. }
  83.  
  84. encrypt ()
  85. {
  86. gpg -ac --no-options "$1"
  87. }
  88.  
  89. decrypt ()
  90. {
  91. gpg --no-options "$1"
  92. }
  93.  
  94. extract()
  95. {
  96. if [ -f "$1" ] ; then
  97. case "$1" in
  98. *.tar.bz2) tar xjf "$1" ;;
  99. *.tar.gz) tar xzf "$1" ;;
  100. *.tar.Z) tar xzf "$1" ;;
  101. *.bz2) bunzip2 "$1" ;;
  102. *.rar) unrar x "$1" ;;
  103. *.gz) gunzip "$1" ;;
  104. *.jar) unzip "$1" ;;
  105. *.tar) tar xf "$1" ;;
  106. *.tbz2) tar xjf "$1" ;;
  107. *.tgz) tar xzf "$1" ;;
  108. *.zip) unzip "$1" ;;
  109. *.Z) uncompress "$1" ;;
  110. *) echo "'$1' cannot be extracted." ;;
  111. esac
  112. else
  113. echo "'$1' is not a file."
  114. fi
  115. }
  116.  
  117. PS1='\[\033[01;32m\]\u\[\033[01;34m\]@\[\033[01;31m\]\h\[\033[01;37m\]{\[\033[01;37m\]\w\[\033[01;37m\]}\[\033[01;32m\]:\[\033[00m\]'
  118.  
  119. #------------------------------------------////
  120. # System Information:
  121. #------------------------------------------////
  122. clear
  123. echo -e "${LIGHTGRAY}";figlet "ArchLinux";
  124. echo -ne "${white}Today is:\t\t${cyan}" `date`; echo ""
  125. echo -e "${white}Kernel Information: \t${cyan}" `uname -smr`
  126. echo -ne "${white}";upinfo;echo ""
  127. echo -e "${white}"; cal -3
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement