Startup Applications: automatic execution of the most used programs during every user login

During every login or bootup, the OS performs a number of tasks in the background to get the OS up and running and ready to be used. Customizations in Linux OS like Ubuntu can be done very easily, that allows an user to add any number of “custom” tasks or programs to the system to be performed every time the user logs in or boots up the OS.

We can choose a certain number of tasks to be automated, thereby reducing the repetitive work of the user to quite an extent. The tasks that can be automated include running a certain program like a custom system check that the user might want to view, or to run applications like the web browser with certain predefined websites. Or it can be automating system control programs that needs to be run during each bootup or even login. Ubuntu allows us to do these kind of automation in a very simple manner, by providing us a GUI based software called the “Startup Applications”.

Though this may provide a lot of convenience, it is important to remember not to overuse this feature. Users might face problems when a large number of tasks are provided or selected to be automated. The main problem this leads to is slowing down your system at startup. Hence, it is very important for the user to NOT over utilise this functionality and only automate the most required or used tasks.

So let’s begin. First thing to do is to open the Startup Applications. To do so, in the desktop Dash, type:

“startup applications” as shown in the image below.

Ubuntu Desktop - Startup applications

Click on the “Startup Applications” icon, and the Startup Applications window opens. It will look similar to the image below. Note that you might have a different set of entries in your window than the ones that can be seen in the image below.

Startup applications preferences

Once this is open, we can start with the automation of tasks. This posts will demonstrate some of the tasks, but many other tasks that are important to you can be added the same way. So here are a few examples:

1 Starting a browser with a predefined web page

Every build of Ubuntu comes with Firefox inbuilt. We can use that to open websites that we check regularly. For example, I like to read Linux news, from the website “lxer.com”. To open this website every time, click on the add button present on the upper right side of the Startup Applications window.

Another window opens. In the new window, type the following in the command field:

Firefox “http://www.lxer.com”

Fill out the name as well and use the comment field to describe your new task. An example is shown in the image below. Once that is done, click on the “Add” button and you will see an entry named “lexr Linux news” (in this case) in the Startup Applications window.

Add startup program

This way, a browser can be opened automatically with any website or search query. For example, if the first thing you do is view the trade stock market, then you can click “Add” and enter the command to go directly to a trade website. Example:

Firefox “NASDAQ”

2 Running system management functions automatically

Certain system management functions or programs require to be started each time a user logs in. Consider the situation of system overheating experienced by many Ubuntu users. In this case, most of the users install a software called “TLP”. And in many cases, TLP doesn’t always start on its own automatically. In such a case, rather than to run it manually each time, the Startup Applications can be used to run it automatically, by following the similar steps. So, click on the “Add” button and use the following command in the command field:

sudo tlp start

For the name and the comment field, refer to the image below:

sudo tlp start

Unlike the first example, this example of TLP , the program is started in the background and not visible to the user. Thus in this way, a user can start a variety of background processes automatically that relate to system management functions.

To read my full post head over to HowToForge: here

Advertisements

Grub rescue

I had triple-boot on my system. Windows 8, windows 7 and Ubuntu and all the boot management done by Ubuntu Grub of course. Almost having all the 3 OS for about 6 months, I started facing difficulties like slowing down, shortage of space, etc and so I decided to delete windows 8.

The process to do that is simple.
on start menu, select run and type msconfig. Once that opens select the Boot tab and in it select the Windows 8 option and click on delete and then click on OK.
I then, deleted the partition holding Windows 8 and merged it with one on the other drives. Now, this leads to en error. The Linux grub manages only the windows 8 and the windows 8 boot loader manages between windows 7 and windows 8. So, when the windows 8 partition was deleted , it corrupted the grub as well.
This lead to the error :

unknown filesystem:
grub rescue> _

This error can be fixed easily.  The path the grub has to be set. So, type the following commands :

set boot=(hd0,msdos6)
set prefix=(hd0,msdos6)/boot/grub
insmod normal
normal

Once all the 4 commands are typed , automatically the grub loads allowing you to chose the OS to boot into.

once the boot options is got.. Boot into Ubuntu and then reinstall the grub using the following commands

sudo update-grub
sudo grub-install /dev/sda

Some times the boot file might not be there on (hd0,msdos6) , in this situation , you can type ls and find out all the partitions
Example :
grub rescue> ls
(hd0), (hd0,msdos5),(hd0,msdos6),(hd0,msdos7),(hd0,msdos8)

So use ls to find the boot folder.
Eg:
grub rescue> ls  (hd0,msdos5)
no file system found
grub rescue> ls (hd0,msdos6)
ext4: file system

So, when a message that come like ext4 or any other file system exist, the boot file is present in that partition. So in the above 4 statements, substitute (hd0,msdos6) with the partition you have found containing the file system.

