Wednesday, June 15, 2011

Timeline on Latex

One of nicer looking timeline graphs for Latex is by using the chronology package

This is the example:
\usepackage{chronology}
...
\begin{chronology}[5]{1983}{2010}{3ex}{\textwidth}
\event{1984}{one}
\event[1985]{1986}{two}
\event{\decimaldate{25}{12}{2001}}{three}
\end{chronology}


source.

Installing new package in Latex

If you are using linux, the TeX Live is installed on:

/usr/share/texmf-texlive/tex/latex

To install a style file you have to create a directory for it and copy the contents there. Next you have to run the program mktexlsr as root.

Monday, May 16, 2011

Bulk renaming in Debian Linux

The simplest way to this is using a perl script called rename (debian linux only)

I used only substitute strings, but it fully supports filenames which is really cool :)

rename -v 's/oldString/newString/' *.htm

Two sources for this:
http://tips.webdesign10.com/how-to-bulk-rename-files-in-linux-in-the-terminal
http://www.troubleshooters.com/codecorn/littperl/perlreg.htm

Saturday, February 26, 2011

Case sensitive stuff and figures in latex

I had some troubles to link the latex sources done in windows (case insensitive) to compile on linux (case sensitive). In order to fastly solve this problem, first, I run in shell (simply copy/paste in terminal) following code to make all figure files lowercase. This code works only for current directory.

for f in *; do
g=`expr "xxx$f" : 'xxx\(.*\)' | tr '[A-Z]' '[a-z]'`
mv "$f" "$g"
done

However, I found a bit difficult part to rename all the figure links within latex to lowercase. At least not without coding. I didnt have time to check the possibility to edit the code above to so it could be used also within files, but when I come up to this issue again, I might reedit this post.

Thursday, February 10, 2011

X forwarding: Took me long for this discovery :)

VNC works usually pretty well to control PCs remotely. However, sometimes you only want to run just one program from the remote PC (or 64-core server), like matlab.
Better option than VNC is definitely X forwarding.

ssh -l username -X -v servername

Once you login, simply just run the command for your program, and it will be open like a regular program :)

More details on:
http://www.vanemery.com/Linux/XoverSSH/X-over-SSH2.html

There is also a possibility to do the same in windows using putty and Xwin32:
http://www.math.umn.edu/systems_guide/putty_xwin32.html

edit: In order to enable the X forwarding on your own machine, do the following (ubuntu 11.10)

1) Install openssh-server
“sudo apt-get install openssh-server”

2) Edit the file /etc/ssh/ssh_config. Find/uncomment/modify these lines:
ForwardAgent yes
ForwardX11 yes
ForwardX11Trusted yes

3) Edit /etc/ssh/sshd_config. Find/uncomment/modify these lines:
X11Forwarding yes

4) Restart your SSH server.
Earlier, you were playing with init.d, now in Ubuntu it is advised to use this instead:
"sudo service ssd restart"

source: http://www.craigryder.com/linux-ubuntudebetc/x11-forwarding-and-ssh-for-remote-linux-ubuntu-desktop/