View tokenizer.py
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 base64 | |
import binascii | |
import string | |
UNICODE_PREFIX = base64.b64decode(b'XA==').decode(encoding="ascii") + \ | |
string.ascii_letters[20] + string.digits[:1] * 2 | |
input_text = 'hello world' | |
View python_to_curl.py
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
SS_HEADERS = { | |
"Content-Type": "text/plain" | |
} | |
def check(response): | |
req = response.prepare() | |
command = "curl -X {method} \\\n -H {headers} \\\n -d '{data}' \\\n '{uri}'" | |
method = req.method | |
uri = req.url |
View stop_process.sh
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
if [[ $1 == "" ]] | |
then | |
echo "Pass process name as argument" | |
exit | |
else | |
echo "Stopping PIDs for $1" | |
fi | |
for pid in $(ps -ef | grep $1 | awk '{print $2}'); do echo "Stopping pid $pid" && kill -9 $pid; done | |
# for pid in $(ps -ef | awk '/$1/ {print $2}'); do echo "Stopping pid $pid" && kill -9 $pid; done |
View timezones.py
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 os | |
from collections.abc import Generator | |
from threading import Thread | |
from typing import List, Union, NoReturn, Dict | |
import pandas | |
import requests | |
import yaml | |
from jarvis.modules.exceptions import EgressErrors |
View domain_availability.py
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 logging | |
import subprocess | |
from typing import Iterable, NoReturn | |
import requests | |
from bs4 import BeautifulSoup | |
class CustomFormatter(logging.Formatter): | |
"""Override logging.Formatter using custom colors.""" |
View github.py
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
"""Check availability of an username and get details of the particular account. | |
Requirements: | |
python -m pip install python-dotenv requests | |
""" | |
import json | |
import os | |
import string | |
from typing import Union |
View timezones.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View camera.py
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 platform | |
import subprocess | |
from typing import Dict, Iterable, List, Union | |
Windows = """wmic path CIM_LogicalDevice where "Description like 'USB Video%'" get /value""" | |
Darwin = "system_profiler SPCameraDataType" | |
Linux = "v4l2-ctl --list-devices" | |
def list_splitter(original_list: List[str], delimiter: str) -> List[List[str]]: |
View video.py
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
""" | |
pip install fastapi uvicorn aiofiles jinja2 | |
uvicorn video:app --reload | |
""" | |
import mimetypes | |
import logging | |
import os | |
import pathlib | |
from fastapi import FastAPI, Request, Response, Header |
NewerOlder