-
Notifications
You must be signed in to change notification settings - Fork 2
/
zshrc_orca.sh
90 lines (77 loc) · 2.15 KB
/
zshrc_orca.sh
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
#!/usr/bin/env zsh
#--------------------------------------------------
# Prompt Setting
#--------------------------------------------------
HOST=$(hostname | cut -d. -f1)
if [ "$PS1" ]; then
PS1="%n_$HOST$ "
ignoreeof=1
fi
#--------------------------------------------------
# General ENV
#--------------------------------------------------
#export LANG=en_US
#export LC_CTYPE="utf-8"
export CLICOLOR=1
export LSCOLORS=ExFxCxDxBxegedabagacad
export CVSEDITOR=vim
export PATH=$HOME/local/bin:$PATH
# For MacPort:
export PATH=/opt/local/bin:$PATH
# Ruby
export PATH=/usr/local/opt/ruby/bin:$PATH
# Python
export PATH=$HOME/Library/Python/3.9/bin:$PATH
#--------------------------------------------------
# General Aliases
#--------------------------------------------------
alias l="ls"
alias ll="l -lh"
alias lsd="l -d */"
alias p="pwd"
alias rm~="rm *~"
alias sd="ssh -D 9999 [email protected]"
alias si="ssh -D 9999 [email protected]"
alias sk="networksetup -setsocksfirewallproxystate Wi-Fi"
alias jk="bundle exec jekyll serve"
alias mk="mkdocs serve"
#--------------------------------------------------
# Functions
#--------------------------------------------------
bak(){
if [ -z "$1" ]; then
echo "Ocean(o) Ocean3(o3)?"
elif [ "$1" = "o" ]; then
rsync -avuE -P $HOME/Documents /Volumes/Ocean/Documents
rsync -avuE -P $HOME/Pictures /Volumes/Ocean/Pictures
rsync -avuE -P $HOME/Movies /Volumes/Ocean/Movies
elif [ "$1" = "o3" ]; then
rsync -avuE -P $HOME/Documents /Volumes/Ocean3/Documents
rsync -avuE -P $HOME/Pictures /Volumes/Ocean3/Pictures
rsync -avuE -P $HOME/Movies /Volumes/Ocean3/Movies
fi;
}
sl() {
hostnames=(cern ihep)
export [email protected]
export [email protected]
if [ -z "$1" ]; then
for hostname in ${hostnames[*]}
do
subst="$hostname"
echo " ["$hostname"]" ${(P)subst} #zsh
done
read menu
else
menu=$1
fi
for hostname in ${hostnames[*]}
do
subst="$hostname"
if [[ $menu == $hostname ]];
then
echo "Logging into" ${(P)subst} "..."
ssh -Y ${(P)subst}
fi
done
}