Monday, July 29, 2013

Algorithms


Algorithm is simply a set of rules used to perform some tasks. In computer terminology algorithm is collection of instructions occurring in some specific sequence and such algorithm defines decision making, flow of data etc.
Algorithm is step done before implementing program in computer, because algorithm helps to design code for programm. After implementation of programm it is compiled by computer compiler and then programm will run. Also important point about algorithm is when program is run it may ask for input data and perform desired action. Following figure 1 shows process of writing programm code.
Figure: steps of implementing code
Algorithm section is divided int two parts:
  • Algorithm Heading:- It consist of title of algorithm, problem description and input and output.
  • Algorithm Body:-It consist of logical body of algorithm i.e conditional statement, assignments statements and others statement.
There are some standered way to write algorithms we are discussing in following section:

  1. The complete algorithm comes under one main procedure body. The title of algorithm must be specified after keyword “Algorithm” and then the parameters of the method.

    Ex:

      Algorithm name_of _procedure(p1,p2,p3------Pn)

  2. Then heading section include problem description,input and output.
  3. The compound statement should included in {} brackets.
  4. For assignments operators use <-
  5. There other various types of operators such as ” <,>,<=,>=,=, != ”.
  6. The input and output can written by using menthods : read(“Message”) and write(“Message”).
  7. The conditional statement written as :

    if(condition) then statement else statement
  8. The while loop can be written as:

    while(condition)do

    {

    Statement 1

    Statement 2
       :
       :
    Statement n
    }
  1. The for loop can be written as:
       for var<-val1 to val2 do
       {
       Statement 1
    Statement 2
       :
       :
       Statement n
       }

Lets take an example for writing algorithm for multiplication of two numbers:

Algorithm mul (5,2)
//problem Description:Algorithm for finding multiplication of no 5 //and 2.
//Input:Two numbers
//Output:Multiplication of 5 and 2
result<- (5*2)




Using Mobile As Modem


Hi readers in today's world we normally use wireless devices for our communication. The best means of communication is Mobile which is accepted all over the world,so we can use mobile for connecting to our Laptops by means of Bluetooth.  For using your mobile as modem, your mobile must contain a Bluetooth device and which provides Dial Up Network(DUN) Service.
1. Activate your Bluetooth device of Phone.
2. Activate your Bluetooth device of Laptop.
3. Now pair your Phone Bluetooth with your Laptop Bluetooth as shown in figure below:





4. Go to Bluetooth settings which will open the window as shown below:



5. Click on the ” + ” button at the bottom shown below so that you can add your Bluetooth device:


6. Select your device and press continue to proceed.


7. See  to it that your pin matches with the pin which is displayed on your screen and click matches if it matches.


8. Check the box to access the internet using your mobile phone(DUN), which will detect your phone configuration ans show the following steps:


9. Now Set up your Mobile Broadband Connection press continue to proceed, as shown in figure below :


10. Select the country and press continue,


11. Select your provider and continue,


12. select your plan for internet from the list given, as per your billing plan, and continue to proceed.


13. Confirm Mobile Broadband setting and click on Apply.


14. You will not get the the message as “Your Device Is ready To Use”.
15. Now select the Provider name from the list of wireless connections available,and wait till it connects.
16. Now go to the proxy settings and select the proxy as “No Proxy” and then access the internet.


Friday, July 26, 2013

OPENSSH-SERVER


SSH is program to login into remote computer in Network. You can have all accessibility when you logged into remote computer. This is done by Linux terminal. You can also login from Windows to Linux System but you must have the Public key and password of the remote System, but for Linux you just need password of remote system. As I mention in the  beginning of this blog SSH is a program from which you can login into remote System. But it is must that Remote System must have Openssh-server installed in its system.

You can read more about SSH program by typing “man ssh” on your Linux terminal, as shown below.

Fig :1
In above image you can see at left most corner is given “SSH(1)”, that 1 means its “Executable programs or shell commands”. In Linux there are different types of programs that run on Linux Terminal. For example there is one command that is “kill()” which can be use for two different purposes.

You can check program type by typing on terminal “man man”, it shows following output on terminal as below.

Fig : 2

As mention we must have Openssh-server on Remote system, following is an example for installing Openssh-server in your system.
For installing openssh-server:

    sudo apt-get install openssh-server

Fig :3
You can also download openssh-server(any package) instead of installing it for later use.

For downloading openssh-server:

        sudo apt-get download openssh-server

Fig:4
Now, to connect to remote System you have to type on your terminal,

          ssh -4 IP_Address_of_Remote_System

Fig:5
In above command I used “-4”, which indicate that it's a IPV4, for IPV6 use “-6”. When you'll try to login into Remote host, it will ask for the Remote account password for security purpose. After logged into Remote Host you can have all access to Remote host on your terminal. But for Administrative or root access you must know it's password. To access as Administrative or root you can switch to that account by typing on terminal:

      su account_name

It will ask you the password for the same account. After entering into that account you can have access as Admin or root.

Many times it happened that you login as Admin but you can't use some commands like poweroff . So for that purpose just try following command,

       sudo poweroff

