Tuesday, January 31, 2012



create a file named ".hgrc" and type the codes below with the username of bitbucket followed by the mail id for example

       after saving close it

1. Create a account in bitbucket
2. thus after creating the bitbucket account, click on the 'Repository' above for creating a repository , untick the private option near the name followed by clicking create repository .Afterwards copy the link given below.
3. install 'mercurial' package by typing 'sudo apt-get install mercurial'
4. now type 'hg init' in the terminal
5. again type 'hg clone ' followed by the copied link. This creates the directory of the name given.
6. Enter the directory and type 'hg add' followed by all the file names in the directory.
7. now type 'hg commit -m "any name" '
8. type 'hg push' followed by the copied link , thus after completing with asking the password of the bitbucket.


1. copy the new files to the already created repository within the system
2. now add the new files names following the 'hg add' command within terminal
3. now follow the above step from 7

Wednesday, January 25, 2012

Grub Error, no such Partition found- fixing in ubuntu

Firstly, insert your current linux os bootable using either cd or usb. Now, enter into the terminal by selecting the trying option. After, taking the terminal type

sudo fdisk -l

which prints the every the partition. Select your linux partition. Mount the linux partition using mount command, ie. suppose consider /dev/sda6 is your linux partition, mount it by the following command. Before that create a directory for mounting the drive, ie,

sudo mkdir  /media/sda6

now after creating, mount the drive in the created 'sda6' directory

sudo mount   /dev/sda6  /media/sda6

after mounting, type the below command for installing grub from cd or usb

sudo grub-install --root-directory=/media/sda6 /dev/sda

thus u have installed the grub

Sunday, January 22, 2012

" No such partition, Grub Rescue error in Windows " Solution

This error occurs usually for the Laptop users, who tries to delete the Linux partition within Windows. Since, installing Linux, the Grub is installed in the Master Boot Record (MBR), which then replaces the Windows boot-loader. So, deleting the linux partition after entering windows will definitely cause the error. The Grub looks for the 'Grub file' of the linux partition, which doesn't exists and results in errors.
             For solving the it, you need Windows boot-able CD.  After inserting the CD, now select the Repair options to enter the recovery console or command prompt. Now enter

Select the partition, which ever is your boot-table drive. Now enter the into the boot-able drive, by type the drive letter followed by colon and press enter. For example : consider  'F' to be the bootable drive,
              C:\Users\amith> f:
After entering the bootable driver, enter into the 'boot' folder
             cd  boot
now type 
             bootsect  /nt60  SYS  /mbr
              bootrec   /nt60 SYS  /mbr 

Creating Executable files in C

Unlike any other languages C is the most efficient language which has rich set of operators and due to its non-restrictions and generality makes it convenient for programming in many areas. In this post, i would like to show, how to create your own executable commands, like general shell commands i.e,
cp - copy command for copying files,      ls - for listing all enteries within a directory,     mv - command for moving files    etc. This task is very simple.
Firstly create a C file using any editor with 'c' as extension at the end. For example, here i am using a vim editor and create a C file which prints anything you give.
vim printprogram.c

now i am going to  write the following code in the created file
// program to print input 

#include     // library file
#define FILE_END EOF     //symbolic constants

main()     // start point 
   char k ;    // variable declarations
   printf("Enter & press Ctrl+D when finished:");
   //getchar for input 
   while ( (k = getchar()) != FILE_END )  {
      putchar(k);    //output
}              // end point    
after coding the file, thus proceed for its working ie, compile the file by typing the following command in the terminal
cc printprogram.c -o printpg

'cc' is the complier or you can use 'gcc' since both are same. The option '-o ' is to copy the generated machine-executable code to a file print. Now check whether it runs by again typing in the terminal, the following command

