Jeff Mangum's Software Stuff

TIP Last Update: JeffMangum - 21 October 2015


Remote Desktop Connection to the SCO or CVPOST Clusters

The following is a rather general description of how to connect from a local computer (that can be anywhere) to a remote cluster node. In the following we assume that you have an active reservation on the lustre node cvpost666 (reservations are currently not necessary on sciops). I have also listed equivalent commands for connecting to SCO in parentheses following the relevant CVPOST commands:

Starting Your VNC Server and Setting-Up an SSH Tunnel

  1. If this is your first time running VNC on the host computer (NRAO or SCO lustre) computing system, you need to set your VNC password as follows:
    1. Log into the lustre node:
      1. ssh -AY ssh.cv.nrao.edu (or ssh -AY login.alma.cl)
      2. ssh -AX cvpost666.cv.nrao.edu (or ssh -AX sciops01.sco.alma.cl)
    2. In the terminal window on the remote (lustre) computer, type at the Linux prompt: vncpasswd
    3. Enter your chosen VNC server password. Remember, this password MUST be different from your NRAO or ALMA Linux account password as it will be shared with support staff when you require assistance.
  2. Start the VNC server on the lustre node computer:
    1. Log into the lustre node (you can use the same login session as you started above if you wish):
      1. ssh -AY ssh.cv.nrao.edu (or ssh -AY login.alma.cl)
      2. ssh -AX cvpost666.cv.nrao.edu (or ssh -AX sciops01.sco.alma.cl)
    2. Once you are logged into the lustre node, and regardless of your remote computer:
      1. At the Linux prompt on cvpost666, type: vncserver. If you have a big monitor connected, you can use something like vncserver -geometry 1400x900, which will give you a lot of real estate to work with during your VNC session but will not consume your entire monitor screen.
      2. Once you have typed vncserver, the system will reply (e.g.) New 'cvpost666:1 (USERNAME)' desktop is cvpost666:1. In this case, your VNC session number is 1. Remember this number since you will need it later. In the instructions below, the VNC session number is designated as X.
  3. Open up an SSH tunnel from your local computer to the luster node. Do this by starting another terminal on your local computer and typing (the "Y" is a free local port on your machine, while the "X" in the port number is your VNC server session number from above):
    1. ssh -N -C -L 590Y:cvpost666.cv.nrao.edu:590X YOURLOGIN@ssh.cv.nrao.edu (or ssh -N -C -L 590Y:sciops01.sco.alma.cl:590X YOURLOGIN@login.alma.cl)
  4. For the "Y" in the above, consider the following:
    • If you are running the Apple Remote Desktop Manager (installed in October 2007 on many Macs in CV by CIS), you cannot use "0", as this remote desktop application uses port 5900.
    • A good start is to try "1", but higher numbers may be necessary.
    • It's easiest to make X = Y for simplicity.
    • If you have trouble finding a free port use netstat -a | grep 59 to list all ports in use.
  5. If you are connecting to the host computer from another network, you will be prompted for your host login password.

