This file contains hidden or 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 |
This file contains hidden or 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 |
This file contains hidden or 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' | |
This file contains hidden or 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
timezone_map = { | |
'GMT': 'Greenwich Mean Time', | |
'UTC': 'Universal Coordinated Time', | |
'ECT': 'European Central Time', | |
'EET': 'Eastern European Time', | |
'ART': '(Arabic) Egypt Standard Time', | |
'EAT': 'Eastern African Time', | |
'MET': 'Middle East Time', | |
'NET': 'Near East Time', | |
'PLT': 'Pakistan Lahore Time', |
This file contains hidden or 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 binascii | |
import getpass | |
import json | |
import os | |
import time | |
from urllib.request import urlopen | |
from OpenSSL import crypto | |
IP_INFO = json.load(urlopen('http://ipinfo.io/json')) or json.load(urlopen('http://ip.jsontest.com')) |
This file contains hidden or 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 asyncio | |
from typing import Dict | |
from urllib.parse import urljoin | |
import aiohttp | |
from pydantic import HttpUrl | |
from pydantic_settings import BaseSettings | |
class Settings(BaseSettings): |
This file contains hidden or 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 typing import List | |
import requests | |
SESSION = requests.Session() | |
headers = { | |
'Accept': 'application/vnd.github+json', | |
'Authorization': f"Bearer {os.getenv('GIT_TOKEN')}", |
This file contains hidden or 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 math | |
import pyaudio | |
_logger = logging.getLogger(__name__) | |
_logger.addHandler(logging.StreamHandler()) | |
_logger.setLevel(logging.DEBUG) | |
This file contains hidden or 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 | |
import shutil | |
import subprocess | |
import time | |
with open('requirements.txt') as file: | |
requirements = file.readlines() | |
tmp_name = f'requirements_{int(time.time())}.txt' | |
os.rename('requirements.txt', tmp_name) |