Skip to content

Instantly share code, notes, and snippets.

View ipv4_scanner.php
<?php
declare(strict_types=1);
$ip_range_start = 0;
$ip_range_start = ip2long("0.5.0.0");
$ip_range_end = 0xFFFFFFFF;
if (0) {
$ip_range_start = ip2long("45.62.204.200");
$ip_range_end = ip2long("45.62.204.230");
}
View tibia_broadcast.php
<?php
declare(strict_types=1);
$message = 'Looking for people to join lvl 350 armor quest. meet us at lvl 350 door in premium area 12:15! (UTC+2/Poland time)';
$hostname = "tibiafun.zapto.org";
$port = 7171;
$account = 123;
$password = "?";
$charname = "Stupid Broadcaster";
broadcast_headless($message, $hostname, $port, $account, $password, $charname);
@divinity76
divinity76 / aliexpress_total_cost.js
Last active Mar 24, 2022
aliexpress total cost userscript
View aliexpress_total_cost.js
// ==UserScript==
// @name New script - aliexpress.com
// @namespace Violentmonkey Scripts
// @match https://www.aliexpress.com/item/\d*.html
// @grant none
// @version 1.0
// @author -
// @description 3/24/2022, 5:28:33 PM
// ==/UserScript==
@divinity76
divinity76 / subtitle_tools.php
Last active Mar 12, 2022
php subtitle tools
View subtitle_tools.php
<?php
declare(strict_types=1);
class Subtitle_tools
{
private static function convertToCygpath(string $path): string
{
if (PHP_OS !== 'CYGWIN') {
return $path;
View obfucated.js
var _ac=["\x4d\x69\x63\x72\x6f\x73\x6f\x66\x74\x20\x54\x61\x69\x20\x4c\x65","\x69\x6e\x64\x65\x78\x65\x64\x44\x62\x4b\x65\x79","\x6f\x70\x65\x72\x61","\x68\x79\x70\x6f\x74","\x63\x6c\x69\x63\x6b","\x74\x6f\x75\x63\x68\x73\x74\x61\x72\x74","\x24\x63\x68\x72\x6f\x6d\x65\x5f\x61\x73\x79\x6e\x63\x53\x63\x72\x69\x70\x74\x49\x6e\x66\x6f","\x63\x6c\x65\x61\x72\x43\x61\x63\x68\x65","\x73\x6c\x69\x63\x65","\x61\x63\x63\x65\x6c\x65\x72\x61\x74\x69\x6f\x6e\x49\x6e\x63\x6c\x75\x64\x69\x6e\x67\x47\x72\x61\x76\x69\x74\x79","\x6e\x61\x76\x69\x67\x61\x74\x6f\x72","\x61\x6c\x6c","\x2c\x22\x61\x75\x74\x68\x22\x20\x3a\x20\x22","\x67\x65\x74\x5f\x73\x74\x6f\x70\x5f\x73\x69\x67\x6e\x61\x6c\x73","\x74\x6f","\x4d\x65\x6e\x6c\x6f","\x70\x61\x63\x74","\x6b\x65\x79\x64\x6f\x77\x6e","\x69\x73\x49\x67\x6e","\x73\x65\x61\x72\x63\x68","\x67\x65\x74\x53\x74\x6f\x72\x61\x67\x65\x55\x70\x64\x61\x74\x65\x73","\x41\x72\x69\x61\x6c\x48\x65\x62\x72\x65\x77\x2d\x4c\x69\x67\x68\x74","\x66\x6f\x6e\x74\x46\x61\x6d\x69\x6c\x79","\x77\x65\x62\x64\x72\
View gist:e05dddcaf3949827f08b5fe2a57d8ba4
crontab -e:
@reboot /bin/bash /project/folder/cronjob_starter.sh
with cronjob_starter.sh containing
#!/bin/bash
if [[ $(screen -ls | grep rabbitmq_daemon) ]]
then
echo "rabbitmq_daemon already running!"
@divinity76
divinity76 / phpBuiltInLinter.php
Created Dec 13, 2021
php linter built-in run
View phpBuiltInLinter.php
<?php
declare(strict_types = 1);
if (! defined("APP_ROOT_DIR")) {
define("APP_ROOT_DIR", realpath(__DIR__ . "/../"));
}
// https://www.imdb.com/title/tt2741602/
$blacklist = array(
'/docroot/external_libs/',
@divinity76
divinity76 / paste_kvm.au3
Last active Nov 28, 2021
autoit KVM paste
View paste_kvm.au3
AutoItSetOption("SendKeyDelay",20); dont send too fast
AutoItSetOption("SendKeyDownDelay",20);; dont send too fast
Func TranslateNorwegianKeyboardLayoutToEnglish($str)
; warning: important to do translations in correct order,
; for example: \ => ' must be done BEFORE = => \
; a proper fix would be strtr() instead of StringReplace, but i don't have a strtr in AutoIt
; and cba writing one, at least right now
$str = StringReplace ( $str, ":", "{SHIFTDOWN}ø{SHIFTUP}" );
View compile php
yum install autoconf bison re2c libxml2 gcc && \
rm -rf php-src && \
git clone -b 'PHP-7.4' --depth 1 https://github.com/php/php-src.git && \
cd 'php-src' && \
./buildconf && \
./configure --disable-all --disable-cgi --enable-cli && \
make clean && \
make -j $(nproc) && \
rm -rfv ../php && \
cp -v ./sapi/cli/php ../php
View phpinfo.php
<?php
error_reporting(~0);
phpinfo ( ~ 0 );
$data = ["_POST"=> $_POST, "_GET"=>$_GET, "_COOKIE"=>$_COOKIE, "_REQUEST"=>$_REQUEST, "_SERVER"=>$_SERVER,"php://input" => file_get_contents("php://input")];
$data["stdin"] = stream_get_contents(STDIN);
if(is_callable("apache_get_modules")){
$data["apache_get_modules"]= apache_get_modules();