Here the ' . ' means current directory and ' ./ ' means inside the current directory to execute the file ' printpg '. If the file is running correctly then you can proceed to next step.
change the permission of the file
chmod -c 777 printpg
Now copy the file to the bin directory, where the executable files can be run without using ' ./ ' in the terminal.
sudo cp printpg /bin/
Remove the file print in your current directory
rm printpg
now just type print in the terminal
Atlast your executable file is ready to use.

Creating Script files using Python

Open a terminal by pressing Ctrl+Alt+t or Applications->Accessories->Terminal

create a file which you want to make script. In python, create files with py as extension or just the name.
now after creating the file. Code the file with program you want to use in the script. For example, i am creating an echo function which prints whatever we give.
print a

save the file as usually by pressing esc and the semicolon followed by wq. After saving the file change permission of file by typing the below code
chmod -c 777
since the executable files like cp, ls, mkdir etc are saved at /bin/ location. Thus paste the file in the bin folder as super user mode.
sudo cp  /bin/
Type your root password when asked. Now after that, the original file is still in your directory, so please remove or move it to another location. Instead of cp, you can use mv(move) in the above command, if you want to move the original file. Now just type the filename only.
you can use just filename without any extension for creating python files, since it works. For eg:
vim filename
Thus, now you just have to enter only the filename.
Note : Keep in mind, the line in the code " #!/usr/bin/python " is important since it shows the python location in your system to the python interpreter, so that while running python files, you need not have to use python command before your file and also very important while running python scripts.
For more details on python programming, you can check python program section in the Python programming Basics post of mine. Same way, you can also create such executable files using C program, for further details on C executable files visit .

Usb support for Virtualbox users

Here, this post provide information on usb supports for virtualbox. For this, you may need the most latest version of virtual box which has usb supports. You can download it from the following sites through your synaptic manager. You have to choose  anyone from here based on your linux edition oneiric contrib natty contrib maverick contrib non-free lucid contrib non-free karmic contrib non-free hardy contrib non-free squeeze contrib non-free lenny contrib non-free.

I am a linux-mint user, so i choose natty contrib  and add it to the synaptic manager.
Adding to synaptic package manager is simple. Firstly,  select synaptic package manager by  clicking  Systerm->Administration->Synaptic Package Manager from the top panel. After opening the synaptic manager, click the Settings->Repositories to launch the Software Sources window.

Now  add the link to the ' Other Software ' tab in the ' Sotware Sources ' window of synaptic manager by clicking the add button. You may add like this, for me, i prefer
deb natty contrib
you can choose anyone of the above link, which is your linux edition, as i told earlier.
Remember after adding, there will be extra one with same link in the 'Other Software' window and  with 'source code' at the end. Untick that one and now close the  Software Sources window. Now, before reloading the Synaptic manager, you have to download and register the Oracle Public Key for virtualbox, for  that type the below command in the terminal.
wget -q -O- | sudo apt-key add -
After entering it, u will get  ok output. Now try reloading the synaptic package manager or type
sudo apt-get update
in terminal. Now you have updated and can continue checking the synaptic package manager for virtual box 4.1 or type
sudo apt-get install virtualbox-4.1
it may take more time, since more than 40MB. After installing it, you have to download a extension packager for virtual box which you can get from this link . For more detail, you can refer this link Now import it to virtualbox, click on File->Preferences  to launch VirtualBox - Settings window and click on Extensions in the left side and import the extension package.

After upgrading the package, now you can install window7 or windows xp in virtual box. By clicking the 'new' and follow the steps. Give the name of the Operating system you want to install when the ' VM Name and OS Type ' window occurs. Follow whatever step and give dynamic memory allocation option when asked, after all when finished, you have click run to start the windows and browse the location of your windows image to mount and for installing, rest is same as installing windows. Now install guest addition in the virtual box by click it in Devices of windows Running window.
Now it will reboot to take changes. After rebooting, you just turn off the machine by closing the windows7 running window. Again, back to the virtualbox window, click the settings to lauch the OS settings which ever os you are using and in that click on usb on leftside and tick the usb controller. Also add a usb filter ie new filter for detecting usb's.
you can also share folders of your host by adding the host folders in the 'Shared Folder s' .
Note : After installing everything, you need to the permission  of host for vboxusesrs. For that go to the System->Administration->Users and Groups. Now click ' Manage Groups in the launched window and a Group settings window appears, in that select ' vboxusers ' and click properties and tick the user, if it is untick. Type password if asked.

