Try   HackMD

~/.bashrc: executed by bash(1) for non-login shells.

see /usr/share/doc/bash/examples/startup-files (in the package bash-doc)

for examples

If not running interactively, don't do anything

case $- in
i) ;;
*) return;;
esac

don't put duplicate lines or lines starting with space in the history.

See bash(1) for more options

HISTCONTROL=ignoreboth

append to the history file, don't overwrite it

shopt -s histappend

for setting history length see HISTSIZE and HISTFILESIZE in bash(1)

HISTSIZE=1000
HISTFILESIZE=2000

check the window size after each command and, if necessary,

update the values of LINES and COLUMNS.

shopt -s checkwinsize

If set, the pattern "**" used in a pathname expansion context will

match all files and zero or more directories and subdirectories.

#shopt -s globstar

make less more friendly for non-text input files, see lesspipe(1)

[ -x /usr/bin/lesspipe ] && eval "$(SHELL=/bin/sh lesspipe)"

set variable identifying the chroot you work in (used in the prompt below)

if [ -z "

Misplaced &(cat /etc/debian_chroot)
fi

set a fancy prompt (non-color, unless we know we "want" color)

case "$TERM" in
xterm-color|*-256color) color_prompt=yes;;
esac

uncomment for a colored prompt, if the terminal has the capability; turned

off by default to not distract the user: the focus in a terminal window

should be on the output of commands, not on the prompt

#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 [ "

colorprompt"=yes];thenPS1={debian_chroot:+($debian_chroot)}[\033[01;32m]\u@\h[\033[00m]:[\033[01;34m]\w[\033[00m]$ '
else
PS1='
\({debian_chroot:+(\)
debian_chroot)}\u@\h:\w$ '
fi
unset color_prompt force_color_prompt

If this is an xterm set the title to user@host:dir

case "

TERM"inxterm|rxvt)PS1="\[\e]0;{debian_chroot:+(
Extra close brace or missing open brace
PS1"
;;
*)
;;
esac

enable color support of ls and also add handy aliases

if [ -x /usr/bin/dircolors ]; then
test -r ~/.dircolors && eval "

(dircolorsb /.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

colored GCC warnings and errors

#export GCC_COLORS='error=01;31:warning=01;35:note=01;36:caret=01;32:locus=01:quote=01'

some more ls aliases

alias ll='ls -alF'
alias la='ls -A'
alias l='ls -CF'

Add an "alert" alias for long running commands. Use like so:

sleep 10; alert

alias alert='notify-send urgency=low -i "$([

Misplaced &(history|tail -n1|sed -e '''s/^\s*[0-9]+\s*//;s/[;&|]\s*alert$//''')"'

Alias definitions.

You may want to put all your additions into a separate file like

~/.bash_aliases, instead of adding them here directly.

See /usr/share/doc/bash-doc/examples in the bash-doc package.

if [ -f ~/.bash_aliases ]; then
. ~/.bash_aliases
fi

enable programmable completion features (you don't need to enable

this, if it's already enabled in /etc/bash.bashrc and /etc/profile

sources /etc/bash.bashrc).

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

bashrc

export PATH="/usr/share/dotnet:

PATH"exportPYENVROOT="HOME/.pyenv"
export PATH="
PYENVROOT/bin:
PATH"
if command -v pyenv 1>/dev/null 2>&1; then
eval "$(pyenv init -)"
fi

Cuda

export CUDAHOME=/usr/local/cuda-11.1
export PATH=

CUDAHOME/bin:{CUDAHOME}/NsightCompute-2019.3
\({PATH:+:\)
{PATH}}
export LD_LIBRARY_PATH=
CUDAHOME/lib64
{LD_LIBRARY_PATH:+:${LD_LIBRARY_PATH}}

Export paths

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

Unreal Engine

UE_HOME=/home/jitesh/3d/UnrealEngine

function unrealbuild {
CURR_DIR=pwd;
PROJ_NAME=$(basename ${1%.uproject});
$UE_HOME/Engine/Build/BatchFiles/Linux/Build.sh

PROJNAMELinuxDevelopmenteditorrecompile"{CURR_DIR}/${PROJ_NAME}.uproject" -progress -editor -game -NoHotReloadFromIDE
}
complete -f -X '!*.@(uproject)' unrealbuild

function unrealeditor {
DIR="

(cd"( dirname "$i" )" && pwd )"
$UE_HOME/Engine/Binaries/Linux/UE4Editor $DIR/$1
}
complete -f -X '!*.@(uproject)' unrealeditor

function unrealgen {
DIR="

(cd"( dirname "$i" )" && pwd )"
pushd
UEHOME./GenerateProjectFiles.shproject="
DIR/$1" -game -engine -editor
popd
}
complete -f -X '!*.@(uproject)' unrealgen

For automation tests, if used

function unrealtest {
DIR="

(cd"( dirname "$i" )" && pwd )"
$UE_HOME/Engine/Binaries/Linux/UE4Editor $DIR/$1 -Game -ExecCmds="Automation RunTests $2" -log
}
complete -f -X '!*.@(uproject)' unrealtest

Zip into parts

slack_zip()
tar cvzf - $1 split bytes=950MB - $(basename $1).tar.gz.

zip_targz_in_parts()
# Example: $1=dataset_dir $2=. $3=200MB
tar cvzf - $1 split -b $3 - $(realpath -s

2)/(basename $1).tar.gz.

unzip_targz_parts()
cat ${1}.* tar xzvf -

tar_compress

tar_compress() {
tar cvzf $(basename $1).tar.gz $1
}
tar_extract() {
tar xvzf $1
}

zip_slack

zip_slack()
CHECK="du -hs --block-size=M $1"
CHECK=

Extra open brace or missing close brace(echo "$CHECK > "999"" bc -l) ));
then
echo "big"
tar cvzf - $1| split bytes=950MB - $(basename $1).tar.gz.
else
echo "small"
tar cvzf $(basename $1).tar.gz $1
fi

