-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path.osx
More file actions
executable file
·84 lines (68 loc) · 2.05 KB
/
.osx
File metadata and controls
executable file
·84 lines (68 loc) · 2.05 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
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
# OS X Antibody configuration
if [[ ${DEBUG_ZSH} ]]; then
echo "[$(date +%H:%M:%S.%3N)] Loading OS X dotfile configuration..."
fi
autoload -Uz compinit && compinit
#
# Exports
#
export PATH=${HOME}/.krew/bin:$PATH
export PATH=${HOME}/.kubectl-plugins:$PATH
#
# Antibody bundles
#
# 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}'
}
function 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 -9 $(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
function caskup() {
rm -rf "$(brew --cache)"
brew update
brew cask uninstall --force "$@"
brew cask install "$@"
}
function idea() {
open -a "IntelliJ IDEA" "$1"
}
function goland() {
open -a "Goland" "$1"
}
function fixPos1End(){
mkdir -p ~/Library/KeyBindings
# shellcheck disable=SC2028
echo '{
"\\UF729" = moveToBeginningOfLine:; // home
"\\UF72B" = moveToEndOfLine:; // end
"$\\UF729" = moveToBeginningOfLineAndModifySelection:; // shift-home
"$\\UF72B" = moveToEndOfLineAndModifySelection:; // shift-end
}' > ~/Library/KeyBindings/DefaultKeyBinding.dict
}