-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy path.bashrc
148 lines (117 loc) · 3.15 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
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
[[ $- != *i* ]] && return
eval `dircolors ~/.dircolors`
HISTCONTROL=ignoreboth
shopt -s histappend
HISTSIZE=4096
HISTFILESIZE=4096
shopt -s checkwinsize
[ -x /usr/bin/lesspipe ] && eval "$(SHELL=/bin/sh lesspipe)"
if test -z "${debian_chroot:-}" && test -r /etc/debian_chroot
then
debian_chroot=$(cat /etc/debian_chroot)
fi
if ! shopt -oq posix
then
if test -f /usr/share/bash-completion/bash_completion
then
. /usr/share/bash-completion/bash_completion
elif test -f /etc/bash_completion
then
. /etc/bash_completion
fi
fi
function _update_ps1() {
PS1="$(~/.local/bin/powerline-shell $?)"
}
if [ "$TERM" != "linux" ]; then
PROMPT_COMMAND="_update_ps1; $PROMPT_COMMAND"
fi
export LANG=C
export LC_MESSAGE=C
export LC_TIME=en_US.UTF-8
export LESSCHARSET=utf-8
export locale=en_US.UTF-8
case $TERM in
linux) LANG=C ;;
*) LANG=ja_JP.UTF-8 ;;
esac
export marked="$HOME/marked"
if test -e /opt/ros; then source ~/.rosrc; fi
cd()
{
builtin cd "$@" && ls -avF --color=auto
}
alias ls='ls -avF --color=auto'
# alias sl='ls'
alias ks='ls'
alias cdm='echo "move marked path: $(cat $marked/unnamed)"; cd $(cat $marked/unnamed)'
alias alpha='for each in $(echo {a..z}); do echo $each; done'
alias grep='grep --color=always --exclude-dir=.git'
alias ps='ps aux --sort=start_time'
alias rank='sort | uniq -c | sort -nr'
alias tmux='tmux -2u'
compare()
{
if which colordiff &> /dev/null
then
alias diff='colordiff'
fi
diff -Bbyw $@ | less -R
}
update()
{
sudo apt update && sudo apt upgrade
}
cxx()
{
compiler="g++-7"
version="-std=c++17"
options="-Wall -Wextra"
boost_links="-lboost_system -lboost_thread -lboost_date_time"
other_links="-ldl -lstdc++fs"
$compiler $@ $version $options $boost_links $other_links
}
mark()
{
file="unnamed"
info="[mark] following path marked"
mkdir -p $marked || exit 1
for opt in "$@"
do
case "$@" in
"-c" | "--catkin" )
file="catkin"
info="$info as catkin workspace"
break;;
esac
done
echo "$info: $(pwd | tee $marked/$file)";
}
# 初回シェル時のみ tmux実行
if [ $SHLVL = 1 ]; then
tmux
fi
source /opt/ros/kinetic/setup.bash
# export PYTHONPATH=$PYTHONPATH:/home/yokota/.local/lib/python2.7/site-packages
export PATH=$PATH:/home/yokota/.local/bin:/home/yokota/bin
alias cdr="cd ~/Dropbox"
alias cdt="cd ~/Dropbox/works/toybox"
alias cdw="cd ~/Dropbox/works"
alias cdp="cd ~/Dropbox/works/papers"
alias l="ls"
alias png2eps="~/bin/png2eps.sh"
alias jpg2eps="~/bin/jpg2eps.sh"
alias fetchall="~/bin/fetchall.sh"
alias sshm="ssh [email protected]"
alias sshm6="ssh [email protected] -p26"
# alias sshm6gui="ssh -Y -C [email protected] -p26"
alias sshm6gui="ssh -Y [email protected] -p26"
alias vimrc="vi ~/.vimrc"
alias bashrc="vi ~/.bashrc"
alias gpu="watch -n 0.1 nvidia-smi"
export PATH=/usr/local/cuda-9.0/bin:${PATH}
export LD_LIBRARY_PATH=/usr/local/cuda-9.0/lib64:${LD_LIBRARY_PATH}
export PATH=$PATH:/home/yokota/Dropbox/works/mixcell/QTCode
export PYTHONPATH=$PYTHONPATH:/home/yokota/Dropbox/works/mixcell/source_code
export JAVA_HOME=$(readlink -f /usr/bin/javac | sed "s:/bin/javac::")
export PATH=/usr/lib/llvm-6.0/bin:$PATH