Tuesday, May 15, 2007

Ganga Job submit() over Grid ... could have never started!! :-D

He he he!!! :)

It was some hours that I tried to submit an Athena job over the Grid with Ganga...

...the job was "loaded" fine, but it remained always in the "new" status.

In the end...I discovered that I mispelled the submit command into my python job script....

....in the last line I used

job.submit

instead of

job.submit()

Ah ah ah!!!! :-D ;-) Hence the numerous jobs I launched...never started!!!!!!! :-D Ah ah ah!!! :-P

Ehy Ma, Pay attention!! ;-)

How to fix "cannot access parent directories" shell error. (Also with Ganga,DQ2 on Grid)

If you are working in a shell and you get an error like this:

shell-init: error retrieving current directory: getcwd: cannot access parent directories: No such file or directory

probably you are working in a directory you have deleted from within another shell. I.e. you are in shell A and you are working within /home/Joe/test/ folder. After a while you open a new shell B and you work there. After completed your work you delete the folder /home/Joe/test/ folder and close the shell B. After a while you come back to shell A and start to work there...and you get the Mistery error message, because actually you are working in a deleted directory! ;-)

Try this at the prompt [trust me, it's ugly but safe! :-) ] :

ls $(pwd) && ls /etc/
cd /

first you get an error like "No such file or directory", because the working folder has been previously deleted and doesn't exist anymore. But then, if you move to an existing directory, the problem is fixed! :-)

P.S. You can get this error also working with Ganga and DQ2. If you are working in a .../Local/jobid directory (e.g. in order to read the 'stdout' file) of a Job that you have deleted from withing Ganga CLIP (Command Line IPython Interpreter) with the command jobs[jobid].remove() and try to use dq2_get in order to retrieve an output from the Grid, you get exactly the same error above. Try the same solution.

Good work! :-)

Tuesday, May 8, 2007

How to fix the TortoiseSVN "invalid port number" problem

I waste a while to find the solution to this problem, searching the web and trying and melting various recipes. The following solution worked fine for me, both for plain TortoiseSVN under Windows.

Problem: When you try to connect to the repository hosted by another machine over a network (LAN or Internet) with SSH protocol, using PuTTY as client, you get an error like this:

"Invalid Port Number"

and after that the connection hangs or falls down.


Solution: Right-Click into a whichever folder; a pop-up menu shows up. Open the "TortoiseSVN" and then the "Settings" menu. Check the "Network" section: the "SSH client" field must be empty.

Now open PuTTY.exe and check the name you give to the session for connecting the machine where your SVN repository is. Assume you named "mysvnhost" the session to connect the "host.example.net" machine.

Now you have to use this name at the place of the machine name, when you set the address for the "svn+ssh" access protocol. For example like this:

svn+ssh://username@mysvnhost/folder/folder/svn/repository/trunk/

Friday, May 4, 2007

How to safely use backspace with VI editor under linux?

Sometimes, when you log on a linux machine and try to edit a file with VI editor, you get characters like '?>' when you click on backspace in order to delete a string. How to fix it?

Solution:

In your HOME directory (if you don't know where is it, just type 'cd' at the prompt) edit your .bashrc (or your .bash_profile) file and add these lines:

#Let VI work with Backspace
echo "I run 'stty sane'"
stty sane
echo "Done"

The .bashrc file is loaded (and sourced) every time you log in the machine or you start a shell; so your VI will properly work for ever since now on! : )

P.S. I like to know what my .bashrc does, but if you prefer you can delete the echo lines, of course.

Thursday, May 3, 2007

how to show the MAC address, IP, Host Name and Gateway on Windows with ipconfig

Do you want to know your MAC address (the physical address of your Ethernet LAN card) on your Windows machine?

Open a Command Prompt window and type:

ipconfig /all

You'll get many parameters; among them the most useful are:

  • Host name --> Your machine name. You can use this name to connect to your machine from within other machines in your LAN;
  • Physical address --> Your Ethernet card MAC-address;
  • IP address --> The IP address for your machine. If you are connected in a company or university LAN, your IP should not change. And normally it doesn't change even if you connect your desktop or laptop via a router in a domestic LAN. If you use a Ethernet or USB modem (and not a Router) to connect your PC or notebook to your Internet provider (both Dial-Up via telephone or ADSL), your IP should change every time you connect to your provider server;
  • Default Gateway --> The IP address of the machine it's physically connected to the Internet and is used like router/filter between the private LAN and the external Internet. In a big LAN the Gateway is usually a physical machine; in small or home LAN it's usually the router box.


Wednesday, May 2, 2007

PyDev + Eclipse Error Message. How to configure the Python interpreter

If you installed the PyDev plugin into Eclipse, you may get this message when you start up Eclipse:

An internal error occurred during: "PyDev code completion: rebuilding modules"

It means that, during the rebuilding of the Code Completion Tool, the Python interpreter has not been found. It happens when your Python system was not installed on the default folder (c:\Python); for example mine is installed in D:/Programs/Python. Yes I know, it's not a good practice and it's not suggested in the Python documention.


Solution:

How to set the Python system PYTHONPAT

Being into Eclipse you have to enter in "Window" menu, than "Preferences", "Pydev", "Interpreter-Python" and here you can configure your path. Click on "New..." on the left of "Python interpreters" window, and then choose your right python folder. In the shown up list, check every folder within your main python folder and go on.
Restart Eclipse.

P.S. You could also disable the "Code Completion Tool" rebuilding, but you loose this nice feature. Anyway, if you want to disable it, you can look into "Window-Preferences-Pydev-Builders" menu.