TurnKey Linux Virtual Appliance Library

a Hastebin patch

I've been looking for a pastebin solution to be used internally by our organization (school). I settled on hastebin before I really explored every option. Hastebin was the most daunting because I'm utterly unfamiliar with node.js; moreover, moreover, the documentation is not meant for my type of noob; moreover, nodejs and npm are in the repos for neither squeeze nor lucid.

With all that in mind, I'll be attaching either two patches or four patches:

hastebin for core lucid and squeeze;

nodejs with npm for core lucid and squeeze.

We have failed to make hastebin run as a service. We've tried an inithook, init.d, and local.rc. I'd love some support on this once I post the patch, so I can revise for utility.

hastebin exemplar: http://hastebin.com/

haste-server and documentation: https://github.com/seejohnrun/haste-server

Many thanks to students Nelson and Delonte, both juniors at Chelsea School and who helped more than they realize.

Patch is intended for TurnKey Linux Core 11.3 (Ubuntu Lucid) or 12.2RC (Debian Squeeze).

After applying the patch and booting:

Access command prompt your favorite way (drop out of confconsole, access via webmin, or access via ssh):

npm start /var/haste-server/

or

npm start /var/haste-server/ & #to keep hastebin in the background.

Here's the conf script:

#! /bin/bash -ex

####Overlay####
#/var/haste-server/config.js - no, moving from overlay/tmp
#/etc/confconsole/services.txt


# Set Hostname

HOSTNAME=hastebin
echo "$HOSTNAME" > /etc/hostname
sed -i "s|127.0.1.1 \(.*\)|127.0.1.1 $HOSTNAME|" /etc/hosts


# install dependencies #########################################################

apt-get update
DEBIAN_FRONTEND=noninteractive apt-get -y \
    -o DPkg::Options::=--force-confdef \
    -o DPkg::Options::=--force-confold \
    install \
        git-core \
        build-essential \
        curl \
        wget \
        openssl \
        redis-server

#Clone nodejs
    git clone http://github.com/ry/node.git
#Build node js from source
    cd node
    ./configure
    make
    make install
    cd ..
#download and run install script for npm
    curl http://npmjs.org/install.sh|sh
#Download and move hastebin-server
    git clone https://github.com/seejohnrun/haste-server.git
    mv haste-server/ /var/haste-server

#npm install hastebin-server
    cd /var/haste-server
    npm install

#install redis
    npm install redis

mv /tmp/config.js /var/haste-server/

Done over again for Core 13RC. The new patch uses apache2 for a proxy. I can't justify this yet, and the more I read the more I think it's a bad idea. I haven't come any distance in my understanding of node; my gut suggested there's more flexibility, security, speed with Apache as a proxy. I'm reading that performance will most certainly take some hit. In any event, I've attached to new patch for this pastebin actalike below.

gem install haste to use the client from the command line. Look into haste-client for configuraion. Patch is on github here: https://github.com/ghoulmann/haste-server-tklpatch.

Working great in production

Using patched 11.3 Core on Lucid for a dedicated Haste-server on ESXi. Working phenomenally for students, whether composing or coding. Using in my lab with haste client. ISO available at our emerging new site: http://www.23eyes.org/9while9/ .


New Patch Attached

Working on Core 13.0 RC. A great group of students put this together at Chelsea School: Paul led it up with support from David and Alex. More support from TJ and Lucas.

https://github.com/ghoulmann/haste-server-tklpatch


Post new comment

The content of this field is kept private and will not be shown publicly. If you have a Gravatar account, used to display your avatar.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Allowed HTML tags: <a> <p> <span> <div> <h1> <h2> <h3> <h4> <h5> <h6> <img> <map> <area> <hr> <br> <br /> <ul> <ol> <li> <dl> <dt> <dd> <table> <tr> <td> <em> <b> <u> <i> <strong> <font> <del> <ins> <sub> <sup> <quote> <blockquote> <pre> <address> <code> <cite> <strike> <caption>

More information about formatting options

Leave this field empty. It's part of a security mechanism.
(Dear spammers: moderators are notified of all new posts. Spam is deleted immediately)