Monday, August 27, 2012

Obtaining Kernel/OS information through terminal

     It is always a pleasure to have fun messing around with terminal and yet getting fruitful results from the mess. One such thing is obtaining the information regarding Kernel name, OS name, Kernel version, Kernel Release, Machine type, Processor type and so on. All these information is available to the user with the help of uname command. uname is a command line tool with which we can derive various machine and os information. Lets see the commands one by one.

  • To obtain kernel name,
      • uname -s
  •  To obtain OS name,
      • uname -o
  •  To obtain machine type,
      • uname -m
  • To obtain processor type,
      • uname -p
  •  To obtain information on hardware platform,
      • uname -i
  • To obtain the kernel version
      • uname -v
  • To obtain kernel release,
      • uname -r
  • To obtain all,
      • uname -all

      Whenever you need immediate information on your kernel or os these commands come in handy. Don't forget that the terminal is a more powerful tool which is more fast and efficient than the GUI. Go on and mess around more with your system. Because its the only you can get to know your system( "interacting a lot") and don't worry if anything happens because everything can be restored with linux. Hope the information was useful. Looking forward for more.













Find out various hardware/system information using terminal

     Whenever you are in urgent need for system information for example, you would want to know the free memory, your system configuration, hard disk information, a friend may need some immediate details and so on. Always relying on GUI tool can be inefficient because you have to search the tool and view the information. Instead there are tons of commands available out there so that you can view the system information for any particular component or as whole right from the terminal whenever you need. We shall see the commands based on the category listed one by one.

Graphics Information:
  • To know info about your OpenGL, graphics card use the command,
      • glxinfo, 
  • Note: glxinfo may not be installed on your system, install it using
      • sudo apt-get info glx
  • To check if you have 3d rendering,
      • glxinfo | grep direct
      • grep searches for the text direct in glxinfo and returns the information in it.
  • To see the graphics card vendor,
      • glxinfo | grep vendor
  • To see the specifications of the graphics card model,
      • lspci | grep VGA
  • A simple 3d benchmark,
      • glxgears

  •  To see the supported resolutions,
      • xrandr
 Audio Information:
  • To know the information on audio controller,
      • lspci
  • lspci is a command that is used to display detailed information on PCI buses and devices connected to the system.
  •  To know audio device information,
      • aplay --list-devices
 Memory information:
  • To display the amount of RAM and swap space available and how much is being used,
      • cat /proc/meminfo
      • for more information on proc file click here
  •  To display the amount free memory,
      • free -m
      • -m is used to display size in Mb.
      • for more info of free type free --help
  •  To see the processes running in your system (like task manager in microsoft windows),
      • top
      • press C to sort data based on cpu usage.
      • press M to sort data based on memory usage.
HDD information:
  • To display the filesystem information,
      • df -h
      • -h displays data in GB.
  • To display the partition table,
      • sudo fdisk -l
 
 Network Information:
  • To display info on your ethernet controller,
      • lspci | grep Ethernet
  • To display info regarding system IP and other network info,
      • ifconfig
 
 Software Information:
  • To know the current distribution and version,
      • cat /etc/issue
  • To display package version and its dependencies,
      • apt-cache showpkg shutter
      • apt-cache show shutter | grep Version, shows only the version.
 
 USB drives Information:
  • To display the list of usb devices,
      • lsusb
 
 Detailed Information:
  • To list all PCI devices,
      • lspci
 
  •  Overview of all hardware information in short,
      • hwinfo --short
      • To install hwinfor,
        • sudo apt-get install hwinfo
      • For more help hwinfo --help
  
  • CPU uptime can be obtained using,
      •  uptime
 
     You can obtain tons of detailed information regarding your system with the help of these commands. You can get more help on these commands and their uses from the web. Always there will be help when you need it. Hope, the information was helpful.









