-
Notifications
You must be signed in to change notification settings - Fork 0
/
backpack.conf
52 lines (44 loc) · 1.34 KB
/
backpack.conf
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
#Hello, I am a travelling bash rc autogenerated by a script.
#I should be cleaned up automatically, if you are seeing this it's the result
#of an error. Feel free to delete me, sorry for making a mess :(
tmprc="/tmp/backpack.conf.tmp"
conf="~/.bash_backpack"
trap cleanup 0 1 2 3 6
cleanup() {
[ -f $tmprc ] && rm $tmprc &>/dev/null
}
PS1='\[\033[01;32m\]\u\[\033[01;37m\] @ \[\033[01;32m\]\h\[\033[01;30m\] - \[\033[01;37m\] \w \n\[\033[01;32m\]>\[\033[00m\] '
alias ls='ls --color=auto'
alias ssh=backpack
alias cp="cp -i"
alias la='ls -lah'
alias ll='ls -lh'
bind '"\e[A": history-search-backward'
bind '"\e[B": history-search-forward'
bind '"\e[C": forward-char'
bind '"\e[D": backward-char'
bind "set show-all-if-ambiguous on"
export HISTIGNORE="&:[ ]*:exit:ls:bg:fg:cd:history"
HISTCONTROL="erasedups:ignoreboth"
shopt -s dirspell 2> /dev/null
shopt -s cdspell 2> /dev/null
decode() {
printf %s "$1" | fold -w 64 | base64 -d
}
xhunt() {
find "$1" -mtime -1 \( -name "*.log" -o -name "*.out" -o -name "*.trace" \) -exec grep "xception" -l {} \;
}
ssu() {
eval cp $conf $tmprc
chmod 664 $tmprc
# (sleep 10 && cleanup &)
sudo su - $1 --session-command="bash --rcfile $tmprc -i"
}
function cd() {
if [ -z "$*" ]; then
destination=~
else
destination=$*
fi
builtin cd "${destination}" >/dev/null && ls
}