Skip to content

Commit

Permalink
Added exiftool, shifted bash alises to config directory, minor updates
Browse files Browse the repository at this point in the history
  • Loading branch information
rsnk96 committed Feb 15, 2020
1 parent 84c2474 commit 2b0e9a3
Show file tree
Hide file tree
Showing 4 changed files with 38 additions and 46 deletions.
42 changes: 5 additions & 37 deletions 1-BasicSetUp.sh
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,8 @@ if [[ ! -n $CIINSTALL ]]; then
sudo apt-get dist-upgrade -y
sudo apt-get install ubuntu-restricted-extras -y
fi
#sudo ubuntu-drivers autoinstall

# My choice for terminal: Tilda+tmux
# Choice for terminal that will be adopted: Tilda+tmux
# Not guake because tilda is lighter on resources
# Not terminator because tmux sessions continue to run if you accidentally close the terminal emulator
execute sudo apt-get install git wget curl -y
Expand Down Expand Up @@ -83,29 +82,9 @@ sudo chsh -s "$(command -v zsh)" "${USER}"

execute sudo apt-get install aria2 -y

touch /opt/.zsh/bash_aliases
# Create bash aliases
cp ./config_files/bash_aliases /opt/.zsh/bash_aliases
ln -s /opt/.zsh/bash_aliases ~/.bash_aliases
spatialPrint "Adding aliases to ~/.bash_aliases"
{
echo "alias jn=\"jupyter notebook\""
echo "alias jl=\"jupyter lab\""
echo "alias maxvol=\"pactl set-sink-volume @DEFAULT_SINK@ 150%\""
echo "alias download=\"wget --random-wait -r -p --no-parent -e robots=off -U mozilla\""
echo "alias server=\"ifconfig | grep inet && python3 -m http.server\""
echo "alias gpom=\"git push origin master\""
echo "alias update=\"sudo apt update && sudo apt full-upgrade -y && sudo apt autoremove -y\""
echo "alias aria=\"aria2c --file-allocation=none -c -x 10 -s 10\""
echo "alias tsux=\"tmux -u new-session \\; \\
neww \\; \\
send-keys 'htop' C-m \\; \\
split-window -h \\; \\
send-keys 'nvtop' C-m \\; \\
split-window -v \\; \\
send-keys 'watch sensors' C-m \\; \\
rename-window 'performance' \\; \\
select-window -l\""

} >> ~/.bash_aliases

# Now create shortcuts
execute sudo apt-get install run-one xbindkeys xbindkeys-config wmctrl xdotool -y
Expand Down Expand Up @@ -133,14 +112,11 @@ execute /opt/anaconda3/bin/conda clean --all -y
execute /opt/anaconda3/bin/conda install ipython -y

execute /opt/anaconda3/bin/conda install libgcc -y
execute /opt/anaconda3/bin/pip install numpy scipy matplotlib scikit-learn scikit-image jupyter notebook pandas h5py cython
execute /opt/anaconda3/bin/pip install numpy scipy matplotlib scikit-learn scikit-image jupyter notebook pandas h5py cython jupyterlab
execute /opt/anaconda3/bin/pip install msgpack
execute /opt/anaconda3/bin/conda install line_profiler -y
sed -i.bak "/anaconda3/d" ~/.zshrc

execute /opt/anaconda3/bin/pip install autopep8 scdl youtube-dl jupyterlab
echo "alias ydl=\"youtube-dl -f 140 --add-metadata --metadata-from-title \\\"%(artist)s - %(title)s\\\" -o \\\"%(title)s.%(ext)s\\\"\"" >> ~/.bash_aliases

execute /opt/anaconda3/bin/conda info --envs

spatialPrint "Adding anaconda to path variables"
Expand Down Expand Up @@ -168,21 +144,13 @@ spatialPrint "Adding anaconda to path variables"

## Detect if an Nvidia card is attached, and install the graphics drivers automatically
if [[ -n $(lspci | grep -i nvidia) ]]; then
spatialPrint "Installing Display drivers and any other auto-detected drivers for your hardware"
execute sudo add-apt-repository ppa:graphics-drivers/ppa -y
execute sudo apt-get update
execute sudo ubuntu-drivers autoinstall
fi

