Monthly Archives: July 2015

Set & Get environment variables in python

In bash generally we export environment variables like : export VARIABLE=value In some cases in our we need to set some environment variables inside our python programme to use it further. But in Python, the if we try to use … Continue reading

Posted in HOWTO, Programming, TIPS & T RICS | Tagged , , | Leave a comment

Fix SSH Issue : Offending key for IP in ~/.ssh/known_hosts:n

When ever we connect to another host with ssh client, it asks the user to add the public key of the remote host in the ~/.ssh/known_hosts file of that user. This is by default enabled by “StrictHostKeyChecking yes” which can … Continue reading

Posted in HOWTO, TROUBLESHOOT, TUTORIALS | Tagged , | Leave a comment

One liner tricks using perl/bash

Sometime small small hacks saves a lot of our time. The regexes used here can be changed as per need. In some cases try alternatively with single/double quote if dont work. Count the number of times a specific character appears … Continue reading

Posted in HOWTO, Programming, TIPS & T RICS, TUTORIALS | Tagged , , , , | Leave a comment

Python pexpect – (password and password less authentication by ssh and do remote task)

This code use pexpect module of python to perform the operation.   Using the sys module this can be further enhanced to pass the arguments in argv[n]. Here logs will be written in stdout but it can be changed to … Continue reading

Posted in Programming, TIPS & T RICS, Uncategorized | Tagged , | Leave a comment