remotely connect to Matlab

Prepare two machines. In my case:

  • remote machine (ubuntu 13.04 x64)
  • local machine ( macbook air with Mac OS X 10.8 )

Basic Setup

  1.  Install Matlab application to Ubuntu Desktop.
  2.  By typing the following command in the terminal on the Mac, Matlab would be started in client-side.

ssh -X REMOTE-HOST “matlab -desktop”

Speed Up

Using the default setting would produce  poor performance if it is over 3G connection. Thus, it is recommended to apply the following optimization.

  • Switch to server-side and then create a file call java.opts  with a statement -Dsun.java2d.pmoffscreen=false  under the home directory, or simply run this command:

echo “-Dsun.java2d.pmoffscreen=false” > ~/java.opts

  • we can use SSH with compression and a faster encryption algorithm , blowfish which make the application smoother.

ssh -c arcfour,blowfish-cbc -Y -C -X REMOTE-HOST -p PORT “matlab -desktop”

SSH login without password

  1. run the following command in server-side and client-side to generate SSH key :

    ssh-keygen -t rsa

  2. import the client’s public key to the server:

    cat .ssh/ | ssh REMOTE-HOST ‘ cat >> .ssh/authorized_keys’

Trouble Shooting

matlab: command not found

This error means  the PATH variable is not pointed to it. You have two options to solve such problem.

  • Create a symbolic link in /usr/local/bin and point to the executable binary of Matlab , in my case which is  “/usr/local/MATLAB/R2013a/bin/matlab”.

ln -s /usr/local/bin/matlab “/usr/local/MATLAB/R2013a/bin/matlab”

  • Run the program with absolute path.

ssh -X REMOTE-HOST “/usr/local/MATLAB/R2013a/bin/matlab -desktop”



C Plus / Add: Speeding up Matlab over X11 Forwarding

linux – Remotely Connect to Matlab – Stack Overflow

Linux X11 Connection Rejected Because of Wrong Authentication Error and Solution

解決 Git 不能 push 的問題

我的 Windows 不知幹什麼了,一直以來都有個很奇怪的 Git 問題。用 Git Gui 可以輕鬆就 Push 到 Remote Repository ,但在 Git Bash 或者是 Gui Extensions 就出現了 fatal :the remote end hung up unexpectedly 的錯誤。後來研究 Nodejs 連系統都轉用 Ubuntu ,這個問題便不了了之。最近有個專案使用到 MVC3 ,重歸 Windows 後不能自如地 push ,就整個很不爽了。今天終於找到解決方法,問題在於SSH client。

  1.  開啓 Git Extensions 後按 Settings > Ssh
  2. 在 Specify which ssh client to use 中選擇 Other ssh client
  3. 在右邊的方格找出 ssh 路徑 ,通常是 C:\Program Files (x86)\Git\bin\ssh.exe

按確定後開啓 Git Bash ,輸入 git push ,錯誤訊息不再出現了。