Skip to content

Commit fd1ffa4

Browse files
committed
Branch from hastebin, with cleaner look and addition of pictures for linux servers in specific configuration.
0 parents  commit fd1ffa4

File tree

879 files changed

+137223
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

879 files changed

+137223
-0
lines changed

.gitignore

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
data
2+
static/images
3+

.htaccess

+20
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
#####################
2+
# Dev atmoner.com
3+
# Fix rewriting urls
4+
#####################
5+
ModPagespeed off
6+
RewriteEngine On
7+
8+
RewriteRule ^([^/]*)\.html$ /?page=$1 [QSA,L]
9+
RewriteRule ^([^-]*)-([^-]*)/$ /index.php?page=$1&act=$2 [QSA,L]
10+
RewriteRule ^([[:alnum:]]{8})/*$ /index.php?page=paste&id=$1 [QSA,L]
11+
12+
13+
14+
15+
ErrorDocument 401 /index.php?page=error&id=401
16+
ErrorDocument 403 /index.php?page=error&id=403
17+
ErrorDocument 404 /index.php?page=error&id=404
18+
19+
SetOutputFilter SUBSTITUTE
20+
Substitute s|head|bar|n

README.md

+68
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
# Hastebin Plus
2+
Hastebin Plus is an open-source Pastebin software written in node.js, which is easily installable in any network.
3+
It bases upon [haste](https://github.com/seejohnrun/haste-server) and got enhanced in matters of **Design, Speed and Simplicity**.
4+
5+
## Features
6+
* Paste code, logs and ... almost everything!
7+
* Syntax-Highlighting
8+
* Add static documents
9+
* Duplicate & Tweet pastes
10+
* Raw paste-view
11+
12+
## Demo
13+
For a Hastebin Plus Demo click here: http://hastebin-plus.herokuapp.com/.
14+
15+
## Installation
16+
1. Install Git and node.js: `sudo apt-get install git nodejs`
17+
2. Clone this repository: `git clone https://github.com/MarvinMenzerath/HastebinPlus.git hastebin-plus`
18+
3. Open `config.js` and change the settings (if you want to)
19+
4. Install dependencies: `npm install`
20+
5. Start the application: `npm start`
21+
22+
## Update
23+
1. Pull changes from this repository: `git pull`
24+
2. Install new dependencies: `npm install`
25+
26+
## Settings
27+
| Key | Description | Default value |
28+
| ---------------------- | -------------------------------------------- | ------------- |
29+
| `host` | The host the server runs on | `localhost` |
30+
| `port` | The port the server runs on | `8080` |
31+
| `dataPath` | The directory where all pastes are stored | `./data` |
32+
| `keyLength` | The length of the pastes' key | `10` |
33+
| `maxLength` | Maximum chars in a paste | `500000` |
34+
| `staticMaxAge` | Max age for static assets | `86400` |
35+
| `compressStaticAssets` | Whether or not to compile static js assets | `true` |
36+
| `documents` | Static documents to serve; will never expire | See below |
37+
38+
### Default Config
39+
```json
40+
{
41+
"host": "0.0.0.0",
42+
"port": 8080,
43+
"dataPath": "./data",
44+
"keyLength": 10,
45+
"maxLength": 500000,
46+
"staticMaxAge": 86400,
47+
"compressStaticAssets": true,
48+
"documents": {
49+
"about": "./README.md",
50+
"javaTest": "./documents/test.java"
51+
}
52+
}
53+
```
54+
55+
## Authors
56+
* [haste](https://github.com/seejohnrun/haste-server): John Crepezzi - MIT License
57+
* [jQuery](https://github.com/jquery/jquery): MIT License
58+
* [highlight.js](https://github.com/isagalaev/highlight.js): Ivan Sagalaev - [License](https://github.com/isagalaev/highlight.js/blob/master/LICENSE)
59+
60+
## License
61+
Copyright (C) 2014 Marvin Menzerath
62+
63+
This program is free software: you can redistribute it and/or modify
64+
it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 of the License, or any later version.
65+
66+
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details.
67+
68+
You should have received a copy of the GNU Affero General Public License along with this program. If not, see http://www.gnu.org/licenses/.

cgi-bin/test/test.cgi

+32
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
#!/usr/bin/perl
2+
3+
print <<HTML;
4+
Content-type: text/html
5+
6+
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
7+
<html>
8+
<head>
9+
<title></title>
10+
<meta http-equiv="Content-Type" content="text/html">
11+
<link rel="stylesheet" type="text/css" href="../../css/style.css">
12+
</head>
13+
<body>
14+
<table cellspacing="0" cellpadding="0" border="0">
15+
<tr class="subhead" align="Left"><th>Name</th><th>Value</th></tr>
16+
HTML
17+
18+
my $class;
19+
20+
foreach (sort keys %ENV) {
21+
next unless /^HTTP_|^REQUEST_/;
22+
$class = ($class ne 'normal')? 'normal': 'alt';
23+
print <<HTML;
24+
<tr class="$class"><td valign="top">$_</td><td>$ENV{$_}</td></tr>
25+
HTML
26+
}
27+
28+
print <<HTML;
29+
</table>
30+
</body>
31+
</html>
32+
HTML

config.js

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
{
2+
"host": "0.0.0.0",
3+
"port": 7777,
4+
"dataPath": "/opt/pastebin/data",
5+
"keyLength": 4,
6+
"maxLength": 500000,
7+
"staticMaxAge": 86400,
8+
"compressStaticAssets": true,
9+
"documents": {
10+
"about": "/opt/pastebin/README.md"
11+
}
12+
}

css/style.css

+64
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
/* Copyright 1999-2014. Parallels IP Holdings GmbH. All Rights Reserved. */
2+
html { font-size: 100%; -webkit-text-size-adjust: 100%; -ms-text-size-adjust: 100%; }
3+
html, body { border: 0; margin: 0; height: 100%; min-height: 100%; }
4+
body { color: #1e1e1e; font: 13px/1.231 arial, helvetica, sans-serif; background: #f5f5f5; }
5+
img { border: 0; vertical-align: middle; -ms-interpolation-mode: bicubic; }
6+
table { border-collapse: collapse; border-spacing: 0; }
7+
form { margin: 0; padding: 0; border: 0; }
8+
a, a:visited { color: #0050b4; }
9+
a:hover, a:active { outline: 0; color: #00a0ff; }
10+
hr { display: block; margin: .9em 0; padding: 0; height: 2px; border: 0; border-top: 1px solid #c8c8c8; box-shadow: inset 0 1px 0 #fff; }
11+
.lte7 hr { margin: .5em 0; }
12+
h1, h2 { margin: 10px 0 15px; padding: 0; font: italic 20px georgia, serif; color: #1e3c64; }
13+
h2 { margin: 0 0 5px; font-size: 17px; }
14+
h3 { margin: 0 0 8px; padding: 0; font-size: 13px; font-weight: 400; }
15+
p { margin: 0; padding: 0 0 12px; }
16+
ul { margin: 0; padding: 0; list-style: none; }
17+
li { padding: 0 0 8px 14px; background: url(../img/bullet.gif) 0 5px no-repeat; }
18+
#page { min-height: 100%; text-align: left; }
19+
.ie6 #page { height: 100%; }
20+
#wrapper { padding: 0 0 45px; }
21+
#top { border-bottom: 1px solid #fff; height: 50px; background: #646464 url(../img/top-bottom.png) repeat-x; }
22+
.product-logo { display: inline; float: left; margin: 0 20px; }
23+
.company-logo { display: inline; float: right; margin: 7px 20px 0; }
24+
#content { margin: auto; padding: 10px 0 0; width: 960px; text-shadow: 0 1px 0 #fff; }
25+
#footer-wrapper { position: relative; margin: -45px 0 0; height: 35px; padding: 10px 0 0; }
26+
#footer { border-top: 4px solid #bce1f8; padding: 0 20px; height: 31px; line-height: 30px; text-align: center; text-shadow: 0 -1px #000; font-size: 11px; color: #969696; background: #313131 url(../img/top-bottom.png) 0 -100px repeat-x; box-shadow: inset 0 1px 0 #1594ff; }
27+
#footer a, #footer a:visited, #footer a:hover, #footer a:active { color: #969696; text-decoration: none; }
28+
#footer a:hover, #footer a:active { text-decoration: underline; }
29+
#footer .separator { border-left: 1px solid #646464; margin: 0 10px; }
30+
.p-box, .test-box { border: 1px solid #7896aa; border-radius: 10px; margin: 0 0 10px; background: #efefef url(../img/p-box.png) repeat-x; background-clip: padding-box; box-shadow: inset 0 1px 0 #fff, 0 1px 0 #fff; }
31+
.p-box-wrap { padding: 10px 20px; }
32+
.p-box-page-info .p-box-wrap { padding-left: 230px; min-height: 168px; background: url(../img/globe.png) 20px 10px no-repeat; }
33+
.grid { white-space: nowrap; letter-spacing: -1em; font-size: 0; }
34+
.g-span { display: inline-block; width: 50%; vertical-align: top; white-space: normal; letter-spacing: 0; font-size: 13px; }
35+
.lte7 .g-span { display: inline; zoom: 1; }
36+
.g-span-1-2-wrap { padding: 0 5px 0 0; }
37+
.g-span-2-2-wrap { padding: 0 0 0 5px; }
38+
.p-box .g-span-wrap { overflow: hidden; }
39+
.p-box .g-span img { display: inline; float: left; margin: 0 10px 0 0; }
40+
.test-list { text-align: center; }
41+
.test-list li { display: inline; padding: 0; background: none; }
42+
.test-list .icon { display: inline-block; margin: 0 1px 5px; padding: 0; min-height: 32px; text-decoration: none; vertical-align: top; color: #000; cursor: pointer; background-position: 50% 0; background-repeat: no-repeat; }
43+
.lte7 .test-list .icon { display: inline; zoom: 1; }
44+
a.icon, a.icon:visited, a.icon:hover, a.icon:active { color: #000; text-decoration: none; }
45+
a.icon:hover, a.icon:active { color: #00a0ff; text-decoration: underline; }
46+
.icon span { display: block; padding: 36px 0 0; width: 80px; text-align: center; cursor: pointer; }
47+
.i-php { background-image: url(../img/icons/php.png); }
48+
.i-perl { background-image: url(../img/icons/perl.png); }
49+
.i-python { background-image: url(../img/icons/python.png); }
50+
.i-ssi { background-image: url(../img/icons/ssi.png); }
51+
.i-fcgi { background-image: url(../img/icons/fastcgi.png); }
52+
.i-aspnet { background-image: url(../img/icons/aspdotnet.png); }
53+
#content.test { width: 700px; }
54+
.pathbar { font-size: 11px; color: #787878; }
55+
.pathbar a { text-decoration: none; }
56+
.test-box-wrap { padding: 20px; }
57+
iframe { border: 1px solid #7896aa; }
58+
.test-data { text-align: left; background: #f5f5f5; }
59+
.test-data table { border: 0; border-collapse: collapse; width: 100%; }
60+
.test-data th, .test-data td { padding: 6px; height: 16px; vertical-align: top; color: #1e1e1e; }
61+
.test-data .subhead th { border-bottom: 1px solid #7896aa; text-align: left; white-space: nowrap; font-weight: 400; color: #000; background: #f5f5f5 url(../img/th.png) repeat-x; }
62+
.lte8 .test-data .subhead th:first-child { border-left-width: 0; }
63+
.test-data .normal { background-color: #fff; }
64+
.test-data .alt { background-color: #ebebeb; }

documents/test.java

+48
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
public class Dancer {
2+
private static final String VERSION = "1.2.4.3 Beta 2";
3+
4+
private String name;
5+
private int age;
6+
private int moves;
7+
8+
public static void main(String[] args) {
9+
System.out.println("Welcome to DANCE-MASTER 3000 v" + VERSION + "!");
10+
System.out.println("Creating and testing your Dancers. Please be patient...!");
11+
12+
Dancer hugo = new Dancer("Hugo", 34, 6);
13+
Dancer mike = new Dancer("Mike", 81, 2);
14+
Dancer nori = new Dancer("Nori", 22, 27);
15+
Dancer john = new Dancer("John", 4, 1);
16+
Dancer rony = new Dancer("Rony", 42, 24); // WTF is this name?
17+
18+
System.out.println("Goodbye!");
19+
System.exit(0);
20+
}
21+
22+
public Dancer(String name, int age, int moves) {
23+
// Save the values
24+
this.name = name;
25+
this.age = age;
26+
this.moves = moves;
27+
28+
// Welcome our new Dancer
29+
System.out.println("Welcome, " + name + "!");
30+
boolean goodDancer = dance(); // Let's go!
31+
}
32+
33+
/**
34+
* Here the Dancer has to dance.
35+
* This is not possible for everyone...
36+
*
37+
* @return whether the Dancer is a good Dancer or not
38+
*/
39+
private boolean dance() {
40+
if (age > 6 && age < 70 && moves > 5) {
41+
System.out.println("YEAH! THIS ROCKS!!!");
42+
return true;
43+
} else {
44+
System.out.println("Dude... Move on!");
45+
return false;
46+
}
47+
}
48+
}

favicon.ico

1.12 KB
Binary file not shown.

img/apps/container-box.gif

5.27 KB
Loading

img/apps/pcp-box.gif

6.27 KB
Loading

img/apps/pd-box.gif

5.76 KB
Loading

img/apps/pdfwl-box.gif

5.6 KB
Loading

img/apps/poa-box.gif

5.79 KB
Loading

img/apps/server-box.gif

6.08 KB
Loading

img/bullet.gif

1.18 KB
Loading

img/globe.png

45.2 KB
Loading

img/icons/aspdotnet.png

3.18 KB
Loading

img/icons/fastcgi.png

2.89 KB
Loading

img/icons/perl.png

3.25 KB
Loading

img/icons/php.png

2.6 KB
Loading

img/icons/python.png

2.67 KB
Loading

img/icons/ssi.png

2.76 KB
Loading

img/p-box.png

943 Bytes
Loading

img/panel-logo.png

1.73 KB
Loading

img/parallels-logo.png

2.29 KB
Loading

img/th.png

959 Bytes
Loading

img/top-bottom.png

1.08 KB
Loading

index.html

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
<html>
2+
<h1> down for maintenance</h1>
3+
<p>Either that, or the server process is gone</p>
4+
<p>regardless, you cant use this right now.</p>
5+
6+
</html>

0 commit comments

Comments
 (0)