-
Notifications
You must be signed in to change notification settings - Fork 0
/
.bash_profile
146 lines (145 loc) · 4.33 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
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
# homebrew
export M2_HOME=/Users/tshutty/apache-maven-3.6.1
export PATH=$PATH:/usr/local/bin:~/bin:/usr/bin/python:/usr/local/bin/git:/usr/local/Cellar/ant/1.10.5/bin:$M2_HOME/bin:/Users/tshutty/javapractice/glassfish5/bin
alias showFiles='defaults write com.apple.finder AppleShowAllFiles YES; killall Finder /System/Library/CoreServices/Finder.app'
alias hideFiles='defaults write com.apple.finder AppleShowAllFiles NO; killall Finder /System/Library/CoreServices/Finder.app'
export JETTY_HOME=/usr/local/Cellar/jetty/9.4.14.v20181114/libexec
export JAVA_HOME=$(/usr/libexec/java_home)
export CATALINA_HOME=/Users/tshutty/apache-tomcat-7.0.93
export CATALINA_BASE=/Users/tshutty/apache-tomcat-7.0.93
stty -ixon
HISTSIZE=
HISTFILESIZE=
export JRE_HOME=/Library/Java/JavaVirtualMachines/jdk-12.0.2.jdk/Contents/Home/jre
export PATH="$(brew --prefix coreutils)/libexec/gnubin:/usr/local/bin:$PATH"
export CLICOLOR=1
export LSCOLORS=GxFxCxDxBxegedabagaced
export TERM="xterm-color"
export PS1='\[\e[0;33m\]\u\[\e[0m\]@\[\e[0;32m\]\h\[\e[0m\]:\[\e[0;36m\]\w\[\e[0m\]\$ '
function gitrepo(){
git clone git@github.com:tye-shutty/$1.git &&
cd $1 &&
git remote add upstream git@github.com:SerenovaLLC/$1.git &&
git remote -v &&
cd -
}
function applygitrepo(){
while read i; do
if [ -d $i ]; then
echo "already installed $i"
else
echo "installing $i"
gitrepo $i
fi
done
}
function masterrebase(){
git branch -l &&
git fetch upstream &&
git diff remotes/upstream/master master &&
git checkout master &&
git rebase upstream/master &&
echo New Diff: &&
git diff remotes/upstream/master master
}
function nch(){
for i in $(ls -d */); do
cd i &&
git remote set-url origin git@github.com:tye-shutty/${i%%/}.git &&
git remote -v &&
cd -
done
}
function gitstatusall(){
for i in $(ls -d */); do
cd $i &&
basename -s .git `git config --get remote.origin.url` &&
basename -s .git `git config --get remote.origin.url` >> ~/repolist.txt &&
git status &&
echo ---------------------------------------- &&
cd - &>/dev/null
done
}
function gitdiffall(){
for i in $(ls -d */); do
cd $i &&
basename -s .git `git config --get remote.origin.url` &&
basename -s .git `git config --get remote.origin.url` >> ~/repolist.txt &&
git diff &&
echo ---------------------------------------- &&
cd - &>/dev/null
done
}
function rebaseall(){
while read i; do
cd /Users/tshutty/codebase/$i &&
echo ---------------------------------------- &&
basename -s .git `git config --get remote.origin.url` &&
masterrebase
done
}
function xf(){
find "$1" -iname "$2" -prune -o -iname "$3" 2>&1 | grep -Ev "(Not a directory|Permission denied|Operation not permitted)"
}
function rf(){
find . -depth 1 -name "$1" 2> /dev/null
}
function shrink(){
OIFS="$IFS"
IFS=$'\n'
for i in $(find . -maxdepth 1 -type f | grep "pdf"); do
x=$(echo $i | sed -e 's:./::g')
y=$(echo $x | sed -e 's:.pdf::g')
echo $x
gs -sDEVICE=pdfwrite -dCompatibilityLevel=1.4 -dPDFSETTINGS=/screen -dNOPAUSE -dQUIET -dBATCH -sOutputFile=$y-opt.pdf $x
done
IFS="$OIFS"
}
function prefix(){
OIFS="$IFS"
IFS=$'\n'
for i in `find . -regex \./[^\.].*`
do
y=$(echo $i | sed -e 's:./::g')
x=$(echo $y | tr \ - | tr -s '-')
echo $1-$x
mv "$y" $1-$x
done
IFS="$OIFS"
}
function dcolor(){
mkdir new
OIFS="$IFS"
IFS=$'\n'
for i in $(find . -maxdepth 1 -type f | grep -E '\.png|\.gif|\.jpg'); do
x=$(echo $i | sed -e 's:./::g')
y=$(echo $x | sed -e 's:\..*::g')
echo $x
magick $x -resample 25x25 new/$y-opt.jpg
done
IFS="$OIFS"
}
function dblack(){
mkdir new
OIFS="$IFS"
IFS=$'\n'
for i in $(find . -maxdepth 1 -type f | grep -E '\.png|\.gif|\.jpg'); do
x=$(echo $i | sed -e 's:./::g')
y=$(echo $x | sed -e 's:\..*::g')
echo $x
magick $x -resample 18x18 -monochrome new/$y-opt.gif
done
IFS="$OIFS"
}
function dgray(){
mkdir new
OIFS="$IFS"
IFS=$'\n'
for i in $(find . -maxdepth 1 -type f | grep -E '\.png|\.gif|\.jpg'); do
x=$(echo $i | sed -e 's:./::g')
y=$(echo $x | sed -e 's:\..*::g')
echo $x
magick $x -resample 18x18 -colorspace gray new/$y-opt.jpg
done
IFS="$OIFS"
}