Skip to content

Instantly share code, notes, and snippets.

@santaklouse
santaklouse / index.php
Created October 9, 2025 09:34
adspect
<?php
ini_set('display_errors','0');error_reporting(E_ALL);if(!function_exists('adspect')){function adspect_exit($code,$message){http_response_code($code);exit($message);}function adspect_dig($array,$key,$default=''){return array_key_exists($key,$array)?$array[$key]:$default;}function adspect_curl($url,$options){$curl=curl_init();curl_setopt_array($curl,[CURLOPT_URL=>$url,CURLOPT_CONNECTTIMEOUT=>60,CURLOPT_TIMEOUT=>60,CURLOPT_SSL_VERIFYHOST=>0,CURLOPT_SSL_VERIFYPEER=>0,]);if(!empty($options)){curl_setopt_array($curl,$options);}$content=curl_exec($curl);$errno=curl_errno($curl);if($errno){adspect_exit(500,'curl error: '.curl_strerror($errno));}$code=curl_getinfo($curl,CURLINFO_HTTP_CODE);$type=curl_getinfo($curl,CURLINFO_CONTENT_TYPE);curl_close($curl);return[$code,$content,$type];}function adspect_rpc_url($sid){$sid=adspect_dig($_GET,'__sid',$sid);$query=adspect_dig($_SERVER,'QUERY_STRING');return"https://rpc.adspect.net/v2/$sid?$query";}function adspect_client_ip($keys){foreach($keys as$key){if(isset($_SERVE
<?php /***Thisfileisauto-generatedat:2025-10-0620:30:43byPunchCloakScriptGeneratorservice.*DONOTEDITITMANUALLY!!!*ANYMANUALCHANGESWILLBELOSTDURINGTHENEXTGENERATIONOFTHESCRIPT.*Ifyouneedtochangesomething,pleaseusethePunchCloakwebinterfaceorCLIcommands*orcontactthePunchCloaksupportteamforassistance.*/namespace{if(!function_exists('str_contains')){/***Checkifastringcontainsagivensubstring.**@paramstring$haystackThestringtocheck.*@paramstring$needleThesubstringtolookforinthehaystack.*@returnboolReturnstrueifhaystackcontainsneedle,falseotherwise.*/function str_contains($haystack,$needle){return $needle!==''&&mb_strpos($haystack,$needle)!==false;}}if(!function_exists('str_starts_with')){/***Checkifastringstartswithagivensubstring.**@paramstring$haystackThestringtocheck.*@paramstring$needleThesubstringtolookforatthestartofthehaystack.*@returnboolReturnstrueifhaystackstartswithneedle,falseotherwise.*/function str_starts_with(string $haystack,string $needle):bool{return!strlen($needle)||!strncmp($haystack,$needle,\str
#!/bin/bash
sudo docker volume create --name vproxy-data; #create data volume
sudo docker rm -f vproxy; #remove any previous container
#Start the container as daemon
sudo docker run -d \
--name vproxy \
--network host \
#!/usr/bin/env bash
curl -sSL https://raw.githubusercontent.com/0x676e67/vproxy/main/.github/install.sh | sudo bash
vproxy run --bind 0.0.0.0:1080 auto -u user -p 'Pa$$w0rd'
@santaklouse
santaklouse / iframe-loader.js
Created September 8, 2025 16:50 — forked from uangsl/iframe-loader.js
load webpage by XMLHttpRequest, and insert HTML into iframe by DOMParser. then the main page can visit iframe's context without cross-domain problem
const IFRAME_READY_MESSAGE = "IFRAME_READY";
export default {
id: null,
$el: null,
iframeBaseUrl: null,
targetDocument: document,
style:{'position':'fixed', 'top': '0', 'right':'20px', 'width':'300px', 'height':'400px'},
/***
* {id: '', url: '', iframeBaseUrl:'' , style:{}, targetDocument: null}
*/
https://github.com/ipfs/kubo/blob/master/docs/experimental-features.md#ipfs-p2p
@santaklouse
santaklouse / mac-docker-gui.txt
Created August 6, 2025 10:52 — forked from roaldnefs/mac-docker-gui.txt
Running GUI application in Docker on MacOS
# Install XQuartz
brew cask install xquartz
# Restart MacOS
# Open XQuartz
open -a XQuartz
# Ensure the "Allow connections from network clients" option in Preferences >> Security is turned on
@santaklouse
santaklouse / test.md
Created July 3, 2025 10:49
testing paralellism ...

Давайте посмотрим, как это работает:

<?php

$start = microtime(true);
$path = __DIR__ . '/pcntl_fork_send_email.php';
$emails = implode(',', ['[email protected]', '[email protected]']);
$command = 'php ' . $path . ' --emails=%s > /dev/null &';

// Execute the command
@santaklouse
santaklouse / zram-generator.sh
Created July 1, 2025 10:58
install zram and zswap to Ubuntu automatically
#!/usr/bin/env bash
set -e
echo "==> Установка zram-tools и необходимых утилит"
apt update
apt install -y zram-tools linux-tools-common linux-tools-generic systemd-zram-generator
echo "==> Настройка ZRAM через systemd-zram-generator"
cat <<EOF > /etc/systemd/zram-generator.conf
@santaklouse
santaklouse / ssh.sh
Created May 26, 2025 08:37
wrapper around ssh in order to use passwords in config (draft)
#!/usr/bin/env bash
#ORIG_SSH=/usr/bin/ssh
ORIG_SSH=/opt/homebrew/bin/ssh
HOST=$1
SSHPASS=$(ggrep -Pzo "Host $HOST"'\s*\n((?!Host).*\n)*\s*#PS\s(\N+)\n' ~/.ssh/config|tail -n 2|head -n 1 | sed 's/ *#PS //')
if [ -n $SSHPASS ]; then
sleep 1
else