NDDS output data postprocessing

postprocessing_data.() {
/home/jitesh/3d/venv/bin/python /home/jitesh/3d/data/src/data_postprocessing.py -f $1 -c $2
}

Reinstall a repository from PT-ML

install-from-pt() {
pip install https://github.com/PT-ML/$(basename $1).git
}

Reinstall a repository from cm107

reinstall() {
pip uninstall

1pipinstallhttps://github.com/cm107/(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'

Copy multiple times

copy2multiple() {
tee <(basename $1).png o{$2..$3}.png >/dev/null
}

Make a new folder

folder() {
mkdir $1 && cd $1
}

Replace a string in multiple files

replace-in-files() {
sed -i 's/$1/$2/g' $3
}

Connecting Diff Server

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 a repository from cm107

reinstall()
pip uninstall

1pipinstallpyclay(basename $1)
}
reinstall.all() {
yes pip uninstall pyclay-annotation_utils pyclay-common_utils pyclay-logger pyclay-streamer
pip install pyclay-annotation_utils
pip install pyclay-common_utils
pip install pyclay-logger
pip install pyclay-streamer

Copy multiple times

copy2multiple() {
tee <(basename $1).png o{$2..$3}.png >/dev/null
}

Make a new folder

folder() {
mkdir $1 && cd $1
}

Replace a string in multiple files

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 initialize >>>

!! Contents within this block are managed by 'conda init' !!

__conda_setup="$('/home/jitesh/miniconda3/bin/conda' 'shell.bash' 'hook' 2> /dev/null)"
if [

?eq0];theneval"__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

<<< conda initialize <<<

export PYENV_ROOT="

HOME/.pyenv"exportPATH="PYENV_ROOT/bin:
Misplaced &
(pyenv init -)"
fi

upload_graph() {
ts
python upload_events.py folder $1
}

export HARUHOME="/home/haru"

# doc-18 Unity-Ros interaction

## My PC

export ROS_MASTER_URI=http://$HOSTNAME:11311

export ROS_HOSTNAME=$HOSTNAME

export ROS_IP=$(ip route get 8.8.8.8 | awk -F"src " 'NR==1{split($2,a," ");print a[1]}')

Use Real Haru

export ROS_MASTER_HOSTNAME="haru-47"
export ROS_MASTER_URI=http://

ROSMASTERHOSTNAME:11311/exportMYIP=(ip route get 8.8.8.8 | awk -F"src " 'NR==1{split(
Extra close brace or missing open brace
MY_IP
export ROS_HOSTNAME=$ROS_IP

alias connect-haru="ssh haru@

ROSMASTERHOSTNAME"aliasconnecthar="sshpasspharusshharu@ROS_MASTER_HOSTNAME"

Make a new folder

folder() {
mkdir $1 && cd $1
}

Replace a string in multiple files

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 "

1"c:vlibvpxvp9crf33b:v0speed4"{strarr[0]}.webm"
yes ffmpeg -i "
1"c:vlibvpxqualitygoodcpuused0b:v7000kqmin10qmax42maxrate500kbufsize1500kthreads8vfscale=1:1080c:alibvorbisb:a192kfwebm"
{strarr[0]
.webm"
mv "${strarr[0]}.webm" webm/
echo "Moved ${strarr[0]}.webm to webm/ directory"
}

convert-all-mov-to-webm() {
for file in

1/.movdoconvertmovtowebm"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 ;
}

Android

export JAVA_HOME="

HOME/JDK/jdk11.0.18"exportANDROIDHOME="HOME/Android"
export ANDROID_SDK_ROOT="
HOME/Android/Sdk"PATH="
JAVA_HOME/bin:
ANDROIDSDKROOT:
ANDROID_HOME/Sdk/cmdline-tools:
ANDROIDHOME/Sdk/platformtools:
PATH"