Archive for 5th February 2010

SSH tunneling and example Python client-server codes

This document demonstrates how we could run client-server software via SSH. The main purpose of using this technique relies on that on most HPC servers most of the IP ports are nromally blocked except for the SSH port 22.

  1. SSH tunneling settings in PuTTY
    In this case, the server port 8888 is mapped to the local port 7777. The meaing of this is simple: once connected to the server using PuTTY, any data on the server sent/received at port 8888 will be redirect to the port 7777 of the local machine (the computer you are using PuTTY at the moment). As a result, any client software running on the client computer can communicate with the server program via the local port 7777.
    Continue reading ‘SSH tunneling and example Python client-server codes’ »

Formlayout – an user-friendly way to interact

Continue reading ‘Formlayout – an user-friendly way to interact’ »

Bash: exit codes for background jobs

Useful commands:

  • wait <pid>: wait the background job with specified pid to be finished and return the exit code ( hint: stored in $? )
  • jobs -p: list the pids of all the background jobs (hint: use for statement of bash to loop over each process)
  • ( sleep 30s; /bin/false ) & : generate a background testing job with a error exit code

Continue reading ‘Bash: exit codes for background jobs’ »