Starting Your Local VNC Viewer

  1. Start the VNC viewer on your local computer. There are quite a few VNC client viewers in use:
    1. Screen Sharing on OSX (built-in): available in newer versions of Mac OSX:
      1. Open the Finder.
      2. Under the "Go" pulldown menu, choose "Connect to Server" (or type Command-K)
      3. Specify vnc://cvpost666.cv.nrao.edu:590X (where X is specified as above).
      4. Enter your vnc password as above. You can manage this password in your keychain if you want.
    2. Chicken: A favourite of Mac users. It has recently shown signs of its age and lack of support, though.
      1. Start Chicken.
      2. Go to Connection, Open Connection
      3. Enter Host = localhost, Display = Y, your password, check Remember Password, and check Allow other clients to connect. The "Y" in the display parameter above is the "Y" in the port number chosen above.
      4. Hit the Connect button.
    3. RealVNC: A free VNC viewer that works well on Macs.
      1. Start RealVNC.
      2. From the VNC Viewer menu select Launch Listening VNC Viewer. This will start a listener process from which you can open multiple VNC connections. An icon on the top menu bar will appear.
      3. From the VNC listening icon select New Connection...
      4. Enter your VNC server address and port number: localhost:1 (assuming you have set up an ssh tunnel as instructed above).
      5. Select Connect. You will get a warning about this being an insecure connection, even if you have tunneled through ssh (it does not seem to be smart enough to know that you have setup an ssh tunnel...). Select Continue. This behaviour is normal. Rest assured that your connection is secure.
      6. You will next get a popup asking for your "Password". This is your VNC password that RealVNC wants. Enter it and select OK.
    4. Tiger VNC:
      1. Similar to RealVNC (apparently...have not used)
    5. vncviewer: Apparently a linux-based VNC client that I have not used...
    6. remmina: the default remote desktop client on Ubuntu. Details TBD.
  2. The VNC Viewer window to cvpost666 will now appear.
  3. If you want to be able to cut-copy-paste to-from your local computer and your VNC session, type the command vncconfig in one of your VNC session's terminals. This trick seems to work for the RealVNC and TigerVNC clients.

-- JeffMangum - 2015-10-21

Wget Tips

It is often useful to be able to use wget to grab information on a web site. To do this using:
  • Compression
  • Putting it in the background
  • Bypassing any robots.txt restrictions
...use the following command...

wget -b -e robots=off --wait 1 -rc -nH --cut-dirs=1 --header="accept-encoding: gzip" --user=Chicken --password=Butt https://archive.nrao.edu/secured/ChickenButt/

-- JeffMangum - 2012-05-16

Python Tips

Useful Packages

Many of the packages listed below have dependences on other packages (and each other). See the associated web links for further information.

  • python astronomy packages listing: Very thorough listing of python packages for astronomy. Contains many of the packages listed below.
  • matplotlib: Great 2D plotting library which produces publication-quality plots. I use this extensively for analysis of antenna positioning analysis.
  • SciPy: Mathematics and statistics package. Requires Numpy.
  • Numpy: Fundamental scientific computing package upon which many (i.e. SciPy) other mathematic and statistical packages are built.
  • APLpy: Produces publication-quality plots of astronomical data in FITS format. Very easy to use and very slick!
  • pywip: Python wrapper for the popular WIP plotting package (part of the miriad analysis package).
  • PyFITS: Python interface to FITS files.
  • pySLALIB: Python port of Pat Wallace's SLALIB library.
  • physcon.py: Physical constants library. Saves having to define constants. Just "import physcon as pc" or something similar and you have a reasonably good list of physical constants at your disposal.
  • Profiling Images:

Gnuplot Tips and Tricks

Simple Function Plotting

Plot two versions of a somewhat complicated function of Az:

gnuplot> set terminal x11 1 enhanced font "arial,15"
gnuplot> set title "HESA3 and HESA3" 0,0
gnuplot> set xlabel "Azimuth (deg)"
gnuplot> set ylabel "Arcsec"
gnuplot> set autoscale
gnuplot> set angle degrees
gnuplot> de(az)=-1.41*sin(3*az)+0.25*cos(3*az)
gnuplot> de2(az)=-0.97*sin(3*az)-0.46*cos(3*az)
gnuplot> plot [az=0:360] de(az) 1, de2(az) 3

Then to make a hardcopy:

gnuplot> set terminal jpeg
gnuplot> set output "HESA3HECA3.jpg"
gnuplot> replot
gnuplot> set output
gnuplot> set term x11

The plot looks like this:
HESA3HECA3.jpg

-- JeffMangum - 18 Nov 2008
Topic revision: r8 - 2015-10-21, JeffMangum
This site is powered by FoswikiCopyright © by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding NRAO Public Wiki? Send feedback