rPaste v1.0

Asphyxia

Owner
Administrator
Apr 25, 2015
1,845
2
2,199
327
Here, I give to you a very simple tool for sharing text with your friends. It is intended to be quick and easy:
http://voip.r4p3.net/rPaste/ (this tool has been taken offline, find my source below)
Tell me what you think? I plan on releasing the source after I do a little more work on it. :cool:

Feel free to request features or anything, my ears are open.
 
Last edited:

Asphyxia

Owner
Administrator
Apr 25, 2015
1,845
2
2,199
327
Thank you guys for the kind words, any ideas or requests for making it better or easier to use? :p
 

Derp

Retired Staff
Contributor
Apr 30, 2015
933
1,014
217
Thank you guys for the kind words, any ideas or requests for making it better or easier to use? :p

Suggestions
1. View Counter - (a Counter that counts how many people have seen your paste)
2. Delete Paste (or) Auto Delete after [*] Time
 

Asphyxia

Owner
Administrator
Apr 25, 2015
1,845
2
2,199
327
Very awesome ideas Derp, I will implement those when I work on rPaste.
 

Asphyxia

Owner
Administrator
Apr 25, 2015
1,845
2
2,199
327
I am pretty sure I will not be implementing SYNTAX highlighting nor a line counter. The browser has nothing native to handle/process such tasks with ease. There are a bunch of dependencies (files) required for such a task, it may slow down the client and lag for example when you are modifying something that is over 200 lines --- pointless. The idea of rPaste is not to be your online Notepad++, simply your exchange so you can send source quickly to show how you did something or request assistance, or just even show someone some text with information. There is no need for someone to analyze source outside of their editor, because even if they find something and want to change it.. there are features in a good editor like Notepad++ you just can not quite replace in a website with ease. rPaste is about simplicity, not code --- find text, Copy, Paste, Copy, Paste and you can send the code or text around the world. I even find that sometimes syntax highlighting is annoying, especially in small snippets of code. No need to make something small and simple to read have added colors, I find syntax highlighting only useful for a large project with a lot of source to look at. In that case, the person is best just copying the source over to an advanced editor as I mentioned --- just my thoughts.
In addition, I think source highlighting makes your eyes lazy, rather than analyze/inspect code paying close attention to fine details, you rely on an engine to process whether there is a missing single or double quote. Whenever I don't use synhigh (my new abbreviation), I feel that I pay closer attention to details in syntax. ;)

ON SECOND THOUGHT rPaste is about what people use/want, being lazy --- I will surely add it lol. :cool:
Upcoming changes listed below:
  • Handling paste deletion.
  • Syntax highlighting coming --- Prettify.
  • View counter which shows total page loads (no IP logs).
 
Last edited:

Supervisor

Administrator
Apr 27, 2015
1,863
2,546
335
I think rPaste is already getting used pretty good. If you still gonna make those highlighting stuff, it could possibly get even better haha.
How long is the stuff saved we paste in there? Because I guess if no limit is set, it could get pretty big pretty fast.
 

Asphyxia

Owner
Administrator
Apr 25, 2015
1,845
2
2,199
327
index.html
Code:
<title>rPaste by R4P3.NET</title>

<link href='https://fonts.googleapis.com/css?family=Poiret+One' rel='stylesheet' type='text/css'>
<style type="text/css">
body{
    background-color: #2B596B;
    color: #0A1D25;
    margin:0px;
    font-family:sans-serif;
    font-family: 'Poiret One', cursive;
}

.cHead{
    background-color: #3D768C;
    border: 1px #0A1D25 solid;
    width: 200px;
    overflow:hidden;
}
.cMain{
    background-color: #0A1D25;
    font-size: 50px;
    color: #3D768C;
    border:0px #0A1D25 solid;
    width:100%;
    overflow:hidden;
}

