# If you come from bash you might have to change your $PATH.
export PATH=$HOME/bin:/usr/local/bin:$PATH
export PATH=/miniconda3/bin/:$PATH
export PATH=~/miniconda3/bin:$PATH


USER=``

# Path to your oh-my-zsh installation.
export ZSH="/Users/jakub/.oh-my-zsh"
source ~/.oh-my-zsh/templates/zshrc.zsh-template

ZSH_THEME="agnoster"

plugins=(virtualenv git vscode tmux)

source $ZSH/oh-my-zsh.sh
# plugins=(
#   git
#   bundler
#   dotenv
# )


export PATH=$HOME/.local/bin:$PATH
export PATH=/usr/local/bin/python3:$PATH
export PATH=/Users/jakub/Library/Python/3.7/bin:$PATH
export PATH=$HOME/.local/bin:$PATH

export BETTER_EXCEPTIONS=1

# alias python=python3

source activate b39
# cd ~/code/data-toolkit 
# source env/bin/activate
# eval `ssh-agent -s`
# ssh-add tools/ssh/CL-key
# git config --global url.ssh://git@github.com/.insteadOf https://github.com/
# git clone 
# git pull && git checkout dev-asco-ota-updates
# perl -i -p -e 's|https://(.*?)/|git@\1:|g' .gitmodules
# GIT_SSH_COMMAND="ssh -i /data/openpilot/tools/ssh/CL-key" git submodule update --init
# reboot
# cd .. && mv CL-key gitkey && mv openpilot openpilot_backup
# git clone git@github.com:Creation-Labs-AI/openpilot.git --recursive 

alias gs='watch -d -n .5 nvidia-smi'
alias psh='conda deactivate; pipenv shell'
alias psi=" conda deactivate && pipenv shell"
alias pll='pipenv install'
alias py='/miniconda3/envs/b37/bin/python'
alias gpureload="sudo rmmod nvidia_uvm ; sudo modprobe nvidia_uvm"
alias nbx='jupyter notebook'
alias cll='conda install'
#TODO: change
alias scl='f() { scp -i ~/.ssh/keys/project-lucas.pem $1 ubuntu@lucas-0${2}.love-lucas.com:/mnt/efs/ };f'
alias tnl='g() { ssh -L ${2:=8000}\:localhost:${3:=8888} ${1:=2-lucas} -fN}; g'
alias im2vid="f5() { ffmpeg -framerate 25 -pattern_type glob -i '*${1}.png' -c:v libx264 -r 30 -pix_fmt yuv420p ${1}.mp4 }; f5"
# ln -s /mnt/efs/datasets/drone_videos/pictures/*  trainA && ls -l trainA
alias symDir="f6() { for f in $(ls -d ${1}/*); do ln -s $f ${2}; done && ls -al ${2} }; f6 "
alias wh='f1() { tree . -f | grep ${1}}; f1'
alias we='f2() { env | grep ${1}}; f2'
alias lt='ls --human-readable --size -1 -S --classify'
alias gd='f3() {git diff HEAD~${1} HEAD~${2}}; f3'
# alias lt='du -sh * | sort -h'
# possible BT fix 
alias btfix='rm -rf ~/.config/pulse.old/ && mv ~/.config/pulse/ ~/.config/pulse.old/ && systemctl --user restart pulseaudio'
# docker images | awk '{print $3}' | head -n 20 | xargs docker rmi        
# (b39)  jakub@jl-rzr-21  ~  ssh cl-SW-interview "cat /home/ubuntu/cl-openpilot-gosia/gosia_diff.txt" | xclip -selection clipboard
# (b39)  jakub@jl-rzr-21  ~  ssh cl-SW-interview "cat /home/ubuntu/cl-openpilot-gosia/gosia_diff.txt" > ~/code/gosia_diff.txt   

bindkey -e
bindkey '^[[1;9C' forward-word
bindkey '^[[1;9D' backward-word
bindkey '^[[Z' up-line-or-search

# find devices
# sudo arp-scan --localnet
# ps aux | grep fastboot | awk '{print $2}' | head -n 2| xargs sudo kill
# route

alias python=python3

export PATH="/usr/local/opt/icu4c/bin:$PATH"
export PATH="/usr/local/opt/icu4c/sbin:$PATH"

export PATH=/usr/local/cuda-11.2/bin${PATH:+:${PATH}}
export LD_LIBRARY_PATH=/usr/local/cuda-11.2/lib64${LD_LIBRARY_PATH:+:${LD_LIBRARY_PATH}}
export CUDA_HOME=/usr/local/cuda
export LD_LIBRARY_PATH=/home/jakub/code/cuda/lib64:$LD_LIBRARY_PATH
export PATH="/usr/local/include:${PATH}"
PATH=/bin:/usr/bin:/usr/local/bin:${PATH}
