Sunday, December 4, 2011

Installing clipgrab (Youtube downloader) on Ubuntu (11.04)

Installed clipgrab, a Youtube video downloader.

1. Reference(s)
Youtube video: http://www.youtube.com/watch?v=HTA7smqOBUY

2. Add a PPA repository.
$ sudo add-apt-repository ppa:clipgrab-team/ppa

3. Install.
$ sudo apt-get update
$ sudo apt-get install clipgrab

Saturday, December 3, 2011

Installing rush on Ubuntu (11.04)

I've installed rush (a Unix shell replacement based on Ruby)

1. Resource(s)
rush home page: http://rush.heroku.com/

2. Installation
$ gem list rush --remote
*** REMOTE GEMS ***
rush (0.6.7)
rushcheck (0.8)
rushiro (1.0.0)

$ sudo gem install rush
Successfully installed fattr-2.2.0
Successfully installed session-3.1.0
Successfully installed rush-0.6.7
3 gems installed
Installing ri documentation for fattr-2.2.0...
Installing ri documentation for session-3.1.0...
Installing ri documentation for rush-0.6.7...
Installing RDoc documentation for fattr-2.2.0...
Installing RDoc documentation for session-3.1.0...
Installing RDoc documentation for rush-0.6.7...

3. Launching rush
$ rush
rush>

4. Testing
rush> root.ls      # 'root' is one of predefined variables, the other being 'home'
////
  bin/
  boot/
  cdrom/
  dev/
  etc/
  home/
  lib/
...
rush> htmldir = home['public_html/']     # get sub directory
=> localhost:/home/socrateos/public_html/
rush> htmldir.ls                         # ls command
/home/socrateos/public_html/
  apps/
  domain1.com/
  domain2.com/
  domain3.com/
rush> htmldir['apps/dbmanager/'].ls      # sub directory of sub directory...
/home/socrateos/public_html/apps/dbmanager/  
  controller/
  layout/
  model/
  public/
  spec/
  view/
  app.rb
  config.ru
  start.rb
rush> file=htmldir['apps/dbmanager/app.rb']  # file object
=> localhost:/home/socrateos/public_html/apps/dbmanager/app.rb
rush> file.class                             # typical ruby command
=> Rush::File
rush> file.name                              # file name
app.rb
rush> file.path                              # display file path 
/home/socrateos/public_html/apps/dbmanager
rush> file.size                              # get file size
=> 385
rush> file.read                              # displays file content (lines 41-54)
# This file contains your application, it requires dependencies and necessary parts of 
# the application.
#
# It will be required from either `config.ru` or `start.rb`
require 'rubygems'
require 'ramaze'

# Make sure that Ramaze knows where you are
Ramaze.options.roots = [__DIR__]

# Initialize controllers and models
require __DIR__('model/init')
require __DIR__('controller/init')

rush> file.search('__DIR__')                  # search file content
Ramaze.options.roots = [__DIR__]
require __DIR__('model/init')
require __DIR__('controller/init')
=> 3 x String

rush> exit                                    # exit from rush shell, and back to bash shell