Booom...........

LabNotes and Random Thoughts...............

Friday, August 28, 2015

picrust hack


I'm running some function profiling of the metagenomic data these days and want to run Picrust. 

Picrust requires numpy == 1.5.1 . The system numpy version is 1.9.2, which I don't want to downgrade to 1.5.1. So I decided to put a separate virtual env running for picrust

The steps I went tru 

virtualenv picrustEnv
source picrustEnv/bin/activate
pip list
pip install --upgrade pip
pip install numpy==1.5.1
pip install biom
pip install cogent
pip isntall ipython
pip list
# biom will show some warnings ... no worries its there
git clone git://github.com/picrust/picrust.git picrust
cd picrust
which python # check exactly which python is running
python setup.py install
cd ..
pip list # check if picrust is installed
which normalize_by_copy_number.py
normalize_by_copy_number.py -h
deactivate # get out of the env



Next time when I'm running picrust source this env and run the python programs inside it

source picrustEnv/bin/activate

Thursday, August 27, 2015

sampling some data using cmdline python

randomly picking some 300 keeg values from a file using command line python

python -c "import random; print [i.strip() for i in random.sample(open('keeg_ids', 'r').readlines(), 300)] "

Tuesday, August 25, 2015

killin time

even after all these years ......its still fun....

$ for i in `cowsay -l | sed 1d`; do echo $i | cowsay -f $i ;done;
 _____
< apt >
 -----
       \ (__)
         (oo)
   /------\/
  / |    ||
 *  /\---/\
    ~~   ~~
 ____________
< beavis.zen >
 ------------
   \         __------~~-,
    \      ,'            ,
          /               \
         /                :
        |                  '
        |                  |
        |                  |
         |   _--           |
         _| =-.     .-.   ||
         o|/o/       _.   |
         /  ~          \ |
       (____@)  ___~    |
          |_===~~~.`    |
       _______.--~     |
       \________       |
                \      |
              __/-___-- -__
             /            _ \
 ______
< bong >
 ------
         \
          \
            ^__^
    _______/(oo)
/\/(       /(__)
   | W----|| |~|
   ||     || |~|  ~~
             |~|  ~
             |_| o
             |#|/
            _+#+_
 ___________
< bud-frogs >
 -----------
     \
      \
          oO)-.                       .-(Oo
         /__  _\                     /_  __\
         \  \(  |     ()~()         |  )/  /
          \__|\ |    (-___-)        | /|__/
          '  '--'    ==`-'==        '--'  '
 _______
< bunny >
 -------
  \
   \   \
        \ /\
        ( )
      .( o ).
 ________
< calvin >
 --------
 \                   .,
   \         .      .TR   d'
     \      k,l    .R.b  .t .Je
       \   .P q.   a|.b .f .Z%       
           .b .h  .E` # J: 2`     .
      .,.a .E  ,L.M'  ?:b `| ..J9!`.,
       q,.h.M`   `..,   ..,""` ..2"`
       .M, J8`   `:       `   3;
   .    Jk              ...,   `^7"90c.
    j,  ,!     .7"'`j,.|   .n.   ...
   j, 7'     .r`     4:      L   `...
  ..,m.      J`    ..,|..    J`  7TWi
  ..JJ,.:    %    oo      ,. ....,
    .,E      3     7`g.M:    P  41
   JT7"'      O.   .J,;     ``  V"7N.
   G.           ""Q+  .Zu.,!`      Z`
   .9.. .         J&..J!       .  ,:
      7"9a                    JM"!
         .5J.     ..        ..F`
            78a..   `    ..2'
                J9Ksaw0"'
               .EJ?A...a.
               q...g...gi
              .m...qa..,y:
              .HQFNB&...mm
               ,Z|,m.a.,dp
            .,?f` ,E?:"^7b
            `A| . .F^^7'^4,
             1.MMMMMMMMMMMQzna,
         ...f"A.JdT     J:    Jp,
          `JNa..........A....af`
               `^^^^^'`
 ________
