-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbash_aliases
More file actions
69 lines (58 loc) · 1.84 KB
/
bash_aliases
File metadata and controls
69 lines (58 loc) · 1.84 KB
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
alias ll='ls -l'
alias la='ls -la'
alias grep='grep --color=auto'
alias gc='git commit -v'
alias gca='git commit -v -a'
alias gci='git commit --interactive'
alias gd='git diff'
alias wo='eval $(poetry env activate)'
alias wo2='workon $(basename $PWD)'
alias mkv='mkvirtualenv $(basename $PWD)'
alias docker-clean='docker ps -a | grep '\''weeks ago'\'' | awk '\''{print }'\'' | xargs docker rm'
alias docker-env='eval $(minikube docker-env)'
alias ecr-login='eval $(aws ecr get-login --no-include-email)'
alias podme='podman run --mount=type=bind,src=$HOME,dst=$HOME -it -w $PWD --privileged'
function show-cert {
local OPTS="-text"
OPTIND=1
while getopts "dv" arg
do
case $arg in
d) local OPTS="-dates";;
v) local VERBOSE=1;;
*)
echo "Usage: show-cert [-d] [-v] hostname [connect]"
return 1
;;
esac
done
shift $((OPTIND - 1))
local SERVERNAME=$1
local CONNECT="${2:-$1}"
if [ -z "$1" ]
then
1>&2 echo "Hostname required"
else
if [ "$CONNECT" != *:* ]
then
local CONNECT="$CONNECT:443"
fi
local COMMAND="openssl s_client -showcerts -servername $SERVERNAME -connect $CONNECT </dev/null 2>/dev/null | openssl x509 -inform pem -noout $OPTS"
if [ -n "$VERBOSE" ]; then echo "$ $COMMAND"; fi
eval $COMMAND
fi
}
function cert-validity {
if [ -z "$1" ]
then
1>&2 echo "Hostname required"
else
openssl s_client -showcerts -servername $1 -connect $1:443 </dev/null 2>/dev/null | openssl x509 -inform pem -noout -dates
fi
}
function myip {
curl -4 https://ip.me
curl -6 https://ip.me
}
# Allow for system-specific aliases that shouldn't be shared everywhere
[ -e "$HOME/.bash_aliases_local" ] && source "$HOME/.bash_aliases_local"