Wednesday, 14 December 2011

Searching strings with grep command

Let me discuss a situation- I have saved all of my contacts information as separate files and put it in a folder called contacts. I have to find the file which contain the name Mr. John. I get started with opening each files in my text editor and ctr+f to find was too difficult since I have about 300 files to search. But working a little smart I found john in 2 minutes..How ? The grep command .
 Grep is a command-line text-search utility originally written for Unix. The name comes from the ed command g/re/p (global / regular expression / print). The grep command searches the given file for lines containing a match to the given strings or words. grep displays the matching lines by default.
How to use grep command :
1.Searching for a string in a file

                $ grep train vehicles.txt

    the above usage will print all the lines containing the text train from vehicles.txt
2 .Searching in multiple files of same type :

                $ grep train *.txt

    the above command will print all the lines with text 'train' from all the text files in that folder
3. Searching by ignoring case sensitivity (with parameter -i)

                $ grep -i train vehicles.txt

     the above command will search all the 'train' sequences wihtout matching the cases.
4 . Word search

                $ grep -w train vehicles.txt
     Selecting all lines containing train as a word, i.e. surrounded' by white space (speedtrain
     and train  do not not match) may be accomplished with the -w option flag
5. Count lines when words are matched
                $ grep -c 'word' /directory

      grep can count the number of times that the pattern has been matched for each file using -c (count)    option.
6.Search recursively in an entire directory

               $ grep -r 'word' /directory  

   You can search recursively i.e. read all files under each directory for a string .

Monday, 5 December 2011

Installing an rpm file in Debian systems

In Linux the two important variants of Operating Systems are Debian And Red hat. For off line installation of softwares Debian variant uses files of type .deb and Red hat uses .rpm files. Most of us uses Debian variant OS and our famous Ubuntu is a Debian variant OS.
>>What you will do to install an rpm file in a Debian variant system , if you can't find out the Debian version of that item ?
There is a way to install an .rpm file in Debian variant systems. You can use alien package converter to do so. Alien is a program that converts between the rpm, dpkg, stampede slp, and slackware tgz file formats. If you want to use a package from another distribution than the one you have installed on your system, you can use alien to convert it to your preferred package format and install it.
Note:Alien should not be used to replace important system packages, like sysvinit, shared libraries, or other things that are essential for the functioning of your system. Many of these packages are set up differently by Debian and Red Hat, and packages from the different distributions cannot be used interchangeably. In general, if you can’t un-install the package without breaking your system, don’t try to replace it with an alien version.
Install alien converter :
The software is available at Ubuntu Universe repository.So add that repository in software sources (Option is available there) ,open up the terminal and type
the following commands :
             $ sudo apt-get update
             $ sudo apt-get install alien

Installing the .rpm file

First convert the .rpm file to .deb by the following command(assumed that your files are in the home directory ) :
             $sudo alien -k name-of-rpm-file.rpm
this will produce a .deb file with the same use dpkg to install the .deb file .
             $sudo dpkg -i name-of-deb-file.deb

Done :)

Monday, 28 November 2011

Split Your Large Files into small files very easily in Your Ubuntu machine

What will we do if we got a situation that we have to transfer a file of 5 GB and the available resource is just two 4 GB Pen drives. I used to stuck in such situations many times especially when you have to copy a Blue-ray film of 5-7 GB s. Most of the times we have to depend on the software s like zip manager . But the thing is that Without any softwares we can simply split up our files using the Linux command terminal,more simpler than the software method.
Go and open up the Terminal and use the following command :

      $ split –b600m yourfile yoursplitfiles.

To join the smaller files to get the big files back:

        $ cat yoursplitfiles.* >yourfile
Here 'yourfile' stands for the name of your big file and 'yoursplitfiles' stands for the splited files. Like the  same way you think.

Note : Dont forget to put a dot(.) after the name 'yoursplitfiles' otherwise it will be diffficult to rejoin

Friday, 25 November 2011

Have Fun with Command Line Browser In Linux