textarea{
    width:100%;height:100%;
    position:absolute;top:0;left:0;
    filter:alpha(opacity=0);-moz-opacity:0;-khtml-opacity: 0;opacity: 0;
    cursor:default;
}
</style>
<center>
<div class="cHead" align="center">
<h1>rPaste v1.0</h1>
</div>
</center>
<center>
<div class="cMain" align="center">
<p>Instructions: hold <u>CTRL</u>+<u>V</u> or <u>right click</u>, <u>paste</u>.</p>
</div>
</center>
<form id="frmPaste" action="rPaste.php" method="POST">
<textarea onfocus="this.value = ''" id="txtPaste" name="txtPaste" oninput="fncPaste()"></textarea>
</form>

<script>
function fncPaste() {
    document.getElementById("frmPaste").submit();
}
window.onload = document.getElementById("txtPaste").focus();
</script>
---
rPaste.php
Code:
<?php
header('Content-Type: text/html; charset=utf-8');

if(isset($_POST['txtPaste']))
{
$filename = md5(htmlentities($_POST['txtPaste']));
$myfile = fopen("rPastes/".$filename, "w") or die("There was a problem, contact the website owner.");
$txt = $_POST['txtPaste'];
fwrite($myfile, $txt);
fclose($myfile);
}else{
die("What are you doing?");
}
header('Location: ./r.php?id='.$filename);
?>
---
r.php
Code:
<?php
header('Content-Type: text/html; charset=utf-8');

if(isset($_GET['id']))
{

    if(ctype_alnum($_GET['id']))
    {
    //Very well mate, continue on.
    }else{
        header('Location: https://www.fbi.gov/');
        die("How did you skip the redirect header?");
    }

}else{
die("What are you doing?");
}
?>
<title>rPaste by R4P3.NET</title>
<style type="text/css">
body{
    margin:0px;
    background-color: #0A1D25;
}

textarea{
    outline-width: 0;
    margin-top:10px;
    border: 0px;
    padding: 10px;
    color: #3D768C;
    background-color: #0A1D25;
    width:100%;height:100%;
    position:absolute;top:0;left:0;
    cursor:default;
    resize: none;
    font-family:"Lucida Console", Monaco, monospace;
}

input{
    outline-width: 0;
    border: 0px;
    padding: 2px;
    text-align:center;
    color: #0A1D25;
    background-color: #3D768C;
    font-family:"Lucida Console", Monaco, monospace;
    width:100%;
}

.cCopy{
    filter:alpha(opacity=60);-moz-opacity:0.60;-khtml-opacity: 0.60;opacity: 0.60;
    background-color: #0A1D25;
    position:absolute;top:0;right:0;
    font-size: 12px;
    color: #3D768C;
    border:0px #0A1D25 solid;
    width:100%;

}

</style>

<?php
$myFile = "rPastes/".$_GET['id'];
$fh = fopen($myFile, 'r');
$theData = fread($fh, filesize($myFile));
fclose($fh);
echo "<textarea id='txtPaste'>".htmlentities($theData)."</textarea>";
?>

<div class="cCopy">
<?php
$actual_link = "https://$_SERVER[HTTP_HOST]$_SERVER[REQUEST_URI]";
echo "<input type='text' id='txtLink' value='".htmlentities($actual_link)."'>";
?>
</div>

<script type="text/javascript">
function SelectAll(id)
{
    document.getElementById(id).focus();
    document.getElementById(id).select();
}
</script>

<body onload="SelectAll('txtLink');">
</body>

Create a directory named "/rPastes", chmod to 755. Now place an .htaccess file inside this directory.
Code:
Deny from all

Feel free to analyze the source and inform me of any security issues. I found one before publishing the source. It was a directory traversal issue which now forwards to FBI lol. There should be spam/flood prevention added in. Rather than using flat-file data storage, a database should probably be used. I personally like the ease of flat-file systems. I had the idea of making the pastes work with dates, so all pastes for the month of 08/2015 are called like this: 082015&md5sum, (mm SPLIT yyyy). That would work until the year 10000 (I won't be alive then, so idgaf).. o_O oh yeah before I forget to mention, replace the "https" with "http" if not running on an HTTPS web-serv in r.php.
 
Last edited:
Top