Interesting commands on Linux :SET 1

Here are some fun commands you can try on your Linux system probably when you are bored or want to try something new and something different. I really liked these commands and hope that you will enjoy using it too.

  1. cowsay
    you can make an image of cow appear on the terminal and  show any text that you want , as if the cow was saying it –
    So install cowsay using one of the following command :
    sudo apt-get install cowsay                     (for Debian based OS)
    yum install cowsay                                   (for Red Hat based OS)
    here is how the uoyput will look:
    cowsay1If you want to have a coloured cow to show any text install xcowsay .  Install it same way as cowsay but replace cowsay with xcowsay.
    Run it and ul get a coloured cow some where on your screen.
  2. Steam Locomotive (sl)
    this command “sl” runs a train across your terminal. Its really cool!!
    So install it using one of the commands:
    sudo apt-get install sl                            (In Debian like OS)
    yum -y install sl                                    (In Red Hat like OS)
    run the command  “sl” in he terminal, you should see something like this:
  3. toilet
    This command itself is funny.. but what it does is takes a text string and builds the text in some different forms like using symbols some colours,etc
    To install use one of the command:
    sudo apt-get install toilet
    yum install

    run the commands as :
    toilet seeTheSource
    toilet3or run the command: toilet -f mono12 -F metal seeTheSource
  4. telnet
    telnet is a network protocol and it causes stories to be run like some kind of animations. Nothing has to be installed here, all you need is a working internet condition.use the command:
  5. cmatrix
    this command is used to create the matrix effect on a terminal.install it using the suitable command:

    sudo apt-get install cmatrix
    yum install cmatrix
  6. espeak
    this command is used for text to speech. So you can configure it to be a welcome sound when your OS loads. Or use it to read text just like that.
    install espeak using one of:

     sudo apt-get install espeak 
     yum install espeakthen run it as: espeak "this is see the source" 
     or any other text you want. And have fun.

So all these commands are really fun to use, there are lots more available.. I will post about more useful commands in the coming posts!!

Animated desktop: For ubuntu 13.04 Raring /ubuntu 13.10 Saucy

An animated desktop looks amazing, and what can be more cooler than having the ability to setup an animated desktop with a video of your own choice??
This post will give the detailed steps to setup an animated desktop on Ubuntu 13.04 and 13.10 . The procedure works completely fine with older versions as well (but the older versions have an easier method). So to get the background live with a video of your choice , a few requirements have to be met. Few software have to be downloaded and installed. And  for videos which you have chosen to work , they must be in the .wmv video format.

Check out the video below to see how the animated desktop looks like. And follow the procedure below to make your desktop look like that. The link to the animations shown in the video is given at the end of this post. But remember this video is for Ubuntu 12.04 so the procedure for 13.04 and 13.10 is not this easy!!!

procedure for Ubuntu 13.04/13.10:–

step 1:
install the following software to support and play your video as a background. Copy paste these following lines one by one in the terminal :

  • sudo apt-get install mplayer
  • sudo apt-get install rar
  • sudo apt-get install unrar
  • sudo apt-get install ubuntu-restricted-extras
  • sudo apt-get install zenity

so this will install all the prerequisites that were needed. Since Zenity has some error, the installation cannot be done correctly on Ubuntu 13.04 and 13.10 which is why a different procedure has to be followed.

step 2:
Here we use the a-desk script for installation. the a-desk is a shell script that automates all the work that has to be done to set the desktop. So go ahead and download the a-desk zip folder from HERE .
Once downloaded extract it to get a folder named “ad” and place it where you want it to be. Now open the terminal and go to the location where you have stored the “ad” folder.
For example. if you have put he folder under /Home then use the command :
cd /home/ad

Once you are in the folder, run the shell script a-desk.installer using the following command:

sudo sh a-desk.installer

This will run the script and give you the options to select your language and the version. That is you can choose to get the 32bit version and 64 bit version .Once you select it it will start installing and once it is done  The “OK” button on the installer window will be highlighted. Click on it to finish the installation.

