Wednesday, July 20, 2016

How to merge folders from command line in Linux

The standard mv has no way to do this. Instead, use rsync.

rsync -av <source_folder> <target_folder> --remove-source-files

See: http://unix.stackexchange.com/questions/127712/merging-folders-with-mv

Tuesday, July 19, 2016

How to monitor the progress of system commands like mv, cp, rsync in Linux

http://unix.stackexchange.com/a/144284

https://github.com/Xfennec/progress


$ git clone git@github.com:Xfennec/progress.git
$ export PREFIX=<install_location>
$ make
$ make install

Then, to continuously monitor commands like mv, cp, rsync etc. simply run:
$ watch progress -q

Wednesday, June 1, 2016

Matlab's keyboard command, but for IPython

Add the following to the preamble.
from IPython.core.debugger import Tracer; debug_here = Tracer()
Then in code, you can call "debug_here()" where you'd use "keyboard" in Matlab.

Thursday, May 26, 2016

YouCompleteMe setup on remote Linux machine (vision)

.vimrc:

vundle link:
valloric/YouCompleteMe

compilation:
cd .vim/bundle/YouCompleteMe
./install.py --clang-completer

To avoid issue "HTTPConnectionPool(): Read timed out. (read timeout=0.5)", reported at:  https://github.com/Valloric/YouCompleteMe/issues/777

change one line per: https://github.com/Valloric/YouCompleteMe/issues/777#issuecomment-42033173





Wednesday, May 18, 2016

neovim from source



git clone https://github.com/neovim/neovim
cd neovim
rm -r build/
make CMAKE_EXTRA_FLAGS="-DCMAKE_INSTALL_PREFIX:PATH=<custom-install-location>"
make install

pip install --upgrade --force-reinstall neovim

Wednesday, May 11, 2016

Color differences between normal terminal and tmux terminal

In ~/.tmux.conf:
      set -g default-terminal "screen-256color"

In .bashrc or .profile:
     export TERM=xterm-256color
   alias tmux ="TERM=xterm-256color tmux"

-------------------------------------------------------------------------

Updated: 5/11/16

Actually, everything works okay with just the change in ~/.tmux.conf...

I removed:
export TERM=xterm-256color from .bashrc
alias tmux="TERM=xterm-256color tmux" from .profile


Discovered this when trying to overcome the following problem created by running tmux in xterm-256color mode. Matlab in commandline mode inside tmux does not recognize home and end keys etc. Displays them as "[~1" etc. rather than moving the cursor.