How to solve "sudo: unable to resolve host " problem ??

     Remember the previous post in which i wrote about changing your system's hostname from terminal. While many of you would have encountered a error message "sudo : unable to resolve host yourhostname" while you install or perform any task that requires root privileges. But wait, don't jump to the conclusion that you won't be able to continue your task, you can still continue with your task. There is a simple thing you have to do to get rid of this error.

  • When you edited the hostname file in /etc/hostname, the hostname file just contains the machine name.
  • You have to make the same change to the hosts file in /etc/hosts.
Viewing contents of both files in terminal:
  • Both the contents of the file can be viewed directly from the terminal using the commands,
      • cat /etc/hostname (or) hostname
      • cat /etc/hosts
      •  
  • From the above image you can see that, the hostname is aldo while the name in hosts is vms20591.
Viewing contents of both files in text editor: 
  • To view the contents of the file in text editor type the following commands,
      • sudo gedit /etc/hostname
      • sudo gedit /etc/hosts
  • Note:
    • Remember that still you will get the error "sudo : unable to resolve host yourhostname", but just ignore it and type your password.
    • Also don't forget to run the command using sudo without that you can't make any changes in the hosts.




    • You can see the hostname varies in both files.
Making changes to the files:
  • In order to get rid of the error, the name in the files /etc/hostname and /etc/hosts should be the same.
  • Use the command previously mentioned,
      • sudo gedit /etc/hostname
      • sudo gedit /etc/hosts 



  • After making the changes reboot the system and see if the error has been cleared.


     So, the error which occurred was eliminated just by making sure the hostname in both files were the same. Hope this information was useful.



















Saturday, August 25, 2012

Obtaining GNOME and Unity version in Ubuntu via terminal

     Many of the users are so puzzled when they hear news about the latest release of GNOME and the features of Unity in the coming version of Ubuntu. But wait, what is the current version of these in my system of now? The answers for your questions comes with two simple commands from terminal.

GNOME version in Ubuntu:
  • Type the following command in terminal,
      • gnome-session --version

Unity version in Ubuntu:
  • Type the following command in terminal,
      • unity --version

 Additional information:
  •  To find out what option we selected (ubuntu or ubuntu 2d) during the login screen provided by display manager type the command,
      • echo $GDMSESSION
      • echo $DESKTOP_SESSION

    •  If you selected ubuntu at the login screen then it will be displayed as ubuntu.
    • The login screen options when you click ubuntu circle next to your profile name,

  •  To display the current desktop type the following command,
      • echo $XDG_CURRENT_DESKTOP
  •  All these weird names up here are the environmental variables. To have a detailed view about these type the following command,
      • env
 

     Hope you got benefited by the information provided. Hoping to provide more tips and tricks for the users.








 

How to find which window manager you are using in Linux?

    An XWindow manager(because we are talking about linux) runs on top of the XWindows system. The Window manager can be visualized like a controller that decides how the various windows in a desktop environment undergo transition. Based on the hardware capabilities of the system the graphical transitions of the windows are decided. There are various window managers available like compiz, kde, mutter, metacity, beryl and so on. Each window manager have their own way of managing the window operations.
   You can have more than one window manager in your system without any worries because the kernel of the OS and GUI are separate in linux so this doesn't tamper with you underlying OS kernel. But only one window manager can run at a time. In order to find out what is the default window manager is running in your system unless you have changed it, simple steps are available.

Method 1:
    •  The simple way is to look into the process list to find out the window manager that is running active in the system. To do that,
        •   pgrep -l compiz |cut -d " " -f2
    •  You can replace compiz in the above command with name of other window managers like metacity , mutter etc
Method 2:
    • By using the command wmctrl which is a command line utility for many window managers (linux,windows,etc) and is used to do variety of operations with the windows in the desktop.
    • One of the functions of the wmctrl command is to display information about the current window manager. To achieve this,
        • wmctrl -m
    • But if you get a error like wmctrl not installed, no worries install it the traditional way,
        • sudo apt-get install wmctrl
    • After the installation again type the command wmctrl -m and find the current window manager in your system.

      
     Hope the information was useful and always don't worry when you face any difficulties with any software tool you use because there are always people out there to help.









