Skip to content

Instantly share code, notes, and snippets.

import pickle
OPS = {
0: '+', 1: '&', 2: '//', 3: '<<', 4: '@', 5: '*', 6: '%', 7: '|',
8: '', 9: '>>', 10: '-', 11: '/', 12: '^'
}
def calculate_expression(current_value, tokens):
result = current_value if isinstance(tokens[0], str) and tokens[0].startswith('flag[') else int(tokens[0])
for i in range(1, len(tokens), 2):
import gzip
import pickle
def chunk_blocks_gz(filepath):
all_blocks, temp_block, is_capturing = [], [], False
with gzip.open(filepath, "rt") as file_handle:
for text_line in file_handle:
text_line = text_line.rstrip()
text_line = 'stack > [...' + text_line[-150:] if 'stack' in text_line else text_line
import marshal
__lltrace__ = True
with open("output.pyc", "rb") as f:
header = f.read(16) # reads and skips the first 16 bytes (this is the header .pyc file with metadata: magic number, timestamp, size, etc.)
code_obj = marshal.load(f)
exec(code_obj)
@excla1mmm
excla1mmm / transfer-rsync.sh
Last active February 11, 2025 10:28
Script for transfer data to the new MikoPBX station using Rsync
# Asking for connection details
echo -n "Enter OLD MikoPBX ip address or host name: "
read PBX_IP
echo -n "Enter ssh root username [root]: "
read PBX_USER
PBX_USER=${PBX_USER:-root}
echo -n "Enter ssh port [22]: "
read PBX_PORT