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
.encode('cp1251').decode('utf-8') |
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
#!/usr/bin/env python | |
"""Find domains on ip address using a ssl certificate""" | |
import argparse | |
import ipaddress | |
import logging | |
import os | |
import socket | |
import ssl | |
import sys | |
import tempfile |
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 httpx | |
import asyncio | |
import aiohttp | |
import os | |
from fp.fp import FreeProxy | |
from time import sleep | |
import logging | |
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 httpx | |
import asyncio | |
import aiohttp | |
import os | |
from fp.fp import FreeProxy | |
THIS_DIR = os.path.dirname(os.path.realpath(__file__)).replace('\\', '/') |
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
https://github.com/aio-libs/aiohttp/issues/955 | |
https://stackoverflow.com/questions/51887784/using-aiohttp-with-proxy | |
https://superfastpython.com/python-async-requests/#Requests_Block_the_Asyncio_Event_Loop_this_is_bad |
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
urls = open_file(0, 500) #array of urls | |
async def fetch_url(i, url, semaphore): | |
async with semaphore: | |
async with httpx.AsyncClient() as client: | |
reply = await client.get(url) | |
print(f'got {url}') | |
return i, reply |
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
str = 'string' | |
list = [.....] | |
if not any(list_elem in str for list_elem in list): | |
do |
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 pandas as pd | |
import openpyxl | |
# maybe in loop | |
for i in data: # let i == [a, b] | |
df = pd.DataFrame( | |
[[a, b]], | |
columns=['Title1', 'Title2'] | |
) |
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
var lengthOfLongestSubstring = function(s, len=undefined) { | |
// check if all chars same | |
if (!len) { | |
if (s.length !== 0) { | |
const arr = [...s] | |
const allEqual = arr => arr.every(val => val === arr[0]) | |
if (allEqual(arr)) { | |
return 1 | |
} |
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
s = "bbbb" | |
const arr = [...s] | |
const allEqual = arr => arr.every(val => val === arr[0]) | |
if (allEqual(arr) { | |
return true | |
} |
NewerOlder