diff options
-rw-r--r-- | archive.php | 55 | ||||
-rw-r--r-- | index.php | 83 | ||||
-rw-r--r-- | lines.png | bin | 0 -> 16556 bytes | |||
-rw-r--r-- | p/index.txt | 13 | ||||
-rw-r--r-- | style.css | 91 |
5 files changed, 242 insertions, 0 deletions
diff --git a/archive.php b/archive.php new file mode 100644 index 0000000..92c17f8 --- /dev/null +++ b/archive.php @@ -0,0 +1,55 @@ +<?php + if (substr_count($_SERVER[HTTP_ACCEPT_ENCODING], gzip)) + ob_start(ob_gzhandler); + else ob_start(); +?> +<title>KISSmo Archive</title> +<link rel="stylesheet" href="./style.css"> +<meta name="viewport" content="width=device-width,initial-scale=1,maximum-scale=1,user-scalable=no"> +<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"> +<meta name="HandheldFriendly" content="true"> + <center><h2>Runing KISSmo Paste</h2></center><br> + <center><form method="POST" action="archive.php" class="search" enctype="multipart/form-data" autocomplete="off"> + <input type="text" name="query" maxlength=75 class="searchbox" minlength=3 placeholder="Enter keywords" required> + <input type="submit" value="Search"></input> +</form></center> +<?php +//*$zer = system('grep -l ' . escapeshellarg($_POST['query']) . ' *p/*.txt'); +if(isset($_POST['query'])) { //only do file operations when appropriate + +echo "<pre class='cmdbox'>"; +system('grep -l ' . escapeshellarg($_POST['query']) . ' *p/*.txt'); +echo "</pre><br>"; +} +?> + <center><a href="./">Paste</a> | <a href="./archive.php">Archive</a></center> + +<?php +// Set the current working directory +$directory = getcwd()."/p/"; + +// Initialize filecount variavle +$filecount = 0; + +$files2 = glob( $directory ."*" ); + +if( $files2 ) { + $filecount = count($files2); +} + +echo "Currently archiving: "; +echo $filecount . " paste files "; + +echo "<br><br>"; + +$dir_open = opendir('./p/'); + +while(false !== ($filename = readdir($dir_open))){ + if($filename != "." && $filename != ".."){ + $link = "<a href='./p/$filename' target='_blank'> $filename </a><br />"; + echo $link; + } +} + +closedir($dir_open); +?> diff --git a/index.php b/index.php new file mode 100644 index 0000000..6b6b62f --- /dev/null +++ b/index.php @@ -0,0 +1,83 @@ +<?php + if (substr_count($_SERVER[HTTP_ACCEPT_ENCODING], gzip)) + ob_start(ob_gzhandler); + else ob_start(); +?> +<?php +$ncsite="paste.uk.to 7777"; +?> +<html> + <body> +<meta name="viewport" content="width=device-width,initial-scale=1,maximum-scale=1,user-scalable=no"> +<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"> +<meta name="HandheldFriendly" content="true"> + +<link rel="stylesheet" href="./style.css"> + <title>Running under KISSmo Paste</title> + <center><h2>Runing KISSmo Paste</h2></center><br> + <center><a href="./">Paste</a> | <a href="./archive.php">Archive</a></center> + <center><form name="form" method="post"> + <textarea name="text_box" cols="40" minlength="5" rows="5" placeholder="Paste your code here..." maxlength="1048576" style="margin: 0px; width: 80%; height: 249px;" required pattern="\S+" oninvalid="this.setCustomValidity('We apologize but we won`t allow empty paste!')" oninput="this.setCustomValidity('')"></textarea> + <br> + <br> + <input type="submit" id="search-submit" value="Paste it!" /> + </form></center> + <br> + <br> + <center>Use this paste via terminal examples <span style="color:#e74c3c">"echo I was here | nc <?php echo"$ncsite";?>"</span> or <span style="color:#e74c3c">"cat example | nc <?php echo"$ncsite";?>"</span><center><br> + <center>KISS (Keep it simple, stupid) style pastebin developed from (monaco) with less than <span style="color:#e74c3c">70</span> Lines of code!</center> + <center>Running KISSmo v.1.0.0 stable > 1.5 KB</center> + <br> +<?php +// Set the current working directory +$directory = getcwd()."/p/"; + +// Initialize filecount variavle +$filecount = 0; + +$files2 = glob( $directory ."*" ); + +if( $files2 ) { + $filecount = count($files2); +} + +echo "<center>Currently archiving: "; +echo $filecount . " paste files </center>"; +?> + </body> +</html> +<?php + +if(isset($_POST['text_box'])) { //only do file operations when appropriate + + $sitename = "https://paste.ircnow.org/p"; + $a = $_POST['text_box']; + $powered = "### This content was generated under KISSmo Paste with love at this time:"; + $tagz = "### "; + $koha = date('d.m.Y H:i:s A'); + $num_str = uniqid() . '.txt'; + //*$num_str = uniqid(rand(), true) . '.txt'; + $myFile = "p/$num_str"; + $fh = fopen($myFile, 'w') or die("can't open file"); + fwrite($fh, $a."\n"."\n"); + fwrite($fh, $powered."\n"); + fwrite($fh, $tagz); + fwrite($fh, $koha."\n"); + fclose($fh); + + echo "<br>"; + echo "<span class='mon'>You're paste has been successful at a correct time: $koha</span>"; + echo "<br>"; + echo "<span style='color:#2c3e50'><strong>Click here to open you're paste -></strong></span>: <a href='$sitename/$num_str' target='_blank'>$num_str<a>"; + echo "<br>"; + echo "Or copy you're full url: <span class='success'><strong>$sitename/$num_str</span></strong></span>"; + echo "<br>"; + echo "<br>"; + echo "You're paste preview here"; + echo "<br>"; + echo "<br>"; + echo "<center><textarea style='margin: 0px; width: 80%; height: 249px;'>$a</textarea></center>"; + echo "<br>"; + } +?> + diff --git a/lines.png b/lines.png Binary files differnew file mode 100644 index 0000000..ffea4e6 --- /dev/null +++ b/lines.png diff --git a/p/index.txt b/p/index.txt new file mode 100644 index 0000000..69a03e2 --- /dev/null +++ b/p/index.txt @@ -0,0 +1,13 @@ +Welcome to KISSmo Paste + +You can use it via terminal with Netcat with this command! + +cat file | nc monaco.uk.to 7777 + +or + +echo KISSmo is awesome | nc monaco.uk.to 7777 + +If you wanna use KISSmo web interface you're more than welcome: + +https://monaco.coconut.ircnow.org/test/ diff --git a/style.css b/style.css new file mode 100644 index 0000000..27d60c4 --- /dev/null +++ b/style.css @@ -0,0 +1,91 @@ +/************************************************************ +** style.css 2021 monaco +** Style css for KISSmo Paste +** Copyright monaco@ircnow.org +** Copyright Ircnow +** This file is part of KISSmo Paste. +************************************************************/ + +body { +background: whitesmoke; +font-family: monospace; +} +span.error { +display: block; +padding: 5px; +background: red; +color: white; +} +span.hidden { +visibility: hidden; +padding: 0; +margin: 0; +} +span.success { +display: block; +padding: 5px; +background: green; +color: white; +} + +span.mon { + display: block; + padding: 5px; + background: #3eb93e; + color: white; +} + +span.success.hidden { +visibility: hidden; +padding: 0; +margin: 0; +} +pre.cmdbox { + background: #F5F5F5; + border: 1px solid #AAAAAA; + overflow: auto; + padding: 10px; +} + +input:required, +textarea:required { + border-color: red !important; +} +input:required + label { + color: red; +} + +form div { + padding: 5px; +} +label { + display: block; +} +input + label { + display: inline-block; + margin-right: 10px; +} + +textarea[type=text_box], +textarea { + border: 1px solid #999; + padding: 5px; + width: 100%; +} + +textarea { + background: url(./lines.png); + background-attachment: local; + background-repeat: no-repeat; + padding-left: 35px; + padding-top: 10px; + border-color:#ccc; +} + +div.b { + word-wrap: break-word; +} + +pre { + word-wrap: break-word; +} |