-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdot.bashrc
More file actions
104 lines (85 loc) · 2.32 KB
/
dot.bashrc
File metadata and controls
104 lines (85 loc) · 2.32 KB
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
if [ -f /etc/bashrc ]; then
. /etc/bashrc
fi
PS1='\h:\W \u \$ '
export LC_ALL=C
for F in /Library/Developer/CommandLineTools/usr/share/git-core/git-completion.bash \
/Library/Developer/CommandLineTools/usr/share/git-core/git-prompt.sh \
/usr/share/doc/git-1.7.1/contrib/completion/git-completion.bash \
/usr/share/doc/tmux-1.6/examples/bash_completion_tmux.sh \
`brew --prefix`/etc/bash_completion \
; do
if [ -f $F ] ; then
. $F
fi
done
export PS1='[\u@\h \W$(__git_ps1)]\$ '
################
AGENT="$HOME/tmp/ssh-agent-$USER"
if [ -S "$SSH_AUTH_SOCK" ]; then
case $SSH_AUTH_SOCK in
/tmp/*/agent.[0-9]*)
ln -snf "$SSH_AUTH_SOCK" $AGENT && export SSH_AUTH_SOCK=$AGENT
esac
elif [ -S $AGENT ]; then
export SSH_AUTH_SOCK=$AGENT
else
echo "no ssh-agent"
fi
################
alias u=pushd
alias o=popd
# alias s='[ $TERM != "screen" ] && screen -D -RR'
alias s='[ $TERM != "screen" ] && (tmux -u attach -d || tmux -u new-session)'
dig() {
TARGET=
XOPT=
for X in $@ ; do
case "$X" in
-* ) ;;
@* ) ;;
* ) if [ "x$TARGET" == "x" ] ; then TARGET=$X ; fi ; break
esac
done
if [[ "$TARGET" =~ "^[0-9]+\.[0-9]+\.[0-9]+\.[0-9]+$" ]] ; then
XOPT='-x'
fi
/usr/bin/dig $XOPT $@
}
title(){
if [ "$1"x != "x" ] ; then
echo "k"$1"\\"
fi
}
alias t=title
window_title(){
if [ "$1"x != "x" ] ; then
echo "]2;"$1""
fi
}
u2t(){
if [ $(uname) == "Darwin" ] ; then
date -r $1
else
date -d "@$1"
fi
}
# cd $(git rev-parse --show-toplevel) ; export GOPATH=~/mygo ; make
gittop(){
git rev-parse --show-toplevel
}
function fury-panda() {
local entry=$(gcloud --project fury-panda compute instances list --filter='status:RUNNING' | peco --query "$*")
local name=$(echo $entry | awk '{print $1}')
local zone=$(echo $entry | awk '{print $2}')
gcloud --project fury-panda compute ssh --zone $zone $name
}
alias wt=window_title
export GOPATH=$HOME/mygo
# added by travis gem
[ -f /Users/shmorimo/.travis/travis.sh ] && source /Users/shmorimo/.travis/travis.sh
for D in /usr/local/go/bin /usr/local/opt/python/libexec/bin /usr/local/bin /usr/local/sbin /usr/local/go/bin $HOME/bin $HOME/.nodebrew/current/bin /opt/homebrew/bin ; do
[ -d "$D" ] && PATH=$D:$PATH
done
source $HOME/.cargo/env
. "$HOME/.cargo/env"