Monday 20 December 2010

Install Redmine on Ubuntu server

First Install the following packages.

sudo apt-get install build-essential ruby ruby1.8-dev libopenssl-ruby libmysql-ruby rubygems rake

Install rails.

sudo gem install rails -v=2.3.5

Then create symbolic link to rails.

sudo ln -s /var/lib/gems/1.8/bin/rails /usr/bin/rails

Go to www directory and checkout redmine from SVN.

cd /var/www
svn checkout http://redmine.rubyforge.org/svn/trunk redmine

Copy config file.

sudo cp redmine/config/database.yml.example redmine/config/database.yml

Change database configuration.

sudo nano redmine/config/database.yml
production:
adapter: mysql
database: redmine
host: localhost
username: redmine
password: redmine's password
encoding: utf8

Optional to change email configuration.

sudo cp redmine/config/email.yml.example redmine/config/email.yml
sudo nano redmine/config/email.yml
production:
delivery_method: :sendmail

Then go to redmine directory and generate a session store secret.

cd redmine
RAILS_ENV=production rake config/initializers/session_store.rb

Create database structure.

RAILS_ENV=production rake db:migrate

Add default configuration data to database.

RAILS_ENV=production rake redmine:load_default_data

Now run Redmine for firs time temporally.

ruby script/server webrick -e production

Now we can access Redmine at http://localhost:3000
Use following commands to running redmine on apache and Enable mod proxy and rewrite.

sudo a2enmod proxy
sudo a2enmod rewrite

Restart apache and install mongrel.

sudo /etc/init.d/apache2 restart
sudo apt-get install mongrel

Create folder mongrel inside /var/log.

sudo mkdir /var/log/mongrel

When you are in redmine directory Start mongrel.

sudo mongrel_rails start -d -p 3000 -e production -P /var/log/mongrel/mongrel-1.pid -l /var/log/mongrel/mongrel.log

Access redmine at http://localhost:3000
Create apache’s virtual host.

sudo nano /etc/apache2/sites-available/redmine

Add following proxy configuration.

<virtualhost *:80>
ServerName http://localhost
ProxyPass / http://localhost:3000/
ProxyPassReverse / http://localhost:3000
ProxyPreserveHost on
<proxy *>
Order allow,deny
Allow from all
</Proxy>
</VirtualHost>

Create symbolic link.

sudo ln -s /etc/apache2/sites-available/redmine /etc/apache2/sites-enabled/redmine

Restart apache.

sudo /etc/init.d/apache2 restart

Access redmine at http://localhost:3000
If you need to stop mongrel, run the following command inside redmine directory.

sudo mongrel_rails mongrel::stop -P /var/log/mongrel/mongrel-1.pid

Possible errors and solutions
To see the running rubby sessions

lsof|grep 3000

This will give you a line starting with.

ruby 6205 admin 4u IPv4

If you need destroy the session

kill -9 6205

If you see followwing error

** !!! PID file /var/log/mongrel/mongrel-1.pid already exists. Mongrel could be running already. Check your /var/log/mongrel/mongrel.log for errors.
** !!! Exiting with error. You must stop mongrel and clear the .pid before I'll attempt a start.

Use following command or destroy session using above step.

rm /var/log/mongrel/mongrel-1.pid
rm /var/log/mongrel/mongrel.log

Thank goes to Just Notes

Sunday 21 November 2010

MySQL to PostgreSQL migration


According to common sense mysql to postgre migration should be work with dump mysql script to file (A) and import script(A) to postgre but its not that simple because mysql and postgre has different syntax.so we need to change syntax before import sql file to postgre.There are perl scripts which will help us to change mysql dump file to postgre dump file we can use that wrapper file to change syntax bulk operation.

perl mysql2perl.perl mysqldump.sql(A) postgredump.sql(B)
now we can import compatible postgre script to postgre databse.

therefor abstract of above operations as follows,
Psuedo,

mysqldump --compatible=postgresql -u username -ppassword databse> mysqldump.sql(A);
perl mysql2pg.perl mysqldump.sql(A) postgredump.sql(B);
psql -h localhost -d postgredatabse -U postgres -W < postgredump.sql(B);

here you can find the mysql2pg.perl script,

Backups
Postgres backup

pg_dump -h localhost - drupaldb -U postgres > /file path/file.sql


Saturday 23 October 2010

What is Organic User Interfaces (OUI)?


Organic User Interfaces: In the future of computing flourishing with thousands of shapes of computing devices that will be as scalable, flexible, and transformable as organic life itself.Organic User Interfaces we can see following characteristics.


1.) Input Equals Output -->In other words output display will become Input.currently we use joystick,keyboard or mouse in order interact with display devices.But in near future those input devices are not sufficient.Therefore OUI use same output as its input device.




