Pages

Sunday, July 17, 2016

How to create Video Upload API using Python Flask Dockers Apache2 Nginx Reverse Proxy SSL Lesson 1

Python Flask Video Upload API

#python #flask #pythondockers #pythonnginx #pythonapache2reverseproxy #pythonnginxreverseproxy #ubuntudockers
Hello and welcome to my blog.Today onwards we going to start a new journey.I'm going to teach you How to build complete video upload REST API using python flask.
so stay with me.
Here is the plan of this lesson series.around 50

  1. Introduction of the project and Setup our working environment.
  2. Create User Registration System using Python Flask.
  3. Create email Sending API for user verification Using Python Flask.
  4. Create API for verified user Identification Using Python Flask.
  5. Create API for user Login Using Python Flask.
  6. Create API for change user email using Python Flask.
  7. Create user email change email sending API.
  8. Create video upload API.
  9. create view uploaded video API.
  10. Change uploaded video details API.
  11. Delete uploaded video API.
  12. Apache reverse proxy.
  13. nginx reverse proxy.
  14. Create docker image from docker file.
  15. Create docker container from docker image.
  16. Create mongodb docker image.
  17. Link web service docker and mongodb docker.
  18. Change host file in ubuntu.
  19. Create virtual host in apache2.
  20. Create virtual host in nginx.
  21. Use unix socket insted of the tcp socket nginx.
  22. Install uwsgi and run flask app.
  23. Create wsgi and run flask application using wsgi.
  24. Commit docker.
  25. Rename docker.
  26. Restart docker.
  27. Stop docker.
  28. Restart docker.
  29. Remove docker image.
  30. Remove docker container.
  31. Stop all running docker container in one click.
  32. Remove all stopped container in one click.
  33. Use https for the flask application.
  34. Redirect http to the https in nginx
  35. Launch flask app to google app engine.
  36. Use single run command in docker file.
  37. Restart flask app if it is crashed.
  38. Run flask app using shell file.
  39. Run flask app using shell file with nohup command.
  40. Create non root ubuntu account to build and run docker image.
  41. How to run any file when docker container start.
  42. Build and run docker container and run video upload web service inside the docker file using one shell script.
  43. Use advance rest client to check your web service.
  44. Use postman to check your web service.
  45. Use curl to check your web service.
  46. How to use GET request to check your web service.
  47. How to use POST method to send request to your web service.
  48. How to use form encoded for send request to web service.
  49. How to solve url character limited nginx.
  50. How to solve apache errors.
  51. How to get POST and GET method both in flask application.
  52. What is IBM Bluemix.
  53. How to deploy docker image to IBM Bluemix. 
Plase share and comment.Have a good day


Tuesday, February 23, 2016

How to Hide Files in Windows System Using ADS(Altanate Data Stream)

How to Hide File Using Python 

Alternate Data stream is a substructure of a NTFS file system.Alternate Data Stream(ADS) can not  detect by common software or tools and it is attach with normal file or folder in hidden layer.

File Data and Attributes <--> Default Data Stream <-->Altanate Data Stream

so first create folder and inside that folder create python file name hide.py and also create text file hello.txt and also add image file photo.jpg we are going to hide this photo.jpg file inside the hello.txt file

What things we need to hide file using python
[+]install python 2.7 to your windows computer
[+]install pyADS 
open command prompt and type 
pip install pyADS


then it will install pyADS for you 
ok now open hide.py file in text editor or python IDE.i use pycharm

then type
import argparse
from pyads import ADS
we use argparse to get user input in command prompt

then create our main function
 def Main():
and create variable name parse and then it take input from argparse method
parser=argparse.ArgumentParser()
then we can get user input to scan for ADS files
Add file to ADS
Remove file from ADS
Extract ADS file

parser.add_argument("file",help="Specify File or Directory")
parser.add_argument("-o","--output",help="Print output to terminal",action="store_true")
parser.add_argument("-a","--add",help="Add stream to <file>",type=str)
parser.add_argument("-e","--extract",help="Extract All",action="store_true")
parser.add_argument("-r","--remove",help="Remove All",action="store_true")
 
Whole Program
import argparse
from pyads import ADS