# echo "The PC will restart now. Check if your display is working, as your display driver would have been updated. Hit [Enter]"
# echo "Also, when installing CUDA next, ********don't******* install display drivers."
# echo "In case your drivers don't work, purge gdm3 and use lightdm (sudo apt-get purge lightdm && sudo dpkg-reconfigure gdm3)"
# read temp


spatialPrint "The script has finished."
if [[ ! -n $CIINSTALL ]]; then
# echo "The terminal instance will now close so that the shell changes can take place"
# read -p "Press [Enter] to continue..." temp
# kill -9 $PPID
su - $USER
fi
21 changes: 13 additions & 8 deletions 3-ML-Basic.sh
Original file line number Diff line number Diff line change
Expand Up @@ -23,15 +23,20 @@ execute () {
fi
}

# Executes first command passed &
# echo's it to the file passed as second argument
run_and_echo () {
eval $1
echo "$1" >> $2
}


if [[ (! -n $(echo $PATH | grep 'cuda')) && ( -d "/usr/local/cuda" ) ]]; then
echo "Adding Cuda location to PATH"
{
echo "# Cuda"
echo "export PATH=/usr/local/cuda/bin:\$PATH"
echo "export LD_LIBRARY_PATH=/usr/local/cuda/lib64:/usr/local/cuda/extras/CUPTI/lib64:\$LD_LIBRARY_PATH"
echo "export CUDA_HOME=/usr/local/cuda"
} >> $SHELLRC
source $SHELLRC
run_and_echo "# Cuda" $SHELLRC
run_and_echo "export PATH=/usr/local/cuda/bin:\$PATH" $SHELLRC
run_and_echo "export LD_LIBRARY_PATH=/usr/local/cuda/lib64:/usr/local/cuda/extras/CUPTI/lib64:\$LD_LIBRARY_PATH" $SHELLRC
run_and_echo "export CUDA_HOME=/usr/local/cuda" $SHELLRC
fi

if which nvidia-smi > /dev/null; then
Expand Down Expand Up @@ -61,7 +66,7 @@ else
PIP="sudo pip3 install"
fi

execute sudo apt-get install libhdf5-dev
execute sudo apt-get install libhdf5-dev exiftool ffmpeg -y

# Install opencv from pip only if it isn't already installed. Need to use `pkgutil` because opencv built from source does not appear in `pip list`
if [[ ! $(python3 -c "import pkgutil; print([p[1] for p in pkgutil.iter_modules()])" | grep cv2) ]]; then
Expand Down
2 changes: 1 addition & 1 deletion Build-OpenCV.sh
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ execute sudo apt-get install libeigen3-dev libtbb-dev -y
spatialPrint "Optional Dependencies"
execute sudo apt-get install libprotobuf-dev protobuf-compiler -y
execute sudo apt-get install libgoogle-glog-dev libgflags-dev -y
execute sudo apt-get install libhdf5-dev -y
execute sudo apt-get install libhdf5-dev exiftool -y
# execute sudo apt-get install doxygen sphinx-common texlive-latex-extra -y
execute sudo apt-get install libfreetype6-dev libharfbuzz-dev -y

Expand Down
19 changes: 19 additions & 0 deletions config_files/bash_aliases
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
alias jn="jupyter notebook"
alias jl="jupyter lab"
alias maxvol="pactl set-sink-volume @DEFAULT_SINK@ 150%"
alias download="wget --random-wait -r -p --no-parent -e robots=off -U mozilla"
alias server="ifconfig | grep inet && python3 -m http.server"
alias gpom="git push origin master"
alias update="sudo apt update && sudo apt full-upgrade -y && sudo apt autoremove -y"
alias aria="aria2c --file-allocation=none -c -x 10 -s 10"
alias tsux="tmux -u new-session \; \
neww \; \
send-keys 'htop' C-m \; \
split-window -h \; \
send-keys 'nvtop' C-m \; \
split-window -v \; \
send-keys 'watch sensors' C-m \; \
rename-window 'performance' \; \
select-window -l"
alias ydl="youtube-dl -f 140 --add-metadata --metadata-from-title \"%(artist)s - %(title)s\" -o \"%(title)s.%(ext)s\""
alias cat="bat -p"

0 comments on commit 2b0e9a3

Please sign in to comment.