mirror of
https://gitlab.com/octospacc/Snippets.git
synced 2025-04-14 15:32:16 +02:00
Auto-Backup $'Thu Sep 12 2024 01:34:19 GMT+0200 (Central European Summer Time)'
This commit is contained in:
parent
b02faa2141
commit
d22046e730
@ -1,3 +1,6 @@
|
|||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
|
mkdir ./Res
|
||||||
prefix=/Main/Server/www/Drive/Misc/Scripts
|
prefix=/Main/Server/www/Drive/Misc/Scripts
|
||||||
cp $prefix/MemosViewer.php $prefix/MemosYacyBridgeCreate.php ./
|
cp $prefix/* ./
|
||||||
|
cp $prefix/Res/* ./Res/
|
||||||
|
#cp "${prefix}/MemosViewer.php" "${prefix}/MemosYacyBridgeCreate.php" ./
|
||||||
|
22
LumaBmp2NinJpgConvert.php
Executable file
22
LumaBmp2NinJpgConvert.php
Executable file
@ -0,0 +1,22 @@
|
|||||||
|
<?php http_response_code(500);
|
||||||
|
|
||||||
|
if (false
|
||||||
|
|| $_SERVER['REQUEST_METHOD'] !== 'POST'
|
||||||
|
|| $_SERVER['HTTP_CONTENT_TYPE'] !== 'image/bmp'
|
||||||
|
|| !str_starts_with($_SERVER['HTTP_USER_AGENT'], 'LumaBmp2NinJpg/')
|
||||||
|
) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
$jpgFile = '/tmp/php.' . rand() . microtime();
|
||||||
|
$jpgQuality = 100;
|
||||||
|
|
||||||
|
$imageTmp = imagecreatefrombmp('php://input');
|
||||||
|
imagejpeg($imageTmp, $jpgFile, $jpgQuality);
|
||||||
|
imagedestroy($imageTmp);
|
||||||
|
|
||||||
|
header('Content-Type: image/jpg');
|
||||||
|
header('Content-Length: ' . filesize($jpgFile));
|
||||||
|
http_response_code(200);
|
||||||
|
fpassthru(fopen($jpgFile, 'rb'));
|
||||||
|
unlink($jpgFile);
|
46
Res/OcttComments.js
Normal file
46
Res/OcttComments.js
Normal file
@ -0,0 +1,46 @@
|
|||||||
|
(async function(){
|
||||||
|
const JSDOM = require('jsdom').JSDOM;
|
||||||
|
const observerPolyfill = 'window.ResizeObserver = (class ResizeObserver { observe(){}; unobserve(){}; disconnect(){}; });';
|
||||||
|
const data = JSON.parse(process.argv[2]);
|
||||||
|
data.pageSlug = data.pageSlug.replace(/^\/+/,'', '');
|
||||||
|
const frameUrl = ('https://giscus.app/it/widget?' + Object.entries({ ...data,
|
||||||
|
reactionsEnabled: 1,
|
||||||
|
strict: 1,
|
||||||
|
emitMetadata: 0,
|
||||||
|
inputPosition: 'bottom',
|
||||||
|
origin: (data.baseUrl + '/' + data.pageSlug),
|
||||||
|
backLink: (data.baseUrl + '/' + data.pageSlug),
|
||||||
|
term: data.pageSlug,
|
||||||
|
}).map(prop => `${prop[0]}=${encodeURIComponent(prop[1])}`).join('&'));
|
||||||
|
/*
|
||||||
|
const pageSlug = 'it/miscellanea/Sul-sitoctt/';
|
||||||
|
const pageUrl = ('https://sitoctt.octt.eu.org/' + pageSlug);
|
||||||
|
const frameUrl = ('https://giscus.app/it/widget?' + Object.entries({
|
||||||
|
origin: pageUrl,
|
||||||
|
theme: 'noborder_light',
|
||||||
|
reactionsEnabled: 1,
|
||||||
|
emitMetadata: 0,
|
||||||
|
inputPosition: 'top',
|
||||||
|
repo: 'octospacc/sitoctt',
|
||||||
|
repoId: 'R_kgDOHbCR4A',
|
||||||
|
category: 'Comments',
|
||||||
|
categoryId: 'DIC_kwDOHbCR4M4CiAIZ',
|
||||||
|
strict: 1,
|
||||||
|
backLink: pageUrl,
|
||||||
|
term: pageSlug,
|
||||||
|
}).map(prop => `${prop[0]}=${encodeURIComponent(prop[1])}`).join('&')); */
|
||||||
|
const frameHtml = (await (await fetch(frameUrl)).text())
|
||||||
|
.replace('<head>', `<head>
|
||||||
|
<script>${observerPolyfill}</script><style> form { display: none; } </style>
|
||||||
|
<link rel="stylesheet" href="https://giscus.app/themes/${data.theme}.css"/>`)
|
||||||
|
.replace('<body>', `<body>
|
||||||
|
<h3>Please enable JavaScript for
|
||||||
|
<code>${data.baseUrl.split('//')[1].split('/')[0]}</code>
|
||||||
|
and <code>giscus.app</code> to post.</h3>`);
|
||||||
|
const frameWindow = (new JSDOM(frameHtml, { url: frameUrl, runScripts: "dangerously", resources: "usable" })).window;
|
||||||
|
while (!frameWindow.document.querySelector('form')) {
|
||||||
|
(await (new Promise(resolve => setTimeout(resolve, 100))));
|
||||||
|
};
|
||||||
|
const result = frameWindow.document.documentElement.outerHTML;
|
||||||
|
console.log(result);
|
||||||
|
})();
|
75
error.php
Executable file
75
error.php
Executable file
@ -0,0 +1,75 @@
|
|||||||
|
<?php
|
||||||
|
http_response_code($_GET['code']);
|
||||||
|
$realsite = '<p style="font-size: smaller;">
|
||||||
|
(Are you were not looking for my <b>real web site</b> very likely?
|
||||||
|
<a href="//www.octt.eu.org">www.octt.eu.org</a>)
|
||||||
|
</p>';
|
||||||
|
?>
|
||||||
|
<!DOCTYPE html>
|
||||||
|
<html>
|
||||||
|
<head>
|
||||||
|
<meta charset="utf-8"/>
|
||||||
|
<meta name="viewport" content="width=device-width, initial-scale=1.0"/>
|
||||||
|
<title><?php print $_GET['code'] ?></title>
|
||||||
|
<style>
|
||||||
|
body { text-align: center; margin: 20px; color: #e0e0e0; background-color: #1f1f1f; }
|
||||||
|
a { color: lightpink; }
|
||||||
|
p, div { width: calc(100vw - 40px); vertical-align: middle; }
|
||||||
|
button { cursor: pointer; }
|
||||||
|
#NoJs, #Action, #Fate { height: calc(100vh - 40px); display: table-cell; }
|
||||||
|
#Action > button { font-size: xx-large; }
|
||||||
|
#Action, #Fate { display: none; }
|
||||||
|
</style>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<div id="NoJs">
|
||||||
|
<p>
|
||||||
|
When if you have eliminaminated the <b>Java Script</b>, the what ever remains.
|
||||||
|
Nothing more than of composes the empty page, so <b>nothing</b> is more consumed.
|
||||||
|
Relax yourself to the <b>HTML silence</b>.
|
||||||
|
</p>
|
||||||
|
<br/>
|
||||||
|
<?php echo($realsite); ?>
|
||||||
|
</div>
|
||||||
|
<script>
|
||||||
|
document.body.innerHTML += `
|
||||||
|
<p id="Action">
|
||||||
|
<button id="Do">What happened?</button>
|
||||||
|
</p>
|
||||||
|
<div id="Fate" hidden="true">
|
||||||
|
<h1><?php print $_GET['code'] ?></h1>
|
||||||
|
<br/>
|
||||||
|
<p>
|
||||||
|
<a href="javascript:Bgm.play()">
|
||||||
|
<!-- Credits: https://missingnumber.com.mx/rhythm-heaven-nintendo-ds/ -->
|
||||||
|
<img id="Gfx" src="/Res/LoveLab-Sad.gif"/>
|
||||||
|
</a>
|
||||||
|
</p>
|
||||||
|
<br/>
|
||||||
|
<p>
|
||||||
|
I would have been loving to being able of loving you, but you are continuing trying break <b>my server</b>. And the site in it my <b>heart</b> too. I'm making sorry for <b>everything</b>. 💔
|
||||||
|
</p>
|
||||||
|
<br/>
|
||||||
|
<?php echo($realsite); ?>
|
||||||
|
<!-- Credits: https://www.youtube.com/watch?v=x9W7WNVHrWk -->
|
||||||
|
<audio id="Bgm" src="/Res/LoveLab-Ext.webm"></audio>
|
||||||
|
</div>
|
||||||
|
`;
|
||||||
|
NoJs.remove();
|
||||||
|
Action.style.display = 'table-cell';
|
||||||
|
Bgm.volume = 0.5;
|
||||||
|
function Sad() {
|
||||||
|
Action.remove();
|
||||||
|
Fate.style.display = 'table-cell';
|
||||||
|
Bgm.play();
|
||||||
|
};
|
||||||
|
if ((!navigator.cookieEnabled) || (document.cookie.search('WhatHappened=true') != -1)) {
|
||||||
|
Sad();
|
||||||
|
};
|
||||||
|
Do.onclick = function(){
|
||||||
|
document.cookie = 'WhatHappened=true; max-age=31536000';
|
||||||
|
Sad();
|
||||||
|
};
|
||||||
|
</script>
|
||||||
|
</body>
|
||||||
|
</html>
|
Loading…
x
Reference in New Issue
Block a user