Skip to content

Instantly share code, notes, and snippets.

View bashkirtsevich's full-sized avatar
:octocat:
bashkirtsevich.github.io

D.A.Bashkirtsev bashkirtsevich

:octocat:
bashkirtsevich.github.io
View GitHub Profile
@bashkirtsevich
bashkirtsevich / demo.py
Created August 13, 2018 06:37
Asyncio exec cmd
import asyncio
async def exec_shell_cmd(commands):
for command in commands:
process = await asyncio.create_subprocess_shell(command)
await process.wait()
@bashkirtsevich
bashkirtsevich / demo.py
Created August 2, 2018 10:29
aiohttp json get
import asyncio
import aiohttp
async def http_get_json(url):
async with aiohttp.ClientSession() as session:
async with session.get(url) as resp:
return await resp.json()
@bashkirtsevich
bashkirtsevich / README.md
Last active July 31, 2018 17:59
CentOS7 docker install

Original source URL

Original automatic install:

bash <(curl -s http://repository.sandbox.infoboxcloud.ru/scripts/docker/centos7/install.sh)

Gist automatic install:

bash &lt;(curl -s https://gist.githubusercontent.com/bashkirtsevich/ad80619ea8ce1fbe0c7204a4e008be90/raw/59deb186f181503826c8d69cfa1d2147ed63daa5/docker-install.sh)
@bashkirtsevich
bashkirtsevich / dns_server.py
Created July 17, 2018 15:29 — forked from Phaeilo/dns_server.py
Bare bones Python 3 DNS server
#!/usr/bin/env python3
# This is free and unencumbered software released into the public domain.
#
# Anyone is free to copy, modify, publish, use, compile, sell, or
# distribute this software, either in source code form or as a compiled
# binary, for any purpose, commercial or non-commercial, and by any
# means.
#
# In jurisdictions that recognize copyright laws, the author or authors
@bashkirtsevich
bashkirtsevich / export-all-images.sh
Last active August 7, 2018 16:20
Compress docker image to tgz
docker save $(docker images -q) | gzip -c > all_images.tgz
@bashkirtsevich
bashkirtsevich / makefile
Last active June 13, 2018 09:32
Docker makefile
.DEFAULT_GOAL := help
help: ## This help.
@awk 'BEGIN {FS = ":.*?## "} /^[a-zA-Z_-]+:.*?## / {printf "\033[32m%-10s\033[0m %s\n", $$1, $$2}' $(MAKEFILE_LIST)
list: ## Show all containers
docker ps -a
@bashkirtsevich
bashkirtsevich / Makefile.ex1
Created June 5, 2018 19:45 — forked from nicr9/Makefile.ex1
Example Makefile for docker project
# Admin commands
all: build up
build:
docker-compose build
up:
docker-compose up -d
#!/bin/bash
# this script installs GCC 4.9.3
# to use it navigate to your home directory and type:
# sh install-gcc-4.9.3.sh
# download and install gcc 4.9.3
wget https://ftp.gnu.org/gnu/gcc/gcc-4.9.3/gcc-4.9.3.tar.gz
tar xzf gcc-4.9.3.tar.gz
cd gcc-4.9.3
@bashkirtsevich
bashkirtsevich / natasha_names_extractor_demo.py
Last active May 22, 2018 17:20
Natasha custom names extractor
from itertools import permutations, chain
from natasha.extractors import Extractor
from natasha.grammars.name import Name, NAME
from natasha.markup import show_json
from natasha.tokenizer import NAME_TOKENIZER
from yargy import rule, or_
from yargy.predicates import gram, in_caseless
from yargy.relations import gnc_relation
@bashkirtsevich
bashkirtsevich / raspbian-python3.6.rst
Created April 29, 2018 15:02 — forked from dschep/raspbian-python3.6.rst
Installing Python 3.6 on Raspbian

Installing Python 3.6 on Raspbian

As of January 2018, Raspbian does not yet include the latest Python release, Python 3.6. This means we will have to build it ourselves, and here is how to do it. There is also an ansible role attached that automates it all for you.

  1. Install the required build-tools (some might already be installed on your system).