I would like to mention about command line again. These days I was trying something different in my terminal .something smells good and useful .what was that ?Simply access the web pages in command line. A Google searched gave me solution .It is somewhat a special experience ,especially for a Geek. Imagine a situation like this.. if your GUI get crashes and you have only the command line access and u need to check one of your important mails ,no other ways .....Don't Worry, A software called links2 comes to help you .
  Links2 is a web browser which is based on 'links' and can be run in two modes. It will display web pages only in text when run in console mode and renders images in a variety of graphics formats when run in graphics mode from within a X window system. Without going to more technical let me explain what to do :

* Install Links2 to in your system
steps are simple . Connect to Internet and type following command to the terminal
         $ sudo apt-get install links2
The browser is designed to run in console mode. But it can be run in graphics mode too..the important feature is the speed. It render the Web-pages very fast .

* How to start and browse with links2 ?
Open terminal and type following command:
         $ links2
replace with your site..

* Start links2 in graphics mode
Open terminal and type following command:
         $ links2 -g

* Shortcuts used in links2 :
  • '\' - toggle between viewing the web page and its source code.
  • '/' - used to search for a word or term in the website that is displayed.
  • [Esc]key - Shows a menu at the top of the browser from which you can also make choices.
  • '=' - Provides further information about the web page such as its size, the web server serving the web page and its url.
  • '|' - Pipe displays the header information.
  • '<-' - left arrow will take you to the previous view. '->' - right arrow will take you forward to the latest view.
  • [Page up]and[Page down]- these keys can be used to navigate through the web page one page at a time. But you can also use[Space bar]and 'b' key combination for the same.
  • 'g' - will pop-up a dialog box where you can enter the url of the website you want to view. To open this dialog box with the url of the current page already entered, press 'G'.
  • Move the mouse pointer over an image and press 'i' to see only the image.

Geeks please note :
You can find a hidden folder .links2/ in your home folder with configuration files .A file named links2.cfg contains all configurations.

Screen shots :
Google in Linux terminal

In Graphics mode 

Wednesday, 19 October 2011

Installing Gnome 3 in Ubuntu 11.10

We were expecting that Gnome 3 interface will be built in with Ubuntu 11.10.but it wasn't there .But the thing is that we can install Gnome 3 interface without breaking Unity interface. Click to Read more about Gnome 3 here  
So how we install Gnome 3 interface in Ubuntu 11.10 ?????
follow the simple step :Open terminal and type (excluding dollar)

                 $ install sudo apt-get install gnome-shell
Now you can choose the interface to Gnome3 when you login next time to your machine...

Friday, 14 October 2011

How to change the login screen in Ubuntu 11.10

category :Tweaks,Customisation

The coolest feature in the new Ubuntu 11.10 is the simple, beautiful new login manager which is known as LightDM. Your new ubuntu 11.10 login screen comes with desktop applets like calender, batttery indicator etc..Now here let us see  what  you need to do to change your login wallpaper in few simple steps:
Step 1 : Install a simple login manger tool
You can do by terminal if you have an Internet connection. Open terminal
and type the following commands(exclude $ symbol) :
               $ sudo apt-add-repository ppa:claudiocn/slm
               $ sudo apt-get update
               $ sudo apt-get install simple-lightdm-manager 
For offline installation :
Download the following package.
Click here to download Simple LightDM Manager:
and after downloading the package use command in terminal
make it executable using :
               $sudo chmod a+x <packagename>.deb
and install by :
               $ sudo dpkg -i <packagename>.deb
eg :- assume the file is in home directory :
               $ sudo chmod a+x ~/simple-light-manager_0.2-public7_all.deb
               $ sudo dpkg -i ~/simple-light-manager_0.2-public7_all.deb 

Step 2 : Take simplelightdm manager from application and change your wallpaper to which you like
search light on application dash to  get the application

Thursday, 13 October 2011

First look on the new Ubuntu 11.10 Oneiric Ocelot

