Skip to content

Instantly share code, notes, and snippets.

View gormih's full-sized avatar
🧸
bear

Michael Alexeevich gormih

🧸
bear
View GitHub Profile
def s_p_s_result(my, enemy):
if my == enemy:
return 'Ничья'
elif (my, enemy) in [('Ножницы', 'Бумага'), ('Камень', 'Ножницы'), ('Бумага', 'Камень')]:
return 'Ты победил'
else:
return 'Я выиграл'
@gormih
gormih / MobSF REST API Python.py
Created October 8, 2019 14:06 — forked from ajinabraham/MobSF REST API Python.py
MOBSF REST API Python Requests Example
"""
MOBSF REST API Python Requests
"""
import json
import requests
from requests_toolbelt.multipart.encoder import MultipartEncoder
SERVER = "http://127.0.0.1:8000"
FILE = 'SAP/diva-beta.apk'
from django.conf import settings
import datetime
class LogIPCookies(object):
def __init__(self):
print(u'http ip log cookies init')
@staticmethod
def process_request(request):
ip = request.META['REMOTE_ADDR']
# -*- coding: utf-8 -*-
import dns.resolver
from ipwhois import IPWhois
import warnings
def chek_yandex_security(host):
yandex_dns = ['77.88.8.7', '77.88.8.3']
resolver = dns.resolver.Resolver()
@gormih
gormih / postgresql_russian_unaccent_config.sql
Last active December 12, 2017 13:39
Create postgresql russian unaccent configuration
CREATE EXTENSION unaccent;
CREATE TEXT SEARCH CONFIGURATION russian_unaccent( COPY = russian );
ALTER TEXT SEARCH CONFIGURATION russian_unaccent
ALTER MAPPING FOR hword, hword_part, word
WITH unaccent, russian_stem;
import zipfile
zip_ref = zipfile.ZipFile(current_zip_full_path, 'r')
extract_to = current_zip_full_path + '_temp'
zip_ref.extractall(extract_to)
zip_ref.close()