10/27/2014

working with Linux OS behind proxy server (Linuxmint 17)

# Configuring proxy servers when you are using Linux/Windows operating system.

# In this case i am using Linux mint 17 - XFCE x64bit

# There are mostly two ways to configure proxy for Linux operating system tools.
    #1. First you can look for tool configuration file, that can be found in Linux System /etc directory,
    For example: If you are using WGET (Linux download manager) that its configuration file in
        /etc/wgetrc
        ~ And you need to edit this file to setup proxy for wget,
   
        #NOTE
                ~ This proxy will be configured for wget will be used every time you run wget.
           So, if you are using proxy for a while than you should avoid this method.

    #2. Second method for configuring proxy is using console/Terminal environment variable.

----------------------------------NOTE------------------------------------------------------------
Environment variables are very important and allows you to directly communicate with another 
command line application or look for any configuration file where that defined for your specific
Application.
A simple example is, So you have installed JAVA_JDK or you are going to install java into your SYSTEM,
How your SYSTEM is going to find that you have installed JAVA_JDK installed,
    -> You can say that path can be defined using windows registry. ok but what about linux?

Their is one another way to use it even without installing it,

    -> This is using Environment variables, these are specific for two scopes
        -> LOCAL Environment Variables
        -> GLOBAL Environment Variables    => need admin privileges
    -> export JAVA_HOME environment variable for that Directory where you have installed/extract
        java_jdk contents.
    -> And you are ready to go ..
----------------------------------------------------------------------------------------------------

         ~  for BASH shell on Linux mint17-XFCE-x64
         ~ I have used this command-
              $ export http_proxy=http://172.16.200.3:3128
          
              ~ So, what actually this is going to do?
                   ~ This actually create a new environment variable using :
                             KEY = http_proxy
                             VALUE= http://172.16.200.3:3128

            ~ If you want to see Environment variable, use env  command,
                   ~ $ env
                    # This is going to print every environment variable KEY and corresponding
                       key VALUES.

    # If you are using Linux tools using CYGWIN package
     https://www.cygwin.com/
     http://x.cygwin.com/

      ~You can set environment variable using set command on windows, 
            ~ There is Syntax
              >set http_proxy=http://172.16.200.3:3128
              >wget http://www.google.co.in 



    # Linux == export ( to define environment variables temporarily)
        ~ And to view them use == env  command
         http://www.computerhope.com/unix/uenv.htm

    # Windows == set ( to define environment variables temporarily on windows OS  )
        ~ And to view all of them use   == set command
        http://www.computerhope.com/sethlp.htm
       http://ss64.com/nt/set.html

# Some examples:
    #1. using wget command line download manager for UNIX like systems.
        ~LINUX
        $ export http_proxy=http://172.16.200.3:3128
       $ wget -o home.html http://python.org

                               OR

       $ http_proxy=http://172.16.200.3:3128 wget -o home.html http://python.org

                              OR

      ~ Use wget  configuration, edit and define proxy server and port for http, https, ftp protocol.
         # nano /ect/wgetrc

    #2. using pip python modules/packages management tool
        ~ LINUX
        $  export http_proxy=http://172.16.200.3:3128
        $ sudo pip install ipython[test, notebook, zmq, qtconsole]
        # This is how we can install IPython with notebook, qtconsole, zmq dependencies.

                                OR

        $ http_proxy=http://172.16.200.3:3128 pip install ipython[test, notebook, zmq, qtconsole]

                                 OR

        # use pre-defined option for proxy server
            $ sudo pip --proxy http://172.16.200.3:3128 install ipython

    #3. using apt-get to install Linux packages form console/terminal
    ~ Although you can use Synaptic package manager or GDebi package manager which are GUI
         for Linux package management, yet apt-get is most basic tool for managing packages on
         debian based Linux operating systems.

         ~ LINUX
         $ export http_proxy=http://172.16.200.3:3128
         $ sudo apt-get install ipython

                               OR

         # http_proxy=http://172.16.200.3:3128 apt-get install ipython

                               OR

       ~ edit configuration file for apt-get tool
          ~ which is apt.conf
          ~ PATH == /etc/apt/apt-conf
               # and now define proxy for this file, note that you can not edit this file untill
                  you have root user privileges.

                  #
         Acquire::http::Proxy "http://172.16.200.3:3128";
         #
 
    # edit your BASH configuration file that can be found in your HOME directory.
       ~/.bachrc 
 
       # Time to edit this file, nano is my favorite command line editor.
       # nano ~/.bashrc
         # go to the bottom of file and this line of code,
           of-course you are familiar with this code. 

         #
         http_proxy=http://172.16.200.3:3128
         export http_proxy
         # 

             # Save using ( CTRL+O )  and exit using ( CTRL+X )

    #4. Using easy_install behind proxy server
        $ export http_proxy=http://172.16.200.3:3128
        $ sudo -E easy_install  ipython



6/10/2014

