-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathaliases
43 lines (36 loc) · 1.51 KB
/
aliases
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
# general
alias history='history 1'
alias reload='exec $SHELL -l'
alias datetime='date '+%Y%m%d%T' | tr -d :'
# git
alias gp='git push origin HEAD'
alias gch="git branch --all | tr -d '* ' | grep -v -e '->' | fzf | sed -e 's+remotes/[^/]*/++g' | xargs git checkout"
alias gchb='git checkout -b $1'
alias grsh='git reset --soft HEAD^'
alias gbclear="git branch --merged|egrep -v '\*|develop|main|master'|xargs git branch -d; git fetch -p"
# fzf
alias repo='ghq list -p | fzf'
alias repoc='cd "$(repo)"'
# npm
alias npmr='npf run'
# gcloud
alias gcal='gcloud auth login'
alias gcadl='gcloud auth application-default login'
alias gcpa='gcloud config configurations activate $(gcloud config configurations list | fzf | awk "{print \$1}")'
alias gcps='gcloud config set project $(gcloud projects list | fzf | awk "{print \$1}")'
alias gcgc='bash ~/.dotfiles/aliase/get-gke-credentials.sh'
# kubectl
alias -g KP='$(kubectl get pods | fzf | awk "{print \$1}")'
alias -g KD='$(kubectl get deploy | fzf | awk "{print \$1}")'
alias -g KS='$(kubectl get svc | fzf | awk "{print \$1}")'
alias -g KI='$(kubectl get ing | fzf | awk "{print \$1}")'
alias -g KJ='$(kubectl get job | fzf | awk "{print \$1}")'
alias -g KA='$(kubectl get all | awk "! /NAME/" | fzf | awk "{print \$1}")'
alias kubectle='kubectl exec -it KP $@'
alias kubectll='kubectl stern $(kubectl get deploy | fzf | awk "{print \$1}")'
alias kubectlo='kubectl get KA -o yaml'
# vscode
alias codeo='code $(repo)'
# docker
alias dcu='docker compose up -d $@'
alias dcn='docker compose down $@'