-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path.zshrc
More file actions
88 lines (71 loc) · 3.37 KB
/
.zshrc
File metadata and controls
88 lines (71 loc) · 3.37 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
85
86
87
88
# defaults
export LC_ALL=en_US.UTF-8
export TERM=xterm-256color
# programs
export PATH=/usr/local/bin:$PATH
export PATH=/usr/local/opt/node@22/bin:$PATH
export PATH=~/.npm-global/bin:$PATH
# init oh my zsh aliases first
export ZSH=/Users/andrew/.oh-my-zsh
ZSH_THEME="robbyrussell"
DISABLE_AUTO_UPDATE="true"
plugins=(git fzf)
ZSH_DISABLE_COMPFIX=true
source $ZSH/oh-my-zsh.sh
# Setting fd as the default source for fzf
export FZF_DEFAULT_COMMAND='fd --type f --strip-cwd-prefix'
eval "$(zoxide init zsh)"
# common aliases
alias vi="nvim"
alias ff="fzf"
alias ls="eza"
alias la="eza -la"
alias d="cd ~/dotfiles/"
alias work="cd ~/work/"
alias dps="docker ps"
# Git aliases
alias gca1="git commit -a -v --amend"
alias gp="git push origin HEAD"
alias g="tig"
alias save="git add .;git commit -a -m 'Update'"
# AWS aliases
alias aws-config="aws configure sso"
alias aws-login="aws sso login --profile ProfileName"
alias aws-creds="vi ~/.aws/credentials"
# Kubernetes aliases
alias kpnspc="k9s --config ~/.kube/prod -n namespace"
alias knnspc="k9s --config ~/.kube/nonprod -n namespace"
alias hpnspc="helm --config ~/.kube/prod -n namespace"
alias hnnspc="helm --config ~/.kube/nonprod -n namespace"
function help() {
cat <<'EOF'
Useful CLI commands:
top: # display sorted information about processes
top -o cpu # by CPU usage
top -o mem # by memory usage
lsof: # list open files
lsof -i :8080 # by port
lsof -i UDP # by protocol
lsof -p 1234 # by process id
lsof -u user # by user name
lsof -c nginx # by process name
lsof -N # when using NFC (network file system)
find: # walk a file hierarchy
find . -size +1M # find files bigger than 1 megabyte in the current dir
find . -size -1M # find files smaller than 1 megabyte in the current dir
find / -name package # find files by name in root folder
find / -name "package*" # find files by name in root folder
find / -type f # find files
find / -type d # find directories
grep: # file pattern searcher
grep pattern -r . # search for pattern in the current directory
curl: # transfer a URL
curl -i example.com # include response headers in the output
curl -H 'header: value' example.com # include response headers in the output
curl -X POST -d @filename http://hostname/resource # restful POST request
du: # display disk usage statistics
du -sh . # display total file size in current directory
EOF
}
alias h="help | less"
# this is a shared file so DON'T put secrets here