Skip to content

Instantly share code, notes, and snippets.

import subprocess
import os
import tempfile
def run_php_code(php_code: str, *args) -> str:
"""
Executes a given PHP code string as a standalone PHP script. This function writes the code to a file,
executes it, captures the output, and performs cleanup.
Args:
@n3rada
n3rada / java_runner.py
Last active July 1, 2024 22:07
Run Java Code From Python3
import subprocess
import tempfile
import os
def run_java_code(java_code: str, *args) -> str:
"""
Executes a given Java code string as a standalone Java program. This function writes the code
to a temporary file, executes it using Java's direct execution feature (introduced in Java 11),
captures the output, and performs cleanup.
@n3rada
n3rada / bruteforce_tester.sh
Last active June 24, 2024 18:04
A shell script for generating a password wordlist with a predetermined password inserted at a random position
#!/bin/bash
# Usage explanation if insufficient parameters are provided
if [[ -z "$1" ]]; then
echo "[x] Usage: $0 <password> [wordlist length]"
exit 1
fi
# The correct password is taken from the first argument
PASSWORD="$1"
@n3rada
n3rada / username_generator.py
Created February 16, 2024 11:00
A Python script to generate a wide array of possible usernames from first and last names listed in a file. It supports various combinations including initials, partial names, and common separators
#!/usr/bin/env python3
import sys
from pathlib import Path
import argparse
from itertools import product
from typing import Generator
def username_variants_generator(fname: str, lname: str) -> Generator[str, None, None]:
"""