-
Notifications
You must be signed in to change notification settings - Fork 4
/
bash.bashrc.template
119 lines (105 loc) · 3.88 KB
/
bash.bashrc.template
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
#!/bin/bash
#------------------------------------------////
# Colors:
#------------------------------------------////
black='\e[0;30m'
blue='\e[0;34m'
green='\e[0;32m'
cyan='\e[0;36m'
red='\e[0;31m'
purple='\e[0;35m'
brown='\e[0;33m'
lightgray='\e[0;37m'
darkgray='\e[1;30m'
lightblue='\e[1;34m'
lightgreen='\e[1;32m'
lightcyan='\e[1;36m'
lightred='\e[1;31m'
lightpurple='\e[1;35m'
yellow='\e[1;33m'
white='\e[1;37m'
nc='\e[0m'
alias ls='ls --color=always'
#------------------------------------------////
# Functions and Scripts:
#------------------------------------------////
localnet ()
{
/sbin/ifconfig | awk /'inet addr/ {print $2}'
echo ""
/sbin/ifconfig | awk /'Bcast/ {print $3}'
echo ""
}
myip ()
{
wget -q -O - http://checkip.dyndns.org:8245/ | grep "Current IP Address" | cut -d":" -f2 | cut -d" " -f2 | cut -d"<" -f1
}
upinfo ()
{
echo -ne "${green}$HOSTNAME ${red}uptime is ${cyan} \t ";uptime | awk /'up/ {print $3,$4,$5,$6,$7,$8,$9,$10}'
}
cd()
{
if [ -n "$1" ]; then
builtin cd "$@" && ls
else
builtin cd ~ && ls
fi
}
#------------------------------------------////
# Some original .bashrc contents:
#------------------------------------------////
# If not running interactively, don't do anything
[ -z "$PS1" ] && return
# don't put duplicate lines in the history. See bash(1) for more options
export HISTCONTROL=ignoredups
# leave some commands out of history log
export HISTIGNORE="&:??:[ ]*:clear:exit:logout"
# update the values of LINES and COLUMNS.
shopt -s checkwinsize
# make less more friendly for non-text input files, see lesspipe(1)
[ -x /usr/bin/lesspipe ] && eval "$(lesspipe)"
#------------------------------------------////
# Prompt:
#------------------------------------------////
PS1="┌─[\u@\h]──\$(if [[ \$? != 0 ]]; then echo '[✗]─'; else echo '────'; fi)────────────────────────────[\w]\n└─\$(if [[ \$EUID == 0 ]]; then echo '#\041'; else echo \$ ; fi)\e[?25h "
case "$TERM" in
xterm-color)
# Enable colors for ls, etc. Prefer ~/.dir_colors
if type -P dircolors >/dev/null ; then
if [[ -f ~/.dir_colors ]] ; then
eval $(dircolors -b ~/.dir_colors)
elif [[ -f /etc/DIR_COLORS ]] ; then
eval $(dircolors -b /etc/DIR_COLORS)
fi
fi
# define color to additional file types
export LS_COLORS=$LS_COLORS:"*.wmv=01;35":"*.wma=01;35":"*.flv=01;35":"*.m4a=01;35"
#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\] \033[?16;0;200c'
;;
esac
PS1="\[\e[0;34m\]┌─\$(if [[ \$? != 0 ]]; then echo '[\[\e[0;31m\]\342\234\227\[\e[0;34m\]]─'; fi)[\$(if [[ \$EUID == 0 ]]; then echo '\[\e[0;31m\]\u'; else echo '\[\e[0;33m\]\u'; fi)\[\e[0;32m\]@\[\e[0;35m\]\h\[\e[0;34m\]]──────────────────────────────\[\e[0;34m\][\[\e[01;34m\]\w\[\e[0;34m\]] \n└─\[\e[0m\]\$(if [[ \$EUID == 0 ]]; then echo '#\041'; else echo \$ ; fi)\e[?25h "
#------------------------------------------////
# System Information:
#------------------------------------------////
clear
echo -e "${LIGHTGRAY}";#figlet "Kali - Odorid C 1";
echo " _ __ _ _ ___ _ _ _ ____ _ "
echo "| |/ /__ _| (_) / _ \ __| |_ __ ___ (_) __| | / ___| / |"
echo "| ' // _\` | | | _____ | | | |/ _\` | '__/ _ \| |/ _\` | | | | |"
echo "| . \ (_| | | | |_____| | |_| | (_| | | | (_) | | (_| | | |___ | |"
echo "|_|\_\__,_|_|_| \___/ \__,_|_| \___/|_|\__,_| \____| |_|"
echo ""
echo -ne "${red}Today is:\t\t${cyan}" `date`; echo ""
echo -e "${red}Kernel Information: \t${cyan}" `uname -smr`
echo -ne "${cyan}";upinfo;echo ""
echo -e "${cyan}"; cal -3
echo ""
case "$TERM" in
linux)
# show the cursor, by config the file /etc/tmux.conf
tmux
;;
*)
;;
esac