Setting up and using Github on Linux : A beginners guide

github

 

GitHub is a treasure trove of some of the world’s best projects, built by the contributions of developers all across the globe. This simple, yet extremely powerful platform helps every individual interested in building or developing something big to contribute and get recognized in the opensource community.

This post will be a quick setup guide on Github and how to perform various functions of creating a repository locally, connecting to the remote host that contains your project (where every one can see), committing the changes and finally pushing all the content in the local system to Github.
Please note that this post assumes the the reader is familiar with the terms  on Github such as push , pull requests , commit , repository,etc.

Step 1

download and install git for Linux :
sudo apt-get install git

Step 2

Set up the configuration details for you, as a user of Github:

git config –global user.name “user_name”
git config –global user.email “email_id”

An example for this would be:
git config –global user.name “akshay” [here the “user_name” can be anything.. in my case its akshay]
git config –global user.name “abc@gmail.com” [here the “email_id” should be the ID used to create the GitHub account. In this example its abc@gmail.com]

Read my full post on HowToForge Here.

Join me on Github: https://github.com/akshaypai

Wikipedia on the terminal , using python

I wanted to get information on my terminal on Ubuntu. y requirement  was that, any  data that i wanted  should be output on the terminal itself. I didn’t want to open a browser each time i wanted some information. And all I needed was the data and not images and videos. So to view the information on the terminal was very convenient and efficient.

When i searched, I was looking for a python implimentstion , i came to know that using Wikipedia API, one can to send a http request to the website as a query action and json format and get the json object. This could be implemented using the request , module in python. So this would give the json object that had the data on the topic to be queried.

The next step was to parse it . And I found that Beautiful Soup can be used to do that so extract only the data. This was one of the best options available . An then the only thing to do was to print the data that is extracted.

I found 2 scripts to do just that. These scripts however dont use Requests module but use urllib and urllib2.
Advantage :
The advantage of using this is that, only a brief summary of the topic under search will be showed. And most of the time it is the only thing we want.

The second thing is that if there are sections in the topic, it will be shown.

Disadvantage :
What this lacks is that, it does not have a good pattern matching for searches, that is if it doesnt ind the exact words in the article it will not be returned. This also happens if each result has multiple result.
Sometimes the data returned is either very less or a lot.

Procedure:

First download and save tehse 2 python files.
wikipedia.py
    wiki2plain.py

Then create a python file and name it wiki.py . Then paste the following script in it.

from wikipedia import *
from wiki2plain import *

lang = ‘simple’
wiki = Wikipedia(lang)
try:
    data1 = raw_input(“enter searh query: “)
    raw = wiki.article(data1)
except:
    raw = None

if raw:
    wiki2plain = Wiki2Plain(raw)
    content = wiki2plain.text
    print content
else:
    print “No text returned”

Save it in the same folder as the other to files and run  wiki.py
Enter the search term and get the results.

Screenshots :

Screenshot from 2014-04-20 22:21:28

Screenshot from 2014-04-20 22:21:06

First Update for Ubuntu Dual Boot Installer from Canonical

On 7th jan 2014 the first update to the Ubuntu dual boot installer for touch devices was released. The mail sent by the Canoical team says that this is the first update since Ubuntu and Android dual boot developer preview was announced in Dec 23rd 2013.  Ubuntu Dual Boot Installer is provided as a tech preview for developers who want to run Ubuntu and Android on a single device.Canonical also  has still kept the warning that it is not for regular users as its not a fully stable version. You have to remember that the Ubuntu Dual Boot Installer is still in development and you might experience problems.

Canonical-Releases-First-Update-for-Ubuntu-Dual-Boot-Installer

Here is a complete download and tutorial from the ubuntu wiki : https://wiki.ubuntu.com/Touch/DualBootInstallation

This version however was extensively tested on the Nexux 4 and yet to be tested on Nexux 10. According to the changelog, a warning for unsupported devices is now shown, Ubuntudualboot app is now installed in Ubuntu, and the Install/Download progress bar now fits the screen size in Nexus 10.
Also, Ubuntuinstaller now supports resume for downloading images, and the Ubuntu Installer Application now displays channel chooser on CM 10.2.

this release comes with  6 major bug fixes that can be found here.
And the list of known bugs is listed over here.

 

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:
    sl2
  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
    toilet

    run the commands as :
    toilet seeTheSource
    toilet3or run the command: toilet -f mono12 -F metal seeTheSource
    toilet4
  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:
    telnet towel.blinkenlights.nl
  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
    
    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 :

~/.gnome2/nautilus-scripts/a-desk
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…
conky22

conkyblog

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.  

 

software

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

softwarecenter2blender

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.