How to check whether Compiz works fine in Linux ?

     Compiz is a composite window manager which unlike other window manager doesn't stop from normal window transitions effect rather providing visual effects when switching between windows using 3D acceleration and rendering techniques. So, how to find out if the compiz window manger that runs on your system is working good? Thats where Compiz-Check comes in. With this script you can instantly know information regarding the abilities of your system to perform under heavy 3D customization.
     Why to run this test? If you happen to do so much of tweaks with your window manager or config tool you may encounter that your system crashes or programs stop working or any internal error. So, before you do anything it is good to do a test like this.

Step 1:
    • To obtain Compiz-Check type the following command in terminal,
        • wget http://blogage.de/files/70708/download -O compiz-check

Step 2:
    • Next convert the compiz-check script to an executable file using,
        • chmod +x compiz-check
    • Press Enter.
    • Run compiz check using,
        • ./compiz-check
    •  To know more information you can continue with y else n.
      With these simple steps you can know if your system can support the graphic transitions provided by Compiz Window Manger. Hope you find this information useful.




 















How to obtain information about GTK+ on Linux

     GTK+ is a cross-platform widget toolkit with Graphics User Interfaces (GUI) are designed. We come across these terms when you come across an application built based on GTK+ or any other version of GTK+. When you want to change the theme of your desktop,  you will see notes like these themes work for GTK+ 3x or GTK+ 2x etc. How to know what are GTK+ versions your system runs. So, for every problem or puzzle there is solution and this article might help you solve it.

Method 1:
  •  COLUMNS=150 dpkg --list libgtk2.0-0 libgtk-3-0


Method 2:
  •   dpkg --list libgtk2.0-0 libgtk-3-0


Method 3:
  •  apt-cache show libgtk2.0-0 libgtk-3-0 | grep Version


Method 4:
  • For detailed view,
      • apt-cache show libgtk2.0-0

      • apt-cache show libgtk-3-0


Method 5:
  • To know the details of the packages installed,
      • dpkg --get-selections | grep gtk


     So, hope you would be knowing how to find the GTK+ version of your system when you need to install any upcoming versions or to know if your GTK+ version is enough compatible for any software you install.












 

Friday, August 24, 2012

How to Install Ubuntu Tweak via PPA?


     Ubuntu Tweak is an all in one configuration tool which is exclusively designed for the Ubuntu GNOME desktop. Ubuntu Tweak is so special when its comes to functionality because with this tool you can configure your system and desktop settings which the default desktop environment provide. Ubuntu Tweak is an open source project and so it is free to download. 
     Ubuntu Tweak can be either downloaded from the website or installed via terminal. Since, working with terminal is fun, efficient and time saving let me guide on installing Ubuntu Tweak via PPA.

Step 1:
    • Launch terminal and type the following command,
        • sudo add-apt-repository ppa:tualatrix/ppa
    • Press Enter.
    • After you press Enter you will be prompted to enter your administrator password so type your password and press Enter.
    • Then you will prompted with a message in the terminal which says
      • You are about to add the following PPA to your system: The official Ubuntu Tweak stable repository More info: https://launchpad.net/~tualatrix/+archive/ppa Press [ENTER] to continue or ctrl-c to cancel adding it
    • Press Enter to continue.
    • Wait for the PPA to verify the source.
    • The PPA will be successfully added to the system.

Step 2:
    • Now you need to update the package manager with the  command,
        • sudo apt-get update
    • Wait for the update to be completed.

Step 3:
    • The final step is installing Ubuntu Tweak.
        • sudo apt-get install gnome-tweak
    • After pressing Enter type your administrator password and press Enter.
    • You will be prompted to download certain amount of data from the web so type y and press Enter.
    • Wait for the installation to complete. 
  
Step 4:
    •  Launch the application from the terminal using the command,
        • nohup ubuntu-tweak &

     Now, you can work your way through the tool to configure your desktop based on your needs. Ubuntu Tweak is an efficient and faster tool for the users. Hope the information would help you get started with this application.

