Wednesday, February 22, 2012

WARNING: REMOTE HOST IDENTIFICATION HAS CHANGED!


Hello ,

Very simple yet common error we get while doing ssh to remote machine :

Reason :
  • Every SSH server uses a random key to identify itself
  • When ssh installed then new key is generated .
  • In this case host key is changed which result in client not able to connect with server , and this message is shown on client side.


@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@    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 DSA host key has just been changed.
The fingerprint for the DSA key sent by the remote host is
cc:35:09:ab:86:4b:72:f0:cc:4b:92:92:77:8e:7e:b2.
Please contact your system administrator.
Add correct host key in /home/username/.ssh/known_hosts to get rid of this message.
Offending key in /home/username/.ssh/known_hosts:7
DSA host key for 'servername' has changed and you have requested strict checking.
Host key verification failed.

How to get rid of this ?
  1.  Easiest way is to delete known_hosts file , with " rm ~/.ssh/known_hosts  " So next time when you connect same server it will create this file again and ask you  (Not Recommended)
  2. Preferred way is to use command " ssh-keygen -R server_host_name " , "-R" removes all keys belonging to server_host_name from know_hosts file ( ~/.ssh/known_hosts). (Recommended)
  3. Or you can manually delete keys from ~/.ssh/known_hosts by deleting 7th line in our example.

Best Regards,
Girish...

Tuesday, February 21, 2012

Blog I Follow


Hello Friends,

Here I will publish cool blogs which I came across.


Will go on adding more in this post!


Best Regards,
Girish



PHP TCP/IP Socket Error Codes


Hello Friends,

php TCP/IP socket error codes:

Make error.php with following code :

for($n=0;$n<125;$n++) {
    $msg = socket_strerror($n)."\n";
    echo $n,' = ',$msg;
}
?>



Socket Error Codes with meaning :


0 = Success
1 = Operation not permitted
2 = No such file or directory
3 = No such process
4 = Interrupted system call
5 = Input/output error
6 = No such device or address
7 = Argument list too long
8 = Exec format error
9 = Bad file descriptor
10 = No child processes
11 = Resource temporarily unavailable
12 = Cannot allocate memory
13 = Permission denied
14 = Bad address
15 = Block device required
16 = Device or resource busy
17 = File exists
18 = Invalid cross-device link
19 = No such device
20 = Not a directory
21 = Is a directory
22 = Invalid argument
23 = Too many open files in system
24 = Too many open files
25 = Inappropriate ioctl for device
26 = Text file busy
27 = File too large
28 = No space left on device
29 = Illegal seek
30 = Read-only file system
31 = Too many links
32 = Broken pipe
33 = Numerical argument out of domain
34 = Numerical result out of range
35 = Resource deadlock avoided
36 = File name too long
37 = No locks available
38 = Function not implemented
39 = Directory not empty
40 = Too many levels of symbolic links
41 = Unknown error 41
42 = No message of desired type
43 = Identifier removed
44 = Channel number out of range
45 = Level 2 not synchronized
46 = Level 3 halted
47 = Level 3 reset
48 = Link number out of range
49 = Protocol driver not attached
50 = No CSI structure available
51 = Level 2 halted
52 = Invalid exchange
53 = Invalid request descriptor
54 = Exchange full
55 = No anode
56 = Invalid request code
57 = Invalid slot
58 = Unknown error 58
59 = Bad font file format
60 = Device not a stream
61 = No data available
62 = Timer expired
63 = Out of streams resources
64 = Machine is not on the network
65 = Package not installed
66 = Object is remote
67 = Link has been severed
68 = Advertise error
69 = Srmount error
70 = Communication error on send
71 = Protocol error
72 = Multihop attempted
73 = RFS specific error
74 = Bad message
75 = Value too large for defined data type
76 = Name not unique on network
77 = File descriptor in bad state
78 = Remote address changed
79 = Can not access a needed shared library
80 = Accessing a corrupted shared library
81 = .lib section in a.out corrupted
82 = Attempting to link in too many shared libraries
83 = Cannot exec a shared library directly
84 = Invalid or incomplete multibyte or wide character
85 = Interrupted system call should be restarted
86 = Streams pipe error
87 = Too many users
88 = Socket operation on non-socket
89 = Destination address required
90 = Message too long
91 = Protocol wrong type for socket
92 = Protocol not available
93 = Protocol not supported
94 = Socket type not supported
95 = Operation not supported
96 = Protocol family not supported
97 = Address family not supported by protocol
98 = Address already in use
99 = Cannot assign requested address
100 = Network is down
101 = Network is unreachable
102 = Network dropped connection on reset
103 = Software caused connection abort
104 = Connection reset by peer
105 = No buffer space available
106 = Transport endpoint is already connected
107 = Transport endpoint is not connected
108 = Cannot send after transport endpoint shutdown
109 = Too many references: cannot splice
110 = Connection timed out
111 = Connection refused
112 = Host is down
113 = No route to host
114 = Operation already in progress
115 = Operation now in progress
116 = Stale NFS file handle
117 = Structure needs cleaning
118 = Not a XENIX named type file
119 = No XENIX semaphores available
120 = Is a named type file
121 = Remote I/O error
122 = Disk quota exceeded
123 = No medium found
124 = Wrong medium type
125 = Operation canceled
126 = Required key not available
127 = Key has expired
128 = Key has been revoked
129 = Key was rejected by service
130 = Owner died
131 = State not recoverable
132 = Unknown error 132