def Main():
    parser=argparse.ArgumentParser()
    parser.add_argument("file",help="Specify File or Directory")
    parser.add_argument("-o","--output",help="Print output to terminal",action="store_true")
    parser.add_argument("-a","--add",help="Add stream to <file>",type=str)
    parser.add_argument("-e","--extract",help="Extract All",action="store_true")
    parser.add_argument("-r","--remove",help="Remove All",action="store_true")

    args=parser.parse_args()
    if args.file:
        handler=ADS(args.file)

        if args.add:
            handler.addStream(args.add)
        if handler.containStreams():
            for stream in handler.getStreams()[:]:
                if args.output:
                    print(args.file+":"+stream)
                if args.extract:
                    fh=open(stream,"wb")
                    fh.write(handler.getStreamContent(stream))
                    fh.close()
                if args.remove:
                    handler.removeStream(stream)
    else:
        print(parser.usage)



Main()
Lets try it
hide file inside
see text file size is 0byte


 open folder and type cmd then it will open Command prompt from there
so type python hide.py hello.txt -a photo.jpg 


now it will combine the photo inside the text file we can check it using python hello.txt -o to scan the ads file see now photo is inside the text file.

now we can check the text file size it is still 0byte

so we can delete the photo.jpg 

now let's recover our hidden photo from text file
python hide.py hello.txt -e


this will extract photo.jpg from hello.txt file 

i hope you would enjoy this tutorial.if you are like this post please share with your friends.

Commands

python hide.py hello.txt -o  To check is there any ADS files
python hide.py hello.txt -a photo.jpg to hide photo inside text file
python hide.py hello.txt -e to extract photo from text file
python hide.py hello.txt -r to remove photo from text file
if you have face error add pyads file to same folder
download






Android Studio not Open After Installing

android studio java.lang.RuntimeException: java.lang.IllegalArgumentException: Argument 


if you are try to install and open android studio for the first time sometimes you may have face to this error .
i also face the same problem .here is the tip for solve the this error and have fun with android app coding

there is two things you can solve the problem
1.disconnect your internet connection and close your android studio and restart android studio.this will help to solve problem
2.Go to android studio Bin folder where you have installed android studio.

and open bin folder there is file name idea.properties 

copy that file to your desktop because that will not edit there and save there.so open copied file in desktop through notepad
then at the end of line add 
disable.android.first.run=true at the last


then save file .make sure save as all files otherwise it will save as text file

then copy and replace the file in bin folder
 then run android studio it will works well now
if you are like this post please comment bellow .and share with your friends

How to install Selenium in python Windows PC

Install Selenium in Python 2.7 For Automation

Selenium is the web driver use for use Test automation.Selenium can use for most of the testing and Automate the software product.and also this can be use for automate the boring stuff with your programming knowledge.in next tutorial im going to teach you a how to automate the LinkedIn Profile views and increase the you are getting job.and expose your LinkedIn profile to others.so before we are going to do that we have to install selenium web driver to your computer.
you will need python 2.7 in your computer
and you need PIP for this python installer package 
open command prompt and type
 pip install selenium
you can activate the pip using add C:\Python27\Scripts line to your environmental variable.see my previous post for how to do this



If you are like to this post Share and comment

How to enable dot net 3.5 (dot net 3.0 or dot net 2.0 ) offline

Install dot net 3.5 framework offline

when you try to install new software in windows 8,or windows 8.1 or windows 10 you will face this problem because windows 8 or 10 does not include the dotnet 3.5 framework.so there is option ,either you have to download dot net 3.5 framework and install it.but do you know if you have windows 8,8.1 or windows 10 DVD or iso file you can easily install dot net 3.5 framework offline
it is simple
 fi you have windows DVD put dvd in to laptop and it will mount .
when the dvd is mounted there is folder called Sources-->SXS
in my laptop it mounted as Drive Letter E so the pasth is
D:\sources\sxs

so open command prompt in administrator mode. you can do this press windows key on keyboard and type CMD. then it will show command prompt then you can right click on common prompt and provide run as administrator

in this command prompt type
Dism.exe /online /enable-feature /featurename:NetFX3 /All /Source:D:\sources\sxs /LimitAccess,

then it will automatically install dotnet 3.5 framework for you.

I hope this article will help you to solve your problem
if you are like this post please share with your friends.