Tuesday, September 2, 2014

Disable a Service during Start-up

To disable any service from starting automatically during boot-up, do the following:
# Say for example you want to disable mysql from auto-start, open the terminal and enter the following:
echo manual | sudo tee /etc/init/mysql.override

This will create a file called mysql.override and dump the content "manual" in it. This will be override mysql program to start automatically while boot-up. To enable auto-start, either remove the file or the content "manual".

Wednesday, August 6, 2014

To compile Python Scripts

Python scripts with .py extension can be compiled to binary files with .pyc extension by the following command:
   python  -m  compileall  ./
This command compiles all scripts in the current directory.

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

Wednesday, February 26, 2014

Time Keeper - Parental Control

For parental control in Linux, the best available tool is "timekpr". This can be installed in debian linux versions like Mint, Ubuntu etc. 
Here is the link to the website to download the latest version:

Click All downloads and you can find different versions.  I personally installed the .deb version and it works excellent. It comes with a GUI, where you can set the day, time and allowable time limits for every user in the system.