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.


Switching between Latex compilers when using vim latex-suite

https://gist.github.com/dineshj1/8f0783ae5211c31a8aa6ea04a9664fa3

Use latexmk with pdflatex as the default compiler. Mapped to <leader><leader>

But now, use latexmk with xelatex as a compiler by using shortcut <leader>x.


Monday, May 9, 2016

Viewing images on remote machine with X11 forwarding

gpicview: http://lxde.sourceforge.net/gpicview/

Easy to install:
./configure
make
make install

Then alias "imshow" to point to the gpicview binary.

After this:
$ imshow <imgfilename>
will display the image.

Monday, April 18, 2016

LaTeX math mode in Microsoft Powerpoint

Writing equations in Powerpoint doesn't have to be a pain. There's Math Mode.
Alt+= will get you there. Mostly LaTeX compatible.

Note: doesn't work on my Powerpoint for Mac 2016 installation. :/ Alt, N, E, I gets you into insert equation mode there, which also mostly recognizes LaTeX-style math entry.

For more handy tips on mathematical presentations in Powerpoint, see:

  • https://www.cs.bu.edu/~reyzin/pptips.html
  • http://www.chem.mtu.edu/~tbco/cm416/EquationEditor_main.pdf


Sunday, April 17, 2016

Look up machine name from IP address

IP address, say, "128.83.139.20".
Simply type:

$ nslookup 128.83.139.20

Output:
Server: 127.0.1.1
Address: 127.0.1.1#53

20.139.83.128.in-addr.arpa name = eldar-9.cs.utexas.edu.