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
{ | |
"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, |
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
<?php | |
declare(strict_types=1); | |
error_reporting(~0); | |
ini_set("display_errors", "1"); | |
phpinfo(~0); | |
$data = ["_POST" => $_POST, "_GET" => $_GET, "_COOKIE" => $_COOKIE, "_REQUEST" => $_REQUEST, "_SERVER" => $_SERVER, "php://input" => file_get_contents("php://input")]; | |
if(defined("STDIN")){ |
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
<?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); |
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
add CURLOPT_VERBOSE and post the verbose log: ```$stderrh=tmpfile(); | |
curl_setopt_array($ch,array(CURLOPT_VERBOSE=>1,CURLOPT_STDERR=>$stderrh)); | |
curl_exec($ch); | |
/* https://bugs.php.net/bug.php?id=76268 */ | |
rewind($stderrh); | |
$stderr=stream_get_contents($stderrh); | |
fclose($stderrh); | |
var_dump($stderr); | |
``` |
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 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 |
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
<?php | |
declare(strict_types = 1); | |
const DOMAIN = "example.org"; | |
$exists = file_exists ( "log.db3" ); | |
$db = new PDO ( "sqlite:log.db3", "", "", array ( | |
PDO::ATTR_EMULATE_PREPARES => false, | |
PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION | |
) ); | |
if (! $exists) { |
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
<?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); |
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
<?php | |
declare(strict_types=1); | |
function dd($var) | |
{ | |
var_dump($var); | |
die; | |
} |
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
<?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}..."; |
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
<?php | |
declare(strict_types=1); | |
error_reporting(E_ALL); | |
set_error_handler(function($errno, $errstr, $errfile, $errline) { | |
if (!(error_reporting() & $errno)) { | |
return; | |
} | |
throw new ErrorException($errstr, 0, $errno, $errfile, $errline); | |
}); | |
function exec1($cmd):int { |