< cheese >
 --------
   \
    \
      _____   _________
     /     \_/         |
    |                 ||
    |                 ||
   |    ###\  /###   | |
   |     0  \/  0    | |
  /|                 | |
 / |        <        |\ \
| /|                 | | |
| |     \_______/   |  | |
| |                 | / /
/||                 /|||
   ----------------|
        | |    | |
        ***    ***
       /___\  /___\
 ______
< cock >
 ------
    \
     \  /\/\
       \   /
       |  0 >>
       |___|
 __((_<|   |
(          |   
(__________)   
   |      |
   |      |
   /\     /\
 _______
< cower >
 -------
     \
      \
        ,__, |    |
        (oo)\|    |___
        (__)\|    |   )\_
             |    |_w |  \
             |    |  ||   *

             Cower....
 ________
< daemon >
 --------
   \         ,        ,
    \       /(        )`
     \      \ \___   / |
            /- _  `-/  '
           (/\/ \ \   /\
           / /   | `    \
           O O   ) /    |
           `-^--'`<     '
          (_.)  _  )   /
           `.___/`    /
             `-----' /
<----.     __ / __   \
<----|====O)))==) \) /====
<----'    `--' `.__,' \
             |        |
              \       /
        ______( (_  / \______
      ,'  ,-----'   |        \
      `--{__________)        \/
 _________
< default >
 ---------
        \   ^__^
         \  (oo)\_______
            (__)\       )\/\
                ||----w |
                ||     ||
 ________
< dragon >
 --------
      \                    / \  //\
       \    |\___/|      /   \//  \\
            /0  0  \__  /    //  | \ \   
           /     /  \/_/    //   |  \  \ 
           @_^_@'/   \/_   //    |   \   \
           //_^_/     \/_ //     |    \    \
        ( //) |        \///      |     \     \
      ( / /) _|_ /   )  //       |      \     _\
    ( // /) '/,_ _ _/  ( ; -.    |    _ _\.-~        .-~~~^-.
  (( / / )) ,-{        _      `-.|.-~-.           .~         `.
 (( // / ))  '/\      /                 ~-. _ .-~      .-~^-.  \
 (( /// ))      `.   {            }                   /      \  \
  (( / ))     .----~-.\        \-'                 .~         \  `. \^-.
             ///.----..>        \             _ -~             `.  ^-`  ^-_
               ///-._ _ _ _ _ _ _}^ - - - - ~                     ~-- ,.-~
                                                                  /.-~
 ________________
< dragon-and-cow >
 ----------------
                       \                    ^    /^
                        \                  / \  // \
                         \   |\___/|      /   \//  .\
                          \  /O  O  \__  /    //  | \ \           *----*
                            /     /  \/_/    //   |  \  \          \   |
                            @___@`    \/_   //    |   \   \         \/\ \
                           0/0/|       \/_ //     |    \    \         \  \
                       0/0/0/0/|        \///      |     \     \       |  |
                    0/0/0/0/0/_|_ /   (  //       |      \     _\     |  /
                 0/0/0/0/0/0/`/,_ _ _/  ) ; -.    |    _ _\.-~       /   /
                             ,-}        _      *-.|.-~-.           .~    ~
            \     \__/        `/\      /                 ~-. _ .-~      /
             \____(oo)           *.   }            {                   /
             (    (--)          .----~-.\        \-`                 .~
             //__\\  \__ Ack!   ///.----..<        \             _ -~
            //    \\               ///-._ _ _ _ _ _ _{^ - - - - ~
 ______
< duck >
 ------
 \
  \
   \ >()_
      (__)__ _
 __________
< elephant >
 ----------
 \     /\  ___  /\
  \   // \/   \/ \\
     ((    O O    ))
      \\ /     \ //
       \/  | |  \/
        |  | |  | 
        |  | |  | 
        |   o   | 
        | |   | | 
        |m|   |m| 
 ___________________
< elephant-in-snake >
 -------------------
       \
        \  ....
          .    ........
          .            .
          .             .
    .......              .........
    ..............................
Elephant inside ASCII snake
 ______
< eyes >
 ------
    \
     \
                                   .::!!!!!!!:.
  .!!!!!:.                        .:!!!!!!!!!!!!
  ~~~~!!!!!!.                 .:!!!!!!!!!UWWW$$$
      :$$NWX!!:           .:!!!!!!XUWW$$$$$$$$$P
      $$$$$##WX!:      .<!!!!UW$$$$"  $$$$$$$$#
      $$$$$  $$$UX   :!!UW$$$$$$$$$   4$$$$$*
      ^$$$B  $$$$\     $$$$$$$$$$$$   d$$R"
        "*$bd$$$$      '*$$$$$$$$$$$o+#"
             """"          """""""
 _______________
< flaming-sheep >
 ---------------
  \            .    .     .  
   \      .  . .     `  ,    
    \    .; .  : .' :  :  : .
     \   i..`: i` i.i.,i  i .
      \   `,--.|i |i|ii|ii|i:
           UooU\.'@@@@@@`.||'
           \__/(@@@@@@@@@@)' 
                (@@@@@@@@)   
                `YY~~~~YY'   
                 ||    ||    
 ______________
< ghostbusters >
 --------------
          \
           \
            \          __---__
                    _-       /--______
               __--( /     \ )XXXXXXXXXXX\v.
             .-XXX(   O   O  )XXXXXXXXXXXXXXX-
            /XXX(       U     )        XXXXXXX\
          /XXXXX(              )--_  XXXXXXXXXXX\
         /XXXXX/ (      O     )   XXXXXX   \XXXXX\
         XXXXX/   /            XXXXXX   \__ \XXXXX
         XXXXXX__/          XXXXXX         \__---->
 ---___  XXX__/          XXXXXX      \__         /
   \-  --__/   ___/\  XXXXXX            /  ___--/=
    \-\    ___/    XXXXXX              '--- XXXXXX
       \-\/XXX\ XXXXXX                      /XXXXX
         \XXXXXXXXX   \                    /XXXXX/
          \XXXXXX      >                 _/XXXXX/
            \XXXXX--__/              __-- XXXX/
             -XXXXXXXX---------------  XXXXXX-
                \XXXXXXXXXXXXXXXXXXXXXXXXXX/
                  ""VXXXXXXXXXXXXXXXXXXV""
 _____
< gnu >
 -----
    \               ,-----._
  .  \         .  ,'        `-.__,------._
 //   \      __\\'                        `-.
((    _____-'___))                           |
 `:='/     (alf_/                            |
 `.=|      |='                               |
    |)   O |                                  \
    |      |                               /\  \
    |     /                          .    /  \  \
    |    .-..__            ___   .--' \  |\   \  |
   |o o  |     ``--.___.  /   `-'      \  \\   \ |
    `--''        '  .' / /             |  | |   | \
                 |  | / /              |  | |   mmm
                 |  ||  |              | /| |
                 ( .' \ \              || | |
                 | |   \ \            // / /
                 | |    \ \          || |_|
                /  |    |_/         /_|
               /__/
 _________
< head-in >
 ---------
    \
     \
    ^__^         /
    (oo)\_______/  _________
    (__)\       )=(  ____|_ \_____
        ||----w |  \ \     \_____ |
        ||     ||   ||           ||
 ____________
< hellokitty >
 ------------
  \
   \
      /\_)o<
     |      \
     | O . O|
      \_____/
 ______
< kiss >
 ------
     \
      \
             ,;;;;;;;,
            ;;;;;;;;;;;,
           ;;;;;'_____;'
           ;;;(/))))|((\
           _;;((((((|))))
          / |_\\\\\\\\\\\\
     .--~(  \ ~))))))))))))
    /     \  `\-(((((((((((\\
    |    | `\   ) |\       /|)
     |    |  `. _/  \_____/ |
      |    , `\~            /
       |    \  \           /
      | `.   `\|          /
      |   ~-   `\        /
       \____~._/~ -_,   (\
        |-----|\   \    ';;
       |      | :;;;'     \
      |  /    |            |
      |       |            |
 _______
< kitty >
 -------
     \
      \
       ("`-'  '-/") .___..--' ' "`-._
         ` *_ *  )    `-.   (      ) .`-.__. `)
         (_Y_.) ' ._   )   `._` ;  `` -. .-'
      _.. `--'_..-_/   /--' _ .' ,4
   ( i l ),-''  ( l i),'  ( ( ! .-'   
 _______
< koala >
 -------
  \
   \
       ___ 
     {~._.~}
      ( Y )
     ()~*~()  
     (_)-(_)  
 ______
< kosh >
 ------
    \
     \
      \
  ___       _____     ___
 /   \     /    /|   /   \
|     |   /    / |  |     |
|     |  /____/  |  |     |    
|     |  |    |  |  |     |
|     |  | {} | /   |     |
|     |  |____|/    |     |
|     |    |==|     |     |
|      \___________/      |
|                         |
|                         |
 ____________
< luke-koala >
 ------------
  \
   \          .
       ___   //
     {~._.~}//
      ( Y )K/ 
     ()~*~()  
     (_)-(_)  
     Luke   
     Skywalker
     koala  
 ______________
< mech-and-cow >
 --------------
                                   ,-----.
                                   |     |
                                ,--|     |-.
                         __,----|  |     | |
                       ,;::     |  `_____' |
                       `._______|    i^i   |
                                `----| |---'| .
                           ,-------._| |== ||//
                           |       |_|P`.  /'/
                           `-------' 'Y Y/'/'
                                     .== /_
   ^__^                             /   /'|  `i
   (oo)_______                   /'   /  |   |
   (__)       )/             /'    /   |   `i
       ||----w |           ___,;`----'.___L_,-'`__
       ||     ||          i_____;----.____i""____

 ______
< meow >
 ------
  \
   \ ,   _ ___.--'''`--''//-,-_--_.
      \`"' ` || \\ \ \\/ / // / ,-\\`,_
     /'`  \ \ || Y  | \|/ / // / - |__ `-,
    /@"\  ` \ `\ |  | ||/ // | \/  \  `-._`-,_.,
   /  _.-. `.-\,___/\ _/|_/_\_\/|_/ |     `-._._)
   `-'``/  /  |  // \__/\__  /  \__/ \
        `-'  /-\/  | -|   \__ \   |-' |
          __/\ / _/ \/ __,-'   ) ,' _|'
         (((__/(((_.' ((___..-'((__,'
 ______
< milk >
 ------
 \     ____________
  \    |__________|
      /           /\
     /           /  \
    /___________/___/|
    |          |     |
    |  ==\ /== |     |
    |   O   O  | \ \ |
    |     <    |  \ \|
   /|          |   \ \
  / |  \_____/ |   / /
 / /|          |  / /|
/||\|          | /||\/
    -------------|  
        | |    | |
       <__/    \__>
 _________
< moofasa >
 ---------
       \    ____
        \  /    \
          | ^__^ |
          | (oo) |______
          | (__) |      )\/\
           \____/|----w |
                ||     ||

             Moofasa
 _______
< moose >
 -------
  \
   \   \_\_    _/_/
    \      \__/
           (oo)\_______
           (__)\       )\/\
               ||----w |
               ||     ||
 ___________
< mutilated >
 -----------
       \   \_______
 v__v   \  \   O   )
 (oo)      ||----w |
 (__)      ||     ||  \/\
   
 ______
< pony >
 ------
       \          /\/\
        \         \/\/
         \        /   -\
          \     /  oo   -\
           \  /           \
             |    ---\    -\
             \--/     \     \
                       |      -\
                        \       -\         -------------\    /-\
                         \        \-------/              ---/    \
                          \                                  |\   \
                           |                                 / |  |
                           \                                |  \  |
                            |                              /    \ |
                            |                             /     \ |
                             \                             \     \|
                              -              /--------\    |      o
                               \+   +---------          \   |
                                |   |                   |   \
                                |   |                    \   |
                                |   |                    |   \
                                |   |                     \   |
                                 \  |                     |   |
                                 |  |                      \  \
                                 |  |                      |   |
                                 +--+                       ---+
 ______________
< pony-smaller >
 --------------
     \      _^^
      \   _- oo\
          \----- \______
                \       )\
                ||-----|| \
                ||     ||
 _____
< ren >
 -----
   \
    \
    ____ 
   /# /_\_
  |  |/o\o\
  |  \\_/_/
 / |_   | 
|  ||\_ ~|
|  ||| \/ 
|  |||_   
 \//  |   
  ||  |   
  ||_  \  
  \_|  o| 
  /\___/  
 /  ||||__
    (___)_)
 _______
< sheep >
 -------
  \
   \
       __    
      UooU\.'@@@@@@`.
      \__/(@@@@@@@@@@)
           (@@@@@@@@)
           `YY~~~~YY'
            ||    ||
 __________
< skeleton >
 ----------
          \      (__)     
           \     /oo| 
            \   (_"_)*+++++++++*
                   //I#\\\\\\\\I\
                   I[I|I|||||I I `
                   I`I'///'' I I
                   I I       I I
                   ~ ~       ~ ~
                     Scowleton
 _________
< snowman >
 ---------
   \
 ___###
   /oo\ |||
   \  / \|/
   /""\  I
()|    |(I)
   \  /  I
  /""""\ I
 |      |I
 |      |I
  \____/ I
 _________________
< sodomized-sheep >
 -----------------
  \                 __
   \               (oo)
    \              (  )
     \             /--\
       __         / \  \
      UooU\.'@@@@@@`.\  )
      \__/(@@@@@@@@@@) /
           (@@@@@@@@)((
           `YY~~~~YY' \\
            ||    ||   >>
 _____________
< stegosaurus >
 -------------
\                             .       .
 \                           / `.   .' "
  \                  .---.  <    > <    >  .---.
   \                 |    \  \ - ~ ~ - /  /    |
         _____          ..-~             ~-..-~
        |     |   \~~~\.'                    `./~~~/
       ---------   \__/                        \__/
      .'  O    \     /               /       \  "
     (_____,    `._.'               |         }  \/~~~/
      `----.          /       }     |        /    \__/
            `-.      |       /      |       /      `. ,~~|
                ~-.__|      /_ - ~ ^|      /- _      `..-'  
                     |     /        |     /     ~-.     `-. _  _  _
                     |_____|        |_____|         ~ - . _ _ _ _ _>
 ________
< stimpy >
 --------
  \     .    _  .   
   \    |\_|/__/|   
       / / \/ \  \ 
      /__|O||O|__ \
     |/_ \_/\_/ _\ | 
     | | (____) | || 
     \/\___/\__/  //
     (_/         ||
      |          ||
      |          ||\  
       \        //_/ 
        \______//
       __ || __||
      (____(____)
 ______
< suse >
 ------
  \
   \____
  /@    ~-.
  \/ __ .- |
   // //  @
 ____________
< three-eyes >
 ------------
        \  ^___^
         \ (ooo)\_______
           (___)\       )\/\
                ||----w |
                ||     ||
 ________
< turkey >
 --------
  \                                  ,+*^^*+___+++_
   \                           ,*^^^^              )
    \                       _+*                     ^**+_
     \                    +^       _ _++*+_+++_,         )
              _+^^*+_    (     ,+*^ ^          \+_        )
             {       )  (    ,(    ,_+--+--,      ^)      ^\
            { (@)    } f   ,(  ,+-^ __*_*_  ^^\_   ^\       )
           {:;-/    (_+*-+^^^^^+*+*<_ _++_)_    )    )      /
          ( /  (    (        ,___    ^*+_+* )   <    <      \
           U _/     )    *--<  ) ^\-----++__)   )    )       )
            (      )  _(^)^^))  )  )\^^^^^))^*+/    /       /
          (      /  (_))_^)) )  )  ))^^^^^))^^^)__/     +^^
         (     ,/    (^))^))  )  ) ))^^^^^^^))^^)       _)
          *+__+*       (_))^)  ) ) ))^^^^^^))^^^^^)____*^
          \             \_)^)_)) ))^^^^^^^^^^))^^^^)
           (_             ^\__^^^^^^^^^^^^))^^^^^^^)
             ^\___            ^\__^^^^^^))^^^^^^^^)\\
                  ^^^^^\uuu/^^\uuu/^^^^\^\^\^\^\^\^\^\
                     ___) >____) >___   ^\_\_\_\_\_\_\)
                    ^^^//\\_^^//\\_^       ^(\_\_\_\)
                      ^^^ ^^ ^^^ ^
 ________
