-
Notifications
You must be signed in to change notification settings - Fork 1
/
.bashrc
98 lines (84 loc) · 2.11 KB
/
.bashrc
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
# .bashrc
# Source global definitions
#if [ -f /etc/bashrc ]; then
# . /etc/bashrc
#fi
# Umask
umask 066
# Environmental Variables
export PAGER=less
export LESS='-X -i -P ?f%f:(stdin). ?lb%lb?L/%L.. [?eEOF:?pb%pb\%..]'
export RSYNC_RSH=ssh
shopt -u sourcepath
export HISTTIMEFORMAT='@"%Y-%m-%d %T" -- '
# User specific aliases and functions
if [ -f ~/.bash_aliases ]; then
. ~/.bash_aliases
fi
if [[ "$PS1" ]]; then
HISTSIZE=50000
HISTFILESIZE=50000
shopt -s histappend
shopt -s histverify
shopt -s histreedit
shopt -s no_empty_cmd_completion
function i {
if [ "$1" ]; then
history 1000 | grep "$@"
else
history 30
fi
}
function I {
if [ "$1" ]; then
history | grep "$@"
else
history 30
fi
}
#tty | sed -e "s/\// /g" | awk '{print $2}' > $path_file_tty && screen
path_file_tty=~/.tty
if [ ! -f $path_file_tty ]; then
echo "screen" > $path_file_tty
fi
str_tty_from_command=`tty | sed -e "s/\// /g" | awk '{print $2}'`
str_tty_from_file=`head -1 $path_file_tty`
if [ $str_tty_from_command == $str_tty_from_file ]; then
str_tty=$str_tty_from_command
elif [ $str_tty_from_file != "screen" ]; then
str_tty=$str_tty_from_file
else
str_tty="screen"
fi
if [ $TERM == "screen" ]; then
PS1="[\u@\h($str_tty) \W]\\$ "
else
#PS1="[\u@\h \W]\\$ "
PS1="\t[\u@\h \W]\\$ "
fi
h2=`expr $HOSTNAME : '\(..\).*'`
u2=`expr $USER : '\(.\).*'`
PS0="$u2@$h2:\[\e[${col}m\]\W[\!]\$\[\e[m\]"
function px {
local tmp=$PS1
PS1=$PS0
PS0=$tmp
}
function wi {
case `type -t "$1"` in
alias|function) type "$1";;
file) L `command -v "$1"`;;
function) type "$1";;
esac
}
function j { jobs -l; }
fi
PATH=$PATH:$HOME/.rvm/bin # Add RVM to PATH for scripting
[[ -s $HOME/.tmuxinator/scripts/tmuxinator ]] && source $HOME/.tmuxinator/scripts/tmuxinator
PATH=$PATH:/usr/local/glusterfs/sbin
MANPATH=$MANPATH:/usr/local/glusterfs/share/man
PATH=$PATH:/usr/lib64/fluent/ruby/bin
docker-attach(){
PID=$(docker inspect --format {{.State.Pid}} $1)
nsenter --target $PID --mount --uts --ipc --net --pid
}