Category : Article ,Review
Well This was a great day .The new version of Ubuntu , Ubuntu11.10 Oneiric Ocelot just released today. It is very cool actually. First coolest thing is the recreation of Unity interface in a better way. A lot of people didn't like unity interface in ubuntu11.04 due to some alien experience. Any way I personally feel a very better experience in my new Ubuntu11.10 machine.
Improved Unity interface :
  • Like other desktops, Unity uses windows to display your running applications. Using both the dash and the launcher, you can launch new applications and control which window is active. In addition to windows, you can also group your applications together within workspaces.
  • It is a hybrid of old unity and gnome 3 :unity interface is too better in performance. It is pretty much faster and make user to search anything faster and accurate. They adapted the good features from gnome 3 interface and integrated to the unity dash
  • Workspace with new dash icon : The workspace is kept as same as the ubuntu11.04 but a new dash home icon Is added to the workspace so that we can easily access the unity dash. The work space Is automatically expanding in nature and hence easy to manage many number of windows together.

LightDM :New Login screen manager 
The cooleset feature is the new login screen. A new login manager called LightDM is used. It is simple and It has got a very different look and feel .it is really beautiful ..i will put screen-shots so that you can understand its beauty. It also contain calender, battery applets etc..and have a special on screen-keyboard inbuilt.
Software Center with New features :
The new software center has improved a lot in construction ..the softwares are easy to Locate and user friendly. You can easily search and update your system using the new software center more better than ever. The simplicity is the most important factor here..more simple but visually better too.
Efficient new, window switching :
The switching between two windows has got a little funny animated graphic mode. You can switch between two windows by pressing <clrl> +<tab> and arrow (side,up )keys.

Customize user settings :
The new interface provides a lot of customizations by default which was not available in ubuntu11.04 like the theme selectivity.

Many applications by default :
Libere office ,Brasero burner ,Banshee player , Firefox browser such famous applications are available default here.

This is the first impression that made by new Ubuntu11.10 Oneiric Ocelot to is too good let us watch and see what happens.

Saturday, 1 October 2011

How to connect the BSNL modem ?

               The most big problem faced by the beginners in Ubuntu is to connect
with BSNL broadband. This is one the Most frequently problem raised.Here we are going to see how to do it...The steps are too simple ...
  •  First connect your modem with the computer and turn on
  •   Then go to terminal and type : sudo pppoeconf

You will get a screen that looks like this :

From here you just press the Enter key at all screens until you get to
this screen :
You have to choose the <No> option there. You are now connected
If you lose your connection at any time just run

  • sudo pon
To turn off the connection type :
  • sudo poff
and you’ll be back ....

Tuesday, 20 September 2011

Get rid of Hardware/Volume Icons From Your Desktop in Ubuntu 11.04

      You may be noticed that when a new drive is mounted on your Ubuntu machine the  icon will be visible in your desktop automatically ,and it disappears when the drive is unmounted .Sometime I felt irritated of the same .So Now let us see how we can discuss about how we can get rid of this.
Step 1: Open Configuration Editor
    to do that hit ALT+F2 , then type gconf-editor and press Enter.
Step 2:
    Then go to apps -> nautilus -> desktop and simply uncheck (select         the row by double clicking on it) the box that says ‘Volumes Visible’.
You have done .thats all . You can see an instant change in your action Now your desktop doesn't shows an icon when a drive or a volume is mounted...ENJOY :-) Here is the screenshot

Saturday, 3 September 2011

Install some important applets on your Ubuntu11.04

Application indicators are very essential to our desktop. Here let's see some
important desktop applets available for Ubuntu 11.04 natty narwhal..and
about Ubuntu 11.04......Ubuntu 11.04 Natty Narwhal is criticized a lot but it
is somewhat good .the main problem was with the new unity interface
..anyway with classic interface it feels very better than the older
versions...and these applets are really useful for that classic gnome interface

1.Weather Indicator Applet
        Weather indicator can be used to determine our weather conditions which
is fetched from Internet. It is so simple to use. To install Weather Indicator
application indicator in Ubuntu 11.04,copy-paste the following command into
================================================================                         sudo apt-get install indicator-weather
Finished. Launch Weather Indicator applet from 'Applications' dash.

2. System monitor indicator

            It is a useful indicator shows the CPU usage ,memory usage etc. It is simple and useful . It is so similar to the task manager in Windows. We can control the processes and services graphically. To install this copy and paste the following command into the terminal.
              sudo add-apt-repository ppa:alexeftimie/ppa
              sudo apt-get update
              sudo apt-get install indicator-sysmonitor