< turtle >
 --------
    \                                  ___-------___
     \                             _-~~             ~~-_
      \                         _-~                    /~-_
             /^\__/^\         /~  \                   /    \
           /|  O|| O|        /      \_______________/        \
          | |___||__|      /       /                \          \
          |          \    /      /                    \          \
          |   (_______) /______/                        \_________ \
          |         / /         \                      /            \
           \         \^\\         \                  /               \     /
             \         ||           \______________/      _-_       //\__//
               \       ||------_-~~-_ ------------- \ --/~   ~\    || __/
                 ~-----||====/~     |==================|       |/~~~~~
                  (_(__/  ./     /                    \_\      \.
                         (_(___/                         \_____)_)
 _____
< tux >
 -----
   \
    \
        .--.
       |o_o |
       |:_/ |
      //   \ \
     (|     | )
    /'\_   _/`\
    \___)=(___/

 _________
< unipony >
 ---------
   \             \
    \             \_
     \             \\
      \             \\/\
       \            _\\/
        \         /   -\
         \      /  oo   -\
          \   /           \
             |    ---\    -\
             \--/     \     \
                       |      -\
                        \       -\         -------------\    /-\
                         \        \-------/              ---/    \
                          \                                  |\   \
                           |                                 / |  |
                           \                                |  \  |
                            |                              /    \ |
                            |                             /     \ |
                             \                             \     \|
                              -              /--------\    |      o
                               \+   +---------          \   |
                                |   |                   |   \
                                |   |                    \   |
                                |   |                    |   \
                                |   |                     \   |
                                 \  |                     |   |
                                 |  |                      \  \
                                 |  |                      |   |
                                 +--+                       ---+
 _________________
< unipony-smaller >
 -----------------
   \        \
    \        \
     \       _\^
      \    _- oo\
           \---- \______
                 \       )\
                ||-----||  \
                ||     ||
 _______
< vader >
 -------
        \    ,-^-.
         \   !oYo!
          \ /./=\.\______
               ##        )\/\
                ||-----w||
                ||      ||

               Cowth Vader
 _____________
< vader-koala >
 -------------
   \
    \        .
     .---.  //
    Y|o o|Y//
   /_(i=i)K/
   ~()~*~()~ 
    (_)-(_)  

     Darth
     Vader   
     koala       
 _____
< www >
 -----
        \   ^__^
         \  (oo)\_______
            (__)\       )\/\
                ||--WWW |
                ||     ||



