Installing open source apps & libraries in Terminal

True open source stylin': a tool chest of programs which do a single thing very well that you chain together to do more advanced things.


A few packages to install & play with:

  1. cowsay - try it. nuff said

    # say something
    cowsay "hello world"
    # think something
    cowthink "what is she wearing??!"
    # a wired cow
    cowsay -w "dude, finals are TOMORROW"
    # using a cowfile
    cowsay -f vader "Luke, I am your father."
    # cowsay inception
    echo "get me out of here" | cowsay -n | cowsay -nd | cowsay -np
  2. cmatrix - Matrix up in your Terminal

  3. wget - download anything (similar to curl)

    wget http://something/you/want/on/your/computer.jpg
  4. youtube-dl - download media from youtube and various other sharing sites

    # list available video formats
    youtube-dl -F https://www.youtube.com/watch?v=w6DW4i-mfbA
    # download medium-sized mp4 (format 18)
    youtube-dl -f 18 https://www.youtube.com/watch?v=w6DW4i-mfbA
  5. imagemagick - encode/decode any image

    # resize all jpgs in the current folder to 320 wide
    mogrify -resize 320 *.jpg 
    # create an animated gif using all the jpgs in the current folder
    convert -delay 15 -loop 0 *.jpg douglas.gif
  6. ffmpeg - encode/decode any video

    # output png frames at 5 fps
    ffmpeg -i input.mp4 -r 5 frames%04d.png
  7. sox - encode/decode any audio

    # combine multiple files
    sox -m file1.wav file2.wav output.wav  
    # copy part of a file into another file (start & duration in seconds)
    sox input.wav output.wav trim 90 120  
    # reverse a file
    sox input.wav output.wav reverse
    # just play a file in reverse
    sox input.wav reverse
    # change the sample rate of a file
    sox input.wav -r 22050 output.wav
    # change the speed of a file (speed as a multiplier where 1.0 is normal speed)
    sox input.wav output.wav speed 3.0
    # extract the left channel of a stereo file into a separate file (l - left, r - right, etc)
    sox stereo.wav -c 1 mono.wav avg -l
  8. lynx - text-mode web browser

    lynx class.danomatika.com
  9. pandoc - convert Markdown to html, epub, pdf, etc

    # convert Markdown to a standalone HTML file
    pandoc -s README.md -o example.html
  10. calc - interactive calculator

    # start calc
    # interest calculation: I (interest) = P (principal) * r (interest rate) * n (number of periods)
    # calculate the interest for 1 month of a $20k loan at 6%
    ; P = 20000
    ; r = 0.06
    ; n = 12
    ; I = P * r * n
    ; I
    ; exit