Finished, Now simply launch this application .

 3.Pastie Clipboard Manager Indicator             
             Pastie is a simple clipboard Manager. To install this copy-paste the
following commands to the terminal .
             sudo add-apt-repository ppa:hel-sheep/pastie
             sudo apt-get update
             sudo apt-get install pastie

It is done..

 4. Keylock Application Indicator
            This applet inform us whether the caps lock key is on or not.So it is
useful during typing .Keylock Application Indicator shows which key locks
you have enabled(caps, num and scroll locks supported among others).
To install keylock indicator copy-paste the following command into terminal
            sudo add-apt-repository ppa:tsbarnes/indicator-keylock
            sudo apt-get update
            sudo apt-get install indicator-keylock



5.Battery Status Indicator
          Battery status is one the most useful indicators needed in Ubuntu 11.04 .
So that we can understand easily that how much power is remaining in the
system. Extremely useful for laptop users. To install the applet copy-paste the following commands into terminal
             sudo apt-add-repository ppa:iaz/battery-status
             sudo apt-get update
             sudo apt-get install battery-status
         Now, to start Battery Status while at start up, open Startup Applications fromUnity applications dash and Add the above command to it.

             /usr/lib/battery-status/battery-status –indicator

Done :-)

Saturday, 13 August 2011

Install a VIDEO CONVERTER for your Linux

       Some days before one of my friends asked me to convert a video for him..only that time I noticed that I don't have a video converter in my Linux System ..well I searched over Internet and saw one of the best video converter available for linux. So I thought I should share it                           
     The software is called 'Handbrake' ,really flexible and easy to use. It ii an open-source, GPL-licensed, multiplatform, multithreaded video transcoder, available for MacOS X, Linux and Windows.
Install handbrake :
connect to internet and open up command prompt then type the following command(or paste it)
   sudo add-apt-repository ppa:stebbins/handbrake-releases && sudo apt-get update
    sudo apt-get install handbrake-gtk

Supported Sources:

  • Most common multimedia files that libavformat and libavcodec support.
  • Any DVD or Bluray-like source which is NOT copy-protected. (removal of copy protection is not supported) 

Misc features:

  • Chapter selection, Chapter Markers
  • Subtitles
    • Vobsub and Closed Captions
    • SRT import and passthru
    • SSA passthru or burn-in (experimental)
  • Constant Quality or Average Bitrate Video Encoding
  • Support for VFR, CFR and VFR
  • Video: Deinterlacing, Decomb, Detelecine, Cropping and scaling
  • Live Video Preivew

  • File format: MP4(M4V) and MKV
  • Video: MPEG-4(ffmpeg), H.264(x264), or Theora(libtheora)
  • Audio: AAC, CoreAudio AAC (OS X Only), MP3, or Vorbis. AC-3 pass-through, DTS pass-thorugh (MKV only) 


    ~~~~~eNjOy ~~~~ 

Sunday, 17 July 2011

Customize your Desktop panel in Ubuntu

  Hi friends ...most of us are not merely impressed by the desktop panel provided by the Ubuntu by default(desktop panel is something that is in ubuntu similar to the taskbar in windows).Lets us tweak it to get a good appearance for the desktop
Ubuntu includes a top panel and a bottom panel by default. Most of us prefer to
keep only one panel at the bottom just like the Windows Taskbar, perform the
following steps :

➢ Delete the bottom panel: right-click over it and click "Delete This Panel".
    Move the top panel to bottom: right-click over it, select "Properties" and
    change Orientation from "Top" to "Bottom".
➢ Add running program buttons: right-click the panel, select "Add to Panel",
    scroll down and select "Window List", click "Add".
➢ Replace the Menu Bar ("Applications-Places-System") with the "Main
    Menu" to save space in the panel:
    1.Right-click the "Menu Bar" and select "Remove From Panel".
    2.Right-click the panel, select "Add to Panel" and choose "Main Menu", click
    3.Right-click the items (Firefox, etc) and untick "Lock to Panel".
    4.Right-click the added "Main Menu", select "Move" to relocate it to the far