First Step with Python ..-->> 001






# What is Python :-                                                                                                                                   
>> General Purpose Language and full object Oriented Programming Language
>> Portable, runs on almost every Operating System available Today
>> High Quality Apps can be rapidly developed and Maintained Easily

<Source:  https://en.wikipedia.org/wiki/Python_(programming_language) >

# Programmer aspects from a Language : -                                                                                            
>> Dynamic and general Purpose
>> Easy to learn and remember
>> Readability and easier to maintain codes
>> High level Interpreted Language
>> Built-in documentation
>> high Quality modules
>> Easier to make your own modules
>> object oriented Programming Language
>> large set of Python Modules or Libraries
>>

# Why you should learn Python :-                                                                                                        


# Primary Resource to learn about python :-                                                                                      
1.> https://wiki.python.org/moin/BeginnersGuide  # Beginners guide

2.> https://www.python.org/about/apps                  # choose popular python module according to your Interest.

3.> http://pypi.python.org/pypi                               # Python module index

# Getting started Python : -                                                                                                                       


## Installing on linux :-
sudo apt-get install python
sudo apt-get install python3
sudo apt-get install python-dev
sudo apt-get install python3-dev
sudo apt-get install python-numpy
sudo apt-get install python-matplotlib
sudo apt-get install python-scipy
sudo apt-get install python-pillow
sudo apt-get install python-pygame
sudo apt-get install python-django

and so on..

## Installing on Windows :-
### Download and Install Python from https://www.python.org/downloads/


### Use Portable Python :- ( BEST )
http://portablepython.com/wiki/Download/
>>> Personally, I like this Project Because of Large set of third party python libraries -
 NumPy, SciPy, Matplotlib, PyWin32, Django, PIL, wxPython, PyQt, PyGame, etc. code editors
- PyScripter and IDLE all packaged in a single installer.
- NumPy == Numerical python
- SciPy   == for scientific calculations
- Matplotlib == for graph plotting and many more cool stuff
- PyWin32  == Python script to exe
- Django    == Python based popular Web FrameWork
- PIL           == Python imaging Library
- wxPython  == GUI apps development using python
- PyGame  == Rapid Game Developement using python
- IDLE  == Interactive IDE for Python
- PyQt == GUI Framework for Python based UPON Qt
- Tkinter == GUI Framework







>>> So you do not need to Install Python Again and Again, Install Python to USB drive and take it anywhere you want.




## Installing Python Modules :-                                                                                                                
### For Windows :-
>>> Unofficial Windows Binaries for Python Extension Packages
http://www.lfd.uci.edu/~gohlke/pythonlibs/

### For Linux :-
>>> You can use PIP or easy_install
for example :-
sudo pip install numpy
sudo pip install pandas

>>> OR use your system package manager
for example for Ubuntu( Debian based)
sudo apt-get install python-numpy
sudo apt-get install python-mmtk


## Interactive Python :-

    IPython
    IDLE
    WinPython

## IDE for Python :-
    PyDev for eclipse
    Spider
    Eric
    IDLE

or You can use:
    NotePad++
    gEdit
    kWrite
    Notepad itself.

# Online Python Interpreters :-                                                                                                                  
1.> http://www.compileonline.com/execute_python_online.php
2.> https://www.learnstreet.com/lessons/study/python
3.> http://www.pythonanywhere.com/
4.> http://repl.it/languages/Python    

## Books You Must read, and Recommended Books for Python:-                                                          
1:: A Byte of Python ( C. Swaroop )
2:: Learn Python the hard way ( Zad A. Shaw)
3:: Building Skills in Python ( Steven F. Lott )
4:: Beginning Game Development with Python and Pygame  ( Will McGugan )
5:: Making use of Python ( R. gupta )
6:: The Definitive Guide to Jython - Python for the Java Platform 
( Josh Juneau, Jim Baker, Victor Ng, Leo Soto, Frank Wierzbicki )
7:: Programming Computer vision with Python :: ( Jan Erik Solem )
8::  Mysql for Python ( Albert Lukaszewski )
9:: Python Pocket Refrence ( Mark Lutz )
10:: Natural Language Processing with Python
( Steven Bird, Ewan Klein, and Edward Loper ) 
11:: Begining Python ( James Payne )
12:: A Primer on Scientific Programming with Python
( Hans Petter Langtangen ) 
13:: Rapid GUI Programming with Python and Qt
( Mark Summerfield )
14:: Python Web Development with Django®
( Jeff Forcier, Paul Bissex, Wesley Chun )
15:: Matplotlib for Python Developers
( Sandro Tosi )
16:: Head First Python  ( Paul Barry )
17:: Tkinter Refrence :: A GUI for Python ( John W. Shipman )
18:: Gray hat Python ( Justin Seitz )
19:: Core Python Programming ( y Wesley J. Chun )
20:: Fundamentals of Python 
( MartinKenneth A. LambertOsborne )



##