Showing posts with label tips. Show all posts
Showing posts with label tips. Show all posts

Saturday, 18 May 2013

How does your bash prompt look like?



decided to add color and full path to my bash prompt to make it easier for me to see which ssh window belongs to where absolute life saver at times when you are running several things and the tabs just don't show enough info
Plus having the user@host:/fullpath/folder in your bash prompt makes it easy to copy and paste a 'url' to scp files into that folder directly instead of typing from scratch The only downside to this is if you are buried deep in folders, you are not going to have a lot of screen estate left to type long bash commands without confusing yourself
   
My final choice:

PS1="\[\033[35m\]\t\[\033[m\]-\[\033[36m\]\u\[\033[m\]@\[\033[32m\]\h:\[\033[33;1m\]\w\[\033[m\]\$ "


image from 8 Useful and Interesting Bash Prompts - Make Tech Easier

Source:
8 Useful and Interesting Bash Prompts - Make Tech Easier
http://www.maketecheasier.com/8-useful-and-interesting-bash-prompts/2009/09/04

How to: Change / Setup bash custom prompt (PS1)
http://www.cyberciti.biz/tips/howto-linux-unix-bash-shell-setup-prompt.html


Tuesday, 19 March 2013

SSH access on my Western Digital mybooklive

I didn't realise that the little black box holds so much wonders! I had assumed that SSH access would have been locked down or not installed at all. Now I am deeply curious about the OS and the other things that might be insde my 2 TB WD mybooklive :)

I hope rsync is one of them!

essentially if you haven't changed the hostname of ur mybooklive
you only need to login to the UI
then enter this link to enable SSH access to the drive

http://mybooklive/UI/ssh

Found this out when I was googling for a faster way to move files within the little NAS (silly enough, it seems to route the data back to the PC then back to the new folder location within the same shared drive )


other neat things I discovered not of so much bioinfomatics relevance was that the twonky server has a HTTP frontend that can be accessed via a browser on your mobile devices! :)


Source: http://community.wdc.com/t5/My-Book-Live/What-are-the-steps-to-enable-SSH/td-p/324417


Friday, 15 July 2011

How add new line to start and end of a file, SED / Linux Goodness

saw this usage of sed in the forums posted by ghostdog74

sed '1 i this is first line' file


sed '$ a this is last line' file


link

Monday, 4 July 2011

genomeCoverageBed to look at coverage of your WGS

BEDTools is a very useful set of programs for looking at your NGS sequencing result. 


one of which I use regularly is 


    $ genomeCoverageBed -d -ibam sortedBamFile.bam -g genome.csv > coverage.csv


so you only need your bam file and a genome file (tab-delimited file with "contig_name contig_size" information for all contigs in the reference genome.
This file can be done automatically with 

   $  samtools faidx reference_genome.fasta

which generates a .fai file which contains the info required. (I very nearly went and wrote a bioperl script to generate this, luckily I remembered the contents of the fai file.




Update: 
Do read the helpful comments by Micheal for using samtools idxstats on the bam file. And the shortcomings of looking at the coverage this way. 
He has a helpful recent post here 

Accurate genome-wide read depth calculation (how-to)



I must say I hadn't thought of the points he raised, but I was generating these to check for evenness of coverage for a bacteria reseq project. I like the coverage plot in IGV but am not sure if there are opensource tools to do the same. 
Any tips to share?


Other references
Discussion at BioStar

Monday, 27 June 2011

Note to self: CentOS Yum cache

to save bandwidth when doing multiple installs from netinstall.iso

to remember to change /etc/yum.conf

keepcache=0

to
 
keepcache=1

This will keep all the packages downloaded as cached.

Datanami, Woe be me