5 ms·
Show HN: elegant open-source pastebin server (node.js & redis)
- _neil 15y agoAs complex as it needs to be. Great project. Now I just wish I had an immediate need for an internal pastebin.
- seejohnrun 15y agoserver: http://github.com/seejohnrun/haste-server http://github.com/seejohnrun/haste-server client: http://github.com/seejohnrun/haste-client http://github.com/seejohnrun/haste-client more info: http://hastebin.com/about.md http://hastebin.com/about.md
- VikingCoder 15y agoNice idea on the CLI client.
- seejohnrun 15y agothanks :)
- TomGullen 15y agoVery nice! It seems about as simple as it could be. One suggestion though, my resolution is quite high and I hate looking to the extremities of my monitor. I don't know how you could solve it nicely but just some feedback!
- seejohnrun 15y agoWouldn't you just make the browser window smaller?
- TomGullen 15y agoNot if it's a tab with my other pages
- potomak 15y agoI love it, maybe I should contribute...
- sheldor 15y agoNice, clean and minimal. Kudos! There's just one little glitch : In IE9, icons are not shown correctly and a javascript error is raised whenever you try to perform an action , or visit a url you just "generated"
- seejohnrun 15y agoHeya - I didn't really test in IE, but tonight I'll get it updated and fixed for IE9. Thanks for the feedback
- emp_ 15y agoYou just need to provide a doctype (the html5 one is fine), IE9 is currently rendering your site as Quirks Mode.
- seejohnrun 15y agoAwesome - added and deployed. Thanks!
- andrewvc 15y agoVery cool! You've easily written the best UI for this kind of thing I've yet seen (though a language syntax picker would be nice). Quick question though, why redis vs something disk based? Are you worried that if this sees a lot of usage you'll hit memory limits? Seems like a great application for a disk based KV, or just plain SQL.
- seejohnrun 15y agoHey - Thanks for the comment. You can set the language by just changing the extension in the URL, if it guesses wrong. the open source project also has an optional disk store you can use in place of redis (http://github.com/seejohnrun/haste-server http://github.com/seejohnrun/haste-server), but my hosted version uses the redis store. Thanks again!
- cabacon 15y agoFor what it's worth, changing the extension doesn't seem to work for me. A simple C program (http://hastebin.com/36QWBlYlML http://hastebin.com/36QWBlYlML) gets detected as TeX. Trying to change the http://hastebin.com/36QWBlYlML.tex http://hastebin.com/36QWBlYlML.tex to http://hastebin.com/36QWBlYlML.c http://hastebin.com/36QWBlYlML.c just redirects me back to the .tex URL. Also, while I am entering a file, the edit box is only two lines long, and I can't see the handle to resize it. This is Safari 5.1.1 on Snow Leopard. Looks nice!
- seejohnrun 15y agoHeya - just didn't have the .c extension in the mapping. Will add it in tonight and get it out. Thanks!
- jurre 15y agoWhile you're at it, changing the extension seems to break the back button in Chrome and Safari on OSX.
- zmanji 15y agoThe use of the solarized colorscheme is wonderful.
- false 15y agoAwesome! However, when I type/paste i can see only the last line of text, it's somehow confusing. Why not to make textarea take whole height?
- seejohnrun 15y agoFixed sorry, temporary bug
- alttag 15y agoSomething isn't working right for me. There's no affordance suggesting what to do. If I start typing, I only get two lines of visible text. If I enter more than two lines, the top line(s) scrolls out of view. this doesn't seem to be intended behavior given all the "white" space on the page. When saved, a multi-line bin seems to work normally. In a quick check, it seems all resources are loading. Safari 5.1.1; OS X 10.7.2. (Tried with extensions, e.g., AdBlock, off too.)
- seejohnrun 15y agoFixed now - sorry for the inconvenience :)
- alttag 15y agoThe two lines visible part is fixed, but there's still no affordance suggesting how to use the site. The current design targets users who're familiar with other bin sites, and is less friendly to new users.
- rossmasters 15y agoFor some reason on Chrome 15 (stable) the body is about 32 pixels high, meaning you can type two lines. Other than that it works nicely.
- seejohnrun 15y agoFixed - sorry
- malone 15y agoNice work. I've been looking for a pastebin server to run on our internal network for a while now and this certainly seems like a winner. Would be useful if there was an option to enable line numbering. Not sure if this would go against the minimalist style you're going for though.
- seejohnrun 15y agodefinitely a good idea, i'll try to think of a way to add it but keep the minimalist approach. I'll file a ticket on github for this and get to it very soon
- mjdwitt 15y agoIn chromium on linux, I can only ever see two lines of text at a time. If I type more than two lines, they scroll off the top of the screen. When I move back up with the arrow keys, I can see those lines again, but I still only see two lines; those further below just disappear until I move back down.
- seejohnrun 15y agoFixed, sorry
- jwmollman 15y agoVery clean and elegant. I like this a lot!
- jurre 15y agoThat is really awesome! It detects my erlang and syntax highlights it beautifully! Very nice, will be using this for all my pastebinning!
- g3orge 15y agothe best implementation of the idea... very useful.
- swah 15y agoFor some reason, node.js programmers are better than average designers, so their websites look slick - but that has nothing to do with running the website on node.js... Okay, they know javascript, that helps... But it makes node.js feel slick... a great marketing trick.
- joe-mccann 15y agoNice one. This is actually what I'm adding to Dillinger next - a Redis store for pastebin style links to markdown files. dillinger.io Dillinger is also 100% open source: github.com/joemccann/dillinger
- seejohnrun 15y agoAwesome - I ended up writing a markdown extension for highlight.js (also OSS) to support the about page i'm definitely gonna check out dillinger
- nuttendorfer 15y agoRequest: Don't override Ctrl + L, I don't want to have to use the mouse to copy the link. Ctrl + L, Ctrl + C is faster.
- seejohnrun 15y agoWill remove that tonight and redeploy. Used to be before I switched over to ^S
- kqueue 15y agoLine numbers missing.
- danso 15y agoLove this feature: --- You can even take this a step further (on OSX) and cut out the last step of copying the URL with: `cat something | haste | pbcopy` After running that, the STDOUT output of `cat something` will show up at a URL which has been conveniently copied to your clipboard. That's all there is to that, and you can install it with `gem install haste` right now. ----- Out of curiosity, why is that only possible on a Mac OS X setup with the Ruby gem? Is it only because Ruby is pre-installed?
- seejohnrun 15y agoYou can do it on linux too: gem install haste cat something | haste | xsel I'll add that to the /about.md page tonight Thanks - glad you like it! :)
- plq 15y agoUnless I'm missing something, you've made your tracker practically unsearchable. How do you plan to cope with that?
- seejohnrun 15y agoProbably no plans to - this is really meant to address the primary use of a pastebin in a more elegant way. I think search is just bloat here
- plq 15y agoha! wrong thread. please disregard this comment, can't seem to delete it.
- shocks 15y agoI really like this. Would it be possible to have show a short summary of the history of a paste? Also, a favicon would be great. :)
- seejohnrun 15y agoWhen you edit a paste, you create a new one - so the history thing is rough. The favicon is a great point and I'll get one together ASAP
- seejohnrun 15y agoCould also start tracking when edits get created as history - i'll look into this
- nicwest 15y agoFavicon is super important if this is to sit pride of place on my bookmarks bar and be my go to pastebin (which I would love it to be!)
- seejohnrun 15y agofavicon is out now. thanks again for the suggestion
- drewda 15y agoCan you please add support for CoffeeScript highlighting? https://github.com/jashkenas/coffee-script/wiki/Text-editor-plugins https://github.com/jashkenas/coffee-script/wiki/Text-editor-... EDIT: Sorry, I should post this as a Github issue instead...
- seejohnrun 15y agoDefinitely - thanks for putting in the issue, and we'll get it in as soon as possible
- LuxuryMode 15y agoPretty cool and great name. Only thing is that (when I tried Java) the syntax highlighting wasn't all that great.
- seejohnrun 15y agoThe syntax highlighting will be constantly improving given changes to highlight.js (another OSS project), and a possible move to pylons. Thanks for the feedback, and I'll take a look at the Java highlighter and see what I can do to make it better. Any obvious things you'd like to see in the highlighting?
- antirez 15y agoSince the author is using Redis for a system like that, I wanted to do some math about how many documents it can store for gigabyte. Assuming a 64 bit instance (that is more memory hungry) and that the average paste size is 512 bytes, every 2 million documents require 1GB (just tested with redis-benchmark). This means that if you have a paste every minute, in order to use 1 GB of memory you need to wait 4 years. Many problems that at a first look appear to be hard to treat with an in-memory DB at a closer look appear quite addressable. That said this is the kind of problem where the working set is very small compared to the whole set of documents stored, and where documents are rarely written and often accessed in a read only fashion, so a *SQL DB would work super well for that use case. I Redis server could form a very good addition in order to perform real time stats about the accesses to the document: number of times the document was read, a sorted set for latest created documents, top documents for this month by page views, and so forth.
- seejohnrun 15y agoI think it would be a really interesting project to get together a way to gather statistics like this. I'm particularly interested in seeing things like average reads per doc, interval between reads, etc (like you mention). Thanks for the research, and look forward to more coming out in the way of statistics soon!
- seejohnrun 15y agoMore related to the central topic of redis as a store for this, I think it really depends on the read per write ratio. Gathering stats like this would be very useful, and its very easy to write a SQL adapter for haste-server, since its just a set/get and optional expire
- antirez 15y agoIn theory in a pastebin-alike site you can have a lot of writes for the analytics. think about a pastebin page appearing on HN or other very busy site, if you want to do real time stats Redis will handle the load without issues.
- jorangreef 15y ago
- deleted 15y ago[deleted]
- jvc26 15y agoLovely work - really elegant and simple pastebin server! Wondered whether you could add syntax highlighting for Puppet config files (.pp)?
- seejohnrun 15y agoThanks - glad you like it :) If you can submit a ticket on github for .pp highlighting I can get it in, by writing a highlight.js adapter for puppet config files
- MostAwesomeDude 15y agoRequires JavaScript just to show the front page or about page. This instantly makes it worse than other pastebins. Cool design, poor execution.
- cel 15y agoI'm not able to save documents right now. The POST to /documents returns a 502 Proxy Error (Error reading from remote server) after 2 minutes. Backend is down?
- seejohnrun 15y agoshould be fixed - sorry for the inconvenience, was upgrading a few things
- cel 15y agoGot it, thanks. Great project!