Showing posts with label TIPS. Show all posts
Showing posts with label TIPS. Show all posts

Monday, June 27, 2011

SSH: "Remote host Identification has changed" error


SSH is the most common and widely used method for remote login. It is better the Telnet because it provides authentication mechanism to secure your machine (If you dont want to enter your password each time when you login, checkout the previous post on passwordless-ssh-login-howto). But, sometimes one may find that the machine that we used to login sometime back is refusing to authenticate. If the error that you found is
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@    WARNING: REMOTE HOST IDENTIFICATION HAS CHANGED!     @
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
IT IS POSSIBLE THAT SOMEONE IS DOING SOMETHING NASTY!
Someone could be eavesdropping on you right now (man-in-the-middle attack)!
It is also possible that the RSA host key has just been changed.
The fingerprint for the RSA key sent by the remote host is
9b:8e:77:08:7c:8f:2d:f7:0b:4e:dc:d3:98:29:dd:ec.
Please contact your system administrator.
Add correct host key in /root/.ssh/known_hosts to get rid of this message.
Offending key in /root/.ssh/known_hosts:8
RSA host key for 192.168.1.8 has changed and you have requested strict checking.
Host key verification failed.
Just delete the file ~/.ssh/known-hosts.
> rm ~/.ssh/known-hosts
 Thats it, now try running ssh at the terminal it will succeed.

Thursday, June 16, 2011

Ubuntu: Creating a bootable Pendrive

 In this post, I will demonstrate how to create a bootable pendrive from an .iso image on ubuntu. Creating a bootable pendrive is very easy in ubuntu. If you are using ubuntu 10.10, then goto
System->Administrator->Startup Disk Creator
Select Startup Disk Creator it will prompt for password if you are not root, enter the password and it starts. It looks like this

Startup Disk Creator


Once you have started the Startup Disk Creator follow these steps to create a bootable Pendrive:

1. click on  "other" button and select the location where you have stored the .iso file.


2. Then if you want to erase all the data on the pendrive then press on "Erase Disk" button and wait for it complete. Skip this step if already empty.


3. Select "Make Startup Disk" button.







Thats it. Once it completes you have a bootable pendrive which you may use it for
  • liveCD
  • installing a fresh distro installation

I have tested this for creating a bootable pendrive from ubuntu-11.04.iso on ubuntu-10.10. If you happen to use it for other distros then do post your results

Friday, June 3, 2011

mencoder: Converting .ogv to .avi

recordMyDesktop produces videos in .ogv format. Youtube and many other websites fail to play the .ogv video. Use mencoder to convert the .ogv video. mencoder is a simple movie encoder, designed to encode MPlayer-playable movies to other  MPlayer-playable formats.

In ubuntu, install the mencoder using
>sudo apt-get install mencoder
once installed, use the following command to covert the .ogv file to .avi file.
>mencoder video.ogv -ovc xvid -oac mp3lame -xvidencopts pass=1 -o video.avi
 There are many more options to mencoder, read the man page for more info.

Saturday, May 21, 2011

Code intendation

In linux, indenting the C code is very easy only if you happen to know tools for doing it. One such tool is "indent". It is a linux command that can be used to indent the C code. By default it indents the code in "gnu" style.
>indent file.c
 By using this command, we can even convert from one C style to another. For instance if you are acquainted to linux style of coding but you have a file that is in different style of coding, then use this command to convert the coding style to linux style of coding
>indent -linux file.c
Here, linux is an option to indent. There are many more options, so start exploring. 

Wednesday, April 20, 2011

Scrolling up and down the Terminal

I will be posting some of the interesting and useful tips to ease the use of command line in Linux. Today's tip is HOWTO scroll through the terminal page up and down. To scroll through the terminal use

           cntrl + shift + [up arrow | down arrow] [page up | page down]

Sunday, March 20, 2011

Toggling through the directory hierarchy

I recently came across pushd and popd commands and found them to be of great help. I use command line to do a most of my work, while I am working there are lot of time's when I move deep into the directory hierarchy and then return to the directory I was previously working in. This is sometime's  tiring and time consuming. If you are one of them and don't know about the pushd and popd command's then you are at the right place. Let me explain it with an example -

       $ pwd
       /home/linux_code

Now you wish to look at the code which might be under fs/minix and then later want to come back to the current directory then first push the current directory to the stack (that is what I think pushd stands for -push directory). It takes an argument (the directory to be saved/pushed).

      $pushd .
      $cd fs/minix

Once you are done with the work just use the popd command to return to the previously saved direcotory. 

      $popd
      $pwd
      /home/linux_code

Also note that, if you start pushing more than one directory on to the stack, then it will be popped in the reverse order (since stack follows Last In First Out (LIFO) order). So start using.