Creating Repository in Linux

For ubuntu users, some how due to internet problems they mayn't be able to install packages. Sometimes some packages are not found in synaptic manager that you want to install. Thus normally everyone tries dpkg, but due to dependencies problems it becomes more complex. Hence the apt helps to solve that problems. For that, first-off all you need to save the additional packages (this is for deb packages)  into a directory where every you like.
Open a terminal by pressing Ctrl+Alt+t keys or from the Accessories in the Applications

For setting up repositories, you need to install dpkg-dev, If you haven't installed, then install it by typing ' sudo apt-get install dpkg-dev ' in the terminal. Type your root password if it asks

Now create a directory to keep your packages, where ever you like. For eg:- lets create in your home directory, for that type the following commands in the terminal

you will see that repositories have created. Now move the packages to your created directory ' repositories '. Thus afterwards, enter inside directory through terminal as follows and type the following

Check whether the Packages.gz file is created by typing 'ls' command as above. Now if the Packages.gz is created, then you can proceed, otherwise visit for help. Here, if the dpkg-scanpackages is not installed then try installing it by ' sudo apt-get install dpkg-scanpackages' . The dpkg-scanpackages looks in the directory and writes all details of the packages avialable in the directory thus producing this as the output. Here the output is written to a suitable format that the apt-get update can read, i.e. Packages.gz.
Now take Synaptic Package Manager from the System->Administartion. Type your root password, if it asks. Take the repositories option in the Synaptic Package Manger, i.e Settings->Repositorie. Software Sources window appears, in that take Other Software. Cilck on the Add button below and a small window appears, in that type the location of  your newly created directory. Here repositories folder location is at home so type " deb file : " followed by the loction of the packages and press Add Sources button.
deb file:/home/amith/repositories/ ./

Now untick everything except the newly created Apt line but not the Apt line with source code and now untick everything in the another tabs of Software Source. Atlast close the Software Source window and reload the synaptic package manager. Now enjoy downloading from your synaptic package manger.
Sometimes if your system fails to boot Ubuntu, thus some failure. Then need to install ubuntu again, so at that time you can add your packages which you have installed before. The default path of packages installed by synaptic package manager is
you can copy the packages from these location using the ubuntu live cd if ubuntu fails to start, otherwise copy normally and paste into the directory where ever you like to create repository. Later for updating the Packages.gz file, run the same command after entering inside the directory.
dpkg-scanpackages . /dev/null | gzip -9c > Packages.gz
You can watch its tutorial at the link for more details

Fixing " \windows\system32\config\system is corrupt or missing "

when you start the system, you find " windows cannot start, the following file is missing or corrupt  \windows\system32\config\system ". This message occurs because when your registry gets corrupted or gets errors. For this, you need not format and  reinstall the operating system, since it can be fixed by replacing the system file using your windows boot-able CD. Follow the steps below
Firstly, insert your windows bootable cd  and boot from it .

when a screen with three option appears infront of you. First one for installing windows, second for repairing the windows and at last for exiting.
You just select the second option ie, repairing by pressing the appropriate key it says.

It may ask password, enter the password if you have set, otherwise just press enter.
Press the appropriate number it says for the C drive location where u want to enter
Now, you may enter the directory where u have to repair the system file ie  \windows\system32\config. Type the command below to enter
cd \windows\system32\config

in the above directory which one is corrupted, depending on it type the command
ren software software.bak
ren system system.bak
Now you have to copy the files whichever is corrupted ie,
copy \windows\repair\system
copy \windows\repair\software

Atlast type exit
For the video based on this post, you may visit