case $- in
i) ;;
*) return;;
esac
HISTCONTROL=ignoreboth
shopt -s histappend
HISTSIZE=1000
HISTFILESIZE=2000
shopt -s checkwinsize
#shopt -s globstar
[ -x /usr/bin/lesspipe ] && eval "$(SHELL=/bin/sh lesspipe)"
if [ -z "(cat /etc/debian_chroot)
fi
case "$TERM" in
xterm-color|*-256color) color_prompt=yes;;
esac
#force_color_prompt=yes
if [ -n "$force_color_prompt" ]; then
if [ -x /usr/bin/tput ] && tput setaf 1 >&/dev/null; then
# We have color support; assume it's compliant with Ecma-48
# (ISO/IEC-6429). (Lack of such support is extremely rare, and such
# a case would tend to support setf rather than setaf.)
color_prompt=yes
else
color_prompt=
fi
fi
if [ "{debian_chroot:+($debian_chroot)}[\033[01;32m]\u@\h[\033[00m]:[\033[01;34m]\w[\033[00m]$ '
else
PS1='debian_chroot)}\u@\h:\w$ '
fi
unset color_prompt force_color_prompt
case "{debian_chroot:+(PS1"
;;
*)
;;
esac
if [ -x /usr/bin/dircolors ]; then
test -r ~/.dircolors && eval "(dircolors -b)"
alias ls='ls –color=auto'
#alias dir='dir –color=auto'
#alias vdir='vdir –color=auto'
alias grep='grep --color=auto'
alias fgrep='fgrep --color=auto'
alias egrep='egrep --color=auto'
fi
#export GCC_COLORS='error=01;31:warning=01;35:note=01;36:caret=01;32:locus=01:quote=01'
alias ll='ls -alF'
alias la='ls -A'
alias l='ls -CF'
alias alert='notify-send –urgency=low -i "$([ (history|tail -n1|sed -e '''s/^\s*[0-9]+\s*//;s/[;&|]\s*alert$//''')"'
if [ -f ~/.bash_aliases ]; then
. ~/.bash_aliases
fi
if ! shopt -oq posix; then
if [ -f /usr/share/bash-completion/bash_completion ]; then
. /usr/share/bash-completion/bash_completion
elif [ -f /etc/bash_completion ]; then
. /etc/bash_completion
fi
fi
export PATH="/usr/share/dotnet:HOME/.pyenv"
export PATH="PATH"
if command -v pyenv 1>/dev/null 2>&1; then
eval "$(pyenv init -)"
fi
export CUDAHOME=/usr/local/cuda-11.1
export PATH={CUDAHOME}/NsightCompute-2019.3{PATH}}
export LD_LIBRARY_PATH={LD_LIBRARY_PATH:+:${LD_LIBRARY_PATH}}
export nagoya_home=/home/doors
export dataset=/home/jitesh/detectron_tutorial/dataset
export dl=/home/jitesh/Downloads
export nddscontent=/home/jitesh/3d/Dataset_Synthesizer/Source/Content
export nddsplug=/home/jitesh/3d/Dataset_Synthesizer/Source/Plugins/DomainRandomizationDNN/Content
export FAIRMOT_ROOT=/home/jitesh/prj/FairMOT
UE_HOME=/home/jitesh/3d/UnrealEngine
function unrealbuild {
CURR_DIR=pwd
;
PROJ_NAME=$(basename ${1%.uproject});
$UE_HOME/Engine/Build/BatchFiles/Linux/Build.sh {CURR_DIR}/${PROJ_NAME}.uproject" -progress -editor -game -NoHotReloadFromIDE
}
complete -f -X '!*.@(uproject)' unrealbuild
function unrealeditor {
DIR="( dirname "$i" )" && pwd )"
$UE_HOME/Engine/Binaries/Linux/UE4Editor $DIR/$1
}
complete -f -X '!*.@(uproject)' unrealeditor
function unrealgen {
DIR="( dirname "$i" )" && pwd )"
pushd DIR/$1" -game -engine -editor
popd
}
complete -f -X '!*.@(uproject)' unrealgen
function unrealtest {
DIR="( dirname "$i" )" && pwd )"
$UE_HOME/Engine/Binaries/Linux/UE4Editor $DIR/$1 -Game -ExecCmds="Automation RunTests $2" -log
}
complete -f -X '!*.@(uproject)' unrealtest
slack_zip()
tar cvzf - $1
zip_targz_in_parts()
# Example: $1=dataset_dir $2=. $3=200MB
tar cvzf - $1
unzip_targz_parts()
cat ${1}.*
tar_compress() {
tar cvzf $(basename $1).tar.gz $1
}
tar_extract() {
tar xvzf $1
}
zip_slack()
CHECK="du -hs --block-size=M $1
"
CHECK=(echo "$CHECK > "999""
postprocessing_data.() {
/home/jitesh/3d/venv/bin/python /home/jitesh/3d/data/src/data_postprocessing.py -f $1 -c $2
}
install-from-pt() {
pip install https://github.com/PT-ML/$(basename $1).git
}
reinstall() {
pip uninstall (basename $1)/archive/master.zip
}
reinstall.all() {
pip uninstall annotation_utils common_utils logger streamer
pip install https://github.com/cm107/annotation_utils/archive/master.zip
pip install https://github.com/cm107/common_utils/archive/master.zip
pip install https://github.com/cm107/logger/archive/master.zip
pip install https://github.com/cm107/streamer/archive/master.zip
}
install-cm-all() {
gitcon
git clone https://github.com/cm107/annotation_utils.git
git clone https://github.com/cm107/common_utils.git
git clone https://github.com/cm107/logger.git
git clone https://github.com/cm107/streamer.git
}
alias uninstall-cm='pip uninstall annotation_utils common_utils logger streamer'
copy2multiple() {
tee <(basename $1).png o{$2..$3}.png >/dev/null
}
folder() {
mkdir $1 && cd $1
}
replace-in-files() {
sed -i 's/$1/$2/g' $3
}
alias diff="sshpass -p 'pas' ssh doors@172.xx.xx.xxx -X"
copy_to_diff_server() {
scp -r $1 doors@172.xx.xx.xxx:$2
}
copy_from_diff_server() {
scp -r doors@172.xx.xx.xxx:$1 $2
}
reinstall()
pip uninstall (basename $1)
}
reinstall.all() {
yes
copy2multiple() {
tee <(basename $1).png o{$2..$3}.png >/dev/null
}
folder() {
mkdir $1 && cd $1
}
replace-in-files() {
sed -i 's/$1/$2/g' $3
}
nvdu(){
current_path="pwd
"
cd ~/3d
venv
cd $current_path
nvdu_viz
}
mp4_2_gif() {
ffmpeg -i $1.mp4 $1.gif
}
__conda_setup="$('/home/jitesh/miniconda3/bin/conda' 'shell.bash' 'hook' 2> /dev/null)"
if [ __conda_setup"
else
if [ -f "/home/jitesh/miniconda3/etc/profile.d/conda.sh" ]; then
. "/home/jitesh/miniconda3/etc/profile.d/conda.sh"
else
export PATH="/home/jitesh/miniconda3/bin:$PATH"
fi
fi
unset __conda_setup
export PYENV_ROOT="PYENV_ROOT/bin:(pyenv init -)"
fi
upload_graph() {
ts
python upload_events.py –folder $1
}
export HARUHOME="/home/haru"
export ROS_MASTER_HOSTNAME="haru-47"
export ROS_MASTER_URI=http://(ip route get 8.8.8.8 | awk -F"src " 'NR==1{split(MY_IP
export ROS_HOSTNAME=$ROS_IP
alias connect-haru="ssh haru@ROS_MASTER_HOSTNAME"
folder() {
mkdir $1 && cd $1
}
replace-in-files() {
sed -i 's/$1/$2/g' $3
}
copy_file_from_haru() {
scp haru@haru-29:$1 $2
}
copy_file_to_haru() {
scp $1 haru@haru-29:$2
}
ros-source() {
source "/home/jitesh/workspaces/$1_ws/devel/setup.bash"
}
convert-mov-to-webm()
IFS="."
read -a strarr <<< "$1"
echo "Converting from $1 to ${strarr[0]}.webm"
mkdir webm
# ffmpeg -i "{strarr[0]}.webm"
yes .webm"
mv "${strarr[0]}.webm" webm/
echo "Moved ${strarr[0]}.webm to webm/ directory"
}
convert-all-mov-to-webm() {
for file in file"
done
}
branch-list() {
local base_path="${1:-.}"
find $base_path -type d -name '.git' -exec echo {} ; -exec git -C {} branch ;
}
all-git-branch() {
local base_path="${1:-.}"
find $base_path -type d -name '.git' -exec echo {} ; -exec git -C {} branch ;
}
all-git-pull() {
local base_path="${1:-.}"
find $base_path
-maxdepth 2 -type d
-name ".git"
-execdir python -c 'import os; print(os.path.abspath("."))' ;
-execdir git branch ;
-execdir git pull ;
}
export JAVA_HOME="HOME/Android"
export ANDROID_SDK_ROOT="JAVA_HOME/bin:ANDROID_HOME/Sdk/cmdline-tools:PATH"