Or just print the Python Zen to tux

$ python -m this | cowsay -f tux
 _________________________________________
/ The Zen of Python, by Tim Peters        \
|                                         |
| Beautiful is better than ugly. Explicit |
| is better than implicit. Simple is      |
| better than complex. Complex is better  |
| than complicated. Flat is better than   |
| nested. Sparse is better than dense.    |
| Readability counts. Special cases       |
| aren't special enough to break the      |
| rules. Although practicality beats      |
| purity. Errors should never pass        |
| silently. Unless explicitly silenced.   |
| In the face of ambiguity, refuse the    |
| temptation to guess. There should be    |
| one-- and preferably only one --obvious |
| way to do it. Although that way may not |
| be obvious at first unless you're       |
| Dutch. Now is better than never.        |
| Although never is often better than     |
| *right* now. If the implementation is   |
| hard to explain, it's a bad idea. If    |
| the implementation is easy to explain,  |
| it may be a good idea. Namespaces are   |
| one honking great idea -- let's do more |
\ of those!                               /
 -----------------------------------------
   \
    \
        .--.
       |o_o |
       |:_/ |
      //   \ \
     (|     | )
    /'\_   _/`\
    \___)=(___/






Friday, August 21, 2015

Thursday, August 13, 2015

mp3 time