2.) Function Equals Forms-->Where the display can take any shape alternatively,Physical shape will results what can do with it.Physical shape goes with its function in other words form of the display equals its function.




3.) Forms Follow Flow-->Where the display can change their shape.Shape can be dynamically change according to situation and activity.e.g. the ubiquitous 'clamshell' phone, where incoming calls alter the phone's function when opening the phone during an incoming call.





sources Wikipedia and organicui

Tuesday 12 October 2010

How to install Gitosis


Firstly, grab the source from the git web repository.
$ cd /usr/local/src
$ git clone git://eagain.net/gitosis.git
Initialized empty Git repository in /usr/local/src/gitosis/.git/
remote: Counting objects: 603, done.
remote: Compressing objects: 100% (172/172), done.
remote: Total 603 (delta 425), reused 597 (delta 422) Receiving objects: 100% (603/603), 92.87 KiB | 23 KiB/s, done. Resolving deltas: 100% (425/425), done.
Once downloaded, we can run the installation.
$ cd gitosis
$ python setup.py install
Then we need to create user
sudo adduser \
    --system \
    --shell /bin/sh \
    --gecos 'git version control' \
    --group \
    --disabled-password \
    --home /home/git \
    git
$ sudo -s
root $ su -git
$ ssh-keygen -t rsa
Generating public/private rsa key pair. Enter file in which to save the key (/home/git/.ssh/id_rsa): Enter passphrase (empty for no passphrase): Enter same passphrase again: Your identification has been saved in /home/git/.ssh/id_rsa. Your public key has been saved in /home/git/.ssh/id_rsa.pub. The key fingerprint is: 59:a8:a8:0a:f7:b5:0e:eb:74:c4:66:cb:ac:03:84:da git@localhost The key's randomart image is:
+--[ RSA 2048]----+
|                 |
|         .       |
| .      . .      |
|. .  o . o       |
|.o  . * S        |
|. E. * .         |
|. o.o *          |
|.o o.* .         |
|.  .=oo          |
+-----------------+
git$ ls -al .ssh
total 16
drwx------ 2 git git 4096 2009-02-11 14:52 .
drwx------ 5 git git 4096 2009-02-11 14:52 ..
-rw------- 1 git git 1743 2009-02-11 14:52 id_rsa
-rw-r--r-- 1 git git  393 2009-02-11 14:52 id_rsa.pub
Now we initialize keys to git repository
git$ gitosis-init < .ssh/id_rsa.pub
Initialized empty Git repository in /home/git/repositories/gitosis-admin.git/ Reinitialized existing Git repository in /home/git/repositories/gitosis-admin.git/
Just look at the file permissions it is important the git user has privileges to access data.
git$ ls -al
Same way look at the repositories.
git$ ls -al repositories/
total 12
drwxr-xr-x 3 git git 4096 2009-02-11 14:57 .
drwx------ 7 git git 4096 2009-02-11 14:57 ..
drwxr-x--- 8 git git 4096 2009-02-11 14:57 gitosis-admin.git
Now we are going to clone gitosis-admin.git.
git$ git clone git@localhost:gitosis-admin.git
Initialized empty Git repository in /home/git/gitosis-admin/.git/ Enter passphrase for key '/home/git/.ssh/id_rsa':
remote: Counting objects: 5, done.
remote: Compressing objects: 100% (4/4), done.
remote: Total 5 (delta 0), reused 5 (delta 0) Receiving objects: 100% (5/5), done.
Creating New Repositories
Lets allow group persmissions.
git$ ls -al repositories/gitosis-admin.git/hooks/post-update-rw-r--r-- 1 git git 69 2009-02-11 14:57 repositories/gitosis-admin.git/hooks/post-updategit$ chmod 755 repositories/gitosis-admin.git/hooks/post-update
git$ ls -al repositories/gitosis-admin.git/hooks/post-update 
-rwxr-xr-x 1 git git 69 2009-02-11 14:57 repositories/gitosis-admin.git/hooks/post-update
Now, Lets take a look at the gitosis-admin source code we checked out .
git$ ls -al gitosis-admin
total 20
drwxr-xr-x 4 git git 4096 2009-02-11 15:38 .
drwx------ 8 git git 4096 2009-02-11 15:49 ..
drwxrwxr-x 8 git git 4096 2009-02-11 15:38 .git
-rw-rw-r-- 1 git git   81 2009-02-11 15:38 gitosis.conf
drwxrwxr-x 2 git git 4096 2009-02-11 15:38 keydir
We can configure gitosis.conf.
git$ cd gitosis-admin
git$ vi gitosis.conf
  1 [gitosis]
  2
  3 [group gitosis-admin]
  4 writable = gitosis-admin
  5 members = git@localhost
  6
  7 [group my-staff]
  8 writable = my-first-repo
  9 members = git@localhost

