SHARE
TWEET

.bashrc

shevnajat Jun 6th, 2013 449 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. # ~/.bashrc: executed by bash(1) for non-login shells.
  2. # see /usr/share/doc/bash/examples/startup-files (in the package bash-doc)
  3. # for examples
  4. # by shevnajat | contact me najatdotnayatoatgmaildotcom
  5. # cipanaslinuxer
  6. # If not running interactively, don't do anything
  7. [ -z "$PS1" ] && return
  8.  
  9. # don't put duplicate lines in the history. See bash(1) for more options
  10. export HISTCONTROL=ignoredups
  11. # ... and ignore same sucessive entries.
  12. export HISTCONTROL=ignoreboth
  13.  
  14. # check the window size after each command and, if necessary,
  15. # update the values of LINES and COLUMNS.
  16. shopt -s checkwinsize
  17.  
  18. # make less more friendly for non-text input files, see lesspipe(1)
  19. [ -x /usr/bin/lesspipe ] && eval "$(lesspipe)"
  20.  
  21. # set variable identifying the chroot you work in (used in the prompt below)
  22. if [ -z "$debian_chroot" ] && [ -r /etc/debian_chroot ]; then
  23.     debian_chroot=$(cat /etc/debian_chroot)
  24. fi
  25.  
  26. # set a fancy prompt (non-color, unless we know we "want" color)
  27. case "$TERM" in
  28. xterm-color)
  29.     PS1='${debian_chroot:+($debian_chroot)}\[\033[01;32m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[00m\]\$ '
  30.     ;;
  31. *)
  32.     PS1='${debian_chroot:+($debian_chroot)}\u@\h:\w\$ '
  33.     ;;
  34. esac
  35.  
  36. # Comment in the above and uncomment this below for a color prompt
  37. #PS1='${debian_chroot:+($debian_chroot)}\[\033[01;32m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[00m\]\$ '
  38.  
  39. # If this is an xterm set the title to user@host:dir
  40. case "$TERM" in
  41. xterm*|rxvt*)
  42.     PROMPT_COMMAND='echo -ne "\033]0;${USER}@${HOSTNAME}: ${PWD/$HOME/~}\007"'
  43.     ;;
  44. *)
  45.     ;;
  46. esac
  47.  
  48. # Alias definitions.
  49. # You may want to put all your additions into a separate file like
  50. # ~/.bash_aliases, instead of adding them here directly.
  51. # See /usr/share/doc/bash-doc/examples in the bash-doc package.
  52.  
  53. #if [ -f ~/.bash_aliases ]; then
  54. #    . ~/.bash_aliases
  55. #fi
  56.  
  57. # enable color support of ls and also add handy aliases
  58. if [ "$TERM" != "dumb" ]; then
  59.     eval "`dircolors -b`"
  60.     alias ls='ls --color=auto'
  61.     #alias dir='ls --color=auto --format=vertical'
  62.     #alias vdir='ls --color=auto --format=long'
  63. fi
  64.  
  65. # list website
  66. alias fb=' chromium http://facebook.com/ '
  67. alias kaskus=' chromium http://kaskus.co.id/ '
  68. alias email=' chromium http://gmail.com/ '
  69. alias exploit=' chromium http://exploit-id.com/ '
  70. alias wiki=' chromium http://wiki.archlinux.org/ '
  71. alias deviant=' chromium http://deviantart.com/ '
  72. function encode() { echo -n $@ | perl -pe's/([^-_.~A-Za-z0-9])/sprintf("%%%02X", ord($1))/seg'; }
  73. function google() { firefox http://www.google.com/search?hl=id#q="`encode $@`" ;}
  74.  
  75. # Fungsi extract file
  76. extract () {
  77.     if [ -f $1 ] ; then
  78.         case $1 in
  79.             *.tar.bz2)    tar xjf $1        ;;
  80.             *.tar.gz)    tar xzf $1        ;;
  81.             *.bz2)        bunzip2 $1        ;;
  82.             *.rar)        rar x $1        ;;
  83.             *.gz)        gunzip $1        ;;
  84.             *.tar)        tar xf $1        ;;
  85.             *.tbz2)        tar xjf $1        ;;
  86.             *.tgz)        tar xzf $1        ;;
  87.             *.zip)        unzip $1        ;;
  88.             *.Z)        uncompress $1    ;;
  89.             *)        echo "'$1' tidak bisa di extract dengan command extract()" ;;
  90.         esac
  91.     else
  92.         echo "'$1' file tidak terdaftar"
  93.     fi
  94. }
  95.  
  96. # Basic command
  97. alias home='cd ~/'
  98. alias web='cd /var/www'
  99. alias install='sudo pacman -S'
  100. alias debinstall='sudo dpkg -i'
  101. alias update='sudo pacman -Syu'
  102. alias semua='ls -la'
  103. alias lsl='ls -l'
  104. alias admin='sudo su'
  105. alias data='sudo mount /dev/sda3 /mnt/DATA'
  106. # tambahkan sesuai kebutuhan
  107.  
  108. # enable programmable completion features (you don't need to enable
  109. # this, if it's already enabled in /etc/bash.bashrc and /etc/profile
  110. # sources /etc/bash.bashrc).
  111. if [ -f /etc/bash_completion ]; then
  112.     . /etc/bash_completion
  113. fi
  114.  
  115. # Warna tput command
  116.  
  117. Black="$(tput setaf 0)"
  118. BlackBG="$(tput setab 0)"
  119. DarkGrey="$(tput bold ; tput setaf 0)"
  120. LightGrey="$(tput setaf 7)"
  121. LightGreyBG="$(tput setab 7)"
  122. White="$(tput bold ; tput setaf 7)"
  123. Red="$(tput setaf 1)"
  124. RedBG="$(tput setab 1)"
  125. LightRed="$(tput bold ; tput setaf 1)"
  126. Green="$(tput setaf 2)"
  127. GreenBG="$(tput setab 2)"
  128. LightGreen="$(tput bold ; tput setaf 2)"
  129. Brown="$(tput setaf 3)"
  130. BrownBG="$(tput setab 3)"
  131. Yellow="$(tput bold ; tput setaf 3)"
  132. Blue="$(tput setaf 4)"
  133. BlueBG="$(tput setab 4)"
  134. LightBlue="$(tput bold ; tput setaf 4)"
  135. Purple="$(tput setaf 5)"
  136. PurpleBG="$(tput setab 5)"
  137. Pink="$(tput bold ; tput setaf 5)"
  138. Cyan="$(tput setaf 6)"
  139. CyanBG="$(tput setab 6)"
  140. LightCyan="$(tput bold ; tput setaf 6)"
  141. NC="$(tput sgr0)"       # No Color
  142.  
  143. # Functions
  144.  
  145. spin ()
  146. {
  147. echo -ne "$White-"
  148. echo -ne "$LightGray\b|"
  149. echo -ne "$LightGreen\bo"
  150. sleep .02
  151. echo -ne "$LightBlue\b-$RC"
  152. }
  153.  
  154. teks1 ()
  155. {
  156. sleep .02
  157. echo -ne "$White W"
  158. sleep .02
  159. echo -ne e
  160. sleep .02
  161. echo -ne l
  162. sleep .02
  163. echo -ne c
  164. sleep .02
  165. echo -ne o
  166. sleep .02
  167. echo -ne m
  168. sleep .02
  169. echo -ne e
  170. sleep .02
  171. echo -ne " "
  172. sleep .02
  173. echo -ne t
  174. sleep .02
  175. echo -ne o
  176. sleep .02
  177. echo -ne " "
  178. sleep .02
  179. echo -ne "$HOSTNAME $NC"
  180. sleep .02
  181. }
  182.  
  183. teks2 ()
  184. {
  185. sleep .02
  186. echo -ne "$LightGreen D"
  187. sleep .02
  188. echo -ne u
  189. sleep .02
  190. echo -ne t
  191. sleep .02
  192. echo -ne a
  193. sleep .02
  194. echo -ne " "
  195. sleep .02
  196. echo -ne K
  197. sleep .02
  198. echo -ne o
  199. sleep .02
  200. echo -ne m
  201. sleep .02
  202. echo -ne p
  203. sleep .02
  204. echo -ne u
  205. sleep .02
  206. echo -ne t
  207. sleep .02
  208. echo -ne e
  209. sleep .02
  210. echo -ne r
  211. sleep .02
  212. echo -ne " "
  213. sleep .02
  214. echo -ne C
  215. sleep .02
  216. echo -ne i
  217. sleep .02
  218. echo -ne p
  219. sleep .02
  220. echo -ne a
  221. sleep .02
  222. echo -ne n
  223. sleep .02
  224. echo -ne a
  225. sleep .02
  226. echo -ne s
  227. sleep .02
  228. sleep .02
  229. echo -ne " "
  230. }
  231.  
  232. load ()
  233. {
  234. sleep .5
  235. echo -ne "$LightGreen ."
  236. sleep .5
  237. echo -ne .
  238. sleep .5
  239. echo -ne .
  240. echo -ne .
  241. sleep .5
  242. echo -ne .
  243. sleep .8
  244. echo -ne "$LightBlue done"
  245. }
  246. INTERFACE=enp2s5
  247. # Welcome screen
  248.  
  249. clear;
  250. echo -e "";
  251. for i in `seq 1 20` ; do spin; done; teks1; for i in `seq 1 23` ; do spin; done ;echo "";
  252. echo "";
  253. echo -ne "$LightBlue Selamat Datang $White$USER $LightBlue!";
  254. echo ""; sleep .3;
  255. echo "";
  256. echo -ne "$LightBlue Hari & tanggal: $White `date "+%b %d, %Y"`";
  257. echo ""; sleep .3;
  258. echo "";
  259. echo -ne "$Red Please Wait"; load;
  260. echo ""; sleep .3;
  261. echo "";
  262. echo -ne "$LightBlue Kernel: $White `uname -smr`";
  263. echo "";
  264. echo -ne "$LightBlue IP:     $White `/sbin/ip addr show $INTERFACE | grep 'inet ' | cut -d t -f2 | cut -d / -f1 | cut -b 2-`";
  265. echo "";
  266. echo -ne "$LightBlue Uptime: $White `uptime | awk {'print $3" "$4" "$5'} | sed 's/:/ hours, /' | sed -r 's/,$/ minutes/'`";
  267. echo ""; sleep .3;
  268. echo "";
  269. for i in `seq 1 20` ; do spin; done; teks2; for i in `seq 1 25` ; do spin; done ;echo "";
  270. echo "" $NC;
  271.  
  272. # Simple bash
  273.  
  274.  PS1='\[\033[01;32m\]\u\[\033[01;34m\]@\[\033[01;31m\]\h\[\033[00;34m\]{\[\033[01;34m\]\w\[\033[00;34m\]}\[\033[01;32m\]:\[\033[00m\]'
RAW Paste Data
Top