Error codes are from 0-131

I like to thanx Reverse Hack  for valuable suggestion on this post.
Thank you once again for bringing this to my attention. 

Best Regards,
Girish


Monday, February 20, 2012

How to mount an USB Pen Drive


Hello,

Those who are new to linux , may need to know procedure to mount it .
Check it out below :

1) Attach your USB pendrive to Linux computer.

   
2)  #dmesg

    ( Check the last lines. It will show the device name used by pendrive for example

    /dev/sda1 or /dev/sdb1 )

3) #mkdir /pendrive

    #mount /dev/sdb1 /pendrive
 
Your pendrive should be mounted!.
 
Best Regards,
Girish

Mind Reading Tricks (Mind Reading Game)


Hello Friends ,

I would recommand you to play this simple mind game!!!

How's that ? ?  Enjoye ? ? Shocked ? ? Lets discuss the logic behind this ? ?  We can discuss by commenting on this post...
Best Regards,
Girish

Sunday, February 19, 2012

8 Tips to Focus Your Mind

Hello ,

Found one good article to stop our monkey mind thinking.
Sometime need to get rid of stress , and need to focus on one thing.
 
http://www.care2.com/greenliving/8-tips-to-focus-your-mind-how-to.html
 
Hope this will be helpful.
 
Best Regards,
Girish

Saturday, February 18, 2012

Ubuntu Single User Mode without root password for maintenance


Hello Friends,

I came across problem , while resetting ubuntu password , Generally when we reset password for RHEL 5 OS , we enter into single user mode through grub by editing Kernel line with Single or 1  , and simply you will boot into single user mode.

But with Ubuntu it was a kinda different.


1.Reboot your machine; press 'Esc' to get to the GRUB menu; select your image; press 'e' to edit; select the Kernel line.

2.Press 'e' to edit the kernel line. Edit the line to get rid of quiet and splash; change 'ro' to 'rw'; and add 'init=/bin/bash'. The line should look something like this:

kernel /vmlinuz-2.6.15-27-386 root=/dev/mapper/Ubuntu-root rw init=/bin/bash3.Press 'enter' then 'b' to boot with these new settings.

Then you can fire up passwd command to reset root password.

Reffered from : http://www.noah.org/wiki/Single_User_Mode

It Works!

Best Regards,
Girish

Samsung Duos GT C-3222 Secrete code


Hello Friends,

You can play around with *#52828378#  code , I have tested it on my duos , and working fine with me.
I wanted to install java application on my duos , for that you need to get in :
OTA test basic >> set Maximum JAR size (kb)" between 500 to  650 , and you will be able to install small java applications on your duos , upto 650 to 700 Kb

Best Regards,
Girish...

Friday, February 17, 2012

Now we can have chat !

Hello Readers,

I have included simple chat plugin , so that we can have chat on technical topics.
We can share our views and get to know each other.

Thank & Regards,
Girish

Monday, February 13, 2012

Most Famous logos and its meaning

Hi Friends ,

This is  a simple but very good link to know famous Logo's and meanings associated with it.

Click here 

Best Regards,
Girish



Wednesday, February 1, 2012

Mysql installation on MAC OS X version 10.6.8


Hi,
Untar mysql in /usr/local/mysql  --> tar -zxvf filename .
As per instructions from INSTALL_BINARY (mysql) , we need to add groups , users , set permissions.

Once done , go to :

1. /usr/local/musql/bin
2. execute ./mysqladmin -u root -p Newpassword (Change root password for MySql)
3. ./mysql -u root -p
4. Enter new set password.

Once connected, you can list databases using

mysql> show databases;
mysql> use databasename;
mysql> show tables;
mysql> create table customer (custid INT , name TEXT);
mysql> insert into customer values(12,'Girish');

Database name --> test
Table name --> customer

While trying to connect using PHP we got following error :
------------------------------------------------------------
warning mysql_connect() function.mysql-connect 2002 no such file or directory (trying to connect via unix:///

Refer Link:
http://stackoverflow.com/questions/3968013/cakephp-no-such-file-or-directory-trying-to-connect-via-unix-var-mysql-mysq

Code :
--------


$con = mysql_connect("localhost","peter","abc123");
...
Error was with above line.

Solution :
----------
mysql defaults to use local unix domain sockets if you use localhost. Switching to the IP forces it to use TCP sockets instead

In above code insted of localhost we user 127.0.0.1 ip , and it worked Fine!!!!


Regards,
Girish