Skip to content

Instantly share code, notes, and snippets.

@divinity76
divinity76 / file_searcher.php
Created January 18, 2024 08:39
file searcher
<?php
declare(strict_types=1);
$dir = realpath(__DIR__ . '/..');
$files = shell_exec("find " . escapeshellarg($dir) . " -print0");
$files = explode("\x00", rtrim($files, "\x00"));
$files = array_filter($files, function ($filepath) {
if (!preg_match("/page/", $filepath)) {
return false;
@divinity76
divinity76 / php_inserter.php
Created January 18, 2024 08:27
php advanced code inserter
<?php
declare(strict_types=1);
$dir = realpath(__DIR__ . '/..');
$files = shell_exec("find " . escapeshellarg($dir) . " -print0");
$files = explode("\x00", rtrim($files, "\x00"));
$files = array_filter($files, function ($filepath) {
if(!preg_match("/page/", $filepath)) {
return false;
@divinity76
divinity76 / php_to_shell.php
Created October 30, 2023 08:14
php script to shell command converter
#!/usr/bin/env php
<?php
declare(strict_types=1);
use function var_dump as d;
function dd(...$args)
{
$trace = debug_backtrace(0, 1)[0]; // odd, i really expected (0, 2)[1] ... but it works
$line = $trace['line'];
$file = $trace['file'];
@divinity76
divinity76 / results.json
Last active September 19, 2023 08:07
sick simulation
{
"percent_sick_if_tested_positive": 4.458833791853989,
"percent_healthy_if_tested_positive": 48.80539325842697,
"percent_sick_if_tested_negative": 0.0011333259793069787,
"percent_healthy_if_tested_negative": 49.99971666368849,
"percent_tested_positive_and_sick": 49.719416386083054,
"percent_tested_positive_and_healthy": 1.9703818540227784,
"percent_tested_negative_and_sick": 1.1037527593818985,
"percent_tested_negative_and_healthy": 49.49240211146362,
"total_population": 5408000,
@divinity76
divinity76 / base64_length.php
Created April 9, 2023 16:23
base64 encoded length/efficiency thingy..
<?php
// https://3v4l.org/XsSjl
function base64url_encode($data) {
return rtrim(strtr(base64_encode($data), '+/', '-_'), '=');
}
$str="";
for($i=1;$i<30;++$i){
$str.=chr($i);
$encoded_base = base64url_encode($str);
@divinity76
divinity76 / Dockerfile_old_php
Created March 12, 2023 16:40
dockerfile old php mysql thingy..
FROM ubuntu:20.04
ENV DEBIAN_FRONTEND=noninteractive
RUN apt-get update -y
RUN apt-get -y full-upgrade;
RUN apt-get -y install apt-utils
RUN apt-get -y install default-mysql-server libmysqlclient-dev git make autoconf gcc re2c wget xz-utils tar file bison
RUN git clone -b 'PHP-7.3' --depth 1 https://github.com/php/php-src.git php56
# https://askubuntu.com/questions/1329414/why-is-my-global-h-from-libmysqlclient-dev-is-missing-in-ubuntu-20-04
#RUN touch /usr/include/mysql/my_global.h
#RUN apt-get install -y bison
@divinity76
divinity76 / nhentai_downloader.php
Created November 27, 2022 23:40
nhentai downloader
<?php
declare(strict_types=1);
function dd($var)
{
var_dump($var);
die;
}
@divinity76
divinity76 / php_code_scanner.php
Last active October 11, 2022 13:08
php code scanner
<?php
declare(strict_types=1);
use function var_dump as d;
$files = shell_exec("find . -name '*.php' -print0");
$files = explode("\x00", rtrim($files, "\x00"));
foreach ($files as $file) {
echo "Checking {$file}...";
@divinity76
divinity76 / swords.py
Last active May 24, 2025 08:01
swords & souls bot
# winpip install var_dump pyautogui pywin32 pymem pillow pyscreeze
import base64
import os
import pyautogui as pyautogui
from pymem import Pymem
from var_dump import var_dump
import time
import math
from random import randrange
import ctypes
@divinity76
divinity76 / rsync_forever.php
Last active December 11, 2023 19:40
rsync dir indefinitely whenever it changes.. syncer
#!/usr/bin/env php
<?php
declare (strict_types = 1);
global $argc, $argv;
if ($argc < 3) {
echo ("Usage: {$argv[0]} 'FOLDER' rsync FOLDER foo@bar:server_folder arg1 arg2 arg3 etc\n");
exit(1);
}
/**