[ssh] Cleaning up shells and ssh configurablility when not at home
This commit is contained in:
42
zsh/.zshrc
42
zsh/.zshrc
@ -10,23 +10,8 @@ plugins=(git z fzf asdf direnv emacs yarn)
|
||||
|
||||
source $ZSH/oh-my-zsh.sh
|
||||
|
||||
|
||||
# Example aliases
|
||||
alias dj="poetry run python manage.py $argv"
|
||||
alias sysu="systemctl --user $argv"
|
||||
alias fsync="find . -type f -name '*.sync-conflict*'"
|
||||
alias vi="vim $argv"
|
||||
alias dus="du -sh * | sort -h"
|
||||
alias rhea="ssh rhea.local"
|
||||
alias pandora="ssh pandora.unbl.ink"
|
||||
alias bastion="ssh bastion.unbl.ink"
|
||||
alias pull="git pull --rebase --autostash"
|
||||
alias push="git push"
|
||||
alias asso="aws sso login --profile $argv"
|
||||
alias bookpull="rsync --delete -avzichP root@rhea.local:/tank/books/ ~/.calibre/"
|
||||
alias bookpush="rsync --delete -avzichP ~/.calibre/ root@rhea.local:/tank/books/"
|
||||
alias chglg="git add ./changelog/ && git commit -m 'Add changelog' && git push"
|
||||
|
||||
# See ~/.aliases for the various aliases seen in here
|
||||
source "$HOME/.aliases"
|
||||
|
||||
newemail () {
|
||||
curl -X POST --user colin@unbl.ink:$(pass personal/colin@unbl.ink | head -n 1) -d "address=$1@unbl.ink" -d "forwards_to=colin@unbl.ink" https://box.unbl.ink/admin/mail/aliases/add
|
||||
@ -60,14 +45,13 @@ sush() {
|
||||
if [[ $1 == "sbx" ]]
|
||||
then
|
||||
asso sure-inc
|
||||
aws eks update-kubeconfig --name surepreme-sandbox-k8s-use1 --profile sure-inc
|
||||
aeks 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-k8s-use1 --profile np-farmers
|
||||
aeks np-farmers
|
||||
kubectl exec -it $(kubectl get pods | fzf | awk '{print $1}'|head -n 1) -- bash
|
||||
fi
|
||||
|
||||
@ -79,6 +63,18 @@ sush() {
|
||||
fi
|
||||
}
|
||||
|
||||
roc() {
|
||||
asso np-farmers
|
||||
aeks np-farmers
|
||||
kubectl port-forward $(kubectl get pods | fzf | awk '{print $1}'|head -n 1) 5001:8080
|
||||
}
|
||||
|
||||
portforward() {
|
||||
asso np-farmers
|
||||
aeks np-farmers
|
||||
kubectl port-forward $(kubectl get pods | fzf | awk '{print $1}'|head -n 1) $1:8080
|
||||
}
|
||||
|
||||
alias qa="sush qa"
|
||||
alias sbx="sush sbx"
|
||||
alias prod="sush prod"
|
||||
@ -90,8 +86,8 @@ prep_pg_for_sure() {
|
||||
}
|
||||
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
|
||||
#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 --force
|
||||
createdb -U sure surepreme
|
||||
psql -U sure surepreme -c "CREATE EXTENSION postgis"
|
||||
@ -111,3 +107,5 @@ export AWS_PROFILE=sure-inc
|
||||
local hostname="%{$fg_bold[white]%}%m"
|
||||
|
||||
PROMPT="${hostname} ${PROMPT}"
|
||||
|
||||
export PATH="$HOME/.yarn/bin:$HOME/.config/yarn/global/node_modules/.bin:$PATH"
|
||||
|
||||
Reference in New Issue
Block a user