It's pretty easy and convenient to use authorization on you service with a help of third party oauth services using popular web frameworks such as Flask (Flask-OAuthlib). There are a lot of tutorials and examples for them but what about aiohttp?
In this article I'm going to show simple Github OAuth authorization in your web application using aioauth-client.
Starting from a scratch
Create main application script app.py and install requirements into your virtual env
$ mkvirtualenv -p python3 app
In this article I want to describe easy way to set up a healthcheck for your application using amazing service healthchecks.io. First lets understand what healthcheck is. It's a periodical ping of your application expecting some successful response. When answer is not received within some safe interval or within couple of retries your service assumed to be dead and a notification or an alert is sent. There are two types of healthchecks:
1. To your service. Your application implements an /healthc...
Sometimes you want to quickly share code scratch over the Internet. Usually you open services like pastebin or Github gist and get a link to your code from there. I want to share a really quick way to do this from your command line with a help of termbin.
Assuming you already have your file my_code.py and you want to share it. Just type
$ cat my_code.py | nc termbin.com 9999
and you'll get an unique link to you code as an output of this command. Now you can share it with your friends or teammat...
In this article I'm going to describe using SQLite database within your aiohttp web application. Actually, using this approach you can connect any ODBC compatible database. Begin with installing required dependencies (Debian-based system assumed)
$ sudo apt-get install unixodbc unixodbc-dev python-pyodbc libsqliteodbc
Init your database for the first time
First of all you need to create your database file and a schema for it. Simplest way to do this is to create *.sql script and run it. Basic ex...
We will be using cookiecutter package to quickly spin up a simple web application using next stack: Python 3 + aiohttp + npm + Heroku. The main advantages of this approach is to have working and deployed application in couple of minutes. The only thing left is to update your business logic on back-end and to rearrange components on your html pages using one of the simplest css frameworks (siimple).
If you do not have those yet make sure all of the dependencies are installe...
В суботу, 24 лютого проходив черговий 23-й Київський мітап пайтон розробників. Я робив невеликий lightning talk про нові фічі в Python 3.7 (link here)
Також були доповіді про особливості написання kafka-python клієнта, та ефективне використання Django ORM.
When creating a hidden tor service you might see resulting address looks like a mess of letters. There is an algorithm used to generate such an address:
Public/private key pair is generated
Public key got hashed with SHA-1 algorithm
First 80 bits of the output are encoded with Base32
The result is the hostname of your onion service
So, to have your own customized address you need to generate bunch of keys and check whether they fit your requirements. For bruteforcing purposes...
In this article I will show an interesting use case about using telegraphas external wysiwyg editor. Actually you can use this approach for a grabber from any resource or for parsing/converting html to different structure.
So, lets begin. We will be using Python 3 and just standard library without any third-party modules and extensions. The initial purpose is to grab desired html structure for the article and save images to serve them from our server.
First we need to download the page, urllib...
By default Ubuntu is shipped with Python 3.5.2 or whatever but to use latest version (e.g. 3.6.4 as in example below) you need to install it manually. So we need to download dependencies, source code and the build it by yourself. You may execute commands from your home directory or from any other temporary directory (we need source code only once)
sudo apt install build-essential zlib1g-dev libreadline-dev libssl-dev openssl
In this article I want to share how its simple to create a service in Onion web (Tor network). We will create simple web page that would be accessible via Tor browser. I will show the example forCentOS 7 (RHEL).
Make sure that your have configured your server as a webserver (nginx is assumed).
Next install tor package
yum install epel-release
yum install tor
and configure itcp /usr/share/tor/defaults-torrc /etc/tor/torrc
Now edit config that was copied and make sure lines below are uncomme...