A Quick Guide/Walkthrough for Stellarium

Introduction:  

     If you happen to be fascinated by Astronomy and always wanted to see the cosmos with your surreal quality then Stellarium is the best tool which makes makes you feel that you are really seeing the planets and stars in the cosmos as if you were present there. Stellarium is an open source tool for viewing and understanding a great deal about planets and stars with stunning visuals and technical details.
     Many people who are new to Stellarium would find it little bit weird on how and where to start working.Well, at first when i started using Stellarium I was puzzled more like you. Here is a very basic and a quick guide to make you get started in working your way in Stellarium.

What is the great deal about Stellarium??? 
  • Stellarium has a default catalog of over 600,000 stars.
  • Constellations for twelve different cultures.
  • Detailed information of planets and their satellites, stars, nebulae.
  • Easy to use interface with switching of views based on perspective.
  • Powerful zooming capabilities.
What can we do with Stellarium???
  • Missed to see the solar or lunar eclipse  last time?? with stellarium you can view everything in stunning detail without having to go and out to the planetarium/observatories.
  • View sunrise and sunset with excellent quality.
Downloading Stellarium:

     Stellarium can be easily downloaded from terminal using the command,
        • sudo apt-get install stellarium

Launching Stellarium:

     Stellarium can be launched from the terminal using the command,
        • nohup stellarium &

     A view of Stellarium,


Interacting with Stellarium:

       There 6 different windows availabe in the Stellarium view port namely,
  • Location Window (press F6):

    • With Location windows you can set your location either by typing the location in search box(marked by rectangle) or directly entering the co-ordinates(marked by arrow).
  • Date/Time Window (press F5):
  
    •  With Date/Time Window you can set the date and time you need and see the position of stars and planets at the time.
  • Sky and Viewing Option Window (press F4):
 
    • The Sky and View option window has 4 tabs of which with sky tab you can show/hide planet markers, planet boundaries and atmosphere.
    • With Markings tab you can change perspective from projections menu(marked by arrow), show/hide different astronomical grids and lines, show/hide constellation art, constellation lines etc.

    • With Landscape tab you can  change the landscape on the viewport.
    • With option present at the bottom you can show/hide ground, fog etc.
 
    •  With Starlore tab you obtain a great deal of knowledge on the stars and planets based on various cultures around the world.
  •  Search Window (press F3):

    • With Search windows you search for any object or planet by typing the name in the search box provided or you can feed in the position.
  • Configuration Window (press F2):

    • With Configuration window you change various setting of stellarium based on your requirement. You would want go through some advanced guides before you tamper with the configuration.
  • Help Window (press F1):
   
    • Help windows provides all the shortcut keys with which will make it lot easier to work with stellarium.
  • Viewing info on any astronomical body:

 To view the information of any planet or star or nebulae just click on it and you will see the information on the top-left of your screen.
  •  A view of the constellations:

    • The glowing icons on the bar below shows that they are enabled. 
    • The bar below is consists of basic functionalities you'll find in the different windows we saw earlier.
    • Basic icons includes show/hide,
        • Constellation art (press R)
        • Constellation line (press C)
        • Constellation labels (press V)
        • Equatorial grid (press E)
        • Azimuthal grid (press Z)
        • Ground (press G)
        • Fog (press F)
        • Atmosphere (press A)
        • Cardinal points / Directions (press Q)
        • Nebulae (press N)
                 and so on.  
  •  A view of Nebulae:
    • By pressing N you can see the Nebulae.
    • By clicking on any Nebulae you can see the information on the top-left.
  • A view of stars:
    •  A view of Sirius Star.
    •  The image shows the sirius along with its details.
  • A view of satellites:
    •  Image shows the satellites which currently orbiting the Earth and their information.
  •  A view of planets:
    • The image show Saturn along with its satellites.
      I guess you would now be having a basic idea what Stellarium is and what it means to you. With these basic guidelines you can explore Stellarium based on your needs and get benefited by it.Hope, the information was useful.