Friday, November 28, 2008

Rip Youtube the CLI way

There are many applications for extracting and downloading videos from youtube and other video hosts like web-based KeepVid or addons like VideoDownloader, and many others. There's also a very good technique of saving any streaming video by buffering it till 100%, navigate to the Cache folder and simply copy the video file (which is /tmp in case of linux).

But recently I got a python based CLI tool youtube-dl, which is a nifty yet a powerful must have tool. You can get it from your default repositories or for youtube-dl under Windows XP. Get it :

$ sudo yum install youtube-dl

Usage
  • Simply download :
    $ youtube-dl http://www.youtube.com/watch?v=video_id

  • Specify filename

    Manually specify :
    $ youtube-dl -o output.flv http://www.youtube.com/watch?v=video_id
    Use the original video title :
    $ youtube-dl -t http://www.youtube.com/watch?v=video_id
    Have a literal title :
    $ youtube-dl -l http://www.youtube.com/watch?v=video_id

  • Download videos which requires your youtube account privileges and confirmation :
    $ youtube-dl -u username -p password http://www.youtube.com/watch?v=video_id

    Or read account details from .netrc file :
    $ youtube-dl -n http://www.youtube.com/watch?v=video_id
    Append this line to ~/.netrc file :
    machine youtube login username password password

  • Simply print video URL instead of downloading :
    $ youtube-dl -g http://www.youtube.com/watch?v=video_id
    Or grab the Title :
    $ youtube-dl -2 http://www.youtube.com/watch?v=video_id

  • Download in silent mode (like wget) :
    $ youtube-dl -q http://www.youtube.com/watch?v=video_id &

  • Get Help :
    $ youtube-dl -h


Know more at the Official Page.

Saturday, October 25, 2008

Custom Search Tool in Firefox

There are search engines which you visit/use frequently and are not listed in Firefox plugin page, so what you will do? Create your own simple :

I will making a Google Linux search tool :
  • Open any text editor and paste this code :
    <search 
    name="Google Linux"
    method="GET"
    action="http://www.google.co.in/linux"
    queryCharset="utf-8"
    >
    <input name="q" user>
    </search>

  • You can add more parameters other than query like "Search within a domain".
    Add
    <input name="sitesearch" value="gnu.org">
    below
    <input name="q" user>
    Just carefully observe the URL after you hit a search for the parameter name/value and keep adding for a filtered search.

  • Save the file as filename.src (I am using glinux.src) to ~/.mozilla/firefox/<profile>/searchplugins/

    TIP : To display icon next to your search engine create a 16X16 PNG or GIF image and save it in the same folder as glinux.src and name it glinux.png or glinux.gif as per your file format

  • Restart Firefox, your source will be compiled and converted into a .XML file automatically and what next! use your engine

Also check : Mycroft Project

Attached few of my favorites : search.tar.gz

Tuesday, October 14, 2008

IP address from NetBIOS name

I will use ping command for knowing the IP address, but for a default *nix system we cannot ping a node using its NetBIOS name. So with a minor edit we can do it all. Here's the process :

  • Edit /etc/nsswitch.conf :
    $ vim /etc/nsswitch.conf
    Or use any other editor of your choice

  • Search for something similar to this :
    hosts:          files mdns4_minimal [NOTFOUND=return] dns mdns4
    and add wins at the end of the line
    hosts:          files mdns4_minimal [NOTFOUND=return] dns mdns4 wins
    Save the file and exit

  • Now use ping command :
    $ ping xyz
    You will get a output something like this :
    PING xyz (192.168.2.1) 56(84) bytes of data.
    Here 192.168.2.1 is the required IP

There may be different ways but I find this one quite simple.

Source(s) : Samba HOWTO

Sunday, October 5, 2008

Maah! Desktop

With GNU/Linux systems you can have a highly customizable desktop with no bounds to possibilities. I have discussed few techniques for a nerdy looking environment in my Feeling Geeky... post earlier. Well this one is just a snapshot preview kinda thing... concentrating mainly on the eye candy stuffs..


Distro : Ubuntu Hardy Heron 8.04
Desktop Environment : GNOME
Window Manager : Metacity/Compiz-Fusion/Fluxbox


Neat
Dirty
I have used Mac4Lin Themes/Skins by Anirudh


Compiz Fusion :



Cube Effect
Window Decoration
Shift Switcher


Random Shots:
Emulators
Gimp

Python Programming
Fluxbox


Build your own desktop, use this links :

http://www.gnome-look.org/
http://www.kde-look.org/
http://www.xfce-look.org/
http://compiz-themes.org/
http://www.fluxbox.org/