Wednesday 14 November 2012

How to iterate through an array in bash? one liner


$ export MYARRAY=("one" "two" "three" "four")
$ for i in ${MYARRAY[@]}; do echo $i;done
one
two
three
four

and to reverse the loop



$ for (( idx=${#MYARRAY[@]}-1 ; idx>=0 ; idx-- )) ; do    echo ${MYARRAY[idx]} ; done

How to scroll up using screen in linux

Crtl + a then press ESC to enter copy mode.

You use the mouse wheel to scroll up and down.

Monday 16 July 2012

Vim Regular Expressions

http://vimregex.com/

Wednesday 20 June 2012

Good vimrc resources

Examples of changing spelling highlight modes

http://bodhizazen.net/Tutorials/vimrc


And another resource from Amir Salihefendic http://amix.dk


http://amix.dk/blog/post/19691#The-ultimate-Vim-configuration-on-Github

http://amix.dk/vim/vimrc.html

Monday 11 June 2012

Yumex Authentication in Openbox

add the next line to your autostart script


(sleep 1 && /usr/libexec/polkit-gnome-authentication-agent-1) &

Tuesday 10 April 2012

how to use empty 'which()' results in R?

As the function returns a vector, for the cases in which the function does not find any cases matching the criteria it will return a vector length of zero

> length(which(borders$end == bands[b,'start']))
[1] 0

Friday 9 March 2012

How to write on the same line in R?

You can achieve this by using the old trick of the carriage return '\r' and the command cat()

for ( i in 1:100){
    cat(c('\r   ',i))
}

Will print on the same line each number from 1 to 100

Thursday 1 March 2012

How to substitute 'NA' in R for any other desired value


my.table$column[is.na(my.table$column)] <- 0

Wednesday 29 February 2012

How to enable SSH on Fedora 16

# become super user
su -
# to activate it
systemctl start sshd.service

# to run it at boot
systemctl enable sshd.service

#enable it on the firewall
system-config-firewall

Monday 20 February 2012

How to rc.local fedora 16?

F16 by default has removed the rc.local file (see the release notes). You just need to create the rc.local file in /etc/rc.d , make it executable and tell the system that is a bash script. See steps below

su -
(root password)


 echo '#!/bin/sh' > /etc/rc.d/rc.local


 chmod +x /etc/rc.d/rc.local


Now you can add your favorite lines to rc.local in order to run commands at start up.


What is FDR in ChIP-seq experiments?

ChIP-seq peak FDR - False Discovery Rate or the ratio between the number of peaks in the control and the experiment when the two are swapped.

-Can this be calculated without a control?
-No, I guess.

source 

Wednesday 1 February 2012

Voices of eternity




Life has been happening ever since the universe appeared (or before for some other universes) thus civilizations, 'people', ideas, feelings... they all have been here for eons. They have come and they have gone. They will come and they will go.

Today, now, we are one of those sparks in this timeless realm

Firefox too slow in Fedora (15)


In firefox


   about:config


Find


network.dns.disableIPv6


set to true

Wednesday 25 January 2012

Inverting screen colours in linux

xcalib -invert -alter

You can set this command to a keyboard shortcut.

Very useful for reading in the screen without bleeding eyes.

Monday 23 January 2012

How to install rWeka and rJava in fedora (15)

Once again a problem of dev libraries.

First install r-java and r-java-dev
$ yum -y install r-java r-java-dev

Procced to install RWeka

$ sudo R CMD javareconf
R$ install.packages('RWeka')

voilá

Note: Sometimes it happens that R is not able to load properly the java libraries. In order to avoid this yo need to re-run as root R CMD javareconf [ see: http://rwiki.sciviews.org/doku.php?id=packages:cran:rjava]