Here, it will ask for the Admin Account password, type it and then you can use some of the root command easily.

Wednesday, July 24, 2013

Record Your Screen Activity with RecordMyDesktop in Ubuntu

As you always wants to capture your memorable moments into a video. That’s the same case when you do some important work in your PC and want it to get capture into a video. Like you have installed any software in your PC and want it to show the step-by-step guide of installation to your colleagues, so instead of repeating the installation process, you can show the video of the same to them by recording your activity during the installation process.

Yes, you can record your screen activity with RecordMyDesktop. RecordMyDesktop is one of the video capture programs available in Ubuntu. RecordMyDesktop will record your activity which you have done on your entire screen or the selected portion of the screen and produces Ogg Theora video files. This format of video file is compatible with the entire video player and you can even upload them to YouTube without having to convert them in another format.

To begin with this, you need to install RecordMyDesktop. You can install it from the terminal by typing the command:-

     sudo apt-get install   gtk-recordMydesktop  

Or, you can install it from Ubuntu Software Center by typing RecordMyDesktop in the search box.

After installation has been done, now you are ready to capture your screen activity.

To start, you have to launch the RecordMyDesktop. You can do this by typing RecordMyDesktop in the dash and then select it.

                                                                         Fig:1

You will see the main screen of RecordMyDesktop with the few options. If you want to record the sound as well so ensure that the checkbox beside Sound Quality is checked.

                     
                                                             Fig:2

Then there are more options like Advanced button. You can do the settings as per your requirements.

                             
                                                             Fig:3

You can start recording by clicking the record option in the RecordMyDesktop screen or you can click the red button appear in top right side of the system tray.
                                    
                         
                                                             Fig:4

After starting the recording the red circle button will change into a red rectangular button.

Unless you select an area of the screen RecordMyDesktop will capture everything that is happening on your screen. This can increase the size of your video file. So better to select the area of the screen and then capture it. You can select the area by clicking the red button and then click on “Select Area on Screen”. Now, you have to drag the mouse, a red rectangle tells the area that you are selecting. After releasing the mouse button, the area that you have selected will be outlined with a black rectangle.
                                                                                              
                                           
                                                                Fig: 5

After selecting the area, you should click the record button and start recording. Now, whatever activity you do in that particular area will get recorded. After that you can stop your recording by clicking at the rectangular button.

Then you will find the video file has been produce in the home directory, named as out.ogv. If the file already exists, RecordMyDesktop will not overwrite it, but instead create a new file with a number at the end to differentiate it.

                                                     Fig:6

Here is a recording of the activity done in the selected area of the screen.

                      
                                                             Fig:7
   

Enjoy recording your activity done on screen of your PC.

YouTube Downloader for Android


Hello, this time I'll be helping you to download your favourite YouTube videos to your Android phone. Downloading YouTube videos is one sure thing that we may be missing on our Android phone. Many times, we may feel sad that we cannot download a particular video that we are watching on our Android phone. There are many YouTube downloading websites available for the PC, but you may not know about YouTube video downloading app for your own Android, and is also free-of-cost. Link to app provided below.

This is actually a modified YouTube app, with features such as:
  1. Pause/Resume Option
  2. Download all available qualities
  3. Simultaneous download of multiple videos
  4. 4 formats available for download 3GP, FLV, MP4 and also MP3
  5. Download videos as MP3 directly
  6. All qualities are PLAYABLE 140p to 1080p HD
  7. Video plays even after screen turns off

No worries, now you can view High Quality videos on your Android phone, and also download your favourite videos for watching them later on your phone. This app can be installed on your Android phone as you normally install an app.

Step-by-Step how to download YouTube videos from this app is as shown below:

  1. Download OGYouTube Downloader from the following site:
  1. Install the downloaded apk file on your Android device. 

     
  2. There will be a shortcut for the app on your Android home screen. Click on it, to start the app.

  3. Select a video you want to download.

  4. There will be a download link at the video's page, click on it. The app will scan for available formats for the video. Click on the link again, it'll show you a list of available formats to download.

  5. Select the video format you wish to download, and observe the status bar, you'll see the video being downloaded.

  6. Congratulations... You've just downloaded a YouTube video.

Tuesday, July 23, 2013

GRUB

To access and use your Linux system, you must carefully follow required start up and shut down procedures. You do not simply turn off and turn on your computer. If you have installed a boot loader, either GRUB or LILO(Linux Loader), when you turn on or reset your computer, the boot loader first decides what operating system to load and run. GRUB will display a menu of operating systems to choose, whereas LILO will display a command-line prompt.

The Grand Unified Bootloader (GRUB) is a multiboot boot loader. It is now the default boot loader used by Ubuntu, Red Hat systems and many more other operating system. GRUB offers extensive compatibility with a variety of operating system. Users can select operating systems to run from a menu interface displayed when a system boots up. Use arrow keys to move to an entry and press ENTER. Press e to edit a command, letting you change kernel arguments or specify a different kernel. The c command places you in a command line interface, GRUB can boot from anywhere on them. Use shell command “info grub” we can list detailed documentation of grub.

