From c187f6bf8ec3431b8d6a5c77f57400a71a21b4bb Mon Sep 17 00:00:00 2001 From: Colin Powell Date: Tue, 6 Feb 2024 10:52:19 -0500 Subject: [PATCH] [zsh] New aliases and clean up Sure functions --- emacs/.config/doom/custom.el | 2 +- emacs/.config/doom/packages.el | 1 + zsh/.zshrc | 31 +++++++++++-------------------- 3 files changed, 13 insertions(+), 21 deletions(-) diff --git a/emacs/.config/doom/custom.el b/emacs/.config/doom/custom.el index e8e82f9..7f4a093 100644 --- a/emacs/.config/doom/custom.el +++ b/emacs/.config/doom/custom.el @@ -4,7 +4,7 @@ ;; Your init file should contain only one such instance. ;; If there is more than one, they won't work right. '(magit-todos-insert-after '(bottom) nil nil "Changed by setter of obsolete option `magit-todos-insert-at'") - '(package-selected-packages '(w3m vulpea ef-themes)) + '(package-selected-packages '(nov w3m vulpea ef-themes)) '(safe-local-variable-values '((pytest-global-name . "docker-compose run --rm test --")))) (custom-set-faces ;; custom-set-faces was added by Custom. diff --git a/emacs/.config/doom/packages.el b/emacs/.config/doom/packages.el index 03801fa..174a856 100644 --- a/emacs/.config/doom/packages.el +++ b/emacs/.config/doom/packages.el @@ -13,6 +13,7 @@ (package! ef-themes) (package! nyan-mode) (package! w3m) +(package! nov) (package! ace-link) (package! git-link) (package! blacken) diff --git a/zsh/.zshrc b/zsh/.zshrc index 66f35d3..ed89e58 100644 --- a/zsh/.zshrc +++ b/zsh/.zshrc @@ -25,6 +25,7 @@ alias push="git push" alias asso="aws sso login --profile $argv" alias bookpull="rsync --delete -avzichP root@atlas.local:/tank/books/ ~/.calibre/" alias bookpush="rsync --delete -avzichP ~/.calibre/ root@atlas.local:/tank/books/" +alias chglg="git add ./changelog/ && git commit -m 'Add changelog' && git push" newemail () { @@ -50,35 +51,22 @@ sush() { if [[ $1 == "sbx" ]] then asso sure-inc - aws eks update-kubeconfig --name surepreme-sandbox-main-cluster --profile sure-inc + aws eks update-kubeconfig --name surepreme-sandbox-k8s-use1 --profile sure-inc + kubectl exec -it $(kubectl get pods | fzf | awk '{print $1}'|head -n 1) -- bash fi if [[ $1 == "qa" ]] then asso np-farmers - aws eks update-kubeconfig --name farmers-qa-main-cluster --profile np-farmers + aws eks update-kubeconfig --name farmers-qa-k8s-use1 --profile np-farmers + kubectl exec -it $(kubectl get pods | fzf | awk '{print $1}'|head -n 1) -- bash fi if [[ $1 == "prod" ]] then asso sure-inc - echo "from platform_core.apps.core_protections.models import *" | pbcopy - aws eks update-kubeconfig --name surepreme-production-main-cluster --profile sure-inc - kubectl exec -it -n bastion $(kubectl get po -n bastion | grep "surepreme.*bastion" | head -n 1 | awk '{print $1}') -- python manage.py shell - fi - - if (( $2 )); - then - if [[ $2 = "-p" ]] - then - echo "Import command is on your clipboard" - echo "from platform_core.apps.core_protections.models import *" | pbcopy - kubectl exec -it $(kubectl get pods | fzf | awk '{print $1}'|head -n 1) -- bash -c "python manage.py shell" - else - kubectl exec -it $(kubectl get pods | fzf | awk '{print $1}'|head -n 1) -- bash - fi - else - kubectl exec -it $(kubectl get pods | fzf | awk '{print $1}'|head -n 1) -- bash + aws eks update-kubeconfig --name surepreme-production-k8s-use1 --profile sure-inc + kubectl exec -it -n bastion $(kubectl get pod -n bastion | grep "surepreme.*bastion" | head -n 1 | awk '{print $1}') -- bash fi } @@ -95,7 +83,7 @@ refresh_sure_db() { echo "This will likely take about 10 minutes" asso np-farmers aws s3 cp --profile np-farmers s3://farmers-qa-rds-exports/pg_dumps/farmers_latest.pgdump /tmp/qa_farmers_latest.pgdump - dropdb -U sure surepreme + dropdb -U sure surepreme --force createdb -U sure surepreme psql -U sure surepreme -c "CREATE EXTENSION postgis" pg_restore -d surepreme /tmp/qa_farmers_latest.pgdump @@ -105,4 +93,7 @@ refresh_sure_db() { [ -f ~/.fzf.zsh ] && source ~/.fzf.zsh +for f in ~/.dotfiles.sure/bash/*.sh; do source $f; done +for f in ~/.dotfiles.sure/direnv/*.sh; do source $f; done + eval "$(atuin init zsh)"