step 3:
Now go to the terminal and type the command :

This will open a window and you have to select the option atomic city. This will load the video atomic city to the background. Atomic city is a video that comes by default with he a-desk script.So thats it.. now you will have an animated desktop.

In my next post I will give the procedure to use customised videos as your animation for the desktop and also to change the animation to the videos present in the link given below!!

More amazing videos to setup from the background can be found from : HERE
Go to that website and download any video that you like and make it your animated desktop.

Disclaimer: When the animated desktop is setup , it doesn’t stay after the bootup. That is , this procedure doesn’t work on startup and you would have to repeat the procedure all over again to set it up. This is something I am working on and as soon as I find a solution, I will post it.

CPU utilisation viewing : with Python

I was curious to know the amount of CPU that is being used to perform tasks on my ubuntu system. I wanted to know if all my cores in the chip were being utilised and if they were  working correctly. A little research led me to the discovery of  CONKY.  A tool that helps the user to monitor/view the utilisation of various system resources. I also found the CONKY MANAGER that allowed users to view the details in a cool graphical way.


Details of installing conky can be found here.
Details of installing conky manager can be found here.

So once Conky and the manager is added the widget/gadget may look somthing like this…


But I wanted only some of the details not all of them and not always.So I decided to write a python script to get the CPU utilisation in terms of percentage  on the whole as well as get the percentage corewise. That is if I have 4 cores then utilisation of each has to be displayed separately.

So on searching I found some useful packages and I wrote a script using them and it led me to get the exact details that I wanted.
The code can be found in my github account – here.
So this program identifies the number of cores in a system and extracts the details and prints it out onto the terminal in an organised way.

The packages i used for extracting the details and formatting the output are—
1)  PSUTIL – the functions of this module helped me to extrcat the average percentage of CPU being used and also the per core details.

2) CURSES- This module helped me to print the details in the same place on the terminal. So that the output looked neat and organised. This is used when there are 8 cores to be shown and
they are divided accross multiple line. If only there was a single line to be printed over and over again at the same place on the terminal, I was able to use the carraige
return sequence “\r” .
I have also used sys and time modules for formatting purposes.

Things to do after installing ubuntu

Ubuntu 12.04 is the latest LTS (long term support)  OS available.But after it is installed there are few things that can  be done – to make it more user friendly , to improve its performance and also to make it look  better.As i started using ubuntu, I started customizing and tweaking it . And while trying out new things like changing the startup sound, creating a 3d desktop ,etc  I found that I could have an operating system that  is so unique that, it represents me. A freedom which no one  will  find  in  any of the proprietary OS. Though there are tons of customization  that can be done,here are a few things to start with..

Keeping the OS updated
Once Ubuntu is installed it is important to update the repositories so that all the features are updated and bugs if any are fixed.It can be done in two ways. One way is to use the software updater.To use it type  “software” in the dash and click on  the “software updater” application. This will automatically check for the updates and asks you weather to install it or not.Select install and let it do the process.  



the other way is to use the terminal.So type the following command in the terminal:
                        sudo apt-get update && sudo apt-get upgrade

Once this is done, now the other software applications can be installed.Again  these software can be installed in two ways.
The first is by using the “Ubuntu software center”. Here you can search and install the software directly. The screenshots below shows installing Blender
animation software.
The second method is to use the command line.You can google  any particular software that you want to install and get the commands to install them.

software center


some of the  Software to install-
This list mentions some of the software that are needed to perform some basic tasks:

  1. VLC madia player – this is the best open source video and audio player known, having  the ability to play any kind of media format which makes it a                                                     preferred choice by most of the users.
  2. Gimp – This is an image editor and has the capability to perform almost all the operations photoshop can.
  3. Chromium – This is an open source browser and is a substitute to the “google chrome” browser.
  4. Jupiter – This is an optimization software and it helps increasing the battery backup and also reduce the heating of the laptop.
  5. Synaptiks –This package helps configure gestures for the laptop’s touchpad.
  6. Gparted – Gparted partition editor  can be used to to maintain and edit the disk drives of the system.
  7. Adobe flash plugin – This plugin is mainly  necessary , while video streaming on the web.The browser asks you to install the plugin when you try watching                                     a youtube video on the newly installed OS.
  8. Bumblebee  –  Ubuntu by default doesn’t  use the external graphics card. But   bumblebee can be  to run specific software using the  external GPU.