➢ Pin Programs to the Panel :
    Frequently used programs can be easily pinned to the panel.
    1. Browse to the program from "Applications" or "Main Menu".
    2. Drag and drop the program to an empty space in the panel, or right-click the
    program and select "Add this launcher to panel".
    3. Right click the program icon, select "Move" and drop it to a new place in the
    4. Right click the program icon and select "Lock to Panel".
➢ Set Fully Transparent Panel:
   Go to Applications (or Main Menu) > Accessories > Terminal.
   1. Enter cp -R /usr/share/themes/Ambiance ~/.themes/
   2. Enter gedit ~/.themes/Ambiance/gtk-2.0/apps/gnome-panel.rc (for Ubuntu
       11.04 or 10.10) OR gedit ~/.themes/Ambiance/gtk-2.0/gtkrc (for Ubuntu
       10.04), to open the file with gedit.
   3. Search for this line bg_pixmap[NORMAL] = "img/panel.png" (for
       Ubuntu 11.04 or 10.10) OR bg_pixmap[NORMAL] = "panel_bg.png"
      (for Ubuntu 10.04)
  4. Comment out the line by placing a # at the beginning of the line, like this:
             # bg_pixmap[NORMAL] = ...
  5. Save the file.
  6. Go to System > Preferences > Appearance, switch to the other theme and
      then back to the Ambiance theme.
  7. Then adjust panel transparency in panel properties.

➢ Change Font Type and Color of Panel Clock
    The font type and color of the panel clock follow the windows
    text in a theme by default. In particular, if the font color is black and
    shown on a dark background through a transparent panel, you can't
    read the clock clearly, but you can tweak it by changing the font color. And  
    you can define the font type for your panel clock
    as well.
   1.Open up the text editor Gedit and paste the following code:
         style "my-panel-clock"
           fg[NORMAL] = "#FFFFFF"
           font_name = "DS-Digital Bold 16"
         widget "*.clock-applet-button.*" style "my-panel-clock"
   2. Save the file as .gtkrc-2.0 (including the dot in front of the filename) inside     
       your home directory /home/your_user_name.
   3. Log out and log back in (OR enter killall gnome-panel into the Terminal) to
       see the change.
Note :
   The DS-Digital font can be downloaded here. After downloading, unzip
   the file and install the font into the system for use

     The panels are much more flexible than the Windows Taskbar in that   
      many  items  in the panels can be easily added, removed or configured.

    Enjoy :-)

Friday, 8 July 2011

Know Your Hardware Information

              Hi Everybody , Here I am going to discuss something about your system
configurations..precisely hardware configurations. It is important to know about the hardware configurations of your computer, All of us know how to see the complete hardware information about computer using device manager...Then what about Linux ?
How we can find all the information about the computer we are using..Lets learn two simple methods to do so ,We are able to do know all the information we need about our hardware..

METHODE 1: Geeky way (using command line)
             If you like to use the command interface to do such a job, to know about your system information completely we can use the following commands ..Open command prompt and type the following to get system information.

                 sudo lshw

to save the report as an html file in your desktop type :

                 sudo lshw -html >systeminfo.html
                 sudo mv systeminfo.html Desktop
METHODE 2: Using Hard info software (GUI METHODE)

   HardInfo can gather information about your system’s hardware and ,operating system, perform benchmarks,and generate printable reports either in HTML
or in plain text formats. Currently it knows about PCI,ISA PnP, USB, IDE, SCSI, Serial and parallel port devices. It will be better for normal users.

Install HardInfo :

          Since it doesn't come default with Ubuntu u need to install it ,For that connect to INTERNET and open terminal(Ctr+Alt+T) and type the following code

-------------------------------------------------------------------------------------------------------                                  sudo apt-get install hardinfo           -------------------------------------------------------------------------------------------------------

             To take hardinfo goto Applications-->System tools-->Hardinfo Once it opens you should see similar to the following screen shot You can see the system Summary, OS details ,Hardware Informations or any information
about your system on clicking them. You can also take a printable version of your
system information by clicking Generate Report tab .
Enjoy :-)

Friday, 1 July 2011

