Skip to content

Commit

Permalink
Merge branch 'docs'
Browse files Browse the repository at this point in the history
  • Loading branch information
anmolakhilesh committed Jul 22, 2018
2 parents eca21a0 + 9f2c1cc commit 5b18783
Show file tree
Hide file tree
Showing 3 changed files with 63 additions and 1 deletion.
2 changes: 2 additions & 0 deletions source/code_management.rst
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,8 @@ Gitlab offers unlimited free public/private repositories, where as Github offers

GitLab offers all the features of Github plus builtin CI/CD service (Continuous Integration & Continuous Delivery), and more authentication levels.

Gitlab(Community Edition) is open-source and can be installed in private servers.




Expand Down
38 changes: 37 additions & 1 deletion source/deployment.rst
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,36 @@ It provides a basic suite of operations for executing local or remote shell comm
the remote machine. It interact with the remote machines that we specify as if
they were local.

**Fabric can be used for many things, including deploying, restarting servers,
stopping and restarting processes.**


To install fabric :code:`pip install fabric`

Fabric, provides a command line utility, :code:`fab` which looks for a fabfile.py, which is a file containing Python code.
example fabfile:

.. code-block:: python
from fabric.api import run
def diskspace():
run('df')
The above example provides a function to check free disk space, :code:`run` command executes a remote command on all specific hosts, with user-level permissions.

The fabfile should be in the same directory where we run the Fabric tool.
We write all our functions, roles, configurations, etc in a fabfile.

.. and host type, as well as defining a group of hosts on which to run
Ansible
---------
Expand Down Expand Up @@ -75,4 +105,10 @@ Amazon Web Services

It offers many featured services for compute, storage, networking, analytics, application services, deployment, identity and access management, directory services, security and many more cloud services.

To use AWS for python, check `this <https://aws.amazon.com/developer/language/python/>`_
To use AWS for python, check `this <https://aws.amazon.com/developer/language/python/>`_

We use `Boto3 <https://github.com/boto/boto3>`_ (python package) which provides interfaces to Amazon Web Services, it makes us easy to integrate our Python application, library, or script with AWS services

Boto3 is the Amazon Web Services (AWS) Software Development Kit (SDK) for Python, which allows Python developers to write software that makes use of services like Amazon S3(Simple storage service) and Amazon EC2(Elastic Compute Cloud).

.. Boto provides an easy to use, object-oriented API as well as low-level direct service access.
24 changes: 24 additions & 0 deletions source/repl_and_debugging.rst
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,30 @@ Using pdb, we can set `breakpoints <https://en.wikipedia.org/wiki/Breakpoint>`_

**pbd help speed up the debugging process a lot faster than using simple print() statements everywhere.**

The easiest way to use pdb is to call it in the code you’re working on.

.. code-block:: python
import pdb; pdb.set_trace()
As soon as the interpreter reaches this line, we’ll receive a command prompt on the terminal where we’re running the program. This is a general Python prompt, but with some new commands.

+ l (list) - Display 11 lines around the current line.
+ r (return) - Continue execution until the current function returns.
+ b (break) - Set a breakpoint (depending on the argument provided).
+ n (next) - Continue execution until the next line in the current function is reached.
+ s (step) - Execute the current line, stop at the first possible occasion.
+ j (jump) - Jump to the next line to be executed.
+ c (continue) - Creates a breakpoint in the program execution.

for more commands `check <https://docs.python.org/3/library/pdb.html#debugger-commands>`_

If we want to run the application from the debugger and set breakpoints without any changes in the source code, then we need to execute the application with the debugger, use the command

.. code-block:: python
$ python -m pdb hello.py
ipdb
Expand Down

0 comments on commit 5b18783

Please sign in to comment.