so many audio books...
how to check the length of each mp3
I want it as h:m:s format

So this is what i did

import mutagen
from glob import glob

import time

def mp3LengthList(files):
    '''list->list
    '''
    s=[]
    for i in files:
        m = mutagen.File(i)
        s.append(m.filename + " : " + secondsToPrint( float(m.info.length) ) )
    return s

def secondsToPrint(seconds):

    return time.strftime("%H:%M:%S", time.gmtime(seconds))
f = glob("../Richard Dawkins/The Selfish Gene - 1976/*.mp3")

../Richard Dawkins/The Selfish Gene - 1976/The Selfish Gene - 01.mp3 : 02:00:00
../Richard Dawkins/The Selfish Gene - 1976/The Selfish Gene - 02.mp3 : 02:00:00
../Richard Dawkins/The Selfish Gene - 1976/The Selfish Gene - 03.mp3 : 02:00:00
../Richard Dawkins/The Selfish Gene - 1976/The Selfish Gene - 04.mp3 : 01:45:30
../Richard Dawkins/The Selfish Gene - 1976/The Selfish Gene - 05.mp3 : 02:00:00
../Richard Dawkins/The Selfish Gene - 1976/The Selfish Gene - 06.mp3 : 02:00:00
../Richard Dawkins/The Selfish Gene - 1976/The Selfish Gene - 07.mp3 : 02:00:00
../Richard Dawkins/The Selfish Gene - 1976/The Selfish Gene - 08.mp3 : 02:00:00
../Richard Dawkins/The Selfish Gene - 1976/The Selfish Gene - 09.mp3 : 00:25:00

