This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- 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() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
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' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def s_p_s_result(my, enemy): | |
if my == enemy: | |
return 'Ничья' | |
elif (my, enemy) in [('Ножницы', 'Бумага'), ('Камень', 'Ножницы'), ('Бумага', 'Камень')]: | |
return 'Ты победил' | |
else: | |
return 'Я выиграл' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import psycopg2 | |
import random | |
num_iterations = 1000 | |
db = 'domains' | |
host = '127.0.0.1' | |
pwd = 'topsecretmegapassword' | |
conn = psycopg2.connect(database=db, | |
user=db, | |
password=pwd) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from django.core.management.base import BaseCommand, CommandError | |
from django.db import connection, connections | |
from django.db.utils import OperationalError | |
| |
| |
class Command(BaseCommand): | |
| |
def add_arguments(self, parser): | |
parser.add_argument('target_base', nargs='+', type=str) | |
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- coding: utf-8 -*- | |
import requests | |
from stem import Signal | |
from stem.control import Controller | |
import time | |
class TorSession(object): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from github import Github | |
def go_github(): | |
allowed_acc = ['allowed_friend1', 'allowed_friend2', 'username'] | |
account = Github("username", "password") | |
for repo in account.get_user().get_repos(): | |
owner = repo.owner.login | |
if owner not in allowed_acc: | |
print(owner) | |
repo.remove_from_collaborators('username') |
OlderNewer