.zshrc 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. # If you come from bash you might have to change your $PATH.
  2. export PATH=$HOME/.bin:/usr/local/bin:$PATH
  3. export ZSH="$HOME/.oh-my-zsh"
  4. ZSH_THEME="robbyrussell"
  5. plugins=(git z fzf asdf direnv emacs yarn)
  6. source $ZSH/oh-my-zsh.sh
  7. # Example aliases
  8. alias dj="poetry run python manage.py $argv"
  9. alias sysu="systemctl --user $argv"
  10. alias fsync="find . -type f -name '*.sync-conflict*'"
  11. alias atlas="ssh atlas.local"
  12. alias pandora="ssh pandora.unbl.ink"
  13. alias bastion="ssh bastion.unbl.ink"
  14. alias pull="git pull --rebase --autostash"
  15. alias asso="aws sso login --profile $argv"
  16. repogo() {
  17. export PRIVATE_REPO_TOKEN="$(aws codeartifact get-authorization-token --domain sure --query authorizationToken --output text --profile registries-read)"
  18. export CODEARTIFACT_AUTH_TOKEN="$PRIVATE_REPO_TOKEN"
  19. poetry config http-basic.codeartifact aws $PRIVATE_REPO_TOKEN
  20. aws codeartifact login --namespace sureapp --tool npm --repository npm --domain sure --domain-owner 348777858795 --profile registries-read
  21. }
  22. kush() {
  23. if [[ $1 == "sbx" ]]
  24. then
  25. aws eks update-kubeconfig --name surepreme-sandbox-main-cluster --profile sure-inc
  26. fi
  27. if [[ $1 == "qa" ]]
  28. then
  29. aws eks update-kubeconfig --name farmers-qa-main-cluster --profile np-farmers
  30. fi
  31. if [[ $1 == "prod" ]]
  32. then
  33. echo "from platform_core.apps.core_protections.models import *" | pbcopy
  34. aws eks update-kubeconfig --name surepreme-production-main-cluster --profile sure-inc
  35. kubectl exec -it -n bastion $(kubectl get po -n bastion | grep "surepreme.*bastion" | head -n 1 | awk '{print $1}') -- python manage.py shell
  36. fi
  37. if (( $2 ));
  38. then
  39. if [[ $2 = "-p" ]]
  40. then
  41. echo "Import command is on your clipboard"
  42. echo "from platform_core.apps.core_protections.models import *" | pbcopy
  43. kubectl exec -it $(kubectl get pods | fzf | awk '{print $1}'|head -n 1) -- bash -c "python manage.py shell"
  44. else
  45. kubectl exec -it $(kubectl get pods | fzf | awk '{print $1}'|head -n 1) -- bash
  46. fi
  47. else
  48. kubectl exec -it $(kubectl get pods | fzf | awk '{print $1}'|head -n 1) -- bash
  49. fi
  50. }
  51. [ -f ~/.fzf.zsh ] && source ~/.fzf.zsh
  52. eval "$(atuin init zsh)"