csvkit is kool


got some Sci-Fi audio books
I am listing out the book names, author and year into a neat table using csvkit

ls Top\ 100\ Sci-Fi\ Books\ -\ * | grep "^[0-9]"|  sed s'/-/\t/g' |csvsort -c 1| csvformat | csvlook -H | sed -e "s/column2/book   /; s/column3/author / ; s/column4/year   /; s/column1/sl_no  /"
|----------+-------------------------------------+----------------------+----------|
|  sl_no   | book                                | author               | year     |
|----------+-------------------------------------+----------------------+----------|
|  1       | Ender's Game                        | Orson Scott Card     | 1985     |
|  2       | Dune                                | Frank Herbert        | 1965     |
|  3       | Foundation                          | Isaac Asimov         | 1951     |
|  4       | Hitchhiker's Guide to the Galaxy    | Douglas Adams        | 1979     |
|  5       | 1984                                | George Orwell        | 1949     |
|  6       | Stranger in a Strange Land          | Robert A Heinlein    | 1961     |
|  7       | Fahrenheit 451                      | Ray Bradbury         | 1954     |
|  8       | 2001; A Space Odyssey               | Arthur C Clarke      | 1968     |
|  9       | Starship Troopers                   | Robert A Heinlein    | 1959     |
|  10      | I, Robot                            | Isaac Asimov         | 1950     |
|  11      | Neuromancer                         | William Gibson       | 1984     |
|  12      | Do Androids Dream of Electric Sheep | Philip K Dick        | 1968     |
|  13      | Ringworld                           | Larry Niven          | 1970     |
|  14      | Rendezvous With Rama                | Arthur C Clarke      | 1973     |
|  15      | Hyperion                            | Dan Simmons          | 1989     |
|  16      | Brave New World                     | Aldous Huxley        | 1932     |
|  17      | The Time Machine                    | H G Wells            | 1895     |
|  18      | Childhood's End                     | Arthur C Clarke      | 1954     |
|  19      | The Moon is a Harsh Mistress        | Robert A Heinlein    | 1966     |
|  20      | The War of the Worlds               | H G Wells            | 1898     |
|  21      | The Forever War                     | Joe Haldeman         | 1974     |
|  22      | The Martian Chronicles              | Ray Bradbury         | 1950     |
|  23      | Slaughterhouse Five                 | Kurt Vonnegut        | 1969     |
|  24      | Snow Crash                          | Neal Stephenson      | 1992     |
|  25      | The Mote in God's Eye               | Niven & Pournelle    | 1975     |
|  26      | The Left Hand of Darkness           | Ursula K Le Guin     | 1969     |
|  27      | Speaker for the Dead                | Orson Scott Card     | 1986     |
|  28      | Jurassic Park                       | Michael Crichton     | 1990     |
|  29      | The Man in the High Castle          | Philip K Dick        | 1962     |
|  30      | The Caves of Steel                  | Isaac Asimov         | 1954     |
|  31      | The Stars My Destination            | Alfred Bester        | 1956     |
|  32      | Gateway                             | Frederik Pohl        | 1977     |
|  33      | Lord of Light                       | Roger Zelazny        | 1967     |
|  34      | Solaris                             | Lem Stanislaw        | 1961     |
|  35      | 20,000 Leagues Under the Sea        | Jules Verne          | 1870     |
|  36      | A Wrinkle in Time                   | Madelein L'Engle     | 1962     |
|  37      | Cat's Cradle                        | Kurt Vonnegut        | 1963     |
|  38      | Contact                             | Carl Sagan           | 1985     |
|  39      | The Andromeda Strain                | Michael Crichton     | 1969     |
|  40      | The Gods Themselves                 | Isaac Asimov         | 1972     |
|  41      | A Fire Upon the Deep                | Vernor Vinge         | 1991     |
|  42      | Cryptonomicon                       | Neal Stephenson      | 1999     |
|  43      | The Day of the Triffids             | John Wyndham         | 1951     |
|  44      | UBIK                                | Philip K Dick        | 1969     |
|  45      | Time Enough For Love                | Robert A Heinlein    | 1973     |
|  46      | A Clockwork Orange                  | Anthony Burgess      | 1962     |
|  47      | Red Mars                            | Kim Stanley Robinson | 1992     |
|  48      | Flowers for Algernon                | Daniel Keyes         |          |
|  49      | A Canticle for Leibowitz            | Walter M Miller      | 1959     |
|  50      | The End of Eternity                 | Isaac Asimov         | 1955     |
|----------+-------------------------------------+----------------------+----------|


ls Richard\ Dawkins/ | sed s'/-/\t/g' |csvsort -r -c 2,1 |csvformat | csvlook -H -l 

|--------------+----------------------------+----------|
|  line_number | column1                    | column2  |
|--------------+----------------------------+----------|
|  1           | An Appetite for Wonder     | 2013     |
|  2           | The Magic of Reality       | 2011     |
|  3           | The Greatest Show on Earth | 2009     |
|  4           | The God Delusion           | 2006     |
|  5           | The Ancestor's Tale        | 2004     |
|  6           | The Blind Watchmaker       | 1986     |
|  7           | The Selfish Gene           | 1976     |
|--------------+----------------------------+----------|


I gotta try out csvjson and csvsql.