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 hmac import new as hmac_new | |
from hashlib import sha256 | |
from urllib.parse import unquote | |
def validate(init_data: str, token: str, c_str="WebAppData") -> None | dict[str, str]: | |
"""Validates init data from webapp to check if a method was received from Telegram | |
Args: | |
init_data (str): init_data string received from webapp |
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 argparse | |
def main(input_filename: str, output_filename: str, ipset_name: str, is_file_append: bool) -> None: | |
input_file = open(input_filename, "r", encoding="utf-8") | |
output_file = open(output_filename, "a" if is_file_append else "w", encoding="utf-8") | |
while True: | |
line = input_file.readline() | |
if not line: |
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
deb https://ftp.debian.org/debian/ bookworm contrib main non-free non-free-firmware | |
# deb-src https://ftp.debian.org/debian/ bookworm contrib main non-free non-free-firmware | |
deb https://ftp.debian.org/debian/ bookworm-updates contrib main non-free non-free-firmware | |
# deb-src https://ftp.debian.org/debian/ bookworm-updates contrib main non-free non-free-firmware | |
deb https://ftp.debian.org/debian/ bookworm-proposed-updates contrib main non-free non-free-firmware | |
# deb-src https://ftp.debian.org/debian/ bookworm-proposed-updates contrib main non-free non-free-firmware | |
deb https://ftp.debian.org/debian/ bookworm-backports contrib main non-free non-free-firmware |
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 functools | |
import kutana | |
from kutana import RequestException | |
from kutana.update import ReceiverType | |
async def wrong_receiver(message: kutana.Message, context: kutana.Context, expected: ReceiverType): | |
if expected == ReceiverType.MULTI: | |
await context.reply("This command is available only in multi chat.") |
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
#!/bin/sh | |
# /opt/etc/ndm/fs.d/100_hirkn-ipsets.sh | |
[ "$1" != "start" ] && exit 0 | |
echo " --- HIRKN ENTRY POINT --- " | |
RKN_SET_FILE="/opt/root/rkn.lst" | |
GOOGLE_SET_FILE="/opt/root/google.lst" | |
CUSTOM_SET_FILE="/opt/root/custom.lst" |
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
# Task 1 | |
def get_spec_digit_count(number, digit): | |
if digit > len(str(number)): | |
return 0 | |
if digit < 0: | |
digit = -digit | |
return int(str(number)[-digit]) | |
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
xdvxdvxdv |