Posts

How to Comment and Uncomment Multiple Lines in Vim

Image
There are several ways you can comment and uncomment a range of lines in vim editor. Commenting  Method I (easiest) Step 1:  Make sure your are in command mode by pressing Esc key Step2: Move your cusor to the start of the starting line of the block that you want to comment out press Ctrl + v for visual mode and now press the down arrow key to select till the last line you wanna comment. Step 3: Press upper case I (shift + i) and type # or // for commenting depending on the programming language. and finally press Esc key wait a sec and it's done! Read more »

Best command-line Password Manager for Linux/ubuntu - kpcli

Image
kpcli is a command line password manager for linux/unix. We can store login credential of various accounts in a databases and access the database with a master password. All kpcli commands  are almost same as linux commands, so it will be nice if you are familiar with them already. kpcli database file can work with keepassx (gui) and vice versa. Let's quickly go through this tutorial to see how to install and use it. Read more »

How to install and run Juypter/Ipython Notebook in Ubuntu/Debian/Linux Mint

Jupyter is a an opensource webapp that allows you to make documents containing live code which can be compiled within the Jupyter notebook itself. It supports over 40 programming languages like python, Ruby... Earlier Jupyter was knows as Ipython Notebook. It is widely used by the scientific community and teachers. You can also run online Jupyter without installing it from http://try.jupyter.org Installation: you can install Jupyter via conda or pip. 1. Using Anaconda First, make sure Anaconda is installed . conda install jupyter 2. Using Pip or pip3 First, make sure you have pip or pip3 installed. ( sudo apt-get install python-pip ) pip install jupyter or pip3 install jupyter Read more »

How to install Anaconda (conda) in Ubuntu/Linux

Image
Anaconda is a packaging tool and installer. The main difference between Anaconda and pip is that anaconda works for python and also non-python packages where as pip is only for python packages. 1.Download anaconda Download either for Python 2.7 (32bit/64bit) or Python 3.5  (32bit/64bit) Just download any one of these. For Python 2.7 64 bit wget https://3230d63b5fc54e62148e-c95ac804525aac4b6dba79b00b39d1d3.ssl.cf1.rackcdn.com/Anaconda2-2.5.0-Linux-x86_64.sh 32 bit wget https://3230d63b5fc54e62148e-c95ac804525aac4b6dba79b00b39d1d3.ssl.cf1.rackcdn.com/Anaconda2-2.5.0-Linux-x86.sh For Python 3.5 64 bit wget https://3230d63b5fc54e62148e-c95ac804525aac4b6dba79b00b39d1d3.ssl.cf1.rackcdn.com/Anaconda3-2.5.0-Linux-x86_64.sh 32 bit wget https://3230d63b5fc54e62148e-c95ac804525aac4b6dba79b00b39d1d3.ssl.cf1.rackcdn.com/Anaconda3-2.5.0-Linux-x86.sh 2. Install anaconda bash Anaconda*.sh 3. Verify if conda was installed conda --version

How to Install Antlr4 in Ubuntu/Linux

Image
Antlr is a parser generator written in Java. Execute these commands to download atlr .jar file in /usr/local/lib directory cd /usr/local/lib curl -O http://www.antlr.org/download/antlr-4.5-complete.jar add antlr4 to your class path. export CLASSPATH=".:/usr/local/lib/antlr-4.5-complete.jar:$CLASSPATH" create alias alias antlr4='java -Xmx500M -cp "/usr/local/lib/antlr-4.5-complete.jar:$CLASSPATH" org.antlr.v4.Tool' alias grun='java org.antlr.v4.runtime.misc.TestRig' Test installation java org.antlr.v4.Tool ANTLR Parser Generator Version 4.5 -o ___ specify output directory where all output is generated -lib ___ specify location of grammars, tokens files -atn generate rule augmented transition network diagrams ........... ........... The above 3 commands (one export and two alias commands) needs to be run every time you start a new terminal. To solve this problem put the three commands in your .bashrc  file li...

How to login as root / superuser in ubuntu linux ?

ROOT Open up your terminal ( ctrl+alt+t ) and enter this command. sudo su enter your password and now you are root user! Notice the $ prompt has changed to # . aman@vostro:~$ sudo su [sudo] password for aman: root@vostro:/home/aman# Now, you don't need to use sudo anymore. for eg. now simply use apt-get update instead of sudo apt-get update . You must be very cautious being a root user. To come back to your normal $ prompt hit ctrl+d .

How to make a gui Calculator in Python using Tkinter

Image
I have written a basic & simple GUI calculator in python using Tkinter module. Since Tkinter is cross-platform so it works on both windows and Linux . If you are a beginner, and want to learn some basic GUI with python, this will be helpful for you. you can download the program HERE    or, you can clone it from my github repository Read more »