-
Notifications
You must be signed in to change notification settings - Fork 0
/
.osx
62 lines (49 loc) · 1.47 KB
/
.osx
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
# OS X Antibody configuration
#
# Exports
#
export PATH=${HOME}/.krew/bin:$PATH
export PATH=${HOME}/.kubectl-plugins:$PATH
#
# Antibody bundles
#
antidote bundle ohmyzsh/ohmyzsh path:plugins/brew >>~/.zsh_plugins.zsh
# Full brew update
alias brew_update="brew -v update; brew upgrade --force-bottle; brew cleanup; brew doctor"
# Useful env variables
#
# OS X aliases
#
alias ll='ls -alhG'
# alias docker="lima nerdctl"
# alias docker="podman"
alias docker-compose="podman-compose"
function docker() {
if [ "$1" = compose ]; then
shift
command podman-compose "$@"
else
command podman "$@"
fi
}
#
# OS X functions
#
function localip() {
ifconfig | grep "inet " | grep -Fv 127.0.0.1 | awk '{print $2}'
}
ports() {
netstat -Watnlv | grep LISTEN | awk '{"ps -o comm= -p " $9 | getline procname;colred="\033[01;31m";colclr="\033[0m"; print colred "proto: " colclr $1 colred " | addr.port: " colclr $4 colred " | pid: " colclr $9 colred " | name: " colclr procname; }' | column -t -s "|"
}
# Kills the process behind the passed port number
function killp() {
kill $(lsof -nP -i:$1 | grep LISTEN | awk -F ' ' '{print $2}') || true
# netstat -Watnlv | grep LISTEN | awk '{"ps -o comm= -p " $9 | getline procname; print "addr.port: " $4 " | pid: " $9 " " ; }' | grep $1 | awk '{print $5}' | xargs kill -9
}
# Update all casks
caskup() {
rm -rf "$(brew --cache)"
brew update
brew cask uninstall --force "$@"
brew cask install "$@"
}