initial commit

This commit is contained in:
tomse
2023-12-21 01:31:35 +01:00
commit 220437e651
75 changed files with 6080 additions and 0 deletions

View File

@@ -0,0 +1,28 @@
<html>
<head>
<script language="JavaScript">
function keyHandler(e)
{
var pressedKey;
if (document.all)
{
e = window.event;
}
if (document.layers || e.which)
{
pressedKey = e.which;
}
if (document.all)
{
pressedKey = e.keyCode;
}
pressedCharacter = String.fromCharCode(pressedKey);
alert(' Character = ' + pressedCharacter + ' [Decimal value = ' + pressedKey + ']');
}
document.onkeyup = keyHandler;
</script>
</head>
<body>
Press any key.
</body>
</html>

View File

@@ -0,0 +1,21 @@
<?php
$cmd = "uname";
$OS = strtolower(trim(shell_exec($cmd)));
switch($OS){
case('linux'):
$cmd = "cat /proc/cpuinfo | grep processor | wc -l";
break;
case('freebsd'):
$cmd = "sysctl -a | grep 'hw.ncpu' | cut -d ':' -f2";
break;
default:
unset($cmd);
}
if ($cmd != ''){
$cpuCoreNo = intval(trim(shell_exec($cmd)));
}
?>

View File

@@ -0,0 +1,50 @@
<?php
/* This file is meant to run from the CLI/Shell
* it extracts the first page of a pdf file and saves to
* jpg with same name + _thumb pic being 240pix wide
* Author Carsten Jensen aka Tomse @ http://awesome.commodore.me
* Copyright (C) 2012 Carsten Jensen
* This is distributed under GNU GPLv2
*/
/* Requirements:
* php (cli/shell version) / or as apache site
* imagemagick module
*/
/* Usage:
* Run the file from the browser (apache setup)
* or from cli : php -f extract
* thumb files will be saved in same dir as pdf files
*/
// Edit the path here where your PDF files are stored.
$dir = "./pages/";
// Edit width in pixels to change sizes
$size = 240;
// Replace false with true to make the script work
$work = false;
// code is here.. nothing more to modify
// -------------------------------------
if ($work == true)
{
$files = glob($dir . "*.[pP][dD][fF]");
foreach($files as $v)
{
$filename = substr($v, 0, strlen($v) - 4);
$thumb = new Imagick();
$thumb->setResolution(300, 300);
$thumb->readImage($v ."[0]");
$thumb->setImageFormat('jpeg');
$thumb->setImagecompression(imagick::COMPRESSION_JPEG);
$thumb->setImageCompressionQuality(75);
$thumb->resizeImage($size, 1024, imagick::FILTER_LANCZOS, 1, true);
$thumb->writeImage($filename . "_thumb.jpg");
$thumb->clear();
$thumb->destroy();
}
}
?>

Binary file not shown.

View File

@@ -0,0 +1,7 @@
for %%i in (vids\*.*) DO (
ffmpeg -i %%i -ss 180 -vframes 1 -r 1 -s 320x200 -f image2 output\%%~ni.jpg
ffmpeg -i %%i -s 320x200 -acodec libvorbis -f webm -b:v 150k -bufsize 16k -vcodec libvpx output\%%~ni.webm -s 320x200 -acodec libmp3lame -b:v 150k -bufsize 16k -vcodec libx264 output\%%~ni.mp4
)
pause