.zshrc 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  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 push="git push"
  16. alias asso="aws sso login --profile $argv"
  17. repogo() {
  18. export PRIVATE_REPO_TOKEN="$(aws codeartifact get-authorization-token --domain sure --query authorizationToken --output text --profile registries-read)"
  19. export CODEARTIFACT_AUTH_TOKEN="$PRIVATE_REPO_TOKEN"
  20. poetry config http-basic.codeartifact aws $PRIVATE_REPO_TOKEN
  21. aws codeartifact login --namespace sureapp --tool npm --repository npm --domain sure --domain-owner 348777858795 --profile registries-read
  22. }
  23. kush() {
  24. if [[ $1 == "sbx" ]]
  25. then
  26. aws eks update-kubeconfig --name surepreme-sandbox-main-cluster --profile sure-inc
  27. fi
  28. if [[ $1 == "qa" ]]
  29. then
  30. aws eks update-kubeconfig --name farmers-qa-main-cluster --profile np-farmers
  31. fi
  32. if [[ $1 == "prod" ]]
  33. then
  34. echo "from platform_core.apps.core_protections.models import *" | pbcopy
  35. aws eks update-kubeconfig --name surepreme-production-main-cluster --profile sure-inc
  36. kubectl exec -it -n bastion $(kubectl get po -n bastion | grep "surepreme.*bastion" | head -n 1 | awk '{print $1}') -- python manage.py shell
  37. fi
  38. if (( $2 ));
  39. then
  40. if [[ $2 = "-p" ]]
  41. then
  42. echo "Import command is on your clipboard"
  43. echo "from platform_core.apps.core_protections.models import *" | pbcopy
  44. kubectl exec -it $(kubectl get pods | fzf | awk '{print $1}'|head -n 1) -- bash -c "python manage.py shell"
  45. else
  46. kubectl exec -it $(kubectl get pods | fzf | awk '{print $1}'|head -n 1) -- bash
  47. fi
  48. else
  49. kubectl exec -it $(kubectl get pods | fzf | awk '{print $1}'|head -n 1) -- bash
  50. fi
  51. }
  52. [ -f ~/.fzf.zsh ] && source ~/.fzf.zsh
  53. eval "$(atuin init zsh)"