Useful LaTeX Tools

LaTeX is a great typeset software in writing academic papers.

Here I give out some useful tools bundled with LaTex (details can be found via man in Linux/Unix systems).

latexmk – generate LaTeX document

latexmk -c Clean up (remove) all regeneratable files generated by latex and bibtex or biber except dvi, postscript and pdf.

latexdiff – determine and markup differences between two latex files

A typical usage of latexdiff is
latexdiff old.tex new.tex > diff.tex
Before running the command, do not forget to run bibtex to generate bbl files if you use bibtex. If you have multiple files with main.tex files, you can run the following command,
latexdiff --append-safecmd=subfile v1/main.tex v2/main.tex --flatten > diff.tex
Finally, you can typeset diff.tex and see the differences. This functionality is extremely useful if you work with others.

Theme Changed

Yeah~ I finally changed the theme of my website after many years later.

I miss the old theme, which is good and has a global map showing all the visits but not mobile friendly.

Hence, I have got this default theme (dark) to be a mobile friend =w=
The theme is somehow like wikipedia, isn’t it?

Tunnelling via SSH

Sometimes, the access to the lab/office computer is necessary. However, the university/company/organisation blocks my direct connection by its firewall, which is not good 🙁

Nevertheless, we can SSH to some computers in DMZ and then tunnelling to the lab/office computer for some specific applications.

Here, we leverage the forward function of SSH as following:
ssh -L port:host:hostport user@hostname

For example, we connect to a RDP server via SSH tunnel.

First, start the tunnel by
ssh -L 3389:123.123.123.123:3389 username@example.com
Above code starts a tunnel to 123.123.123.123:3389 where 123.123.123.123 is the RDP server ip address and 3389 is the RDP port.

Secondly, connect to 127.0.0.1:3389 via any RDP client.

Fast access to UoW databases via EZproxy

University of Wollongong uses a software called EZproxy that enables UoW students or staffs to access the academic databases when off campus.

However, it is not convenient to click a lot of links before you get to the database page. Most of time, you will find the paper in the database first via Google or other search engine. Then you goes to the UoW library and find the related papers.

Sometimes, I hate the summon system in the library and prefer going to the database website directly.

So… I wrote a javascript bookmarklet.

Usage:

  1. Drag the link EZproxy to the bookmark bar
  2. Go to the database website (e.g. SpringLink)
  3. Click the bookmark
  4. Enter your student/staff username and password (ask only once)
  5. Done

Enjoy!

NBSiki created!!!

NBSiki (Chinese) a.k.a. Neural Basis of Synesthesia Wikipedia <– A wikipedia for NBS!

Click above link to browse the site and share your knowledge of NBS!

————————————————–

NBSiki (中文) 即 Neural Basis of Synesthesia Wikipedia 联觉神经基础维基百科(简称:神基式) <– 一个NBS自己的百科

点击上面的链接来浏览该百科,并创造和分享你关于NBS的知识吧!

Way to rollback or revert SVN repository

Sometimes we want to revert a svn repository because of bad commits.

Here is a quote from: http://stackoverflow.com/questions/2324999/revert-a-svn-folder-to-a-previous-revision

Assuming you want to revert from current HEAD (last commited) version to revision 268:

cd folder svn up svn merge -r HEAD:268 . 

Then resolve any conflicts manually (there should be nothing if there is no local change) and:

svn commit "- reverted to revision 268" 

To revert single change (e.g. made in revision 666):

cd folder svn merge -c -666 . 

To revert local changes (not committed yet):

cd folder svn revert -R . 

Let a mac application run in default language as you like

To do that, just use ‘defaults’ command.

The usages is simply:

default [command] [domain] [attribute] [value]

If I want to change the default language of com.apple.mail to be English while the whole system is in Chinese, just type in terminal:

defaults write com.apple.mail AppleLanguages ‘(“en”, “zh”)’

It will search for English language pack first, then Chinese.