Mount Drives automatically when your computer starts

                        In Ubuntu OS all the partitions in the system do not get automatically mounted at startup like windows . We can mount the partitions whenever we needed. It’s not a bad idea to enable auto-mount of hard drive at system startup. That makes your accessibility better .Here we discuss about a method to do so.
                      PySDM is a simple ‘storage device manager’ application (based on PyGTK) that allows full customization of hard drive mount points. To install you can search for ‘pysdm’ in synaptic package manager or Type the following command(s) given below– at Terminal
     sudo apt-get install pysdm

      Then open it from Applications -> System -> Storage Device Manager or simply search for it. Now you are ready to customize it – just select the drive or partitions and  click on mount or any other options that you want to configure. Be careful, while handling with your hard drive.
Enjoy :-)

Friday, 24 June 2011

How To Restore Grub After Installing Windows Over Linux

               Recently I installed Windows 7 in a computer that already contains a linux installation .After installation I was unable to boot into linux OS(I can't find it in boot menu). What to do this time? reinstall linux ? No Need.Let's see what happens in this case..
                               When we install windows ,it uses its own boot loader and overwrites the grub(linux boot loader).The boot loader of windows never mind about any other OS which is installed on the computer .It erases the boot load entry of linux. Still the Linux OS is hidden there in the hard disk. So the solution we have to restore our OS without losing any previous data is to restore or reinstall grub. We can apply this methods when our grub installation has any damages happen. Here we discuss about two methods
which  verified  myself .

Method 1: Using a live CD of Ubuntu 9.10 or higher

Here assuming the Ubuntu partition is sda2,and /boot partition is sda1 (if you have a
separate /boot partition).
Boot up ubuntu from the livecd,open terminal and run:

    sudo -i
    mount /dev/sda2 /mnt
    mount /dev/sda1 /mnt/boot #skip this one if not have a separate /boot partition
    grub-install --root-directory=/mnt/ /dev/sda

If you miss “grub.cfg” file,use following to recreate:
  mount --bind /proc /mnt/proc
  mount --bind /dev /mnt/dev
  mount --bind /sys /mnt/sys
  chroot /mnt update-grub
  umount /mnt/sys
  umount /mnt/dev
  umount /mnt/proc
method 2: This method can be used when you have access to the grub terminal
Using the cd/usb boot up with grub
Boot up the cd/usb,press c in grub will be in the grub terminal
:in terminal type following


  grub>find /boot/grub/core.img
  grub>root (hdx,y) (previous command will output the x,y)
  grub>kernel /boot/grub/core.img
After the boot command,you’ll go into grub2 menu.Select to boot up ubuntu,and run
this command to restore grub:

 sudo grub-install /dev/sda

                                                   The End.

Tuesday, 7 June 2011

Install GNOME 3 on Ubuntu 11.04/11.10

how to install it and remove it Here is the answer

Wednesday, 18 May 2011

Logout user session using Terminal

"Under Linux there are GUIs (graphical user interfaces), where you can point and click and drag, and hopefully get work done without first reading lots of documentation. The traditional Unix environment is a CLI (command line interface), where you type commands to tell the computer what to do. That is faster and more powerful, but requires finding out what the commands are."
-- from man intro(1)

Anyway here is the command that allows to logout from your current session.

Open the terminal and type

gnome-session-save --kill

or  try

gnome-session-save --kill --silent

The First command will give you a pop-up showing a logout button and the if you try the second the sytem will logout automatically.


Wednesday, 27 April 2011

Customise the login wallpaper

1. Copy the wallpaper to your Home folder. Make sure that it is of .JPG format.

2. Move your wallpaper ,run following command in terminal
    (to open terminal go to Applications->Accessories->terminal)
    sudo mv ~/your-wallpaper-name.jpg /usr/share/backgrounds

3. Run the following command to activate the Appearance window upon login

         sudo cp /usr/share/applications/gnome-appearance-properties.desktop /usr/share/gdm/autostart/LoginWindow

4. Now close the terminal and logoff .(If you can’t find your favorite wallpaper,
    click Add. You should be able to find your wallpaper in the /usr/share
    /backgrounds directory).
5. Your login background will instantly change to the wallpaper you have
    selected. Now login to your account.
6.  Open terminal. Type the following command to deactivate the Appearance
     window upon login.

    sudo unlink /usr/share/gdm/autostart/LoginWindow/gnome-appearance-   

You are done ....Enjoy :-)