Posts

Showing posts from 2012

Way to mount remote directory in linux and accessing it over apache

Plenty different ways are out there like Samba, NFS or FTP. I tried FUSE which uses SSH protocol. Step 1: Install fuse-ssh in the system where you want to have remote directory. Ubuntu: apt-get install sshfs Redhat: yum install fuse-sshfs.x86_64 Step 2:  Enable password less SSH login Make sure that you have openssh-server and openssh-client in your system. then issue 'ssh-keygen' command. Then copy id_rsa.pub generated to remote systems ~/.ssh/authorized_keys Step 3: In /etc/fuse.conf  enable 'user_allow_other' If you dont do this apache wont be able to access mounted directoy Step 4: Mounting remote directory sshfs -o allow_other, uid=1000, gid=1000, IdentityFile=~/.ssh/authorized_keys root@XXX.XX.X.XX:/var/www/html/JBrowse/data /var/www/data Now you should be able to access data directory over apache. To unmount the directory use: fusermount -u /var/www/data

Who is best with MySQL? R or Perl or Python: A benchmark

I really surprised to see R talks better with MySQL than Perl or Python!!!... I thought R might be slow in querying MySQL database. But I have a different answer here. Following is the code used for this demo. R script: library(RMySQL) test <- function(){          con <- dbConnect("MySQL", host="genome-mysql.cse.ucsc.edu", user ="genome", dbname = "hg18")          rs <- dbGetQuery(con, "select name, chromEnd from snp129 where chrom='chr1' and chromStart between 1 and 1e8;")          return(rs)          dbClearResult(rs)          dbDisconnect(con)         } print(system.time(test()))    user  system elapsed   0.372   0.039  25.729 R took 25.729 seconds to retrieve half million records. Python script: f...