All the above mentioned software other than bumblebee can be downloaded through the “software center”. These are just a few to start with.
Hundreds of other software, tweaks and customization can be done to make your ubuntu awesome .The only way to use ubuntu is by experimenting and trying out new things on it , so  that it can make your system  efficient and productive for you to use.

Rescuing windows when boot loader is deleted.

I had installed ubuntu 13.04 and wanted to install 12.04LTS . I knew that directly deleting the Ubuntu partition will delete the linux GRUB and also due to the absence of the windows bootloader it will make the system unable to boot any OS. I had heard about the easy BCD software to create a WIndows entry and MBR. But that procedure went wrong and i deleted the partition without knowing the mistake. The laptop wasn’t booting any OS.

the GNU grub is a pacakage that is installed when installing a linux operating system parallel to a windows OS. This package gives you the choice to boot one of the multiple OS on your system.The grub is installed over the default  windows bootloader(that helps booting windows) and hence if the linux OS is deleted so is the grub and the system doesn’t knows where to boot from.The only solution is to add the windows bootloader again into the system.

This led me to do lot of research as to how to add the bootloader. I didn’t have my operating system installation disc either. But my research helped me  repair my system back to normal state booting on windows.I learnt a lot of Do’s and don’ts while installing multiple OS.

I had a windows 7 Ultimate installation disc. But mine was windows 7 home premium.It is not a problem if u have a different version CD of your OS. Boot your laptop with that CD and click on repair computer.It detects the fault and automatically installs the windows bootloader. You have to restart and the windows is back to normal.

Another way is, if you have a live USB with ubuntu in it,then boot the laptop through the live USB and install ubuntu on your system.this reinstalls the linux GRUB and you will be able to boot windows or ubuntu.
Once this is done boot Windows and create a recovery disc so that you can boot using those discs  if the bootloader is deleted.

Remember not to use system recovery present in your laptop as it will reinstall the entire OS and may sometimes delete the data also.It is best advisable to use the method mentioned above and create recovery discs.
If you haven’t already deleted ubuntu and if you want to then use Easy bcd to add windows entry and don’t delete the partition unless the changes you have made using Easy bcd is found working.

Enabling exFAT file system on Ubuntu

exFAT (extended file allocation table) is a Microsoft file system that was developed specifically for large storage flash media,for example , an external  USB drive. It was introduced  into Windows vista and Windows 7 initially. It is much faster than other filesystems like FAT32 when it comes to managing files  with large size and at a good speed.

However, even though Ubuntu can recognize many filesystems it doesn’t have the support to recognize exFAT system by default  and hence it has to be downloaded from a 3rd party PPA (a repository where developers upload latest versions of software and patches). I have tried it on Ubuntu 13.04 and 14.04 and it works perfectly. I am sure it works with some of the previous versions as well.  So to install the package , In your terminal use the following commands:

sudo add-apt-repository ppa:relan/exfat
sudo apt-get update
sudo apt-get install fuse fuse-exfat exfat-utils

These commands get the packages from the 3rd party PPA , update to the latest versions and install them on your system.Once installed the system automatically recognizes any hard drives with exFAT format and mounts it. In case where mounting is not done automatically you can always do it manually using the following commands in the terminal:

sudo mkdir /media/exfat</strong>
sudo mount -t exfat <PATH> /media/exfat

remember to change the <PATH> with the path of the external drive.For example if the connected device has the path /dev/sdc then replace <PATH> with /dev/sdc.

Similarly, the device can be unmounted manually using the command:

sudo umount /media/exfat  </strong></li>

The operations that can be performed on ubuntu with exFAT device  is restricted to read or write and cannot be used to format them and the only way to format it  is using windows.