Using listings to include code in LaTeX

During the last year I have written several small Matlab programs which I needed to include in my masters thesis which I am writing in LaTeX. The easiest way to do this is using the LaTeX package called listings.

This package makes it very easy to include and highlight all sorts of programming languages. The list of supported languages is quite long:


Continue reading Using listings to include code in LaTeX

Supporting non-technical users through remote desktop

The problem
In ideal world every user knows how to forward ports in NAT routers, use perl-scripts to knock on firewalls, establish ssh-tunnels and start a vncserver. The world is indeed not ideal and from time to time I wish to use establish a remote desktop connection or VNC to a less technical inclined friend to help the solve a problem on their computer.

The ideal but non-existing solution
The ideal solution would be to have piece of software that met the following demands:

  • Cross-platform
  • Secure – uses passwords and encrypts the sesssion
  • Simple

I can easily support Windows and Apple users using TeamViewer a commercial product free for personal use. This program is really easy since it does works trough a NAT router and it is encrypted. The only problem is that it is not cross-platform. That said I can support Windows and Mac users running Teamviewer in wine but I can not use it to support a another Linux user.

Common solutions – never meets all the demands
When looking around on the net it seems that most people are ignorant of at least one of the problems in demands I listed.

Opening ports
Most of the time I see people write that the non-technical user should open ports for VNC in their router. This is crazy-talk. Non-technical users wouldn’t know how to do this and there is also the chance that they don’t have administrator rights on the router. A NAT router accepts all outgoing connections and rejects all incoming connections that don’t have origins inside the NAT. There exists clever ways to get through NAT routers, such as the nat-traverse – Use of UDP to traverse NAT gateways [], but this again is not simple.

No encryption
Another problem often ignored is that VNC connections is unencrypted should be send through a SSH tunnel or similar to avoid bad guys to listen-in. Creating SSH-tunnel requires some technical skills which I don’t assume that non-technical user posses.

The best solution so far
The best solution I have seen so far is the Remote Help Assistant []. This python application tries to accomplish the goal of Teamviewer for Linux users. It is not cross-platform but does try to make the support experience easy and secure for non-technical users. The program is still under development and still needs work since it tells user to open ports in routers if they are behind a NAT router. In any case i think this is closest to the perfect solution I have seen so far and anyone interested should test it and give bug and general feedback so the program can mature.

Continue reading Supporting non-technical users through remote desktop

Lenovo X200 and suspend under Ubuntu 8.10

I had the problem that my brand new Lenovo X200 wouldn’t wake up from suspending under Ubuntu 8.10. My laptop would go to sleep just fine and display the green moon but when waking up again the computer would freeze for a minute or so before the computer restarted by it self. I found this bug report that is identical to my problem:

The solution
The solution, for me at least, was to change the boot parameters to include the line acpi_sleep=s3_bios. This is most easily done by editing the file called /boot/grub/menu.lst in the section starting with #kopt. Change the line that is similar to this:

# kopt=root=UUID=abef640b-ba25-46a3-94d1-5ed838f85f56 ro

so it contains acpi_sleep=s3_bios:

# kopt=root=UUID=abef640b-ba25-46a3-94d1-5ed838f85f56 ro acpi_sleep=s3_bios

After this the command update-grub should be run:

root@euler:~# update-grub

Once the computer has been restarted suspend should work.