GRUB configuration is held in the /etc/grub.conf file. You only need to make your entries, and GRUB will automatically read them when you reboot. There are several options you can set such as the time out period and the background image to use. You can specify a system to boot by creating a title entry for it, beginning with the term title. You then have to specify where the operating system kernel or program is located, which hard drive and what partition on that hard drive. This information is listed in parenthesis following the root option. Numbering starts from 0, not 1, and hard drives are indicated with an hd prefix. So root(hd0,2) references the first hard drive (hda) and the third partition on that hard drive (hda3). For Linux systems, you will also have to use the kernel option to indicate the kernel program to run, using the full path name and any options the kernel may need. The Ram disk is indicated by the initrd option.
       title Ubuntu 11.04
       root (hd0,2) 
       kernel /boot/vmlinuz-2.4.7-10 ro root=/dev/hda3
       initrd /boot/initrd-2.4.7-10.img 

For another operating system such as Windows, you would use the root option to specify where Windows is installed. Use the “imakeative” and “chain-loader+1” options to allow GRUB to access it. Windows systems will all want to boot from the first partition on the first disk. This becomes a problem if you want to install several versions of Windows on different partitions or install Windows on a partition other than the first one. GRUB lets you work around this by letting you hide other partitions inline and then unhidden the one you want, making it appear to be the first partition. Use the rootnoverify command to allow the system to boot. 

A sample grub.conf file follows with entries for both Linux and Windows. Notice that kernel parameters are listed in the kernel option as arguments to the kernel.
/etc/g rub.conf
------------------------------------------------------------------------------------------------------
# grub.conf generated by anaconda
#
#boot=/dev/hda
default=0
timeout=30
splashimage=(hd0,2)/boot/grub/splash.xpm.gz
title Ubuntu 11.04
root (hd0,2)
kernel /boot/vmlinuz-2.4.7-10 ro root=/dev/hda3 hdc=ide-scsi
initrd /boot/initrd-2.4.7-10.img
title Windows XP
root (hd0,0)
imakeactive
chainloader +1 

Monday, July 22, 2013

Reset Forgotten Root Password

Hi readers, nowadays there are people who forget their password, as they use multiple operating system, in which ubuntu is one of the most important OS that is used. We need super user authority to install or uninstall a package in ubuntu, where root has all the authorities. If I case we forget the root password then it would be a great trouble for us, and so we need to reset out root password, this can be done in six simple steps which are as follows:
  1. When you see the options in menu shown below.

2.Select the option and press “e” to edit the text which can be seen in
figure below

 3. Go to the sentence and edit the sentence “ro quite splash” as
rw init=/bin/bash”

  4.Now press F10 or Clt + x to reboot the system you will find that you are logged in as root.
  6.Now you can set your password using command,
passwd root

Saturday, July 20, 2013

How to continue your laptop's system even after closing its lid

Hi friends, I will describe a technique to continue your processes like copying huge files, downloading files, playing music players or installation of any programs about which we rarely have some idea about the time it will require to complete and this all can be done even closing your laptop's lid without switching your laptop to sleep mode or hibernate or anything.

It always happens with us while working on laptop; we get interrupted by some other urgent work which needs some time. So to complete that, we have to always save our data and close our lid and leave it. Which turns our laptop to sleep mode and sometimes to hibernate and it’s very difficult when we have to carry our laptop while some processes like downloading or copying of files is running. We cannot interrupt such programs otherwise it may waste our lot of time.

Also, it’s very irritating to cancel your copying or downloading or installation of applications just for your daily routines like a boring lunch or to attend a call or to meet a friend who is waiting at your door just for small chat or discussion. Suppose you want to hide that thing from your friend’s eye, you can simply close your lid without cancelling your process. So, here windows had introduced the best solution to our problem i.e., continuing our processes even after closing laptops flap or lid.

Windows had recently shown some small changes in power modes. Everything can be decided by a user. Here is the method to make changes.


                                                          Fig:1
Note: Only for laptops having windows7 / windows8

Method:

Go to settings - Control Panel

Generally, we can find control panels on everyone’s desktop, but if you can't find it go for the search button in start menu, you will definitely get there. 

Select the option “Hardware and Sound”

 You can see the first column with the third choice is “hardware and Sound”.
This menu style may change from system to system, but for the option we are searching is in Hardware and Sound.

Fig:2


Go for the Power option in the menu provided

You can directly see here the required option “change what Power buttons do” by double clicking on that we can get the required page.

                                                       
                                                           Fig:3

Now, you will get many choices like

    a) Choose what a power button does.
    b) Choose what a sleep do.
    c) Choose when i close my lid.

 Here for the lid options, double click on it.

  Fig:4


 Again you have choices to save your changes in “On battery” mode or “Plug in” mode

For successful savings in your changes, reboot your laptop

 We can also change different things such as “What a power Button does” means while shutting down your laptop what the user wants. In which mode it should go, so that when he/she returns should catch up immediately. You can also play tricks with this with your friend’s laptop.

Have fun, enjoy your long term processes now without interruptions.