SHOW:
|
|
- or go back to the newest paste.
| 1 | - | # ~/.bashrc: executed by bash(1) for non-login shells. |
| 1 | + | #!/bin/bash |
| 2 | - | # see /usr/share/doc/bash/examples/startup-files (in the package bash-doc) |
| 2 | + | |
| 3 | - | # for examples |
| 3 | + | # Bash devis - dexvils |
| 4 | # Last Modified 26 September 2013 by Me@dexvils | |
| 5 | # Running on Kali Linux | |
| 6 | - | case $- in |
| 6 | + | |
| 7 | - | *i*) ;; |
| 7 | + | |
| 8 | - | *) return;; |
| 8 | + | |
| 9 | - | esac |
| 9 | + | |
| 10 | green='\e[0;32m' | |
| 11 | - | # don't put duplicate lines or lines starting with space in the history. |
| 11 | + | |
| 12 | - | # See bash(1) for more options |
| 12 | + | |
| 13 | - | HISTCONTROL=ignoreboth |
| 13 | + | |
| 14 | brown='\e[0;33m' | |
| 15 | - | # append to the history file, don't overwrite it |
| 15 | + | |
| 16 | - | shopt -s histappend |
| 16 | + | |
| 17 | lightblue='\e[1;34m' | |
| 18 | - | # for setting history length see HISTSIZE and HISTFILESIZE in bash(1) |
| 18 | + | |
| 19 | - | HISTSIZE=1000 |
| 19 | + | |
| 20 | - | HISTFILESIZE=2000 |
| 20 | + | |
| 21 | lightpurple='\e[1;35m' | |
| 22 | - | # check the window size after each command and, if necessary, |
| 22 | + | |
| 23 | white='\e[1;37m' | |
| 24 | nc='\e[0m' | |
| 25 | #------------------------------------------//// | |
| 26 | - | # If set, the pattern "**" used in a pathname expansion context will |
| 26 | + | |
| 27 | - | # match all files and zero or more directories and subdirectories. |
| 27 | + | |
| 28 | - | #shopt -s globstar |
| 28 | + | |
| 29 | {
| |
| 30 | echo -n "c0de-number : " | |
| 31 | - | #[ -x /usr/bin/lesspipe ] && eval "$(SHELL=/bin/sh lesspipe)" |
| 31 | + | |
| 32 | if [ "$dexvils" == "1611" ] ; then | |
| 33 | - | # set variable identifying the chroot you work in (used in the prompt below) |
| 33 | + | |
| 34 | - | if [ -z "${debian_chroot:-}" ] && [ -r /etc/debian_chroot ]; then
|
| 34 | + | |
| 35 | reboot | |
| 36 | fi | |
| 37 | } | |
| 38 | - | # set a fancy prompt (non-color, unless we know we "want" color) |
| 38 | + | |
| 39 | - | case "$TERM" in |
| 39 | + | |
| 40 | - | xterm-color) color_prompt=yes;; |
| 40 | + | |
| 41 | - | esac |
| 41 | + | |
| 42 | echo "" | |
| 43 | - | # uncomment for a colored prompt, if the terminal has the capability; turned |
| 43 | + | |
| 44 | - | # off by default to not distract the user: the focus in a terminal window |
| 44 | + | |
| 45 | - | # should be on the output of commands, not on the prompt |
| 45 | + | |
| 46 | - | force_color_prompt=yes |
| 46 | + | |
| 47 | {
| |
| 48 | - | if [ -n "$force_color_prompt" ]; then |
| 48 | + | |
| 49 | - | if [ -x /usr/bin/tput ] && tput setaf 1 >&/dev/null; then |
| 49 | + | |
| 50 | - | # We have color support; assume it's compliant with Ecma-48 |
| 50 | + | |
| 51 | - | # (ISO/IEC-6429). (Lack of such support is extremely rare, and such |
| 51 | + | |
| 52 | - | # a case would tend to support setf rather than setaf.) |
| 52 | + | |
| 53 | - | color_prompt=yes |
| 53 | + | |
| 54 | - | else |
| 54 | + | |
| 55 | - | color_prompt= |
| 55 | + | |
| 56 | - | fi |
| 56 | + | |
| 57 | builtin cd "$@" && ls | |
| 58 | else | |
| 59 | - | if [ "$color_prompt" = yes ]; then |
| 59 | + | |
| 60 | - | PS1='${debian_chroot:+($debian_chroot)}\[\033[01;31m\]devis@\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[00m\]\$ '
|
| 60 | + | |
| 61 | } | |
| 62 | - | PS1='${debian_chroot:+($debian_chroot)}devis@\h:\w\$ '
|
| 62 | + | |
| 63 | {
| |
| 64 | - | unset color_prompt force_color_prompt |
| 64 | + | |
| 65 | 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'`)
| |
| 66 | - | # If this is an xterm set the title to user@host:dir |
| 66 | + | |
| 67 | - | case "$TERM" in |
| 67 | + | |
| 68 | - | xterm*|rxvt*) |
| 68 | + | |
| 69 | - | PS1="\[\e]0;${debian_chroot:+($debian_chroot)}devis@\h: \w\a\]$PS1"
|
| 69 | + | |
| 70 | - | ;; |
| 70 | + | |
| 71 | - | *) |
| 71 | + | |
| 72 | - | ;; |
| 72 | + | |
| 73 | - | esac |
| 73 | + | |
| 74 | export HISTCONTROL=ignoredups | |
| 75 | - | # enable color support of ls and also add handy aliases |
| 75 | + | |
| 76 | - | if [ -x /usr/bin/dircolors ]; then |
| 76 | + | |
| 77 | - | test -r ~/.dircolors && eval "$(dircolors -b ~/.dircolors)" || eval "$(dircolors -b)" |
| 77 | + | |
| 78 | - | alias ls='ls --color=auto' |
| 78 | + | |
| 79 | - | #alias dir='dir --color=auto' |
| 79 | + | |
| 80 | - | #alias vdir='vdir --color=auto' |
| 80 | + | |
| 81 | debian_chroot=$(cat /etc/debian_chroot) | |
| 82 | - | #alias grep='grep --color=auto' |
| 82 | + | |
| 83 | - | #alias fgrep='fgrep --color=auto' |
| 83 | + | |
| 84 | - | #alias egrep='egrep --color=auto' |
| 84 | + | |
| 85 | # Prompt: | |
| 86 | #------------------------------------------//// | |
| 87 | - | # some more ls aliases |
| 87 | + | |
| 88 | - | #alias ll='ls -l' |
| 88 | + | |
| 89 | - | #alias la='ls -A' |
| 89 | + | |
| 90 | - | #alias l='ls -CF' |
| 90 | + | |
| 91 | #if [ `id -un` != root ]; then | |
| 92 | - | # Alias definitions. |
| 92 | + | |
| 93 | - | # You may want to put all your additions into a separate file like |
| 93 | + | |
| 94 | - | # ~/.bash_aliases, instead of adding them here directly. |
| 94 | + | |
| 95 | - | # See /usr/share/doc/bash-doc/examples in the bash-doc package. |
| 95 | + | |
| 96 | #------------------------------------------//// | |
| 97 | - | if [ -f ~/.bash_aliases ]; then |
| 97 | + | |
| 98 | - | . ~/.bash_aliases |
| 98 | + | |
| 99 | clear | |
| 100 | deviskali; | |
| 101 | - | # enable programmable completion features (you don't need to enable |
| 101 | + | |
| 102 | - | # this, if it's already enabled in /etc/bash.bashrc and /etc/profile |
| 102 | + | |
| 103 | - | # sources /etc/bash.bashrc). |
| 103 | + | |
| 104 | - | if ! shopt -oq posix; then |
| 104 | + | |
| 105 | - | if [ -f /usr/share/bash-completion/bash_completion ]; then |
| 105 | + | |
| 106 | - | . /usr/share/bash-completion/bash_completion |
| 106 | + | |
| 107 | - | elif [ -f /etc/bash_completion ]; then |
| 107 | + | |
| 108 | - | . /etc/bash_completion |
| 108 | + | |
| 109 | echo -e "${darkgray}Kernel Information: \t${red}" `uname -smr`
| |
| 110 | echo -ne "${lightcyan}";upinfo;echo ""
| |
| 111 | echo "=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=" |