debugging ssh trust problem trick
Say, you are trying to establish trust between sourceaccount@sourceserver –> destinationaccount@destinationserver. So you added the contents of the sourceserver:/home/sourceaccount/.ssh/id_rsa.pub key file to destinationserver:/home/destinationaccount/.ssh/authorized_keys file and yet you are unable to ssh from the source server to the destination server. Firstly, ensure the destinationaccount is not locked out. Then, to find out if there’s a permission […]
longest palindrome in a string
#!/bin/env python string1=”prefixsatorarepotenetoperarotassuffix” maxlength=-1 for i in range(0,len(string1)): if (len(string1) – i ) <= maxlength : break for j in range(i, len(string1)): if ( len(string1) – j ) < maxlength : break else: string2 = string1[i:len(string1)-j+i] string2 = string2[::-1] if string1[i:len(string1)-j+i] == string2: maxlength = len(string2) finalstring = string2 break print finalstring