Thursday, 9 August 2012

How to Change Forgotten Password in Ubuntu?


Changing Forgotten Password in Ubuntu

In the current times when we have lots of password to remember, i think its quite human to forgot few. Mostly it happens with me so I thought to share this method of changing the password of Ubuntu system. In case you or your friends have forgotten the password of their Ubuntu system, it will come handy.

These are the steps to change your password on Ubuntu system:
  1.  If your system has multiple operating systems installed, from the boot options that is displayed at the time of starting the system select the "Recovery Mode".
  2. If your system has only Ubuntu installed, press "SHIFT" key during the boot up, and in the boot menu select "Recovery Mode".
  3. You will be logged in as root user and a terminal will be shown to you. Please be cautious now, in writing commands, because you are now root user and your actions will affect your entire system.
  4. Write this command to enable read / write mode:
            mount -o rw, remount /
  5. If you have also forgotten your username this one will be useful:
            ls /home
            This will display all the usernames of the users of the system.
  6.  Now comes the last step for which we have done all the above exercise:
            passwd username (username is of the user whose password is needed to be changed).
            Prompt will ask for new password and retype password.
  7. If everything is alright you will see the empty prompt or a success message.
  8. type exit to reboot the system.
 Hope it helps you like it has saved me countless number of times.

Tuesday, 19 June 2012

Creating Insert Query from An Existing Table in MSSQL

How To create an Insert Query from an existing table in MSSQL


These are the steps to create Insert query from an existing table in MSSQL. It will be helpful in importing the data from one db to another. I am using SQL Server 2008 R2.
The steps involved are:

  • Open your SQL SERVER Management Studio.
  • Select the database for which you want to create the queries.
  • Right Click on it and select Task. Under Task Select Generate Scripts.
insert query from existing table in mssql


  • It will open the Generate and Publish Script wizard.
How to generate insert query in mssql

  •  Click Next.
  • This will take us to Choose object screen, where we have choice to either generate script for the entire database or for few selected tables.
Creating Insert Query MSSQL

  • If you want to generate the query for a particular table, then select the "Select specific database objects" option. After that you can check the tables for which you want to generate the query.
  • Here I am creating the script for the entire database.
  • Click Next. This will open the screen in which we have to set the scripting options.

  •  In this screen select the advanced tab.  This will open the Advanced Scriptiing option. In this screen change the Types of data selected to "schema and data " if you want to have the table structure along with insert queries and "data only" if you want insert queries only.
creating insert query in mssql server management studio

  • Press Ok. And then click Next. You will see now "Review Your Selection" screen. Here you can re-check the options you have selected.  If everything is right select next.
creating insert query in mssql management studio

  • If Everything is correct then you will get the success screen. And you can check your file in the location were you have saved it.


Hope it helps someone who is learning the MSSQL like me.