Tuesday, July 22, 2014

Python Auto Completion in Terminal

Auto completion is a nice feature for Terminal commands but inside a Python interpreter it does not work. To enable auto-completion within python interpreter, we need to do the following.

Step 1: Create a file pythonrc at /etc/ directory and add the following lines in the file:
from readline import parse_and_bind
import rlcompleter
parse_and_bind("tab: complete")

Step2:  In the file at /etc/bash.bashrc , add the following line
export PYTHONSTARTUP=/etc/pythonrc

Step3:  Restart the terminal and invoke python interpreter.

Tuesday, July 8, 2014

To remove the guest login in Ubuntu

To Remove Guest Login from Ubuntu:
1. sudo vi  /usr/share/lightdm/lightdm.conf.d/50-ubuntu.conf
2. Add the line at the bottom:
" allow-guest=false "

Thursday, July 3, 2014

Creating Encrypted password for Linux:

Method 1:
openssl  passwd  -salt  <2 letter code>  <your password>

Method 2:
python -c ' import crypt;  print crypt.crypt("your password", "2 letter code") '

Method 3:
perl -e ' print crypt("your password", "2 letter code"), "\n" '