VLC: Command Line Interface

This post is for those who love to work out everything from the terminal. Ever wondered how to play media files (audio or video) from the terminal ?? Check out !! First a screenshot :

vlc comman line

In this post I assume you are using Linux with VLC installed. VLC has a very simple GUI with lots of functionality. It also has an equally powerful command line ncurses interface. You can open this interface by typing in the terminal :

$ vlc -I ncurses

Now press ‘h’ to explore the help.

Let me show some usage. Say you have some mp3 files in ~/Music and you want to add all these mp3 files in playlist. You need to type in the terminal :

$ vlc -I ncurses ~/Music/*.mp3

And you will find all these files in the playlist.

There are a plenty of options like you can increase volume by pressing ‘a’ and decrease volume by ‘z’. For loads of other options press ‘h’ and browse through the help.

Keep rocking !

Posted in Linux, vlc | Tagged , | 7 Comments

A nice hidden feature of Firefox 3.0

Firefox search bar is of great help. But the problem comes when one has to search in different search engines. say you have to search for IIT Guwahati in wikipedia. Now what you can do is search for IIT Guwahati in Google and then click the wikipedia link. Another option is directly go to www.wikipedia.com and search for IIT Guwahati. Yet another option is change the search engine to wikipedia in search tab of Firefox and then search for IIT Guwahati. Theres a very nice feature in Firefox 3.0 which gets you out of this situation.

Click the search tab in Firefox 3.0 and click “Manage Search Engines” . Then select Wikipedia in the list and then click “Edit Keyword” in the side panel and enter wiki in the text box that follows. Now close this “Manage Search Engine list” dialogue box.

Now in the address bar type in “wiki IIT Guwahati” , without Quotes ofcourse. Voilla! what you see is the Wikipedia article of IIT Guwahati. Similarly you can add keywords for other search engines and search directly from the Address bar.

I have added the keyword goo for Google, wiki for Wikipedia, yahoo for Yahoo!

Now I can easily search in multiple search engines.

Happy searching !

Posted in Firefox | Tagged | 3 Comments

How to install Pintos on QEMU

UPDATE (Dec 2010) : I wrote this article in fall 2008. Now the files of PINTOS have changed and so this tutorial may not work. But still you can read to take hints on setting up.

Just wanted to share my experience of installing Pintos on Qemu.

First of all install Qemu. In Ubuntu it is available in Universe repository. It is also available in Fedora repositories.

Ubuntu users can install qemu by typing in:

$ sudo apt-get install qemu

and Fedora users can install Qemu by typing in the following command as root user:

# yum install qemu

Note: Fedora 9 users need to make some extra changes as mentioned by Mukund in his comments to the post.

Now we are ready to install Pintos. Download Pintos from here. Extract it in some directory say ~/cs342/

Copy the perl scripts ‘backtrace’ , ‘pintos’, ‘pintos-gdb’, ‘pintos-mkdisk’ from ~/cs342/pintos/src/utils to a directory in PATH. I have added ~/bin into PATH. so i copied these scripts in ~/bin

Now open the script ‘pintos-gdb’ (the one you copied in the ~/bin) in any text editor. Find the variable GDBMACROS and set it to point to ‘~/cs342/pintos/src/misc/gdb-macros’. Now you have installed pintos-gdb.

Next go back to ~/cs342/pintos/src/utils and compile the rest Pintos utilities by typing make.

$ cd ~/cs342/pintos/src/utils

$ make

Copy the script ‘squish-pty’ in the ~/bin folder or wherever you saved scripts mentioned above.

Compile pintos :

$ cd ~/cs342/pintos/src/threads/

$ make

Now open the file ~/cs342/pintos/src/threads/Make.vars in any text editor. change the last line to:

SIMULATOR = --qemu

Next open the file ~/bin/pintos (the one you copied in the PATH) in any text editor and edit the following lines:

Line no.24: replace ‘os.dsk’  with  ‘~/cs342/pintos/src/threads/build/os.dsk’

Note: Replace ~ with absolute path as perl doesnt identify ~ (Thanks to Kholu :) )

Line no.88 :    $sim = “qemu” if !defined $sim;

Line no.110:    --qemu (default) Use QEMU as simulator

Line no.111:  --bochs Use bochs as simulator

This is all. Now you are ready to run pintos. Check your installation by typing in the terminal:

$ pintos run alarm-multiple

This will create 5 threads and sleep for some predefined times. You can see all these messages in the terminal as well as in a Qemu terminal. Now you are ready to implement changes and enhance pintos.

Happy Coding !!

Posted in Linux, Pintos | Tagged , , | 41 Comments

Dual Monitor with Nvidia in Ubuntu Hardy : A PhotoBlog

Yesterday I bought my new 21.6″ LG LCD. Now, I have two LCDs one 20.1″ and the other one 21.6″. Here are few snaps and a screenshot. Enjoy  watching :)

Here’s the screenshot. Click to see the full size image.


Cool Workspace !! Ain’t it ?

Posted in Uncategorized | 6 Comments

Colourful man pages in Ubuntu

Linux man pages are the most important resource for a Linux freak. By default man pages are formatted using the ‘less’ utility. ‘less’ shows the man pages in black & white, something like this :

grayscale man pages

If you use ‘most’ utility to format man pages, you will get a properly colour-formatted man pages. Take a look at man pages configured on my system :

color man pages

Do you like this one ?? Read on how to configure ‘most’ as your man pages viewer.

Step 1: Install the package ‘most’

$ sudo aptitude install most

Step 2: Configure ‘most’ as your man page viewer using update-alternatives :

$ sudo update-alternatives --config pager

update-alternatives

Enter the number corresponding to /usr/bin/most , here in this screenshot its 5.

Yeah, its done. Nothing more to do !!

Have fun.

Let me know if you find any difficulty doing this.

P.S: This can be done in Fedora as well as other linux also. In Fedora I guess you will have to use the command  /usr/sbin/alternatives instead of update-alternatives as root. Somebody try out in Fedora and let me know.

Posted in Linux, Man pages, Ubuntu | Tagged , , | 11 Comments