git$ git commit -a -m "Allow my staff access to my-first-repo"
[master]: created 0c6a685: "Allow my staff access to my-first-repo"
1 files changed, 3 insertions(+), 0 deletions(-)

git$ git push
Enter passphrase for key '/home/git/.ssh/id_rsa':
Counting objects: 5, done.
Compressing objects: 100% (3/3), done.
Writing objects: 100% (3/3), 381 bytes, done.
Total 3 (delta 0), reused 0 (delta 0)
To git@localhost:gitosis-admin.git
   7b3ddbe..0c6a685  master -&gt; master

git$ cd
Then we are going to create our first repository.
git$ mkdir my-first-repo
git$ cd my-first-repo
git$ git init
Initialized empty Git repository in /home/git/my-first-repo/.git/
git$ git remote add origin git@localhost:my-first-repo.git
git$ echo "Hello" &gt; README.txt
git$ git add README.txt
git$ git commit -a -m "Initial Revision"
[master (root-commit)]: created 6f567f9: "Initial Revision"
1 files changed, 1 insertions(+), 0 deletions(-)
create mode 100644 README.txt
git$ git push origin master:refs/heads/master
Enter passphrase for key '/home/git/.ssh/id_rsa':
Counting objects: 3, done.
Writing objects: 100% (3/3), 220 bytes, done.
Total 3 (delta 0), reused 0 (delta 0)
To git@localhost:my-first-repo.git
* [new branch]      master -&gt; master
git$ cd ..
Now we have new repository,finally we can add new users.
git$ cd gitosis-admin
git$ cp ~/alice.pub keydir
git$ cp ~/bob.pub keydir
git$ git add keydir
git$ vi gitosis.conf
  1 [gitosis]
  2
  3 [group gitosis-admin]
  4 writable = gitosis-admin
  5 members = git@localhost
  6
  7 [group my-staff]
  8 writable = my-first-repo
  9 members = alice bob
git$ git commit -a -m "alice/bob writable to my-first-repo"
[master]: created 17b3295: "alice/bob writable to my-first-repo"
1 files changed, 1 insertions(+), 1 deletions(-)
create mode 100644 keydir/alice.pub
create mode 100644 keydir/bob.pub
git$ git push
Enter passphrase for key '/home/git/.ssh/id_rsa':
Counting objects: 8, done.
Compressing objects: 100% (4/4), done.
Writing objects: 100% (5/5), 430 bytes, done.
Total 5 (delta 1), reused 0 (delta 0)
To git@magneto:gitosis-admin.git
   305600f..17b3295  master -&gt; master
now users can access our central repository.
alice$ git clone git@SERVER_HOSTNAME:my-first-repo.git

Monday 4 October 2010

Install GIT

How to install Git

sudo apt-get install git-core
add user name and email

 git config --global user.name "name"
 git config --global user.email "email id"

go to the project folder and

cd project folder
we can see our config file by typing this

cat /project folder/.config/
we can enable command colors by using

git config --global color.ui true
we go to folder  and  initialize the project repository.

git init
git commit
git commit  -m ' comment'
git add  

now we can use following commands

git diff --cached
git log  


finally update the server info

sudo -u git update-server-info
now we have access to repository .we can use commit pull push command
For instance http://localhost/efp/.git/


I found some useful resources
http://git.or.cz/course/svn.html
http://sysmonblog.co.uk/misc/git_by_example/
http://www.kernel.org/pub/software/scm/git/docs/user-manual.html

Install GIT web


Intsall the application
sudo apt-get install  gitweb

Create a new folder in /var/www and change into that directory like:

sudo mkdir /var/www/gitweb
cd /var/www/gitweb  

Create a softlink to the /var/www/gitweb folder from where the css and the pics of gitweb originally do reside:

sudo ln -s /usr/share/gitweb/* .
Now we have all things linked to the correct place.
Then we need to modify the apache.conf. This must happen only if we do not have already this line enabled in apache.conf:

ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/
So if this line isn’t in your apache.conf, then add this line and another one like:
sudo nano /etc/apache2/apache.conf   
##add the following two lines:
ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/
Include /etc/gitweb/apache.conf  
Then we need to create a folder in /etc namely “gitweb” and add the apache.conf for gitweb there.

 sudo mkdir /etc/gitweb
Then we  add a file namely apache.conf in it like:

sudo nano /etc/gitweb/apache.conf
And we add the following code in it:


Options Indexes FollowSymlinks ExecCGI
DirectoryIndex /cgi-bin/gitweb.cgi
AllowOverride All

Save the file. Then we need to configure the last file, namely gitweb.conf:
sudo nano /etc/gitweb.conf  
There we have to enter the following code:

$# path to git projects (.git)  
$projectroot = "/var/www/";  

# directory to use for temp files
$git_temp = "/tmp";  

# target of the home link on top of all pages
#$home_link = $my_uri || "/";  

# html text to include at home page
$home_text = "indextext.html";  

# file with project list; by default, simply scan the projectroot dir.
$projects_list = $projectroot;  

# stylesheet to use
$stylesheet = "/gitweb/gitweb.css";    

Finally: restart the server like:

sudo /etc/init.d/apache2 restart

Friday 1 October 2010

Install FreeNX via putty+xming

    Installing the FreeNX server on Ubuntu 9.10.
    I use putty.exe + xming to login to ubuntu via ssh

$sudo add-apt-repository ppa:freenx-team
$sudo apt-get update
$sudo aptitude install freenx

   Now use nxsetup to install necessary files and create the special user "nx"
   $sudo /usr/lib/nx/nxsetup --install

   FreeNX Client installation in ubuntu 9.10 
   If you want to install opensource client for freenx use QTNX,QTNX NX client for QT instal
   qtnx using as follows.

   $sudo apt-get install qtnx

   Install Freenx client in windows
   You can download freenx windows client from here and install.

For start
$sudo /etc/init.d/freenx-server start
For stop
$sudo /etc/init.d/freenx-server stop

Errors..
If you get Cannot initialize the display service problems follow this instructions
 If you get "The nx service is not available or the nx access was disabled" error
To fix this, connect to your SSH and type:
$cat /var/lib/nxserver/home/.ssh/client.id_dsa.key
Copy the text you get and in your NX client, on your login dialog box go to:
Configure… > General Tab > Key

Thursday 23 September 2010

Overview of DNA, genome, gene, RNA, chromosome

DNA is a nucleic acid that contains the genetic instructions used in the development and functioning of all known living organisms with the exception of some viruses. The main role of DNA molecules is the long-term storage of information. DNA is often compared to a set of blueprints, like a recipe or a code, since it contains the instructions needed to construct other components of cells, such as proteins and RNA molecules. The DNA segments that carry this genetic information are called genes, but other DNA sequences have structural purposes, or are involved in regulating the use of this genetic information.
DNA consists of two long polymers of simple units called nucleotides, with backbones made of sugars and phosphate groups joined by ester bonds. These two strands run in opposite directions to each other and are therefore anti-parallel. Attached to each sugar is one of four types of molecules called bases. It is the sequence of these four bases along the backbone that encodes information. This information is read using the genetic code, which specifies the sequence of the amino acids within proteins. The code is read by copying stretches of DNA into the related nucleic acid RNA, in a process called transcription.
Within cells, DNA is organized into long structures called chromosomes. These chromosomes are duplicated before cells divide, in a process called DNA replication. Eukaryotic organisms (animals, plants, fungi, and protists) store most of their DNA inside the cell nucleus and some of their DNA in organelles, such as mitochondria or chloroplasts. In contrast, prokaryotes (bacteria and archaea) store their DNA only in the cytoplasm. Within the chromosomes, chromatin proteins such as histones compact and organize DNA. These compact structures guide the interactions between DNA and other proteins, helping control which parts of the DNA are transcribed.




Humans have 46 chromosomes. There are a total of 23 pairs of chromosomes or 46 total chromosomes.Chromosomes are made up of long strands of DNA which contain all the body’s genes.following screen cast describes more details.



In this post I tried to understand that a genome is made up of a collection of DNA chromosomes. Those contain stretches of DNA that are called coding and non-coding. Gene is the functional unit of heredity which is passed down from our parents. The sequences of genes formed the DNA. DNA is the code information to produce the protein in our body. We called it chromosome when we grouped all DNA in a structure. And a complete set of chromosomes which inherited as a unit from our parents is called genome .




Learn about D.N.A (^^)



(sources wiki and houstuffworks,bimatics)

Wednesday 22 September 2010

Bioinformatics + Interaction Design.

Why We need Interaction Design for Bioinformatics?
Bioinformatics comprises  of databases, algorithms, computational and statistical techniques and theory to solve formal and practical problems arising from the management and analysis of biological data.In the process of Bioinformatics we will go through following steps.
    •         Online Biological Research
    •         Use Gene-Centric databases
    •         Visualize protein in 3D
    •         Interpret and analyse sequence
Therefore its important to understand the right tools in order to explore human genome and DNA sequence.Furthermore Its very important to understand the Interaction process in order to design efficient bioinformatics tools.For instance www.ncbi.nlm.nih.gov/entrez and  www.expasy.org/sprot are the examples of bioinformatics tools.But its hard to interact with above tools without having basic computer knowledge because of interaction complexity.We can use interaction design principals and modern technologies to eliminate complexity and enhance the interaction even for biologists and researchers who have less computer competence.