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 "


To add, modify or delete partitions in windows 7, use the utility "Diskpart"
1. Type "diskpart" in command line or run it.
2. Type "list volume" , which will output the available volumes and their sizes.
3. Type "select volume <no>" to select the required volume.
4. Type "extend" to extend the disk space into free partition.

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" '