-
Notifications
You must be signed in to change notification settings - Fork 1
/
functions
56 lines (47 loc) · 1.25 KB
/
functions
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
function setup_dotfiles {
cwd="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
cp -f ${cwd}/.bash_profile ~/.bash_profile
cp -f ${cwd}/.bashrc ~/.bashrc
ln -sf ${cwd}/.bash_prompt ~/.bash_prompt
ln -sf ${cwd}/.aliases ~/.aliases
ln -sf ${cwd}/.exports ~/.exports
ln -sf ${cwd}/.functions ~/.functions
ln -sf ${cwd}/.paths ~/.paths
ln -sf ${cwd}/.vimrc ~/.vimrc
ln -sf ${cwd}/.vim ~/.vim
}
function findit {
find . -exec grep -nHi $1 {} \; -maxdepth $2;
}
function replaceit {
EXT=$1
FIND=$2
REPLACE=$3
for i in `find . -name "$EXT"`
do
echo "Processing $i"
chmod +w $i
sed "s/$FIND/$REPLACE/g" $i > TEMPFILE
mv TEMPFILE $i
done
}
# Docker
function d_rmia {
docker rmi $(docker images | grep '^<none>' | awk '{print $3}')
}
function d_rma {
docker rm $(docker ps -a -q)
}
function google {
open "https://google.com/search?q=${*}"
}
# Functions to change the author email setup on the git commits
function awork {
export [email protected]
}
function aper {
export [email protected]
}
function ccert {
echo | openssl s_client -showcerts -connect $1 2>/dev/null | openssl x509 -inform pem -noout -text
}