Wednesday, June 24, 2009
Sign in to yahoo by PIDGIN
These days Pidgin does not allow to connect to yahoo. It is due to some maintenance or upgrade of their servers. This is a really annoying experience to pidgin-yahoo users. The simple solution is to upgrade the Pidgin version to 2.5.7 (newest). the instructions are given in the pidgin site.
Tuesday, June 9, 2009
Disk Partition strategy for Ubuntu
A newie-bee to Ubuntu may tend to install it in to a single partion ("/"). But it is always advisable to create few more partitions in order make our lives easier, when it is required to re-install Ubuntu as well as when you required to retain the user accounts, their configuration and the softwares insatalled.
In order to achive this, it is required to create atleast another home partition ("/home"). According to the interest, a "/opt" partion can be created in order to install softwares.
Say, You have to re-install Ubuntu due to a inevitable reason, then it is only require to format the root ("/") partion only, other partions can be left intact. You required to create the same user accounts to activate the old user accounts.
In this way, it is possible to re-install Ubuntu without wasting much to configure it again.
In order to achive this, it is required to create atleast another home partition ("/home"). According to the interest, a "/opt" partion can be created in order to install softwares.
Say, You have to re-install Ubuntu due to a inevitable reason, then it is only require to format the root ("/") partion only, other partions can be left intact. You required to create the same user accounts to activate the old user accounts.
In this way, it is possible to re-install Ubuntu without wasting much to configure it again.
Saturday, May 23, 2009
Configure SSH to connect without entering password
This blog post is not about hacking into another's machine without the proper authorization of the owner. If you are looking for that, this is not the right place.
This is about configuring the SSH without entering the password, but, with the proper authorisation of the machine owner :). In cluster computing quite often, it is required to do this. This article describes how to do it by using "DSA" encryption algorithm. It is quite possible to use "RSA" encryption too.
Say there are two machines called A and B. Now we are going to configure machine A to connect to machine B without entering the password of machine B.
Generate private and public keys for the machine A.This is about configuring the SSH without entering the password, but, with the proper authorisation of the machine owner :). In cluster computing quite often, it is required to do this. This article describes how to do it by using "DSA" encryption algorithm. It is quite possible to use "RSA" encryption too.
Say there are two machines called A and B. Now we are going to configure machine A to connect to machine B without entering the password of machine B.
ssh-keygen -t dsa
The ssh-keygen command will ask you to enter a passphrase. In this case it should be empty in order to connect without entering a password to the machine B.
The above command will place the private key file (id_dsa) and the public key file (id_dsa.pub) in the ".ssh" directory in the home directory of your user account.
Then copy the public key of machine A to the ".ssh/authorized_keys" file resides in the home directory of the machine B.
Now, you can connect to the ssh server of machine B from machine A without entering a password/passphrase.
In a cluster environment, you have to configure ssh in such a way that it enables to connect each others' ssh servers.
NOTE: It is not recommended to leave a passphrase empty when creating the keys. But, for the situations like clusters who comunicates via ssh, passphrase should be kept empty.
Labels:
DSA,
RSA,
SSH,
SSH for MPICH,
ssh without password,
ssh-keygen
Get MySQL Cluster data nodes started after an unexpected shutdown
This article relates to MySQL version 5.1 and NDB Cluster version 6.x
When you are new to the MySQL Cluster, quite frequently, you face to the the problem of getting the data nodes attached to the cluster. Although some data nodes are started using the ndbd command, the management console shows it as disconnected. You know that there cannot be any configuration problms/errors, because you have started the cluster successfully few hours ago or the previous attempt.
In this kind of situation, most of the time, the root cause of the problem is that the cluster was ended in a improper way, in the previous time. The simple solution is starting the data nodes with the --initial option.
When you are new to the MySQL Cluster, quite frequently, you face to the the problem of getting the data nodes attached to the cluster. Although some data nodes are started using the ndbd command, the management console shows it as disconnected. You know that there cannot be any configuration problms/errors, because you have started the cluster successfully few hours ago or the previous attempt.
In this kind of situation, most of the time, the root cause of the problem is that the cluster was ended in a improper way, in the previous time. The simple solution is starting the data nodes with the --initial option.
ndbd --initial
Reference: MySQL documentation
Labels:
crash,
data node,
MySQL Cluster,
NDB,
ndbd,
start,
unable to start data node
Add multiple jars to classpath
In java (in UNIX like platform), it is not enough just to include the directory, in which the jar dependencies of your application reside, to the classpath. It is required to include path of each and every dependant jars to the classpath. If your application only depends on few jars this is not a problem. But, what if your application depends on several jars say 20, it will be an annoying task to add all the paths of jars to the classpath manually.
It is possible to use a simple shell script to accomplish the above mentioned task. The script can be customized to suit your application very easily.
It is possible to use a simple shell script to accomplish the above mentioned task. The script can be customized to suit your application very easily.
export JAR_HOME=path to directory which includes jars
for f in $JAR_HOME/*.jar
do
JAR_CLASSPATH=$JAR_
done
export JAR_CLASSPATH
#the next line will print the JAR_CLASSPATH to the shell.
echo the classpath $JAR_CLASSPATH
java -classpath $JAR_CLASSPATH Name of the programme
Say your jars are in several diferent folders, then you will have to use a for loop per each directory and finally concaternate to a single variable.
Saturday, April 18, 2009
How to re-recover your files (mp3, etc...) after recovering from a bad damage
The recovery mentioned above means to crop out the excessive bits added to the begining of the file, probably after a system recovery. This was a true experience, that I had about an year back. I had a hard disk crash, so that all the data is gone. Finally I was able to recover the files, but with some arbitrary size of bits appended front of some (majority of) files.
There is a simple and more straight forward solution. That is to use a hex editor, and open each file with the editor, then delete the junk bits and save the file. It will be hell a lot of pain, if you are going to follow above method, since there may be several thousands of files to be edited. (Actually in the first place, I was determined to follow this method. Eventually I realised the silliness after couple of days :D)
Therefore I came up with a simple C++ programme to get the job done. I thought of sharing it with you, so that it may help you out in some case :). The programme was implemented to be used in Windows platform, but it could be worked out to run on UNIX without much of a pain.
In the current version, the executable should be moved to the directory that contains the set of corrupted files and directories containing them. Then run the programme using command prompt. It will recover the files in the current directory as well as iteratively the sub-directories.
The programme is written in such a way that it will remove all the bits before the file type's header tag. In this case it will cure only one file type at a run. But feel free to change the code according to your wish and to make your own recovery programme.
You can get the source code from here
There is a simple and more straight forward solution. That is to use a hex editor, and open each file with the editor, then delete the junk bits and save the file. It will be hell a lot of pain, if you are going to follow above method, since there may be several thousands of files to be edited. (Actually in the first place, I was determined to follow this method. Eventually I realised the silliness after couple of days :D)
Therefore I came up with a simple C++ programme to get the job done. I thought of sharing it with you, so that it may help you out in some case :). The programme was implemented to be used in Windows platform, but it could be worked out to run on UNIX without much of a pain.
In the current version, the executable should be moved to the directory that contains the set of corrupted files and directories containing them. Then run the programme using command prompt. It will recover the files in the current directory as well as iteratively the sub-directories.
The programme is written in such a way that it will remove all the bits before the file type's header tag. In this case it will cure only one file type at a run. But feel free to change the code according to your wish and to make your own recovery programme.
You can get the source code from here
Thursday, April 16, 2009
High Performance Computing for Financial Mathematics (HPC4Finance)
Most of the mathematical models in finance are highly resource intensive, when it comes to processing. Therefore, it is encouraging to go for a High Performance Computing resolution. As a result, We, Damitha, Nilendra, Thilina and myself (Waruna) came up with a system which consists of a computational cluster, database cluster and an Excel plug-in to speed-up the financial calculations as well as to add more user convenience by providing a user interface as an Excel plug-in. Hence your results are only a click away.
The system is developed in such a way that other financial models can be integrated to the system dynamically by the user (in this case the developers). In the latest release of HPC4Finance has inbuilt support for three (3) short rate models, namely Geometric Brownian Motion (GBM), Vasicek Model and Cox-Ingersoll-Ross model (CIR).
MPICH2 (1.0.8) cluster which is an implementation of MPI 2.0 specification, is used to implement the computational cluster. The cluster is built on UNIX environment. But it is available for other platforms as well (i.e. Windows even though its not tested enough). The two major problems, we faced with the MPICH2 cluster are load balancing and the fault tolerance. A simple resolution is introduced to improve load balancing by using a round robin algorithm to resolve the jobs (tasks) and their respective execution nodes. Say, that 2 jobs where both are supposed to run in 10 machines (nodes), are submitted to the cluster where there are 20 machines. Then, in default case, both the jobs will run in the same set of nodes and there are 10 nodes idling. This is a huge waste of resources. Therefore, as our resolution, the jobs are explicitly submitted to the next (available) set of nodes in a round robin manner. Unfortunately, we could not come up with an straight forward mechanism to fault tolerance and fail over management which should be a functionality of the cluster itself. But we provide a logging system which enables to track the fault and restore or restart the job.
MySQL cluster is used to implement the database cluster. The data is automatically replicated through the cluster. The cluster support data node fail-over, but not SQL (API) node fail-over.
Excel plug-in is the most important component which adds a great deal of value to the system. It enables financial professionals who are not keen in programming and computer clusters to run their financial models by using just a few mouse clicks. The results are drawn on a graph and presented to the user with the other relevant information. The plug-in enables users to import and update financial data through a web service or form a .csv file.
The user is also facilitated with a ribbon, to change and the set the preferences and settings of the plug-in.
The user also equiped with ability to stop (kill) jobs any time which enables users to terminate jobs whose parameters are entered incorrectly.



The system (HPC4Finance) is just an insight to the possibilities of High Performance Computing to the field of Finance with great deal of extendibility and user convenience.
Reference
MPICH2 (1.0.8) cluster which is an implementation of MPI 2.0 specification, is used to implement the computational cluster. The cluster is built on UNIX environment. But it is available for other platforms as well (i.e. Windows even though its not tested enough). The two major problems, we faced with the MPICH2 cluster are load balancing and the fault tolerance. A simple resolution is introduced to improve load balancing by using a round robin algorithm to resolve the jobs (tasks) and their respective execution nodes. Say, that 2 jobs where both are supposed to run in 10 machines (nodes), are submitted to the cluster where there are 20 machines. Then, in default case, both the jobs will run in the same set of nodes and there are 10 nodes idling. This is a huge waste of resources. Therefore, as our resolution, the jobs are explicitly submitted to the next (available) set of nodes in a round robin manner. Unfortunately, we could not come up with an straight forward mechanism to fault tolerance and fail over management which should be a functionality of the cluster itself. But we provide a logging system which enables to track the fault and restore or restart the job.
MySQL cluster is used to implement the database cluster. The data is automatically replicated through the cluster. The cluster support data node fail-over, but not SQL (API) node fail-over.
Excel plug-in is the most important component which adds a great deal of value to the system. It enables financial professionals who are not keen in programming and computer clusters to run their financial models by using just a few mouse clicks. The results are drawn on a graph and presented to the user with the other relevant information. The plug-in enables users to import and update financial data through a web service or form a .csv file.
The user is also facilitated with a ribbon, to change and the set the preferences and settings of the plug-in.The user also equiped with ability to stop (kill) jobs any time which enables users to terminate jobs whose parameters are entered incorrectly.



The system (HPC4Finance) is just an insight to the possibilities of High Performance Computing to the field of Finance with great deal of extendibility and user convenience.
Reference
T.P. Dampahala, H.D.D.D. Premadasa, P.W.W. Ranasinghe, J.N.P. Weerasinghe, K.A.D.N.K. Wimalawarne, "Efficient High Performance Computing Framework for Short Rate Models," ams, pp.608-613, 2009 Third Asia International Conference on Modelling & Simulation, 2009
Can be found at - Efficient High Performance Computing Framework for Short Rate Models - http://doi.ieeecomputersociety.org/10.1109/AMS.2009.27
List of published papers in the 3rd Asia International Conference on Modeling & Simulation
Can be found at - Efficient High Performance Computing Framework for Short Rate Models - http://doi.ieeecomputersociety.org/10.1109/AMS.2009.27
List of published papers in the 3rd Asia International Conference on Modeling & Simulation
Subscribe to:
Posts (Atom)