export HUNGRYROOT_DIR="$HOME/src/github.com/hungryroot/hungryroot"

alias v="vim $*"
alias c="clear"
alias dj="poetry run python manage.py $*"
alias dc="docker compose $*"
alias sysu="systemctl --user $*"
alias fsync="find . -type f -name '*.sync-conflict*'"
alias vi="vim $*"
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 bookpull="rsync -aziuvhP rhea.local:/tank/books/ ~/.calibre/"
alias bookpush="rsync -aziuvhP ~/.calibre/ rhea.local:/tank/books/"
alias gpghup='gpgconf --kill gpg-agent && gpgconf --launch gpg-agent'
alias dotup='(cd ~/.dotfiles && git pull public master && make)'
alias djlogs="tail -f -n 50 /tmp/django.log"
alias clogs="tail -f -n 50 /tmp/celery.log"
#alias pullkeys="SSH_ASKPASS_REQUIRE='' scp -r powellc@nfs.service:~/.gnupg ~/"
#alias pullvar="SSH_ASKPASS_REQUIRE='' scp -r powellc@nfs.service:~/var ~/"
#alias sshp="SSH_ASKPASS_REQUIRE='' ssh $*"


# Vrobbler shortcuts
alias vdeploy="ssh life.unbl.ink \"rm -rf /root/vrobbler-venv/lib/python3.11/site-packages/vrobbler-0.15.4.dist-info/ && pip install git+https://code.unbl.ink/secstate/vrobbler.git@develop && systemctl restart vrobbler\""
alias vsh="ssh life.unbl.ink vrobbler shell_plus"

alias dump_gconf="dconf dump / > ~/.dotfiles/gnome/.local/share/custom-gconf.conf"
alias e="emacsclient -nw $*"

alias sweep_movies="sudo find /tank/videos/incoming -type f \( -iname '*.mp4' -o -iname '*.mkv' \) ! -iname '*sample*' -exec mv {} /tank/videos/movies/ \;"
alias clear_incoming="sudo find /tank/videos/incoming -type d -maxdepth 1 -mindepth 1 ! -name '.stfolder' -exec rm -rf {} +"
alias lk="load_keys"

# Hungryroot
alias hrhup="sysu restart hungryroot-django"
alias hrtest="$HUNGRYROOT_DIR/manage.py test --keepdb"
alias hr="cd $HUNGRYROOT_DIR"
alias hrdj="(cd $HUNGRYROOT_DIR && just django)"
alias hrdjsh="(cd $HUNGRYROOT_DIR && just djshell)"
alias hrqa="(cd $HUNGRYROOT_DIR && just ecs-exec qa)"
alias hrstg="(cd $HUNGRYROOT_DIR && just ecs-exec staging)"
alias hrprod="(cd $HUNGRYROOT_DIR && just ecs-exec prod)"
alias hrdc="(cd $HUNGRYROOT_DIR && just docker-run)"
alias hrotp="pass otp work/hungryroot/okta"
