Sabtu, 17 Desember 2011

Kode Seni Bashr

  1. #!/bin/bash
  2. #------------------------------------------////
  3. # Bash Zee - Eichel
  4. # Last Modified 18 nov 2011 by Me@zee-eichel
  5. # Running on Backtrack 5 R1
  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. # Aliases:
  29. #------------------------------------------////
  30. #alias myip='curl -s checkip.dyndns.org|sed -e 's/.*Current IP Address: //' -e 's/<.*$//'
  31. alias findbig='find . -type f -exec ls -s {} \; | sort -n -r | head -5'
  32. #alias ps='my_ps'
  33. alias ports='netstat -nape --inet'
  34. alias btadmin='firefox http://indonesianbacktrack.or.id/wp-admin &'
  35. alias forum=' firefox http://forum.indonesianbacktrack.or.id &'
  36. alias fadmin=' firefox http://forum.indonesianbacktrack.or.id/susan &'
  37. alias zee='ssh robalt@indonesianbacktrack.or.id '
  38. alias ping='ping -c 6'
  39. alias ns='netstat -alnp --protocol=inet'
  40. alias ls='ls -aF --color=always'
  41. alias la='ls -Al'
  42. alias lx='ls -lXB'
  43. alias lk='ls -lSr'
  44. alias lc='ls -lcr'
  45. alias lu='ls -lur'
  46. alias lr='ls -lR'
  47. alias lt='ls -ltr'
  48. alias lm='ls -al |more'
  49. alias rm='rm -rf'
  50. #------------------------------------------////
  51. # Functions and Scripts:
  52. #------------------------------------------////
  53. susanmylove ()
  54. {
  55. echo -n "c0de-number : "
  56. read susan
  57. if [ "$susan" == "0510" ] ; then
  58. echo "continue the desktop"
  59. else
  60. reboot
  61. fi
  62. }
  63.  
  64. localnet ()
  65. {
  66. /sbin/ifconfig | awk /'inet addr/ {print $2}'
  67. echo ""
  68. /sbin/ifconfig | awk /'Bcast/ {print $3}'
  69. echo ""
  70. }
  71. myip ()
  72. {
  73. lynx -dump -hiddenlinks=ignore -nolist http://checkip.dyndns.org:8245/ | grep "Current IP Address" | cut -d":" -f2 | cut -d" " -f2
  74. }
  75. upinfo ()
  76. {
  77. echo -ne "${green}$HOSTNAME ${red}uptime is ${green} \t ";uptime | awk /'up/ {print $3,$4,$5,$6,$7,$8,$9,$10}'
  78. }
  79. cd()
  80. {
  81.   if [ -n "$1" ]; then
  82.     builtin cd "$@" && ls
  83.   else
  84.     builtin cd ~ && ls
  85.   fi
  86. }
  87. weather ()
  88. {
  89. declare -a WEATHERARRAY
  90. WEATHERARRAY=( `lynx -dump "http://www.google.com/search?hl=en&lr=&client=firefox-a&rls=org.mozilla_en-US_official&q=weather+${1}&btnG=Search" | grep -A 5 -m 1 "Weather for" | sed 's;\[26\]Add to iGoogle\[27\]IMG;;g'`)
  91. echo ${WEATHERARRAY[@]}
  92. }
  93. #------------------------------------------////
  94. # Some original .bashrc contents:
  95. #------------------------------------------////
  96. # If not running interactively, don't do anything
  97. [ -z "$PS1" ] && return
  98. # don't put duplicate lines in the history. See bash(1) for more options
  99. export HISTCONTROL=ignoredups
  100. # update the values of LINES and COLUMNS.
  101. shopt -s checkwinsize
  102. # make less more friendly for non-text input files, see lesspipe(1)
  103. [ -x /usr/bin/lesspipe ] && eval "$(lesspipe)"
  104. # set variable identify\e[1;32ming the chroot you work in (used in the prompt below)
  105. if [ -z "$debian_chroot" ] && [ -r /etc/debian_chroot ]; then
  106.     debian_chroot=$(cat /etc/debian_chroot)
  107. fi
  108. #PS1='${debian_chroot:+($debian_chroot)}\[\033[01;32m\]zee@\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[00m\]\$ '
  109. #------------------------------------------////
  110. # Prompt:
  111. #------------------------------------------////
  112.  
  113. #PS1='\e[0;36m\h\[\e[0;36m\] \w \[\033[00m\] $ \[\033[00m\]'
  114. PS1='\033[01;32mzee\[\033[01;32m\]@\[\033[01;32m\]\h\[\033[00;32m\]{\[\033[01;32m\]\w\[\033[01;32m\]}\[\033[01;32m\]:\[\033[00m\]'
  115. #PS1='\e[0;36m\W\@ \$\e[m '
  116. #if [ `id -un` != root ]; then
  117. #PS1="[${EGR}\u@\h${EBL} \W${NONE}]# "
  118. #else
  119. #PS1="[${ERD}\h${EBL} \W${NONE}]# "
  120. #fi
  121. #------------------------------------------////
  122. # System Information:
  123. #------------------------------------------////
  124. clear
  125. susanmylove;
  126. clear
  127. echo -e "${lightgreen}";figlet "derly-my-love";echo "=============================zee-eichel"
  128. echo -ne "${lightgreen}Today is:\t\t${red}" `date`; echo ""
  129. echo -e "${lightgreen}Kernel Information: \t${red}" `uname -smr`
  130. echo -ne "${lightgreen}";upinfo;echo ""
  131. echo "Indonesian Backtrack Team"
  132. echo ""the quieter you become, the more you able to hear""
  133. echo "=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-="
  134.  

Tidak ada komentar:

Posting Komentar