-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.bash_profile
96 lines (67 loc) · 1.84 KB
/
.bash_profile
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
# Aliases
alias writer="open -a iA\ Writer";
alias sublime="open -a Sublime\ Text\ 2";
alias chrome="open -a Google\ Chrome";
alias firefox="open -a Firefox";
alias safari="open -a Safari";
alias browsers="chrome; firefox; safari;";
alias ls="ls -aG";
alias bashreload="source ~/.bash_profile";
# Screen capture in arg1 seconds, arg2 filename
shot(){
screencapture -T $1 /users/$(logname)/Desktop/$2.jpg;
}
# ls and grep together arg1 grep find
lg(){
ls | grep $1;
}
# quick code testing arg1 filename arg2 if new dir needed
code(){
cd code;
if [ $2 != "" ]; then
mkdir $2;
cd $2;
fi
vim $1;
}
# new dropbox folder with symnlink in documents
mkdropboxdir(){
### Get home path
mkdir "/Users/$(logname)/Dropbox/$1";
ln -s "/Users/$(logname)/Dropbox/$1" "/Users/$(logname)/Documents/$1";
}
# java on the command line
jcompile(){
mkdir ./src/classes;
javac -d ./src/classes -cp classes ./src/java/*.java;
cd ./src/classes;
echo "now run java -classpath . package.main";
}
# useful tcpdump command
pckdump(){
echo "tcpdump -xX -vv -i lo0 'port 123' ";
sudo tcpdump -xX -vv -i $2 "port $1";
}
# create github repo {Not useful with 2FA tokens}
githubcreate(){
# if no args probably forgotten them
if [ -z $1 ]; then
echo "arg1: repo name, arg2: repo description"
return;
fi
# default to private reporsitory
private=$3
if [ -z $3 ]; then
private="true";
fi
# curl request to the github API
curl -u "$(logname)" https://api.github.com/user/repos -d '{"name":'\""$1"\"',"description":'\""$2"\"', "private":'"$private"'}'
}
# Process groff man page
manpageview(){
groff -Tascii -man $1;
}
# Setting PATH for Python 3.5
# The orginal version is saved in .bash_profile.pysave
PATH="/Library/Frameworks/Python.framework/Versions/3.5/bin:/Users/$(logname)/Library/Android/sdk:/Users/$(logname)/Library/Android/android-ndk-r10e:${PATH}"
export PATH